[erlang-questions] What does Prompt in io:get_line/2 do?

Robert Virding rvirding@REDACTED
Fri May 30 23:46:07 CEST 2014


The prompt can be anything. It is ignored when sending input requests to
devices for which prompting has no meaning, for example files. It is there
to preserve the API.

Robert



On 29 May 2014 16:35, Ivan Uemlianin <ivan@REDACTED> wrote:

> Aha thanks.  Special atoms.  Also standard_error.
>
> Ivan
>
>
> On 29/05/2014 15:24, Roger Lipscombe wrote:
>
>> 1> io:get_line(standard_io, foo).
>> foohaskgjdhgsdg
>> "haskgjdhgsdg\n"
>> 2> io:get_line(standard_io, enter_something).
>> enter_somethingsdgdsgsgsad
>> "sdgdsgsgsad\n"
>> 3> io:get_line(standard_io, 'meh>').
>> meh>fdasfhjdgfsadg
>> "fdasfhjdgfsadg\n"
>>
>> On 29 May 2014 15:07, Ivan Uemlianin <ivan@REDACTED> wrote:
>>
>>> Dear All
>>>
>>> Quick question!
>>>
>>> In io:get_line(IoDevice, Prompt), what is the point of Prompt?  Just
>>> using a
>>> random atom seems to work fine.
>>>
>>> 1> {ok,F} = file:open("data.txt",[read, {encoding, utf8}]).
>>> {ok,<0.36.0>}
>>> 2> io:get_line(F, x).
>>> "first line\n"
>>> 3> io:get_line(F, y).
>>> "second line\n"
>>> % ... etc
>>>
>>> Thanks
>>>
>>> Ivan
>>>
>>>
>>> --
>>> ============================================================
>>> Ivan A. Uemlianin PhD
>>> Llaisdy
>>> Speech Technology Research and Development
>>>
>>>                      ivan@REDACTED
>>>                       www.llaisdy.com
>>>                           llaisdy.wordpress.com
>>>                github.com/llaisdy
>>>                       www.linkedin.com/in/ivanuemlianin
>>>
>>>                          festina lente
>>> ============================================================
>>> _______________________________________________
>>> erlang-questions mailing list
>>> erlang-questions@REDACTED
>>> http://erlang.org/mailman/listinfo/erlang-questions
>>>
>>
> --
> ============================================================
> Ivan A. Uemlianin PhD
> Llaisdy
> Speech Technology Research and Development
>
>                     ivan@REDACTED
>                      www.llaisdy.com
>                          llaisdy.wordpress.com
>               github.com/llaisdy
>                      www.linkedin.com/in/ivanuemlianin
>
>                         festina lente
> ============================================================
> _______________________________________________
> erlang-questions mailing list
> erlang-questions@REDACTED
> http://erlang.org/mailman/listinfo/erlang-questions
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20140530/4751b33e/attachment.htm>


More information about the erlang-questions mailing list