# HG changeset patch # User aidan # Date 1169312226 0 # Node ID 73288faa5759c1666c75b92d5ebd16361b395bd8 # Parent c737b76ac6dc0a8380f6687d67861da88bcb2521 [xemacs-hg @ 2007-01-20 16:57:05 by aidan] Fill out docstrings fo `function,' `quote' and `require.' diff -r c737b76ac6dc -r 73288faa5759 src/ChangeLog --- 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 + + * 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 * fileio.c (check_writable): Check old-style readonly bit first. diff -r c737b76ac6dc -r 73288faa5759 src/eval.c --- 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)) { diff -r c737b76ac6dc -r 73288faa5759 src/fns.c --- 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)) {