[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Kent Dybvig's Comments on Scheme



Not having participated in the workshop, I've been hesistant about
making comments on the various issues flying by recently, but I couldn't
resist responding to Bill Roza's comments on special forms:

        I think that there are only two valid reasons for adding
    special forms:
    
            - They provide a convenient syntax for something which
    could be expressed only considerably more clumsily without them.
    Example: COND (as compared to nested IFs).  These are usually macros
    which expand into the clumsier form.
    
            - They provide an extension to the language which requires
    special handling by the interpreter or compiler.  Their effect could
    otherwise not be achieved.  Example: QUOTE.  These are the "TRUE"
    special forms.
    
I think there's one other reason, which in a sense subsumes the first:
*readability*.  In particular, with regard to IF having or not having
an alternative sub-expression, I find that when I'm reading code and
come across an IF expression, I look very hard to see if it has an
alternative branch.  If it doesn't, I look again to be sure I didn't
miss it.  I think this "convenient feature" degrades readability.
I agree with Bill Rozas that one shouldn't proliferate special forms,
but my reason is that they are typically complex, and their syntax
becomes hard to remember.  However you can't get much simpler than
WHEN and UNLESS.  Their use, in my opinion, greatly enhances
readability.

    - Paul Hudak (hudak@yale)