Erlang Mailing Lists

Author Message

<  Erlang bugs mailing list  ~  io:get_line types

anders_n
Posted: Wed Apr 14, 2010 2:59 pm Reply with quote
User Joined: 28 Feb 2005 Posts: 155 Location: Saltillo, Mexico
In io.erl the types specified for get_line/1 is

-type prompt() :: atom() | string().
-spec get_line(prompt()) -> iodata() | 'eof' | {'error', term()}.

get_line(Prompt) ->
get_line(default_input(), Prompt).

And that is also what the documentation states.

But in ssh/examples/ssh_sample_cli.erl there is

Line = io:get_line({format, "CLI> ", []}),

Is this a secret unsupported invocation or is it an error in the
io documentation?

If it is unsupported it should not be used in examples.

/Anders

________________________________________________________________
erlang-bugs (at) erlang.org mailing list.
See http://www.erlang.org/faq.html
To unsubscribe; mailto:erlang-bugs-unsubscribe@erlang.org

Post received from mailinglist
View user's profile Send private message Yahoo Messenger
Guest
Posted: Fri Apr 16, 2010 1:17 pm Reply with quote
Guest
Hello!

I cannot tell why the io:get_line call didn't follow the documented API,
but ssh_sample_cli.erl has now been corrected.

Best regards,

Niclas @ Erlang/OTP

On Wed, 14 Apr 2010, Anders Nygren wrote:

> In io.erl the types specified for get_line/1 is
>
> -type prompt() :: atom() | string().
> -spec get_line(prompt()) -> iodata() | 'eof' | {'error', term()}.
>
> get_line(Prompt) ->
> get_line(default_input(), Prompt).
>
> And that is also what the documentation states.
>
> But in ssh/examples/ssh_sample_cli.erl there is
>
> Line = io:get_line({format, "CLI> ", []}),
>
> Is this a secret unsupported invocation or is it an error in the
> io documentation?
>
> If it is unsupported it should not be used in examples.
>
> /Anders
>
> ________________________________________________________________
> erlang-bugs (at) erlang.org mailing list.
> See http://www.erlang.org/faq.html
> To unsubscribe; mailto:erlang-bugs-unsubscribe@erlang.org
>



________________________________________________________________
erlang-bugs (at) erlang.org mailing list.
See http://www.erlang.org/faq.html
To unsubscribe; mailto:erlang-bugs-unsubscribe@erlang.org

Post received from mailinglist

Display posts from previous:  

All times are GMT
Page 1 of 1
This forum is locked: you cannot post, reply to, or edit topics.

Jump to:  

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum