[plt-scheme] keywords aren't isomorfic to symbols?

From: Hans Oesterholt (hdnews at gawab.com)
Date: Sun Nov 6 17:45:19 EST 2005


The original mail about keywords states:

>/ * Syntactic forms can also use keywords, and pattern matching "just
/>/   works". Using keywords can help clarify when a syntactic form
/>/   expects to match literals (e.g., the colon in a `compound-unit/sig'
/>/   form) versus bindings (e.g., `quasiquote' in a `match' pattern).

So why doesn't the following work?

Welcome to MzScheme version 299.403, Copyright (c) 2004-2005 PLT Scheme, Inc.
(define-syntax a
  (syntax-rules ()
    ((_ b ...)
     (list 'b ...)

(define q (a e f g h i j))
(map (lambda (x) (symbol? x)) q)
> > (#t #t #t #t #t #t)
> (define-syntax ka
  (syntax-rules ()
    ((_ kb ...)
     (list #:kb ...)

(define kq (ka e f g h i j))
(map (lambda (x) (keyword? x)) kq)

> stdin::400: syntax: no pattern variables before ellipses in template at: ... in: (list #:kb ...)
> reference to undefined identifier: ka
> reference to undefined identifier: kq


Thanks in advance for your answer,

Hans Oesterholt-Dijkema

Posted on the users mailing list.