<table cellspacing='0' cellpadding='0' border='0' ><tr><td valign='top' style='font: inherit;'>can i use conses in erlang?<br>like in scheme, then i only need one function. is the range func in erlang ood erlang-style or is there a better way to do it?<br><br>(define (seq a b)<br> (if (< a b)<br> (cons a (seq (+ a 1) b))<br> '()))<br><br>-module(test).<br>-export([range/2]).<br> <br>range(Start, End) when Start < End, is_integer(Start), is_integer(End) -> <br> seq(Start, End, []).<br><br>seq(Start, End, List) -><br> if Start =< End -><br> seq(Start + 1, End, List ++ [Start]);<br> true -><br> List<br>end.<br></td></tr></table><br>
<hr size=1><table><tr><td>Ta semester! - sök efter resor hos Kelkoo. <br>Jämför pris på flygbiljetter och hotellrum: <a href="http://www.kelkoo.se/c-169901-resor-biljetter.html?partnerId=96914051">http://www.kelkoo.se/c-169901-resor-biljetter.html</a></td></tr></table>