mirror of
https://github.com/justinethier/cyclone.git
synced 2025-07-14 00:07:36 +02:00
Relocate and/or to define-syntax macros
This commit is contained in:
parent
322696e4c1
commit
377db59ab5
3 changed files with 5 additions and 21 deletions
|
@ -274,7 +274,7 @@
|
||||||
(in-prog (read-file in-file))
|
(in-prog (read-file in-file))
|
||||||
(program? (not (library? (car in-prog))))
|
(program? (not (library? (car in-prog))))
|
||||||
(lib-deps
|
(lib-deps
|
||||||
(if (my-and program?
|
(if (and program?
|
||||||
(tagged-list? 'import (car in-prog)))
|
(tagged-list? 'import (car in-prog)))
|
||||||
(lib:get-all-import-deps (cdar in-prog))
|
(lib:get-all-import-deps (cdar in-prog))
|
||||||
'()))
|
'()))
|
||||||
|
|
|
@ -80,14 +80,14 @@
|
||||||
flush-output-port
|
flush-output-port
|
||||||
read-line
|
read-line
|
||||||
features
|
features
|
||||||
my-and
|
and
|
||||||
my-or
|
or
|
||||||
)
|
)
|
||||||
(begin
|
(begin
|
||||||
;; Features implemented by this Scheme
|
;; Features implemented by this Scheme
|
||||||
(define (features) '(cyclone r7rs exact-closed))
|
(define (features) '(cyclone r7rs exact-closed))
|
||||||
|
|
||||||
(define-syntax my-and
|
(define-syntax and
|
||||||
(er-macro-transformer
|
(er-macro-transformer
|
||||||
(lambda (expr rename compare)
|
(lambda (expr rename compare)
|
||||||
(cond ((null? (cdr expr)) #t)
|
(cond ((null? (cdr expr)) #t)
|
||||||
|
@ -95,7 +95,7 @@
|
||||||
(else (list (rename 'if) (cadr expr)
|
(else (list (rename 'if) (cadr expr)
|
||||||
(cons (rename 'and) (cddr expr))
|
(cons (rename 'and) (cddr expr))
|
||||||
#f))))))
|
#f))))))
|
||||||
(define-syntax my-or
|
(define-syntax or
|
||||||
(er-macro-transformer
|
(er-macro-transformer
|
||||||
(lambda (expr rename compare)
|
(lambda (expr rename compare)
|
||||||
(cond ((null? (cdr expr)) #f)
|
(cond ((null? (cdr expr)) #f)
|
||||||
|
|
|
@ -139,22 +139,6 @@
|
||||||
(define (get-macros) *defined-macros*)
|
(define (get-macros) *defined-macros*)
|
||||||
(define *defined-macros*
|
(define *defined-macros*
|
||||||
(list
|
(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 (exp rename compare) (let=>lambda exp)))
|
||||||
(cons 'let
|
(cons 'let
|
||||||
(lambda (expr rename compare)
|
(lambda (expr rename compare)
|
||||||
|
|
Loading…
Add table
Reference in a new issue