<span class="bold_code"><br>The Type information for lists:sublist/3 <br>places this restriction on Start:<br></span><span class="bold_code"><br>Start = 1..(length(List1)+1)</span><br>
<span class="bold_code"><br>As long as Start does not exceed length(List1)+1, <br>Start + Length can be >  than the length of the list. <br><br>For example: <br></span>    lists:sublist([1,2,3,4], 4, 2000).<br>is ok.<br>
<span class="bold_code"><br>-dae<br></span><br><div class="gmail_quote">On Thu, Jun 12, 2008 at 9:57 PM, Jay Nelson <<a href="mailto:jay@duomark.com">jay@duomark.com</a>> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
The documentation for lists:sublist/3 gives an example to show that<br>
there is no error for start+length > the length of the list:<br>
<br>
 > lists:sublist([1,2,3,4], 5, 2).<br>
[]<br>
<br>
However, in R12B-2 I try the following:<br>
<br>
 > lists:sublist([1,2,3,4], 6, 2).<br>
** exception error: no function clause matching lists:nthtail(1,[])<br>
      in function  lists:sublist/3<br>
<br>
jay<br>
<br>
_______________________________________________<br>
erlang-questions mailing list<br>
<a href="mailto:erlang-questions@erlang.org">erlang-questions@erlang.org</a><br>
<a href="http://www.erlang.org/mailman/listinfo/erlang-questions" target="_blank">http://www.erlang.org/mailman/listinfo/erlang-questions</a><br>
</blockquote></div><br>