Erlang列表反转

-module(helloworld). 
-export([tail_reverse/2,start/0]). 

tail_reverse(L) -> tail_reverse(L,[]).

tail_reverse([],Acc) -> Acc; 
tail_reverse([H|T],Acc) -> tail_reverse(T, [H|Acc]).

start() -> 
   X = [1,2,3,4], 
   Y = tail_reverse(X), 
   io:fwrite(~w,[Y]).

相关文章

-module(helloworld). -export([start/0]). start() ->...
-module(helloworld). -export([start/0]). start() ->...
-module(helloworld). -export([start/0]). start() ->...
-module(helloworld). -export([start/0]). start() ->...
-module(helloworld). -export([add/2,start/0]). add(X,...
% Erlang整数 -module(helloworld). -export([start/0]). ...