Mercurial > hg > xemacs-beta
comparison src/eval.c @ 4905:755ae5b97edb
Change "special form" to "special operator" in our sources.
Add a compatible function alias, and the relevant manual index entries.
src/ChangeLog addition:
2010-01-31 Aidan Kehoe <kehoea@parhasard.net>
* symbols.c (Fspecial_operator_p, syms_of_symbols):
* eval.c (print_subr, Finteractive_p, Ffuncall)
(Ffunction_min_args, Ffunction_max_args, vars_of_eval):
* editfns.c:
* data.c (Fsubr_max_args):
* doc.c (Fbuilt_in_symbol_file):
Change "special form" to "special operator" in our sources.
man/ChangeLog addition:
2010-01-31 Aidan Kehoe <kehoea@parhasard.net>
* xemacs/programs.texi (Defuns):
* lispref/variables.texi (Local Variables, Defining Variables)
(Setting Variables, Default Value):
* lispref/symbols.texi (Definitions):
* lispref/searching.texi (Saving Match Data):
* lispref/positions.texi (Excursions, Narrowing):
* lispref/objects.texi (Primitive Function Type):
* lispref/macros.texi (Defining Macros, Backquote):
* lispref/lispref.texi (Top):
* lispref/intro.texi (A Sample Function Description):
* lispref/help.texi (Help Functions):
* lispref/functions.texi (What Is a Function, Simple Lambda)
(Defining Functions, Calling Functions, Anonymous Functions):
* lispref/frames.texi (Input Focus):
* lispref/eval.texi (Forms, Function Indirection)
(Special Operators, Quoting):
* lispref/edebug-inc.texi (Instrumenting)
(Specification Examples):
* lispref/debugging.texi (Internals of Debugger):
* lispref/control.texi (Control Structures, Sequencing):
(Conditionals, Combining Conditions, Iteration):
(Catch and Throw, Handling Errors):
* lispref/commands.texi (Defining Commands, Using Interactive):
Terminology change; special operator -> special form.
Don't attempt to change this in texinfo.texi or cl.texi, which use
macros I don't understand.
* lispref/macros.texi (Defining Macros): Give an anonymous macro
example here.
* lispref/positions.texi (Excursions):
Correct some documentation that called a couple of macros special
forms.
* lispref/searching.texi (Saving Match Data):
Drop some documentation of how to write code that works with Emacs
18.
* lispref/specifiers.texi (Adding Specifications):
Correct this; #'let-specifier is a macro, not a special operator.
* lispref/windows.texi (Window Configurations)
(Selecting Windows):
Correct this, #'save-selected-window and #'save-window-excursion
are macros, not special operators.
lisp/ChangeLog addition:
2010-01-31 Aidan Kehoe <kehoea@parhasard.net>
* obsolete.el:
* loadhist.el (symbol-file):
* help.el (describe-function-1):
* bytecomp.el: (byte-compile-save-current-buffer):
* byte-optimize.el (byte-optimize-form-code-walker):
* subr.el (subr-arity):
Change "special form" to "special operator" in these files, it's
the more logical term.
* subr.el (special-form-p): Provide this alias for
#'special-operator-p.
author | Aidan Kehoe <kehoea@parhasard.net> |
---|---|
date | Sun, 31 Jan 2010 20:28:01 +0000 |
parents | a98ca4640147 |
children | 17362f371cc2 e813cf16c015 |
comparison
equal
deleted
inserted
replaced
4904:e91e3e353805 | 4905:755ae5b97edb |
---|---|
425 static void | 425 static void |
426 print_subr (Lisp_Object obj, Lisp_Object printcharfun, int UNUSED (escapeflag)) | 426 print_subr (Lisp_Object obj, Lisp_Object printcharfun, int UNUSED (escapeflag)) |
427 { | 427 { |
428 Lisp_Subr *subr = XSUBR (obj); | 428 Lisp_Subr *subr = XSUBR (obj); |
429 const CIbyte *header = | 429 const CIbyte *header = |
430 (subr->max_args == UNEVALLED) ? "#<special-form " : "#<subr "; | 430 (subr->max_args == UNEVALLED) ? "#<special-operator " : "#<subr "; |
431 const CIbyte *name = subr_name (subr); | 431 const CIbyte *name = subr_name (subr); |
432 const CIbyte *trailer = subr->prompt ? " (interactive)>" : ">"; | 432 const CIbyte *trailer = subr->prompt ? " (interactive)>" : ">"; |
433 | 433 |
434 if (print_readably) | 434 if (print_readably) |
435 printing_unreadable_object ("%s%s%s", header, name, trailer); | 435 printing_unreadable_object ("%s%s%s", header, name, trailer); |
821 | 821 |
822 /************************************************************************/ | 822 /************************************************************************/ |
823 /* The basic special forms */ | 823 /* The basic special forms */ |
824 /************************************************************************/ | 824 /************************************************************************/ |
825 | 825 |
826 /* Except for Fprogn(), the basic special forms below are only called | 826 /* Except for Fprogn(), the basic special operators below are only called |
827 from interpreted code. The byte compiler turns them into bytecodes. */ | 827 from interpreted code. The byte compiler turns them into bytecodes. */ |
828 | 828 |
829 DEFUN ("or", For, 0, UNEVALLED, 0, /* | 829 DEFUN ("or", For, 0, UNEVALLED, 0, /* |
830 Eval ARGS until one of them yields non-nil, then return that value. | 830 Eval ARGS until one of them yields non-nil, then return that value. |
831 The remaining ARGS are not evalled at all. | 831 The remaining ARGS are not evalled at all. |
3300 byte-compiled functions, we'll accept it for now. */ | 3300 byte-compiled functions, we'll accept it for now. */ |
3301 if (EQ (*btp->function, Qbyte_code)) | 3301 if (EQ (*btp->function, Qbyte_code)) |
3302 btp = btp->next; | 3302 btp = btp->next; |
3303 | 3303 |
3304 /* If this isn't a byte-compiled function, then we may now be | 3304 /* If this isn't a byte-compiled function, then we may now be |
3305 looking at several frames for special forms. Skip past them. */ | 3305 looking at several frames for special operators. Skip past them. */ |
3306 while (btp && | 3306 while (btp && |
3307 btp->nargs == UNEVALLED) | 3307 btp->nargs == UNEVALLED) |
3308 btp = btp->next; | 3308 btp = btp->next; |
3309 | 3309 |
3310 #else | 3310 #else |
4058 { | 4058 { |
4059 PROFILE_ENTER_FUNCTION (); | 4059 PROFILE_ENTER_FUNCTION (); |
4060 val = SUBR_FUNCTION (subr, MANY) (fun_nargs, fun_args); | 4060 val = SUBR_FUNCTION (subr, MANY) (fun_nargs, fun_args); |
4061 PROFILE_EXIT_FUNCTION (); | 4061 PROFILE_EXIT_FUNCTION (); |
4062 } | 4062 } |
4063 else if (max_args == UNEVALLED) /* Can't funcall a special form */ | 4063 else if (max_args == UNEVALLED) /* Can't funcall a special operator */ |
4064 { | 4064 { |
4065 /* Ugh, ugh, ugh. */ | 4065 /* Ugh, ugh, ugh. */ |
4066 if (EQ (fun, XSYMBOL_FUNCTION (Qthrow))) | 4066 if (EQ (fun, XSYMBOL_FUNCTION (Qthrow))) |
4067 { | 4067 { |
4068 args[0] = Qobsolete_throw; | 4068 args[0] = Qobsolete_throw; |
4241 } | 4241 } |
4242 | 4242 |
4243 DEFUN ("function-min-args", Ffunction_min_args, 1, 1, 0, /* | 4243 DEFUN ("function-min-args", Ffunction_min_args, 1, 1, 0, /* |
4244 Return the minimum number of arguments a function may be called with. | 4244 Return the minimum number of arguments a function may be called with. |
4245 The function may be any form that can be passed to `funcall', | 4245 The function may be any form that can be passed to `funcall', |
4246 any special form, or any macro. | 4246 any special operator, or any macro. |
4247 | 4247 |
4248 To check if a function can be called with a specified number of | 4248 To check if a function can be called with a specified number of |
4249 arguments, use `function-allows-args'. | 4249 arguments, use `function-allows-args'. |
4250 */ | 4250 */ |
4251 (function)) | 4251 (function)) |
4254 } | 4254 } |
4255 | 4255 |
4256 DEFUN ("function-max-args", Ffunction_max_args, 1, 1, 0, /* | 4256 DEFUN ("function-max-args", Ffunction_max_args, 1, 1, 0, /* |
4257 Return the maximum number of arguments a function may be called with. | 4257 Return the maximum number of arguments a function may be called with. |
4258 The function may be any form that can be passed to `funcall', | 4258 The function may be any form that can be passed to `funcall', |
4259 any special form, or any macro. | 4259 any special operator, or any macro. |
4260 If the function takes an arbitrary number of arguments or is | 4260 If the function takes an arbitrary number of arguments or is |
4261 a built-in special form, nil is returned. | 4261 a built-in special operator, nil is returned. |
4262 | 4262 |
4263 To check if a function can be called with a specified number of | 4263 To check if a function can be called with a specified number of |
4264 arguments, use `function-allows-args'. | 4264 arguments, use `function-allows-args'. |
4265 */ | 4265 */ |
4266 (function)) | 4266 (function)) |
4413 /* Multiple values. | 4413 /* Multiple values. |
4414 | 4414 |
4415 A multiple value object is returned by #'values if: | 4415 A multiple value object is returned by #'values if: |
4416 | 4416 |
4417 -- The number of arguments to #'values is not one, and: | 4417 -- The number of arguments to #'values is not one, and: |
4418 -- Some special form in the call stack is prepared to handle more than | 4418 -- Some special operator in the call stack is prepared to handle more than |
4419 one multiple value. | 4419 one multiple value. |
4420 | 4420 |
4421 The return value of #'values-list is analogous to that of #'values. | 4421 The return value of #'values-list is analogous to that of #'values. |
4422 | 4422 |
4423 Henry Baker, in https://eprints.kfupm.edu.sa/31898/1/31898.pdf ("CONS | 4423 Henry Baker, in https://eprints.kfupm.edu.sa/31898/1/31898.pdf ("CONS |
4428 something not true for us. As far as I can tell, it also ignores the | 4428 something not true for us. As far as I can tell, it also ignores the |
4429 contexts where multiple-values need to be thrown, or maybe it thinks such | 4429 contexts where multiple-values need to be thrown, or maybe it thinks such |
4430 objects should be converted to heap allocation at that point. | 4430 objects should be converted to heap allocation at that point. |
4431 | 4431 |
4432 The specific multiple values saved and returned depend on how many | 4432 The specific multiple values saved and returned depend on how many |
4433 multiple-values special forms in the stack are interested in; for | 4433 multiple-values special operators in the stack are interested in; for |
4434 example, if #'multiple-value-call is somewhere in the call stack, all | 4434 example, if #'multiple-value-call is somewhere in the call stack, all |
4435 values passed to #'values will be saved and returned. If an expansion of | 4435 values passed to #'values will be saved and returned. If an expansion of |
4436 #'multiple-value-setq with 10 SYMS is the only part of the call stack | 4436 #'multiple-value-setq with 10 SYMS is the only part of the call stack |
4437 interested in multiple values, then a maximum of ten multiple values will | 4437 interested in multiple values, then a maximum of ten multiple values will |
4438 be saved and returned. | 4438 be saved and returned. |
7156 } | 7156 } |
7157 | 7157 |
7158 | 7158 |
7159 DEFUN ("backtrace-frame", Fbacktrace_frame, 1, 1, 0, /* | 7159 DEFUN ("backtrace-frame", Fbacktrace_frame, 1, 1, 0, /* |
7160 Return the function and arguments NFRAMES up from current execution point. | 7160 Return the function and arguments NFRAMES up from current execution point. |
7161 If that frame has not evaluated the arguments yet (or is a special form), | 7161 If that frame has not evaluated the arguments yet (or involves a special |
7162 the value is (nil FUNCTION ARG-FORMS...). | 7162 operator), the value is (nil FUNCTION ARG-FORMS...). |
7163 If that frame has evaluated its arguments and called its function already, | 7163 If that frame has evaluated its arguments and called its function already, |
7164 the value is (t FUNCTION ARG-VALUES...). | 7164 the value is (t FUNCTION ARG-VALUES...). |
7165 A &rest arg is represented as the tail of the list ARG-VALUES. | 7165 A &rest arg is represented as the tail of the list ARG-VALUES. |
7166 FUNCTION is whatever was supplied as car of evaluated list, | 7166 FUNCTION is whatever was supplied as car of evaluated list, |
7167 or a lambda expression for macro calls. | 7167 or a lambda expression for macro calls. |
7525 | 7525 |
7526 DEFVAR_CONST_INT ("multiple-values-limit", &Vmultiple_values_limit /* | 7526 DEFVAR_CONST_INT ("multiple-values-limit", &Vmultiple_values_limit /* |
7527 The exclusive upper bound on the number of multiple values. | 7527 The exclusive upper bound on the number of multiple values. |
7528 | 7528 |
7529 This applies to `values', `values-list', `multiple-value-bind' and related | 7529 This applies to `values', `values-list', `multiple-value-bind' and related |
7530 macros and special forms. | 7530 macros and special operators. |
7531 */); | 7531 */); |
7532 Vmultiple_values_limit = EMACS_INT_MAX > INT_MAX ? INT_MAX : EMACS_INT_MAX; | 7532 Vmultiple_values_limit = EMACS_INT_MAX > INT_MAX ? INT_MAX : EMACS_INT_MAX; |
7533 | 7533 |
7534 staticpro (&Vcatch_everything_tag); | 7534 staticpro (&Vcatch_everything_tag); |
7535 Vcatch_everything_tag = make_opaque (OPAQUE_CLEAR, 0); | 7535 Vcatch_everything_tag = make_opaque (OPAQUE_CLEAR, 0); |