<html><body><div style="color:#000; background-color:#fff; font-family:arial, helvetica, sans-serif;font-size:12pt"><div><span><br></span></div><div><span>Thanks all...</span></div><div><span><br></span></div><div><span><br></span></div><div><span><br></span></div><div><br></div><div style="font-size: 12pt; font-family: arial, helvetica, sans-serif; "><div style="font-size: 12pt; font-family: 'times new roman', 'new york', times, serif; "><font size="2" face="Arial">----- Forwarded Message -----<br><b><span style="font-weight:bold;">From:</span></b> Dale Harvey <dale@arandomurl.com><br><b><span style="font-weight: bold;">To:</span></b> Amir <amir_fire_2005@yahoo.com><br><b><span style="font-weight: bold;">Cc:</span></b> "erlang-questions@erlang.org" <erlang-questions@erlang.org><br><b><span style="font-weight: bold;">Sent:</span></b> Monday, September 19, 2011 5:46 PM<br><b><span style="font-weight: bold;">Subject:</span></b> Re:
[erlang-questions] Fw: Lists!!<br></font><br><div id="yiv9527832">> "\b" =:= [8].<br>true<br><br>they are exactly the same thing, just different ways to display<br><br><div class="yiv9527832gmail_quote">On 19 September 2011 16:44, Amir <span dir="ltr"><<a rel="nofollow" ymailto="mailto:amir_fire_2005@yahoo.com" target="_blank" href="mailto:amir_fire_2005@yahoo.com">amir_fire_2005@yahoo.com</a>></span> wrote:<br>
<blockquote class="yiv9527832gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"><div><div style="color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); font-size: 12pt; font-family: arial, helvetica, sans-serif; "><div><span><br>
</span></div><div><br></div><div style="font-size: 12pt; font-family: arial, helvetica, sans-serif; "><div style="font-size:12pt;"><div><div style="color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); font-size: 12pt; font-family: arial, helvetica, sans-serif; ">
<div style="font-size: 12pt; font-family: arial, helvetica, sans-serif; "><span>No I am not trying to print them. </span></div><div style="font-size: 12pt; font-family: arial, helvetica, sans-serif; "><span>I want the function to return the list containing a number </span></div>
<div style="font-size: 12pt; font-family: arial, helvetica, sans-serif; "><span><br></span></div><div style="font-size: 12pt; font-family: arial, helvetica, sans-serif; "><span>The r</span><span>equirement says:</span></div><div style="font-size: 12pt; font-family: arial, helvetica, sans-serif; ">
<br></div><div style="font-size: 12pt; font-family: arial, helvetica, sans-serif; ">the function should return [Number]</div><div style="font-size: 12pt; font-family: arial, helvetica, sans-serif; ">For example [8] but the shell shows me "\b"</div>
<div style="font-size: 12pt; font-family: arial, helvetica, sans-serif; "><br></div><div><font size="3">As a result of </font>previous replied<font size="3">, when the function returns "\b" instead of [8], I should imagine the requirement is covered, but it just shows that way?</font></div>
<div><font size="3"><br></font></div><div><font size="3"><br></font></div><div><font size="3"><br></font></div><div><font size="3">---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------</font></div>
<div><font size="3"><br></font></div><div><font size="3"><span style=""><div style="background-color: rgb(255, 255, 255); color: rgb(0, 0, 0); padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; margin-top: 8px; margin-right: 0px; margin-bottom: 0px; margin-left: 12px; display: block; font-size: 12pt; font-family: arial, helvetica, sans-serif; ">
<div><br></div><div style="font-size: 12pt; font-family: arial, helvetica, sans-serif; "><div style="font-size:12pt;"><div class="yiv9527832im"><font face="Arial" size="2">----- Forwarded Message -----<br>
<b><span style="font-weight:bold;">From:</span></b> Chris Hicks <<a rel="nofollow" ymailto="mailto:silent_vendetta@hotmail.com" target="_blank" href="mailto:silent_vendetta@hotmail.com">silent_vendetta@hotmail.com</a>><br><b><span style="font-weight:bold;">To:</span></b> <a rel="nofollow" ymailto="mailto:bob@redivi.com" target="_blank" href="mailto:bob@redivi.com">bob@redivi.com</a>; <a rel="nofollow" ymailto="mailto:amir_fire_2005@yahoo.com" target="_blank" href="mailto:amir_fire_2005@yahoo.com">amir_fire_2005@yahoo.com</a><br>
<b><span style="font-weight:bold;">Cc:</span></b> <a rel="nofollow" ymailto="mailto:erlang-questions@erlang.org" target="_blank" href="mailto:erlang-questions@erlang.org">erlang-questions@erlang.org</a><br><b><span style="font-weight:bold;">Sent:</span></b> Monday, September 19, 2011 5:39 PM<br>
<b><span style="font-weight:bold;">Subject:</span></b> RE: [erlang-questions] Lists!!<br></font><br></div><div><div dir="ltr"><div class="yiv9527832im">If you are trying to print the list, take a look at the options for the <a rel="nofollow" target="_blank" href="http://erldocs.com/R14B03/stdlib/io.html?i=2&search=io:for#format/1">io:format/1</a> 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.<br>
<br></div><div><div class="yiv9527832im">> Date: Mon, 19 Sep 2011 08:33:51 -0700<br>> From: <a rel="nofollow" ymailto="mailto:bob@redivi.com" target="_blank" href="mailto:bob@redivi.com">bob@redivi.com</a><br>> To: <a rel="nofollow" ymailto="mailto:amir_fire_2005@yahoo.com" target="_blank" href="mailto:amir_fire_2005@yahoo.com">amir_fire_2005@yahoo.com</a><br>
> CC: <a rel="nofollow" ymailto="mailto:erlang-questions@erlang.org" target="_blank" href="mailto:erlang-questions@erlang.org">erlang-questions@erlang.org</a><br>> Subject: Re: [erlang-questions] Lists!!<br>> <br></div><div><div class="yiv9527832h5">> These lists are indistinguishable, this is just how the shell displays<br>
> lists that could be interpreted as strings. "abc" =:=
[97,98.99].<br>> <br>> On Mon, Sep 19, 2011 at 8:32 AM, Amir <<a rel="nofollow" ymailto="mailto:amir_fire_2005@yahoo.com" target="_blank" href="mailto:amir_fire_2005@yahoo.com">amir_fire_2005@yahoo.com</a>> wrote:<br>> ><br>> ><br>> > Hey Everyone,<br>
> > Here is the question:<br>> > If you try to enter this on Erlang shell [97,98,99].<br>> > you will get the following answer: "abc"<br>> > But I need the original list to be returned, is there any solution ?<br>
> > By the way,<br>> > init:script_id().<br>> > {"OTP APN 181 01","R14B03"}<br>> ><br>> ><br>> ><br>> > _______________________________________________<br>> > erlang-questions mailing list<br>
> > <a rel="nofollow" ymailto="mailto:erlang-questions@erlang.org" target="_blank" href="mailto:erlang-questions@erlang.org">erlang-questions@erlang.org</a><br>> > <a rel="nofollow" target="_blank" href="http://erlang.org/mailman/listinfo/erlang-questions">http://erlang.org/mailman/listinfo/erlang-questions</a><br>
> ><br>> ><br>> _______________________________________________<br>> erlang-questions mailing list<br>> <a rel="nofollow" ymailto="mailto:erlang-questions@erlang.org" target="_blank" href="mailto:erlang-questions@erlang.org">erlang-questions@erlang.org</a><br>
>
<a rel="nofollow" target="_blank" href="http://erlang.org/mailman/listinfo/erlang-questions">http://erlang.org/mailman/listinfo/erlang-questions</a><br></div></div></div></div></div><div class="yiv9527832hm"><br></div></div><div class="yiv9527832hm"><div style="font-size:12pt;">
<br></div><div style="font-size:12pt;"><br></div><div style="font-size:12pt;"><br>
</div></div></div></div></span></font></div><div style="font-size: 12pt; font-family: arial, helvetica, sans-serif; "><div style="font-size: 12pt; font-family: times, serif; "><font face="Arial" size="2"><div class="yiv9527832hm"><hr size="1">
<b><span style="font-weight:bold;">From:</span></b> Bob Ippolito <<a rel="nofollow" ymailto="mailto:bob@redivi.com" target="_blank" href="mailto:bob@redivi.com">bob@redivi.com</a>><br><b><span style="font-weight:bold;">To:</span></b> Amir <<a rel="nofollow" ymailto="mailto:amir_fire_2005@yahoo.com" target="_blank" href="mailto:amir_fire_2005@yahoo.com">amir_fire_2005@yahoo.com</a>><br>
<b><span style="font-weight:bold;">Cc:</span></b> "<a rel="nofollow" ymailto="mailto:erlang-questions@erlang.org" target="_blank" href="mailto:erlang-questions@erlang.org">erlang-questions@erlang.org</a>"
<<a rel="nofollow" ymailto="mailto:erlang-questions@erlang.org" target="_blank" href="mailto:erlang-questions@erlang.org">erlang-questions@erlang.org</a>><br><b><span style="font-weight:bold;">Sent:</span></b> Monday, September 19, 2011 5:33 PM</div><div class="yiv9527832im"><br><b><span style="font-weight:bold;">Subject:</span></b> Re: [erlang-questions] Lists!!<br>
</div></font><div class="yiv9527832im"><br>These lists
are indistinguishable, this is just how the shell displays<br>lists that could be interpreted as strings. "abc" =:= [97,98.99].<br><br>On Mon, Sep 19, 2011 at 8:32 AM, Amir <<a rel="nofollow" ymailto="mailto:amir_fire_2005@yahoo.com" target="_blank" href="mailto:amir_fire_2005@yahoo.com">amir_fire_2005@yahoo.com</a>> wrote:<br>
><br>><br>> Hey Everyone,<br>> Here is the question:<br>> If you try to enter this on Erlang shell [97,98,99].<br>> you will get the following answer: "abc"<br>> But I need the original list to be returned, is there any solution ?<br>
> By the way,<br>> init:script_id().<br>> {"OTP APN 181 01","R14B03"}<br>><br>><br>><br>> _______________________________________________<br>> erlang-questions mailing list<br>
> <a rel="nofollow" ymailto="mailto:erlang-questions@erlang.org" target="_blank" href="mailto:erlang-questions@erlang.org">erlang-questions@erlang.org</a><br>>
<a rel="nofollow" target="_blank" href="http://erlang.org/mailman/listinfo/erlang-questions">http://erlang.org/mailman/listinfo/erlang-questions</a><br>><br>><br><br><br></div></div></div></div></div><br><br></div>
</div></div></div><br>_______________________________________________<br>
erlang-questions mailing list<br>
<a rel="nofollow" ymailto="mailto:erlang-questions@erlang.org" target="_blank" href="mailto:erlang-questions@erlang.org">erlang-questions@erlang.org</a><br>
<a rel="nofollow" target="_blank" href="http://erlang.org/mailman/listinfo/erlang-questions">http://erlang.org/mailman/listinfo/erlang-questions</a><br>
<br></blockquote></div><br>
</div><br><br></div></div></div></body></html>