Hi Vadim,

That looks like a small bug in the UI listener with copy-paste, if you type
``readln readln`` and hit enter, and then type two lines (instead of
pasting) it appears to work.

Some workarounds, you generally will be writing I/O code that abstracts
away from where you are reading, so you can read from a string:

    "Line1\nLine2" [ readln readln ] with-string-reader

Or a file:

  "/path/to/file" utf8 [ readln readln ] with-file-reader

Thanks for reporting the problem with copy-paste, testing I/O words through
input like that in the UI listener isn't a use-case that I use that much.

Best,
John.

On Sun, Feb 8, 2015 at 1:14 PM, Vadim Tukaev <vadim_tuk...@bk.ru> wrote:

> How to read multiple lines from standard input (in Listener)?
>
> I tried to write something like "readln readln", then copy-paste two lines
> of text to Listener, but I got an unexpected result. I got first line on
> stack, then program waited for my input. I pressed the "Enter" key and, of
> course, got empty string on stack. So, I got "Line1" "" instead of "Line1"
> "Line2". How to get both lines? For example, "Line1\nLine2" or something
> else. Maybe I chose the wrong input method?
>
>
> ------------------------------------------------------------------------------
> Dive into the World of Parallel Programming. The Go Parallel Website,
> sponsored by Intel and developed in partnership with Slashdot Media, is
> your
> hub for all things parallel software development, from weekly thought
> leadership blogs to news, videos, case studies, tutorials and more. Take a
> look and join the conversation now. http://goparallel.sourceforge.net/
> _______________________________________________
> Factor-talk mailing list
> Factor-talk@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/factor-talk
>
>
------------------------------------------------------------------------------
Dive into the World of Parallel Programming. The Go Parallel Website,
sponsored by Intel and developed in partnership with Slashdot Media, is your
hub for all things parallel software development, from weekly thought
leadership blogs to news, videos, case studies, tutorials and more. Take a
look and join the conversation now. http://goparallel.sourceforge.net/
_______________________________________________
Factor-talk mailing list
Factor-talk@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/factor-talk

Reply via email to