[erlang-questions] Fw: Lists!!

Dale Harvey <>
Mon Sep 19 17:46:29 CEST 2011


> "\b" =:= [8].
true

they are exactly the same thing, just different ways to display

On 19 September 2011 16:44, Amir <> wrote:

>
>
> No I am not trying to print them.
> I want the function to return the list containing a number
>
> The requirement says:
>
> the function should return        [Number]
> For example     [8]        but the shell shows me "\b"
>
> As a result of previous replied, when the function returns "\b" instead of
> [8], I should imagine the requirement is covered, but it just shows that
> way?
>
>
>
>
> ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
>
>
> ----- Forwarded Message -----
> *From:* Chris Hicks <>
> *To:* ; 
> *Cc:* 
> *Sent:* Monday, September 19, 2011 5:39 PM
> *Subject:* RE: [erlang-questions] Lists!!
>
> If you are trying to print the list, take a look at the options for the
> io:format/1<http://erldocs.com/R14B03/stdlib/io.html?i=2&search=io:for#format/1> module.
> If you are going to be performing mathematical calculations on the different
> items in the list, the Erlang system will automatically treat them as
> numbers, because that's what they are. The issue you are seeing is due to
> the fact that there is no string type in Erlang, simply lists of ASCII codes
> corresponding to the characters and the shell makes the assumption that you
> have input a string, in this case. It is just a formatting issue, not a
> change of the underlying structure.
>
> > Date: Mon, 19 Sep 2011 08:33:51 -0700
> > From: 
> > To: 
> > CC: 
> > Subject: Re: [erlang-questions] Lists!!
> >
> > These lists are indistinguishable, this is just how the shell displays
> > lists that could be interpreted as strings. "abc" =:= [97,98.99].
> >
> > On Mon, Sep 19, 2011 at 8:32 AM, Amir <> wrote:
> > >
> > >
> > > Hey Everyone,
> > > Here is the question:
> > > If you try to enter this on Erlang shell [97,98,99].
> > > you will get the following answer: "abc"
> > > But I need the original list to be returned, is there any solution ?
> > > By the way,
> > > init:script_id().
> > > {"OTP  APN 181 01","R14B03"}
> > >
> > >
> > >
> > > _______________________________________________
> > > erlang-questions mailing list
> > > 
> > > http://erlang.org/mailman/listinfo/erlang-questions
> > >
> > >
> > _______________________________________________
> > erlang-questions mailing list
> > 
> > http://erlang.org/mailman/listinfo/erlang-questions
>
>
>
>
> ------------------------------
> *From:* Bob Ippolito <>
> *To:* Amir <>
> *Cc:* "" <>
> *Sent:* Monday, September 19, 2011 5:33 PM
>
> *Subject:* Re: [erlang-questions] Lists!!
>
> These lists are indistinguishable, this is just how the shell displays
> lists that could be interpreted as strings. "abc" =:= [97,98.99].
>
> On Mon, Sep 19, 2011 at 8:32 AM, Amir <> wrote:
> >
> >
> > Hey Everyone,
> > Here is the question:
> > If you try to enter this on Erlang shell [97,98,99].
> > you will get the following answer: "abc"
> > But I need the original list to be returned, is there any solution ?
> > By the way,
> > init:script_id().
> > {"OTP  APN 181 01","R14B03"}
> >
> >
> >
> > _______________________________________________
> > erlang-questions mailing list
> > 
> > http://erlang.org/mailman/listinfo/erlang-questions
> >
> >
>
>
>
>
>
> _______________________________________________
> erlang-questions mailing list
> 
> http://erlang.org/mailman/listinfo/erlang-questions
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20110919/f1d61c74/attachment.html>


More information about the erlang-questions mailing list