[E-Lang] get, set, and dot

Marc Stiegler marcs@skyhunter.com
Mon, 26 Feb 2001 09:25:21 -0700

> E does not quite seem to have Java's look and feel..e.g. lack of static
> type-checking, addition of pattern matching, new kind of for loops etc.

Vijay has muttered about the pattern matching stuff a couple of times in
this thread as being a big difference. This has bugged me because it feels
to me like this is not a big deal, the quasi-stuff is just a useful add-on
feature of the language that doesn't risk confusing people in day-to-day
operations, barely a bigger change to the E language than is the addition of
a 2D drawing package to the Java API. In E in a Walnut, there is a short
section on it, and you hardly ever see it again.

I hypothesize that the reason pattern matching looks like a big core element
of the language is that some members of our community use the quasiliterals
and quasiparsers ubiquitously for the most mundane operations:

println(`$name has value $value`)

As a usage convention, I only use quasi-stuff when it has a big payoff, as
in JPanel layouts (boy, does that ever have a big payoff!). I always write
the above as

println(name + " has value " + value)

While some may argue the first is easier to read (actually, I find the
second one easier to read, I've done too much Java :-), Vijay's experience
makes me suspect that it alienates people on first introduction to the
language. So those of you who want to write code that will help attract Java
people to our camp might want to reconsider the circumstances under which
you use this particular construct. It is cute but, as Vijay points out
elsewhere, it is very secondary to the core goal of getting people into
threadless capability programming.