Hi Jason -

readln(s) reads the whole line, it just ignores everything
except for the first word.

We have a readline function that actually reads the whole
line as a string.

readln really exists for cases when you're not reading a string;
e.g.

readln(myInt, myOtherInt);

could read from
1 2 3

... it would just read 1 and 2 and then skip until the newline, leaving
you ready to read the first two integers from the next line...

Likewise


readln(myString, myOtherString);


could read from
word1 word2 .....

Something like the Pascal readln only will make sense as returning
a string, so we have readline for that.

-michael

On 5/27/15, 6:02 PM, "Jason Riedy" <[email protected]> wrote:

>And Michael Ferguson writes:
>> readln(s);
>>
>> s would contain only "hello", because the default string
>> reading rule is to read one word only.
>
>In Pascal, readln reads the whole line.  Is there another
>language with a different definition of readln?  What does the
>"ln" mean otherwise?
>
>(Yeah, I know, the definition of a line is funny.)
>
>
>--------------------------------------------------------------------------
>----
>_______________________________________________
>Chapel-developers mailing list
>[email protected]
>https://lists.sourceforge.net/lists/listinfo/chapel-developers


------------------------------------------------------------------------------
_______________________________________________
Chapel-developers mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/chapel-developers

Reply via email to