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

Re: [Scheme-reports] ANN: first draft of R7RS small language available



On Thu, 21 Apr 2011, Alex Shinn wrote:

> Note the ability to rename and the option to not rename are
> not mutually incompatible.  Chicken works similar to Chibi
> except that it allows renaming (even if the identifiers aren't
> bound).  I think this may be the best of all worlds.

You bring up good points.

The Chicken approach does sound like a good approach.

However, whatever you do I do think it is important that the MATCH example I 
showed should work, where CONS is used as a keyword.  Let me repeat it here:

(module (match)
    (import (base))
    (export (match))

    (define-syntax match
      (syntax-rules (cons)
        ((_ exp1 ((cons y z) exp2))
         (let* ((x exp1) (y (car x)) (z (cdr x))) exp2))))))
   ; end of module

  ;;; Program

  (import (base) (match))

  (match '(1 . 2)
    ((cons x y) (write x) (write y)))

Here CONS is used as a keyword.  It is unclear to me if your intent is for this 
to work protably.  My understanding of what lexical scope means says that it 
should work, because the CONS in the imported module and the CONS keyword use in 
the main program all refer to the CONS from the (base) library.  But you brought 
up the possibility that this might not work in systems that create new bindings 
for imported identifiers.

As I said, this is a macro I would like to be able to write, so I would be 
unhappy if I couldn't.

Andre

_______________________________________________
Scheme-reports mailing list
Scheme-reports@x
http://lists.scheme-reports.org/cgi-bin/mailman/listinfo/scheme-reports