[E-Lang] real live newbie caught trying to learn E
Zooko
zooko@zooko.com
Tue, 23 Oct 2001 10:05:11 -0700
MarcS wrote:
>
> The Maker pattern is far and away the least Java-like element of "ordinary"
> E programming. This chat session is a good reminder that the Walnut section
> on Makers needs to be crafted and recrafted till it is like a polished
> diamond...unless we can think of some more syntactic shorthand that can
> simplify it even more than the "class" shorthand does.
I'm Ppooko the Picky Java Programmer.
"Class shorthand?", I think. I go to read _E_in_a_Walnut_. It says that if
you already know Java you might try just using the Quick Reference, so I go
there:
http://www.erights.org/elang/quick-ref.html
and look for how to define a class. It says:
-------
Objects with state
def operatorMaker new(baseNum) :any {
def randomVariable := 3
def operator {
to addBase(number) :any {
baseNum + number
}
to multiplyBase(number) :any {
baseNum * number
}
}
}
def threeHandler := operatorMaker new(3)
def threeTimes2 := threeHandler multiplyBase(2)
-------
Eh -- I don't understand this. Why is there a "def operator" inside the "def
operatorMaker"? Which one is the name of the class? I don't like this.
I think I'll go call all my friends and tell them that I tried to learn E, but
that I gave up when it turned out it wasn't really Object Oriented.
Sincerely,
Ppooko the Eternally Helpful