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

syntax enforcement

Recently a student came to me with something like
   (case  ..
      (define (foo ..)..)        <- an internal define
      ... )

R4RS is clear that it is illegal since a case clause after datum* only
accepts a sequence and not a body (which allows internal define).  It
is also probable that some implementations tolerate the above program
since it works with the rewriting of case as given in section 7.3.  It
might be better to emphasize that, modifying the rewriting of case and
some others, sequences are placed in a sequence position and not a
body position.  This amounts to write
     (lambda (..) (begin <sequence>))
instead of 
     (lambda (..) <sequence>)

  Students have so much imagination ...