[Date Prev] [Date Next] [Thread Prev] [Thread Next] Date Index Thread Index Search archive:
Date:Mon Dec 11 12:00:57 1992 
Subject:Syntax Misdesign 
From:Steve Knight 
Volume-ID:921212.02 

.... now where did I put those matches?  Ah yes, here they are ....

What's your least favourite piece of POP syntax?  Everyone must have their
own love-to-hate candidate.  

For myself, I cannot abide the list and vector syntax.  Just the other 
day I was speaking with a highly competent programmer (in C & Prolog)
who said to me "You know, I can never seem to get the hang of POP syntax."
Needless to say, I had to investigate!  And, little to my surprise, I
discovered that the quasi-quoting syntax of lists and vectors were the
problem. 

The number of beginners who want to build a list of one element with the
result of a computation, say ``f(x)'', in it who write
    [ f(x) ]
must be beyond recall.  In fact, I suspect _every_ programmer made this
eminently sensible guess when they were learning to program in POP and
discovered, to their horror, just how wrong they were.

Another common mistake must be to attempt to correct the above expression
and write
    [ ^f(x) ]
Whoops!  I just feel tired when I see beginners struggling with this piece
of misdesign.

What I would like to see is list notation brought into line with modern
languages such as Prolog and Standard ML.  I think this could be done in
a practical way by introducing a suitable compile_mode flag, for example.
To make this suggestion work fully, I would adopt the syntactic proposals
of Chris Dollin's Pepper system.

What do other people get fuming about when they use POP?  Inquiring minds
want to know!