sexpressions, sexpr, sex!
Andrew Bromage
bromage@cs.mu.OZ.AU
Thu, 22 Jun 1995 12:44:37 +1000 (EST)
G'day.
I wrote:
> Disagreed.
>
> Functors are a common feature of more modern languages than Lisp.
Garth wrote:
> i agree functors are useful. i don't however see how this applies to
> creating an alternate syntax which is better than sexprs.
Disclaimer: My opinion.
One thing that bugs me about s-expressions is that each cons cell has
only two children. Data usually comes in bigger chunks than that, so
storing larger structures (which we will need) in an s-expression
wastes memory needlessly.
(Question: Cons is the only primitive data constructor, right? That's
if you don't count getprop and putprop. I assume that this isn't just
a Lispism because my version of Prolog (NU-Prolog) has these.)
Apart from implementation considerations, though, here are my main
complaints about s-expression syntax:
- Too many parenthesis. (I know, I know...)
- The cons operation is right-associative. Being
brought up on lambda calculus-based languages, I
find this counter-intuitive.
- The lack of infix and postfix operators. Much
programming is mathematical, and so something that
looks more like mathematical notation makes sense.
All-in-all, s-expressions _look_ like they were intended for machine
consumption.
Functors, on the other hand, look like functions. What's more, you
can make them work like operators (in a syntax system which allows
dynamically-created operators).
> please eloborate (it's late - please forgive me :)
No, fair enough. I re-read my message and I realised that I left
quite a bit unanswered.
Once again, I am fully prepared to be talked out of any/all of the
above if necessary.
Cheers,
Andrew Bromage