mirror of
https://github.com/justinethier/cyclone.git
synced 2025-07-16 17:27:33 +02:00
Handle + and * without any args
This commit is contained in:
parent
17be2dc09a
commit
20a73cac64
1 changed files with 9 additions and 3 deletions
|
@ -1062,10 +1062,16 @@
|
||||||
(cons (car ast)
|
(cons (car ast)
|
||||||
(map (lambda (a) (convert a renamed))
|
(map (lambda (a) (convert a renamed))
|
||||||
(cdr ast)))))
|
(cdr ast)))))
|
||||||
(if (precompute-prim-app? converted)
|
(cond
|
||||||
converted ; TODO:(eval converted) ;; OK, evaluate at compile time
|
((and (equal? (car converted) '+) (= (length converted) 1))
|
||||||
|
0)
|
||||||
|
((and (equal? (car converted) '*) (= (length converted) 1))
|
||||||
|
1)
|
||||||
|
((precompute-prim-app? converted)
|
||||||
|
converted) ; TODO:(eval converted) ;; OK, evaluate at compile time
|
||||||
;converted))) ;; No, see if we can fast-convert it
|
;converted))) ;; No, see if we can fast-convert it
|
||||||
(prim:inline-convert-prim-call converted)))) ;; No, see if we can fast-convert it
|
(else
|
||||||
|
(prim:inline-convert-prim-call converted))))) ;; No, see if we can fast-convert it
|
||||||
((lambda? ast)
|
((lambda? ast)
|
||||||
(let* ((args (lambda-formals->list ast))
|
(let* ((args (lambda-formals->list ast))
|
||||||
(ltype (lambda-formals-type ast))
|
(ltype (lambda-formals-type ast))
|
||||||
|
|
Loading…
Add table
Reference in a new issue