summaryrefslogtreecommitdiffstats
path: root/parser.c
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2018-11-04 11:52:03 -0800
committerKaz Kylheku <kaz@kylheku.com>2018-11-04 11:52:03 -0800
commit44c8e70f810ad52b0f26f06147d5613ed1271900 (patch)
tree6ac8814ce1c8f5a7f2159e19f53f530a072b3aa1 /parser.c
parent167ae958a8a4376703ade38a8f9c56763e3626f3 (diff)
downloadtxr-44c8e70f810ad52b0f26f06147d5613ed1271900.tar.gz
txr-44c8e70f810ad52b0f26f06147d5613ed1271900.tar.bz2
txr-44c8e70f810ad52b0f26f06147d5613ed1271900.zip
compiler: optimize dwim.
* share/txr/stdlib/asm.tl (op-getf): Rename to op-oldgetf. This opcode becomes obsolescent. (op-getf): New opcode. * share/txr/stdlib/compiler.tl (assumed-fun): New global variable. (compiler comp-fun): Use the new getf instruction which takes a function table index instead of a data table index. (compiler comp-lisp1-value): Don't use getl1 opcode any more for dynamic lisp1-style lookup. Instead, we bake the behavior at compile time perform a function lookup if the symbol is completely unbound, a variable lookup if it is bound to a variable (where we decide at compile tie whether it is lexical or dynamic) or else a function if a function binding exists at compile time. Also, if we assume that an unbound symbol is a function, put it on the assumed-fun list. (compiler comp-dwim): If the first argument is a symbol with no lexical binding, and is not bound as a variable, then treat it as a function by transforming the form into a function call form with that symbol in the car position. Put the symbol on the assumed-fun list. (compiler-emit-warnings): New function. (with-compilation-unit): Call compiler-emit-warnings when bailing out of most enclosing compilation unit. (%tlo-ver%): Bump compiled file version to 4, since we added an opcode. * vm.c (vm_execute): Follow rename of GETF to OLDGETF. Implement the new GETF. * parser.c (read_file_common): Extend version range to allow version 4 compiled files. * txr.1: Documented everything.
Diffstat (limited to 'parser.c')
-rw-r--r--parser.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/parser.c b/parser.c
index 8212fdd7..11557be8 100644
--- a/parser.c
+++ b/parser.c
@@ -636,7 +636,7 @@ static val read_file_common(val stream, val error_stream, val compiled)
if (compiled && first) {
val major = car(form);
- if (lt(major, one) || gt(major, three))
+ if (lt(major, one) || gt(major, four))
uw_throwf(error_s,
lit("cannot load ~s: version number mismatch"),
stream, nao);