mirror of
https://github.com/justinethier/cyclone.git
synced 2025-05-24 12:35:05 +02:00
Added a TODO
This commit is contained in:
parent
c9fd208a72
commit
17213d94ac
1 changed files with 30 additions and 1 deletions
|
@ -1927,6 +1927,35 @@
|
||||||
)
|
)
|
||||||
|
|
||||||
(define (analyze:find-known-lambdas exp)
|
(define (analyze:find-known-lambdas exp)
|
||||||
'TODO)
|
TODO: scan for well-known lambdas:
|
||||||
|
- app of a lambda is well-known, that's easy
|
||||||
|
- lambda can be passed as a cont. If we can identify all the places the cont is called (?) and it is not used for anything but calls, then I suppose that also qualifies as well-known.
|
||||||
|
this is more problematic to generate code for, though.
|
||||||
|
may need a lookup table of symbol to well-known function (if any)
|
||||||
|
- ?? must be other cases
|
||||||
|
|
||||||
|
(define (scan exp)
|
||||||
|
(cond
|
||||||
|
((ast:lambda? exp)
|
||||||
|
(for-each
|
||||||
|
(lambda (e)
|
||||||
|
(scan e def-sym))
|
||||||
|
(ast:lambda-body exp)))
|
||||||
|
((quote? exp) exp)
|
||||||
|
((const? exp) exp)
|
||||||
|
((ref? exp)
|
||||||
|
exp)
|
||||||
|
((define? exp) #f) ;; TODO ??
|
||||||
|
((set!? exp) #f) ;; TODO ??
|
||||||
|
((if? exp)
|
||||||
|
(scan (if->condition exp) def-sym)
|
||||||
|
(scan (if->then exp) def-sym)
|
||||||
|
(scan (if->else exp) def-sym))
|
||||||
|
((app? exp)
|
||||||
|
)
|
||||||
|
(else #f)))
|
||||||
|
|
||||||
|
;(trace:error `(update-lambda-atv! ,syms ,value))
|
||||||
|
(scan exp))
|
||||||
|
|
||||||
))
|
))
|
||||||
|
|
Loading…
Add table
Reference in a new issue