moving on Taylor Campbell (07 Dec 2003 19:48 UTC)
Re: moving on Taylor Campbell (07 Dec 2003 20:13 UTC)
Re: moving on bear (07 Dec 2003 21:53 UTC)
Re: moving on Taylor Campbell (08 Dec 2003 00:04 UTC)
Re: moving on Brian Mastenbrook (08 Dec 2003 00:04 UTC)
Re: moving on Alfresco Petrofsky (07 Dec 2003 23:27 UTC)
Re: moving on Taylor Campbell (14 Dec 2003 18:52 UTC)

Re: moving on Taylor Campbell 07 Dec 2003 20:13 UTC

On Dec 7, 2003, at 2:48 PM, Taylor Campbell wrote:

> Comments, and what are some thoughts on whether to use (...) or (...
> ...) for the base of the ellipsis generator, which I mentioned in
> passing a while ago?  (Argument for (...): it makes much more sense.
> Argument for (... ...): it's what everyone uses already.)

Another idea: the ellipsis token is a dotted list whose elements are
all ... and whose terminator is ....  An empty dotted ellipsis list
acts as ellipsis; a dotted ellipsis list pair expands to its CDR.

Here's ALL-SYMBOLS as in the examples section using the dotted list
version, with the other two versions commented out nearby (the order
the lines using the different kinds is the order of my preference):

(define-syntax all-symbols
   (syntax-rules ()
     ((all-symbols (?car . ?cdr) ?k)
      (let-syntax
          ((k (syntax-rules ()
                ((k ?y* ?k*  (?symbol (... . ...))) ;dotted list
;              ((k ?y* ?k*  (?symbol (...)))       ;(...)     -> ...
;              ((k ?y* ?k*  (?symbol (... ...)))   ;(... ...) -> ...
                 (let-syntax
                     ((k* (syntax-rules ()
                            ((k* ?k**
                                 (?symbol* (... ... . ...)))
;                               (?symbol* (... ...)))
;                               (?symbol* (... ... ...)))
                             (union (?symbol  (... . ...))
;                           (union (?symbol  (...))
;                           (union (?symbol  (... ...))
                                    (?symbol* (... ... . ...)))))))
;                                  (?symbol* (... ...)))))))
;                                  (?symbol* (... ... ...)))))))
                   (all-symbols ?y* (k* ?k*)))))))
        (all-symbols ?x (k ?y ?k))))
     ((all-symbols #(?x ...) ?k)
      (all-symbols (?x ...) ?k))
     ((all-symbols ?x ?k)
      (syntax-symbol? ?x
        (apply-syntax-cont ?k (?x))
        (apply-syntax-cont ?k ())))))