Mercurial > hg > xemacs-beta
changeset 3794:73288faa5759
[xemacs-hg @ 2007-01-20 16:57:05 by aidan]
Fill out docstrings fo `function,' `quote' and `require.'
author | aidan |
---|---|
date | Sat, 20 Jan 2007 16:57:06 +0000 |
parents | c737b76ac6dc |
children | 7c78a05bd669 |
files | src/ChangeLog src/eval.c src/fns.c |
diffstat | 3 files changed, 35 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/src/ChangeLog Fri Jan 19 22:51:02 2007 +0000 +++ b/src/ChangeLog Sat Jan 20 16:57:06 2007 +0000 @@ -1,3 +1,12 @@ +2007-01-20 Aidan Kehoe <kehoea@parhasard.net> + + * eval.c: + Document in more detail what happens with byte-compilation, + `function', and `quote'. + * fns.c: + Mention that `require' is evaluated both at byte-compile time and + at runtime. + 2007-01-06 Vin Shelton <acs@xemacs.org> * fileio.c (check_writable): Check old-style readonly bit first.
--- a/src/eval.c Fri Jan 19 22:51:02 2007 +0000 +++ b/src/eval.c Sat Jan 20 16:57:06 2007 +0000 @@ -1177,6 +1177,15 @@ DEFUN ("quote", Fquote, 1, UNEVALLED, 0, /* Return the argument, without evaluating it. `(quote x)' yields `x'. + +There is an alternative and more used reader syntax for `quote'. Precede +any Lisp object with a single apostrophe, and that Lisp object will be +returned unevaluated. 'x is thus equivalent to (quote x). + +Do not use `quote' or the single apostrophe for lambda expressions that you +would prefer to be byte-compiled. Use `function', which see, or take +advantage of the fact that lambda expressions are self-quoting and such +lambda expressions will be automatically byte-compiled. */ (args)) { @@ -1185,8 +1194,16 @@ DEFUN ("function", Ffunction, 1, UNEVALLED, 0, /* Like `quote', but preferred for objects which are functions. -In byte compilation, `function' causes its argument to be compiled. -`quote' cannot do that. + +As with `quote' there is an alternative reader syntax for `function' which +in practice is used more often. Writing #'OBJECT is equivalent to writing +\(function OBJECT), where OBJECT is some Lisp object. + +In byte compilation, `function' causes a lambda expression argument to be +compiled. `quote' cannot do that. lambda expressions are, however, +self-quoting, and self-quoted lambda expressions will be byte-compiled. +Only lambda expressions explicitly quoted with `quote' or that occur in +nested data lists will not be byte-compiled. */ (args)) {
--- a/src/fns.c Fri Jan 19 22:51:02 2007 +0000 +++ b/src/fns.c Sat Jan 20 16:57:06 2007 +0000 @@ -3582,6 +3582,13 @@ If FILENAME is omitted, the printname of FEATURE is used as the file name. If optional third argument NOERROR is non-nil, then return nil if the file is not found instead of signaling an error. +Normally the return value is FEATURE. +The normal messages at start and end of loading FILENAME are suppressed. + +In order to make it possible for a required package to provide macros to be +expanded at byte-compilation time, top level calls of `require' are +evaluated both at byte-compile time and at run time. That is, any top-level +call to `require' is wrapped in an implicit \(eval-and-compile ...\) block. */ (feature, filename, noerror)) {