[E-Lang] newbie syntax: picayune points from a prejudiced programmer

zooko@zooko.com zooko@zooko.com
Wed, 28 Feb 2001 17:46:49 -0800


I've started reading "E in a Walnut".  Here are some notes, in which 
I deliberately choose to point out tiny syntactic objections which 
I would normally pass over.


* Why both "define" and "def"?  Just make "def" to be the only option,
  please.  I love the Python paradigm: there is exactly one way to do
  each common thing.

* In fact, would it be possible to provide Python's automatic
  declaration of variables with no keyword?  If we could write

  answer := a

  instead of

  def answer := a

  this would be big win in terms of interactive, scripting,
  fast-writing style.

* Can we assume that functions with no type annotation are ":any"
  functions?  I hate typing the same thing over and over, and ":any" is
  going to be the type for > 90% of the functions, especially in
  scripting/first-prototype code.

* "The reason functions require parentheses is explained later in this
  chapter."

  Don't bother.  I don't want to know the underlying design decisions.
  All functions should be invoked as `barf()' because that is how C,
  Java, Perl and Python do it.

  Oh wait a sec!

* "A parameterless function must have an open/close paren pair. Calls
  to parameterless functions must also include the parens. This
  contrasts with parameterless methods for objects described later,
  which do not require empty parentheses either during definition or
  when called."

  Ugh.  I wish that functions and methods looked identical except for
  the presence of the object, and I wish that `()' were required on the
  end of every single invokation, so that I can scan a page of text and
  see the `(.*)' patterns and know where the invokations are.

  Perhaps more importantly, the widely used syntaxes (C, Java, Perl,
  and Python-if-you-count-Python), all require `()' at the end of every
  invokation.



Okay I'll stop for now.


Regards,

Zooko