[E-Lang] get, set, and dot

Vijay Saraswat vijay@saraswat.org
Mon, 26 Feb 2001 06:15:39 -0500

Yes, Tyler, I agree with you --- really need to curb new shorthands to make it
easy for people to read other people's code.

Alan Perlis had some quote on how important it is to get syntax right...

The hardest part in understanding a new language is to understand the flow of
the language, get the idioms right. If they keep changing, a reader feels like
s/he is standing on shifting ground. Significantly increases cost of

> I am a fairly conscientious learner, and I've spent a decent amount of
> time thinking about the E language. I still run into things that are
> unfamiliar to me. The latest was in one of your recent posts on the
> ERTP. You had the line:
>         def notary setForInspection(obj) { currentNotarizedObject := obj}
> There are so many shorthands for defining an object. In my use of E,
> I've silently dropped some of them. This use is one I've dropped. If I
> were making an object with a single method that needed a name other
> than the default "run", I would have explicitly coded:
>         def notary {
>                 to setForInspection(obj) { currentNotarizedObject := obj }
>         }

I agree with you that the first shorthand is not worth the effort.

> It took me a significant amount of time to truly understand and
> appreciate E's lexical scoping style of object definition. I really
> like it now that I get it, but it took me some time to get it. It is
> very different from typical class definition as seen in Java. I fear
> that E's many shorthands will make it more difficult for others to
> gain this same understanding.

Nested and inner classes were a significant extension to Java... I hope you
use them.

(I spent over a month getting lexical scoping right for the cc languages in my
thesis..) My group uses these featues a fair bit ... generally for very small
"in situ"/adapter class definitions.