Expected Common Misunderstanding (was: bug: run/3 bug)

Ka-Ping Yee ping@lfw.org
Mon, 7 Jun 1999 22:46:22 -0700 (PDT)

On Mon, 7 Jun 1999, Mark S. Miller wrote:
> >   ? def build3(a,b) {
> >   >     build3(a,b,3)
> >   > }
> >   # value: <build3>
> >    
> >   ? build3(1,2)
> >   # problem: <NoSuchMethodException: run/3>

Sorry that i cannot offer a more constructive comment, but i just
wanted to point out that this example may be construed as a warning
of going too far down the path of sugar and automatic expansion:
in short, the more sophisticated the expansion mechanism is, the
farther afield and more confusing the error messages will seem.

The above could also be considered an example of violation of the
"similar-things-should-be-the-same-or-very-different" principle:
the shortcut leads the beginning user to think that he or she is
defining a simple function, while what actually takes place is 
subtly different.

> Functions are objects.  Methods aren't.  Methods simply describe what 
> objects do.

All that said, i don't think this particular issue is any kind of
showstopper.  Rather, it looks like a very good candidate for an
early example that every beginning E programmer should be given
to illustrate precisely the difference between functions and methods,
and to encourage them to think in the new E way even though they
are using familiar syntax.


"Things are more like they are now than they ever were before."
    -- Dwight D. Eisenhower