[erlang-questions] create list quesion

Roelof Wobben r.wobben@REDACTED
Tue Jan 27 19:12:45 CET 2015


Imants Cekusins schreef op 27-1-2015 om 19:03:
> try changing number to Number?
>

I tried and change everything to this :

-module(create).

-export([create_list/2, create/1]).

create(0) ->
   [];

create(Number) ->
   create_list(Number, [] ).

create_list(0, [list]) ->
   [list];

create_list(Number, [list]) ->
   create_list( Number -1, [Number | list] ).

and still this error message  :

** exception error: no function clause matching create:create_list(1,[]) (create.erl, line 11) 




More information about the erlang-questions mailing list