unusual define-syntax syntax 
Author Message
 unusual define-syntax syntax

Greetings -

I've been spending some time poking around in the S48 source (from the
scsh distribution), trying to pick up some know-how on scheme
implementations.  Going fairly well, but ...

In a few places the authors use a type of define-syntax that I'm not
familiar with, and which doesn't seem to correspond to that described
in r4rs.  Since r4rs warns the reader that the facility described
therein is "but one of several", I guess I shouldn't be surprised.

Anyhow, here're some examples:

; from vm/arch.scm
(define-syntax define-instruction-set
  (lambda (form rename compare)
    (let ((data (do ((data (reverse (cdr form)) (cdr data))
                     (new '() (let ((next (car data)))
                                (if (pair? (car next))
                                    (append (map (lambda (op)
                                                   (cons op (cdr next)))
                                                 (car next))
                                            new)
                                    (cons next new)))))
                    ((null? data) new))))
      `(begin (define-enumeration op
                ,(map car data))
              (define opcode-arg-specs

; from vm/defenum.scm
(define-syntax components
  (cons (lambda (e r c) `(,(cadr e) components))
        '()))

Is there a reference I can check out for this type of macro?  Is it
possible to explain in a USENET post?

Thanks,

--

jd



Sat, 17 Jun 2000 03:00:00 GMT  
 unusual define-syntax syntax

jd> Greetings -

jd> I've been spending some time poking around in the S48 source (from the
jd> scsh distribution), trying to pick up some know-how on scheme
jd> implementations.  Going fairly well, but ...

jd> In a few places the authors use a type of define-syntax that I'm not
jd> familiar with, and which doesn't seem to correspond to that described
jd> in r4rs.

Scheme 48 internally uses explicit renaming macros.  A good
description is in

/cs.indiana.edu:/pub/scheme-repository/doc/prop/exrename.ps.gz

Note that the description uses a keyword "transformer" which is left
out in Scheme 48's implementation.

--
Cheers =8-} Mike
Friede, V?lkerverst?ndigung und berhaupt blabla



Wed, 21 Jun 2000 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. is define-syntax inside define-syntax OK?

2. define-syntax must be followed by syntax-rules ??

3. Implementing letrec-syntax using only let-syntax and syntax-rules

4. shadows of define and define-syntax

5. define in define-syntax

6. define-macro -> define-syntax

7. define-macro vs define-syntax

8. Macros defining macros with define-syntax

9. Unusual syntax

10. Syntax Questions for a new language with somewhat Smalltalk-like syntax

11. block syntax/def syntax question/suggestion

12. Syntax-case vs. syntax-rules

 

 
Powered by phpBB® Forum Software