<div dir="ltr"><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Jul 3, 2013 at 12:09 PM, Ivan Uemlianin <span dir="ltr"><<a href="mailto:ivan@llaisdy.com" target="_blank">ivan@llaisdy.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">[1|1] is an "improper list", in other words, a list that doesn't end with an empty list []. They're valid, but not terribly safe:<br>
<br>
1> is_list([1|1]).<br>
true<br>
2> length([1|1]).<br>
** exception error: bad argument<br>
in function length/1<br>
called as length([1|1])<br>
<br>
I don't know if there's any use for them.<br></blockquote><div> <br></div><div>It can be used to save two words of memory as [1|1] is two words but [1,1] is four words. So if you are developing a highly optimized data structure (like dict for instance) it is useful. Most people will however not need this. <br>
<br></div><div>Lukas<br></div><br></div></div></div>