[erlang-questions] create list quesion

Imants Cekusins imantc@REDACTED
Tue Jan 27 19:23:58 CET 2015


this works:


-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] ).



More information about the erlang-questions mailing list