--Thank youAbhinav Mehta
--
Erlang Programming Website:
http://www.erlangprogramming.org/
2010/10/21 Developer at Works <develope...@gmail.com>Hello GeeksJust for fun, I was trying this and thought to share with you guys too. :)Can we make list of integers, with a sequence while following these instructions:For ex:-> Input:$ myModule:f1(10).-> Output:$ [1,2,3,4,5,6,7,8,9,10]Conditions are: (DONT USE FOLLOWING CONCEPTS)- Dont use any BIF'sfor ex- lists:seq() etc- Dont use Accumulatorfor ex-f1(0, Acc) -> lists:reverse(Acc);f1(N, Acc) -> f1(N-1, [N|Acc]).- Dont use any SERVER e.g. GEN-SERVER etc- Use tail-recursion concept only
To conclude, can we make this in any way, while following the above guidelines.
Sure you can: http://ideone.com/WfMFe (left a link in case the rest want to try the exercise :-)
Cheers,
--Thank youAbhinav Mehta--
Erlang Programming Website:
http://www.erlangprogramming.org/
--
Ale.
what about this?
f1(0)->[];
f1(N)->f1(N-1)++[N].
Hi,
I am trying the examples in chapter 11 paragraph: Communication and Messages in page 252
But I am getting the error below.
(foo@plun2102)1> net_admin:ping('bar@plun0142').
** exception error: undefined function net_admin:ping/1
Where is the module net_admin located so I can its path to PATH.
This is in Linux.
Thanks,
Mohamed
Erlang Programming Website:
http://www.erlangprogramming.org/
Sorry there a typo in the command.
It should be net_adm:ping and not net_admin:ping
Regards,
Mohamed