fun with funs

Robert Virding rv@REDACTED
Wed Apr 28 12:58:34 CEST 1999


Ulf Wiger <ulf.wiger@REDACTED> writes:
>I have a question/discovery that I would like to present:
>
>Every once in a while, the dreaded error message:
>
>{{lambda_clause,mcncServer},{lists,120702597,3}}
>
>appears (mcncServer is just our most recent example.)
...
>
>I think that this method of identifying funs is unique to BEAM, but I
>haven't quite figured out how to read it yet. 
>
>- Is the 'lists' reference a way of saying that the fun was called from
>the module lists? 
>
>- What exactly does 120702597 stand for?
>
>- How is 3 derived in this case? Does it correspond to 'fun%3', or was I
>just lucky this time?
>
>Did I just miss the documentation of this, or isn't there any?

It is not defined and there is no documentation for this.  It is
different for the JAM and the BEAM.

In the new version of the BEAM, R6, this will change, as will how fun
errors are signaled.  The _current_ suggestion is:

1. Error 'badfun' when something which is not a fun is applied, or the
fun module no longer exists.

2. Error 'badarity' if the fun is applied with the wrong number of
arguments.

3. Error 'function_clause' (!!!) if no clause in the fun matches.

4. The name of the fun "function" will be something like '-foo/3-5-'
meaning that it is the 5th fun in the function foo/3.

N.B. This had not yet been finally decided upon, but it will be
something along these lines.  No guarantees.

Two caveats:

1. If this reaches the JAM?  I have no idea.

2. When this reaches Open Source?  I have no idea, ASAP, but I don't
make the descisions, or do the work.  :-)

	Robert
--
Robert Virding                          Tel: +46 (0)8 719 95 28
Computer Science Laboratory             Email: rv@REDACTED
Ericsson Telecom AB                     WWW: http://www.ericsson.se/cslab/~rv
S-126 25 ÄLVSJÖ, SWEDEN
"Folk säger att jag inte bryr mig om någonting, men det skiter jag i".



More information about the erlang-questions mailing list