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

steve jenson stevej@sieve.net
Wed, 28 Feb 2001 18:19:42 -0800


Quoting zooko@zooko.com (zooko@zooko.com):

> 
> 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.

I've done that myself more than a few times, (that is, to forget the
def while defining a variable)

Another issue which arises is the use of the def keyword and the var
keyword. If E were to leave out the def keyword, eventually people
would be yelling for the var keyword to be left out also, and how would
the interpreter know whether to automagically use def or var?


> * 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.

no. functions with no type annotations are :void, this is to protect
for that 10% of the time in which :void should be assumed for security
reasons.

blank type annotations _used_ to be considered :any. I, for one, am
glad they aren't considered that way any longer.


> * "The reason functions require parentheses is explained later in this
>   chapter."
> 
>   Don't bother.  I don't want to know the underlying design decisions.

I like to know these things, as do others.


steve

-- 
steve jenson <stevej@sieve.net> http://sieve.net/
PGP key found at a PKI near you (http://pki.surfnet.nl)
PGP fingerprint: 79D0 4836 11E4 A43A 0179  FC97 3AE2 008E 1E57 6138