1 |
|
2002-06-12 Miles Bader <miles@gnu.org> |
2 |
|
|
3 |
|
Lexical binding changes to the byte-code interpreter: |
4 |
|
|
5 |
|
* bytecode.c (Bstack_ref, Bstack_set, Bstack_set2, Bvec_ref, Bvec_set) |
6 |
|
(BdiscardN): New constants. |
7 |
|
(exec_byte_code): Renamed from `Fbyte_code'. |
8 |
|
Implement above new bytecodes. |
9 |
|
Add ARGS-TEMPLATE, NARGS and ARGS parameters, and optionally use |
10 |
|
them push initial args on the stack. |
11 |
|
(Fbyte_code): New function, just call `exec_byte_code'. |
12 |
|
Add additional optional arguments for `exec_byte_code'. |
13 |
|
(Qand_optional, Qand_rest): New extern declarations. |
14 |
|
* eval.c (Fcurry, Ffunctionp): New functions. |
15 |
|
(syms_of_eval): Initialize them. |
16 |
|
(funcall_lambda): Call `exec_byte_code' instead of Fbyte_code. |
17 |
|
If a compiled-function object has a `push-args' slot, call the |
18 |
|
byte-code interpreter without binding any arguments. |
19 |
|
(Ffuncall): Add support for curried functions. |
20 |
|
* lisp.h (Fbyte_code): Declare max-args as MANY. |
21 |
|
(exec_byte_code): New declaration. |
22 |
|
|
23 |
|
Lexical binding changes to the lisp interpreter: |
24 |
|
|
25 |
|
* lisp.h (struct Lisp_Symbol): Add `declared_special' field. |
26 |
|
(apply_lambda): Add new 3rd arg to decl. |
27 |
|
* alloc.c (Fmake_symbol): Initialize `declared_special' field. |
28 |
|
* eval.c (Vinterpreter_lexical_environment): New variable. |
29 |
|
(syms_of_eval): Initialize it. |
30 |
|
(Fsetq): Modify SYM's lexical binding if appropriate. |
31 |
|
(Ffunction): Return a closure if within a lexical environment. |
32 |
|
(Flet, FletX): Lexically bind non-defvar'd variables if inside a |
33 |
|
lexical environment. |
34 |
|
(Feval): Return lexical binding of variables, if they have one. |
35 |
|
Pass current lexical environment to embedded lambdas. Handle closures. |
36 |
|
(Ffuncall): Pass nil lexical environment to lambdas. Handle closures. |
37 |
|
(funcall_lambda): Add new LEXENV argument, and lexically bind |
38 |
|
arguments if it's non-nil. Bind `interpreter-lexenv' if it changed. |
39 |
|
(apply_lambda): Add new LEXENV argument and pass it to funcall_lambda. |
40 |
|
(Fdefvaralias, Fdefvar, Fdefconst): Mark the variable as special. |
41 |
|
(Qinternal_interpreter_environment, Qclosure): New constants. |
42 |
|
(syms_of_eval): Initialize them. |
43 |
|
(Fdefun, Fdefmacro): Use a closure if lexical binding is active. |
44 |
|
* lread.c (defvar_bool, defvar_lisp_nopro, defvar_per_buffer) |
45 |
|
(defvar_kboard, defvar_int): Mark the variable as special. |
46 |
|
(Vlexical_binding, Qlexical_binding): New variables. |
47 |
|
(syms_of_lread): Initialize them. |
48 |
|
(Fload): Bind `lexically-bound' to nil unless specified otherwise |
49 |
|
in the file header. |
50 |
|
(lisp_file_lexically_bound_p): New function. |
51 |
|
(Qinternal_interpreter_environment): New variable. |
52 |
|
* doc.c (Qclosure): New extern declaration. |
53 |
|
(Fdocumentation, store_function_docstring): Handle interpreted |
54 |
|
closures. |
55 |
|
|
56 |
2002-06-12 Kim F. Storm <storm@cua.dk> |
2002-06-12 Kim F. Storm <storm@cua.dk> |
57 |
|
|
58 |
* xdisp.c (Fformat_mode_line): New function. |
* xdisp.c (Fformat_mode_line): New function. |