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

Re: Initial comments & questions

This page is part of the web mail archives of SRFI 53 from before July 7th, 2015. The new archives for SRFI 53 contain all messages, not just those from before July 7th, 2015.

On Tue, 23 Mar 2004 campbell@xxxxxxxxxxxxxxxxxxxxxxxxxxx wrote:

> I have yet another idea.
> (SYNTAX-SEQUENCE <clause> ... <final>)
>   <clause> ->
>       (COMPUTE <pattern> <syntactic computation>)
>     | (LET <pattern> <form>)
>     | (<syntactic computation>)
>   <final> -> <syntactic computation>
> COMPUTE binds a pattern, a SYNTAX-RULES pattern, to the result of a
> syntactic computation.  LET simply binds a SYNTAX-RULES pattern with a
> form, not a computation.  The third kind of clause ignores the result
> of a syntactic computation.  The result of the SYNTAX-SEQUENCE form is
> the result of the FINAL.

I think these are all expressible more simply with bind only (assuming we
call it syntax-bind). E.g.,

(syntax-bind ((x    (syntax-reverse (x y z))
              (y    (syntax-return (u v w))
              (void (syntax-message "Debug message"))
  (syntax-append x y))

Here the first line does what COMPUTE does, the second line does what 
LET does, and the third line is a syntactic computation with a throwaway

> I also have a suggestion to rename SYNTAX-BIND to SYNTAX-EXTEND, as the
> monadic >>= operator is often differently named.

Good idea.