[erlang-questions] : Sending funs between nodes

David Mercer dmercer@REDACTED
Mon Sep 17 21:09:04 CEST 2007


Raimo Niskanen wrote:
> Since the shell emulates expressions it does not compile funs
> - it emulates them too. And that is done by having a bunch of
> compiled shell funs; arity 0..20 something. These shell funs
> take the real fun code to emulate in their environment. 

Well, that certainly is clever.  I did not know that.  To demonstrate:

8> % 20 arguments
8> fun(A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T)->1 end.
#Fun<erl_eval.5.32516923>
9> % 21 arguments                                      
9> fun(A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U)->1 end.

=ERROR REPORT==== 17-Sep-2007::14:07:57 ===
Error in process <0.48.0> with exit value:
{{argument_limit,{fun,2,[{clause,2,[{
var,2,'A'},{var,2,'B'},{var,2,'C'},{var,2,'D'},{var,2,'E'},{var,2,'F'},{var,
2,'G
'},{var,2,'H'},{var,2,'I'},{var,2,'J'},{var,2,'K'},{var,2,'L'},{var,2,'M'},{
var,
2,'N'},{var,2,'O'},{var,2,'P'},{var,2,'Q'},{var,2,'R'},{var,2,'S'},{var,2,'T
'},{
var,2... 

** exited: {{argument_limit,
                {'fun',
                    2,
                    [{clause,
                         2,
                         [{var,2,'A'},
                          {var,2,'B'},
                          {var,2,'C'},
                          {var,2,'D'},
                          {var,2,'E'},
                          {var,2,'F'},
                          {var,2,'G'},
                          {var,2,'H'},
                          {var,2,'I'},
                          {var,2,'J'},
                          {var,2,'K'},
                          {var,2,'L'},
                          {var,2,'M'},
                          {var,2,'N'},
                          {var,2,'O'},
                          {var,2,'P'},
                          {var,2,...},
                          {var,...},
                          {...}|...],
                         [],
                         [{integer,2,1}]}]}},
            [{erl_eval,expr,3}]} **

Cheers,

David




More information about the erlang-questions mailing list