Relocate and/or to define-syntax macros

This commit is contained in:
Justin Ethier 2015-08-18 22:26:17 -04:00
parent 322696e4c1
commit 377db59ab5
3 changed files with 5 additions and 21 deletions

View file

@ -274,7 +274,7 @@
(in-prog (read-file in-file))
(program? (not (library? (car in-prog))))
(lib-deps
(if (my-and program?
(if (and program?
(tagged-list? 'import (car in-prog)))
(lib:get-all-import-deps (cdar in-prog))
'()))

View file

@ -80,14 +80,14 @@
flush-output-port
read-line
features
my-and
my-or
and
or
)
(begin
;; Features implemented by this Scheme
(define (features) '(cyclone r7rs exact-closed))
(define-syntax my-and
(define-syntax and
(er-macro-transformer
(lambda (expr rename compare)
(cond ((null? (cdr expr)) #t)
@ -95,7 +95,7 @@
(else (list (rename 'if) (cadr expr)
(cons (rename 'and) (cddr expr))
#f))))))
(define-syntax my-or
(define-syntax or
(er-macro-transformer
(lambda (expr rename compare)
(cond ((null? (cdr expr)) #f)

View file

@ -139,22 +139,6 @@
(define (get-macros) *defined-macros*)
(define *defined-macros*
(list
(cons 'and
(lambda (expr rename compare)
(cond ((null? (cdr expr)) #t)
((null? (cddr expr)) (cadr expr))
(else (list (rename 'if) (cadr expr)
(cons (rename 'and) (cddr expr))
#f)))))
(cons 'or
(lambda (expr rename compare)
(cond ((null? (cdr expr)) #f)
((null? (cddr expr)) (cadr expr))
(else
(list (rename 'let) (list (list (rename 'tmp) (cadr expr)))
(list (rename 'if) (rename 'tmp)
(rename 'tmp)
(cons (rename 'or) (cddr expr))))))))
; (cons 'let (lambda (exp rename compare) (let=>lambda exp)))
(cons 'let
(lambda (expr rename compare)