Changeset 12963 in project for chicken


Ignore:
Timestamp:
01/08/09 14:35:04 (11 years ago)
Author:
felix winkelmann
Message:

alternative definition for define-for-syntax (untested)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • chicken/trunk/chicken-syntax.scm

    r12952 r12963  
    10431043  (lambda (form r c)
    10441044    (##sys#check-syntax 'define-for-syntax form '(_ _ . _))
    1045     (let ((head (cadr form))
    1046           (body (cddr form)))
    1047       (let* ((body (if (null? body) '((##core#undefined)) body))
    1048              (name (if (pair? head) (car head) head))
    1049              (body (if (pair? head)
    1050                        `(,(r 'lambda) ,(cdr head) ,@body)
    1051                        (car body))))
    1052         (if (symbol? name)
    1053             (##sys#setslot name 0 (eval body)) ;*** this is likely to be incorrect
    1054             (syntax-error 'define-for-syntax "invalid identifier" name) )
    1055         (##sys#register-meta-expression `(define ,name ,body))
    1056         (if ##sys#enable-runtime-macros
    1057             `(,(r 'define) ,name ,body)
    1058             '(##core#undefined)))))))
     1045    `(,(r 'begin-for-syntax)
     1046      (,(r 'define) ,@(cdr form))))))
    10591047
    10601048
Note: See TracChangeset for help on using the changeset viewer.