summaryrefslogtreecommitdiffstats
path: root/parser.l
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2020-05-03 11:52:21 -0700
committerKaz Kylheku <kaz@kylheku.com>2020-05-03 11:52:21 -0700
commit799f765f3f1fe18901636c124f1ae62df46f93a8 (patch)
treebe67c4dec9db2ce6b1f987049dd049ff7037614b /parser.l
parent898e55a66e8011140257057e4faa52f4cb74648b (diff)
downloadtxr-799f765f3f1fe18901636c124f1ae62df46f93a8.tar.gz
txr-799f765f3f1fe18901636c124f1ae62df46f93a8.tar.bz2
txr-799f765f3f1fe18901636c124f1ae62df46f93a8.zip
compiler: implement lambda lifting.
This is what the recent load-time changes were grooming the compiler toward. When we compile a lambda, we can look at the function and variable refernces it is making. If the lambda makes no lexical function or variable references, we can lift that lambda into load time, so that it's instantiated once and then re-used out of a D register. Effectively, it becomes a top-level function. * share/txr/stdlib/compiler.tl (compiler comp-lambda-impl): New method, formed by renaming comp-lambda. (compiler comp-lambda): Turned not wrapper for comp-lambda impl which compiles the lambda, and checks for the conditions for hoisting it into load time, which is currently done by generating the sys:load-time-lit form around it and re-compiling.
Diffstat (limited to 'parser.l')
0 files changed, 0 insertions, 0 deletions