mirror of
https://github.com/justinethier/cyclone.git
synced 2025-07-09 22:17:33 +02:00
WIP
This commit is contained in:
parent
5f002237cd
commit
397b10dc4d
1 changed files with 5 additions and 3 deletions
|
@ -17,8 +17,8 @@
|
||||||
; can write initial analyze, but can't get too far without being able
|
; can write initial analyze, but can't get too far without being able
|
||||||
; to uniquely ID each lambda
|
; to uniquely ID each lambda
|
||||||
|
|
||||||
(define-library (cps-optimizations)
|
;(define-library (cps-optimizations)
|
||||||
;(define-library (scheme cyclone cps-optimizations)
|
(define-library (scheme cyclone cps-optimizations)
|
||||||
(import (scheme base)
|
(import (scheme base)
|
||||||
(scheme cyclone util)
|
(scheme cyclone util)
|
||||||
(scheme cyclone ast)
|
(scheme cyclone ast)
|
||||||
|
@ -166,7 +166,8 @@
|
||||||
;;
|
;;
|
||||||
;; obviously need to add code later on to reset const if mutated
|
;; obviously need to add code later on to reset const if mutated
|
||||||
(cond
|
(cond
|
||||||
((ast:lambda? (car exp))
|
((and (ast:lambda? (car exp))
|
||||||
|
(list? (ast:lambda-args (car exp)))) ;; For now, avoid complications with optional/extra args
|
||||||
(let ((params (ast:lambda-args (car exp))))
|
(let ((params (ast:lambda-args (car exp))))
|
||||||
(for-each
|
(for-each
|
||||||
(lambda (arg)
|
(lambda (arg)
|
||||||
|
@ -318,6 +319,7 @@
|
||||||
((app? exp)
|
((app? exp)
|
||||||
(cond
|
(cond
|
||||||
((and (ast:lambda? (car exp))
|
((and (ast:lambda? (car exp))
|
||||||
|
(list? (ast:lambda-args (car exp))) ;; Avoid optional/extra args
|
||||||
(= (length (ast:lambda-args (car exp)))
|
(= (length (ast:lambda-args (car exp)))
|
||||||
(length (app->args exp))))
|
(length (app->args exp))))
|
||||||
(let ((new-params '())
|
(let ((new-params '())
|
||||||
|
|
Loading…
Add table
Reference in a new issue