<html>
<head>
<style><!--
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 10pt;
font-family:Tahoma
}
--></style>
</head>
<body class='hmmessage'>


<style><!--
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 10pt;
font-family:Tahoma
}
--></style>

Hi<br><br>I have previously been in touch with Peter Achten regarding some issues I am facing learning programming in Clean. He recommended that I should read CleanBook1, (<span style="background-color:white"><a href="http://wiki.clean.cs.ru.nl/Functional_Programming_in_Clean" target="_blank">http://wiki.clean.cs.ru.nl/Functional_Programming_in_Clean</a></span>), which i did. However, I am still not fully satisfied with my understanding of I/O commands in Clean. I was able to completely understand Chapter 1-2-3 and some parts of Chapter 4 as well, I have also completed all the exercises which came along the first three chapters. <br><br>Now if we consider the example "hello1" from the CleanBook1, chapter 5.1.1<br><br>Start :: *World -&gt; *World<br>Start world<br>&nbsp;&nbsp;&nbsp; # (console,world) = stdio world<br>&nbsp;&nbsp;&nbsp; # console = fwrites "What is your name? " console<br>&nbsp;&nbsp;&nbsp; # (name,console) = freadline console<br>&nbsp;&nbsp;&nbsp; # console = fwrites ("\n\nHello " +++ name) console<br>&nbsp;&nbsp;&nbsp; # (_,console) = freadline console<br>&nbsp;&nbsp;&nbsp; # (ok,world) = fclose console world<br>&nbsp;&nbsp;&nbsp; | not ok = abort "Cannot close console"<br>&nbsp;&nbsp;&nbsp; | otherwise = world<br><span style="background-color:white"></span><br>then it first prints a string (using fwrites) to the console and then reads a line (using freadline) from the console. but I find it hard to understand the meaning of each line of the code. For example: <br><br>Code Line 1 &nbsp; - why does we write (console,world) in the first line of the code?<br>Code Line 3 &nbsp; - is the line read from the console stored in "name"? is "name" a variable or an list/array, and can we perform any operation on it before printing it back to the console?<br>Code Line 5&nbsp;&nbsp; - in (_,console) what does "_" represent<br>Code Line 6&nbsp;&nbsp; - What does (ok,world) mean?<br><br>Question regarding output of the above program: When i compile this program in Clean then it prints out the value 65536 on the console at the end, before terminating. What does this value represent and why is it output? because i am not able to understand where it comes from as it is not mentioned anywhere in the code.<br><br>I will be deeply grateful for any help on this matter.<br><br>Kind regards<br>Khurram<br>
                                               </body>
</html>