Re: [Scheme-reports] ANN: first draft of R7RS small language available Andre van Tonder (19 Apr 2011 17:55 UTC)

Re: [Scheme-reports] ANN: first draft of R7RS small language available Andre van Tonder 19 Apr 2011 17:54 UTC

Alex, here is a better example.

If I understand you correctly, you are advocating accommodating implementations
in which the following very reasonable program /wouldn't/ work.

(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))))))

  ;;; Program

  (import (base) (match))

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

This would /not/ work in the implementations you advocate accommodating becasue
when BASE is imported into the program a new binding for CONS would be created.

I know you don't like arguments from authority and again, I am not a big
authority, but believe me, I have gone through all the iterations you mention in
trying ot imlement modules, so I know that Kohlbecker doesn't work for modules,
and "naive copy imported bindings on import" just doesn't work in a
language with macros.  I know becasue I implemented it and it was just broken in
so many ways.  And you know what, it is not even simpler than a correct
implementation using ER and handling the environments correctly.

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