mirror of
https://github.com/justinethier/cyclone.git
synced 2025-07-14 08:17:35 +02:00
WIP
This commit is contained in:
parent
cf6ccc25d9
commit
d312b0598c
3 changed files with 5 additions and 4 deletions
|
@ -1001,10 +1001,9 @@ if (acc) {
|
|||
(not (assoc 'if renamed)))
|
||||
;; Add a failsafe here in case macro expansion added more
|
||||
;; incomplete if expressions.
|
||||
;; FUTURE: append the empty (unprinted) value instead of #f
|
||||
(let ((new-ast (if (if-else? ast)
|
||||
`(if ,@(map (lambda (a) (convert a renamed)) (cdr ast)))
|
||||
(convert (append ast '(#f)) renamed))))
|
||||
(convert (append ast (list (void))) renamed))))
|
||||
(cond
|
||||
;; Optimization - convert (if (not a) b c) into (if a c b)
|
||||
((and (app? (if->condition new-ast))
|
||||
|
|
|
@ -172,6 +172,7 @@
|
|||
(or (integer? exp)
|
||||
(real? exp)
|
||||
(complex? exp)
|
||||
(eq? (void) exp) ;; Poor man's (void?)
|
||||
(string? exp)
|
||||
(vector? exp)
|
||||
(bytevector? exp)
|
||||
|
|
|
@ -116,6 +116,7 @@
|
|||
(define (self-evaluating? exp)
|
||||
(cond ((number? exp) #t)
|
||||
((boolean? exp) #t)
|
||||
((eq? (void) exp) #t) ;; Poor man's (void?)
|
||||
((string? exp) #t)
|
||||
((vector? exp) #t)
|
||||
((bytevector? exp) #t)
|
||||
|
@ -159,7 +160,7 @@
|
|||
(define (if-alternative exp)
|
||||
(if (not (null? (cdddr exp))) ;; TODO: add (not) support
|
||||
(cadddr exp)
|
||||
#f))
|
||||
(void)))
|
||||
(define (make-if predicate consequent alternative)
|
||||
(list 'if predicate consequent alternative))
|
||||
|
||||
|
@ -1022,7 +1023,7 @@
|
|||
;; Insert default value for missing else clause
|
||||
;; FUTURE: append the empty (unprinted) value
|
||||
;; instead of #f
|
||||
#f)))
|
||||
(void))))
|
||||
((define-c? exp) exp)
|
||||
((define-syntax? exp)
|
||||
;(trace:info `(define-syntax ,exp))
|
||||
|
|
Loading…
Add table
Reference in a new issue