<div>oh thank you!</div><div>I will just try to keep it out of my door</div><div><div><br></div><div><br></div><div style="font-size: 12px;font-family: Arial Narrow;padding:2px 0 2px 0;">------------------ 原始邮件 ------------------</div><div style="font-size: 12px;background:#efefef;padding:8px;"><div><b>发件人:</b> "Konstantin Tcepliaev"<f355@f355.ru>;</div><div><b>发送时间:</b> 2013年7月3日(星期三) 晚上6:16</div><div><b>收件人:</b> "饕餮"<249505968@qq.com>; "erlang-questions"<erlang-questions@erlang.org>; <wbr></div><div></div><div><b>主题:</b> Re: [erlang-questions] What's this mean:[1|1]?It's it a bug?</div></div><div><br></div><div>Hi,</div><div> </div><div>That's what is called "improper list". Lists in Erlang are basically two pointers, to head and to tail, and both of them actually can be of any type.</div><div>List of, say, two elements - [1, 2] - is actually just a syntactic sugar for [1 | [2 | []]], where [] is a special value meaning "empty list". Obviously, anything can be used in its place.</div><div> </div><div>Improper lists can lead to strange errors and definitely should be avoided. They probably can be used in place of 2-tuples when you need some crazy micro-optimization, because I think they're a bit faster. But still, do not try that at home.</div><div> </div><div>Cheers,</div><div>-- </div><div>Konstantin</div><div> </div><div>03.07.2013, 14:03, "饕餮" <249505968@qq.com>:</div><blockquote type="cite">One of my new teammate found that this expression can work like list:nth(1,[1|1]) is legal.<div>And the is_list([1|1]) is true</div><div>so what's this expression mean or it's just like some bug?</div>,<p>_______________________________________________<br>erlang-questions mailing list<br><a href="mailto:erlang-questions@erlang.org">erlang-questions@erlang.org</a><br><a href="http://erlang.org/mailman/listinfo/erlang-questions">http://erlang.org/mailman/listinfo/erlang-questions</a></p></blockquote></div>