* doc/lispref/variables.texi (Scope): Mention the availability of lexbind.
[bpt/emacs.git] / src / ChangeLog
CommitLineData
d032d5e7
SM
12011-03-01 Stefan Monnier <monnier@iro.umontreal.ca>
2
3 * callint.c (quotify_arg): Simplify the logic.
4 (Fcall_interactively): Use lexical binding when evaluating the
5 interactive spec of a lexically bound function.
6
876c194c
SM
72011-02-25 Stefan Monnier <monnier@iro.umontreal.ca>
8
9 * eval.c (Qcurry): Remove.
10 (funcall_funvec): Remove.
11 (funcall_lambda): Move new byte-code handling to reduce impact.
12 Treat all args as lexical in the case of lexbind.
13 (Fcurry): Remove.
14 * data.c (Qfunction_vector): Remove.
15 (Ffunvecp): Remove.
16 * lread.c (read1): Revert to calling make_byte_code here.
17 (read_vector): Don't call make_byte_code any more.
18 * lisp.h (enum pvec_type): Rename back to PVEC_COMPILED.
19 (XSETCOMPILED): Rename back from XSETFUNVEC.
20 (FUNVEC_SIZE): Remove.
21 (FUNVEC_COMPILED_TAG_P, FUNVEC_COMPILED_P): Remove.
22 (COMPILEDP): Rename back from FUNVECP.
23 * fns.c (Felt): Remove unexplained FUNVEC check.
24 * doc.c (Fdocumentation): Don't handle funvec.
25 * alloc.c (make_funvec, Ffunvec): Remove.
26
3e21b6a7
SM
272011-02-21 Stefan Monnier <monnier@iro.umontreal.ca>
28
29 * bytecode.c (exec_byte_code): Change stack_ref and stack_set to use
30 offsets relative to top rather than to bottom.
31
32 * alloc.c (Fgarbage_collect): Don't mark the byte-stack redundantly.
33
e0f57e65
SM
342011-02-19 Stefan Monnier <monnier@iro.umontreal.ca>
35
36 * window.c (Fsave_window_excursion): Remove. Moved to Lisp.
37 (syms_of_window): Don't defsubr it.
38 * window.h (Fsave_window_excursion): Don't declare it.
39 * bytecode.c (exec_byte_code): Inline Fsave_window_excursion.
40
b38b1ec0
SM
412011-02-17 Stefan Monnier <monnier@iro.umontreal.ca>
42
43 * eval.c (Vinternal_interpreter_environment): Remove.
44 (syms_of_eval): Do declare Vinternal_interpreter_environment as
45 a global lisp var, but unintern it to hide it.
46 (Fcommandp):
47 * data.c (Finteractive_form): Understand `closure's.
48
49 * bytecode.c (exec_byte_code): Fix handling of &rest.
50
ce5b520a
SM
512011-02-12 Stefan Monnier <monnier@iro.umontreal.ca>
52
53 * bytecode.c (Bvec_ref, Bvec_set): Remove.
54 (exec_byte_code): Don't handle them.
55
590130fb
SM
562010-12-27 Stefan Monnier <monnier@iro.umontreal.ca>
57
58 * eval.c (Fdefvar): Record specialness before computing initial value.
59
a0ee6f27
SM
602010-12-15 Stefan Monnier <monnier@iro.umontreal.ca>
61
62 * eval.c (Feval): Add `lexical' argument. Adjust callers.
63 (Ffuncall, eval_sub): Avoid goto.
64
defb1411
SM
652010-12-14 Stefan Monnier <monnier@iro.umontreal.ca>
66
67 Try and be more careful about propagation of lexical environment.
68 * eval.c (apply_lambda, funcall_lambda): Remove lexenv arg.
69 (Feval): Always eval in the empty environment.
70 (eval_sub): New function. Use it for all calls to Feval that should
71 evaluate in the lexical environment of the caller.
72 Pass `closure's as is to apply_lambda.
73 (Ffuncall): Pass `closure's as is to funcall_lambda.
74 (funcall_lambda): Extract lexenv for `closure's, when applicable.
75 Also use lexical scoping for the &rest argument, if applicable.
76 * lisp.h (eval_sub): Declare.
77 * lread.c (readevalloop): Remove `evalfun' argument.
78 * print.c (Fwith_output_to_temp_buffer):
79 * data.c (Fsetq_default): Use eval_sub.
80
f07a954e
SM
812010-12-13 Stefan Monnier <monnier@iro.umontreal.ca>
82
83 Make the effect of (defvar foo) local.
84 * eval.c (apply_lambda): Make static. Remove eval_flag arg.
85 (Fsetq): Don't check declared_special.
86 (Fdefun, Fdefmacro): Use Ffunction.
87 (Fdefvar): Don't set declared_special for (defvar foo).
88 (FletX): Check locally-special vars. Only do specbind once.
89 (Flet): Check locally-special vars.
90 (Feval): Don't check declared_special.
91 (funcall_lambda): Check locally-special vars.
92 * lisp.h (apply_lambda): Remove extern declaration.
93 * lread.c (readevalloop): CSE.
94
0bfdb86f
AS
952010-07-23 Andreas Schwab <schwab@linux-m68k.org>
96
97 * eval.c (funcall_funvec): Replace bcopy by memcpy.
98
4a330052
SM
992010-06-18 Stefan Monnier <monnier@iro.umontreal.ca>
100
101 * eval.c (Fspecial_variable_p): Rename from `specialp'.
102
3c3ddb98
SM
1032010-06-15 Stefan Monnier <monnier@iro.umontreal.ca>
104
105 * bytecode.c (exec_byte_code):
106 * eval.c (Ffunctionp): Fix up int/Lisp_Object confusions.
107
894e369d 1082008-04-23 Miles Bader <miles@gnu.org>
6e6e5760 109
894e369d
SM
110 * eval.c (Ffunctionp): Return nil for special forms.
111 (Qunevalled): New variable.
aac0c6e3
MR
112 (syms_of_eval): Initialize it.
113
894e369d 1142007-10-18 Miles Bader <miles@gnu.org>
aac0c6e3 115
894e369d
SM
116 * eval.c (FletX): Test the type of VARLIST rather than just !NILP.
117 (Flet): Use XCAR instead of Fcar.
aac0c6e3 118
894e369d 1192007-10-16 Miles Bader <miles@gnu.org>
aac0c6e3 120
894e369d 121 * alloc.c (make_funvec, Fpurecopy): Set the pseudo-vector type.
aac0c6e3 122
894e369d 1232006-02-10 Miles Bader <miles@gnu.org>
aac0c6e3 124
894e369d 125 * eval.c (Ffunctionp): Supply new 2nd arg to Findirect_function.
aac0c6e3 126
894e369d 1272005-03-04 Miles Bader <miles@gnu.org>
aac0c6e3 128
894e369d
SM
129 * eval.c (FletX): Update Vinterpreter_lexical_environment for each
130 variable we bind, instead of all at once like `let'.
aac0c6e3 131
894e369d 1322004-08-09 Miles Bader <miles@gnu.org>
aac0c6e3 133
894e369d 134 Changes from merging the funvec patch:
aac0c6e3 135
894e369d
SM
136 * eval.c (Feval, Ffuncall): Don't special-case vectors.
137 (funcall_lambda): Use FUNVEC_SIZE.
138 (Fcurry): Remove function.
aac0c6e3 139
894e369d 140 Merge funvec patch.
aac0c6e3 141
876c194c
SM
1422004-05-20 Miles Bader <miles@gnu.org>
143
144 * lisp.h: Declare make_funvec and Ffunvec.
145 (enum pvec_type): Rename `PVEC_COMPILED' to `PVEC_FUNVEC'.
146 (XSETFUNVEC): Rename from `XSETCOMPILED'.
147 (FUNVEC_SIZE, FUNVEC_COMPILED_TAG_P, FUNVEC_COMPILED_P): New macros.
148 (COMPILEDP): Define in terms of funvec macros.
149 (FUNVECP, GC_FUNVECP): Rename from `COMPILEDP' & `GC_COMPILEDP'.
150 (FUNCTIONP): Use FUNVECP instead of COMPILEDP.
151 * alloc.c (make_funvec, funvec): New functions.
152 (Fmake_byte_code): Make sure the first element is a list.
153
154 * eval.c (Qcurry): New variable.
155 (funcall_funvec, Fcurry): New functions.
156 (syms_of_eval): Initialize them.
157 (funcall_lambda): Handle non-bytecode funvec objects by calling
158 funcall_funvec.
159 (Ffuncall, Feval): Use FUNVECP insetad of COMPILEDP.
160 * lread.c (read1): Return result of read_vector for `#[' syntax
161 directly; read_vector now does any extra work required.
162 (read_vector): Handle both funvec and byte-code objects, converting the
163 type as necessary. `bytecodeflag' argument is now called
164 `read_funvec'.
165 * data.c (Ffunvecp): New function.
166 * doc.c (Fdocumentation): Return nil for unknown funvecs.
167 * fns.c (mapcar1, Felt, concat): Allow funvecs.
168
169 * eval.c (Ffunctionp): Use `funvec' operators instead of `compiled'
170 operators.
171 * alloc.c (Fmake_byte_code, Fpurecopy, mark_object): Likewise.
172 * keyboard.c (Fcommand_execute): Likewise.
173 * image.c (parse_image_spec): Likewise.
174 * fns.c (Flength, concat, internal_equal): Likewise.
175 * data.c (Faref, Ftype_of): Likewise.
176 * print.c (print_preprocess, print_object): Likewise.
177
894e369d 1782004-04-10 Miles Bader <miles@gnu.org>
aac0c6e3 179
894e369d
SM
180 * eval.c (Fspecialp): New function.
181 (syms_of_eval): Initialize it.
aac0c6e3 182
894e369d 1832004-04-03 Miles Bader <miles@gnu.org>
aac0c6e3 184
894e369d
SM
185 * eval.c (Feval): If a variable isn't bound lexically, fall back
186 to looking it up dynamically even if it isn't declared special.
aac0c6e3 187
894e369d 1882002-08-26 Miles Bader <miles@gnu.org>
aac0c6e3 189
894e369d 190 * bytecode.c (Fbyte_code): Fsub1 can GC, so protect it.
aac0c6e3 191
894e369d 1922002-06-12 Miles Bader <miles@gnu.org>
aac0c6e3 193
894e369d 194 Lexical binding changes to the byte-code interpreter:
aac0c6e3 195
894e369d
SM
196 * bytecode.c (Bstack_ref, Bstack_set, Bstack_set2, Bvec_ref, Bvec_set)
197 (BdiscardN): New constants.
198 (exec_byte_code): Rename from `Fbyte_code'.
199 Implement above new bytecodes.
200 Add ARGS-TEMPLATE, NARGS and ARGS parameters, and optionally use
201 them push initial args on the stack.
202 (Fbyte_code): New function, just call `exec_byte_code'.
203 Add additional optional arguments for `exec_byte_code'.
204 (Qand_optional, Qand_rest): New extern declarations.
205 * eval.c (Fcurry, Ffunctionp): New functions.
206 (syms_of_eval): Initialize them.
207 (funcall_lambda): Call `exec_byte_code' instead of Fbyte_code.
208 If a compiled-function object has a `push-args' slot, call the
209 byte-code interpreter without binding any arguments.
210 (Ffuncall): Add support for curried functions.
211 * lisp.h (Fbyte_code): Declare max-args as MANY.
212 (exec_byte_code): New declaration.
aac0c6e3 213
894e369d 214 Lexical binding changes to the lisp interpreter:
aac0c6e3 215
894e369d
SM
216 * lisp.h (struct Lisp_Symbol): Add `declared_special' field.
217 (apply_lambda): Add new 3rd arg to decl.
218 * alloc.c (Fmake_symbol): Initialize `declared_special' field.
219 * eval.c (Vinterpreter_lexical_environment): New variable.
220 (syms_of_eval): Initialize it.
221 (Fsetq): Modify SYM's lexical binding if appropriate.
222 (Ffunction): Return a closure if within a lexical environment.
223 (Flet, FletX): Lexically bind non-defvar'd variables if inside a
224 lexical environment.
225 (Feval): Return lexical binding of variables, if they have one.
226 Pass current lexical environment to embedded lambdas. Handle closures.
227 (Ffuncall): Pass nil lexical environment to lambdas. Handle closures.
228 (funcall_lambda): Add new LEXENV argument, and lexically bind
229 arguments if it's non-nil. Bind `interpreter-lexenv' if it changed.
230 (apply_lambda): Add new LEXENV argument and pass it to funcall_lambda.
231 (Fdefvaralias, Fdefvar, Fdefconst): Mark the variable as special.
232 (Qinternal_interpreter_environment, Qclosure): New constants.
233 (syms_of_eval): Initialize them.
234 (Fdefun, Fdefmacro): Use a closure if lexical binding is active.
235 * lread.c (defvar_bool, defvar_lisp_nopro, defvar_per_buffer)
236 (defvar_kboard, defvar_int): Mark the variable as special.
237 (Vlexical_binding, Qlexical_binding): New variables.
238 (syms_of_lread): Initialize them.
239 (Fload): Bind `lexically-bound' to nil unless specified otherwise
240 in the file header.
241 (lisp_file_lexically_bound_p): New function.
242 (Qinternal_interpreter_environment): New variable.
243 * doc.c (Qclosure): New extern declaration.
244 (Fdocumentation, store_function_docstring): Handle interpreted
245 closures.
246
247;; arch-tag: 7cf884aa-6b48-40cb-bfca-265a1e99b3c5