comparison src/eval.c @ 3842:1c2a46ea1f78

[xemacs-hg @ 2007-02-22 16:53:20 by stephent] Doc fixes 2007-02-21. <87k5yaku0s.fsf@uwakimon.sk.tsukuba.ac.jp>
author stephent
date Thu, 22 Feb 2007 16:53:27 +0000
parents 73288faa5759
children 53260b0cd16b
comparison
equal deleted inserted replaced
3841:5989b9bbb612 3842:1c2a46ea1f78
1176 } 1176 }
1177 1177
1178 DEFUN ("quote", Fquote, 1, UNEVALLED, 0, /* 1178 DEFUN ("quote", Fquote, 1, UNEVALLED, 0, /*
1179 Return the argument, without evaluating it. `(quote x)' yields `x'. 1179 Return the argument, without evaluating it. `(quote x)' yields `x'.
1180 1180
1181 There is an alternative and more used reader syntax for `quote'. Precede 1181 `quote' differs from `function' in that it is a hint that an expression is
1182 any Lisp object with a single apostrophe, and that Lisp object will be 1182 data, not a function. In particular, under some circumstances the byte
1183 returned unevaluated. 'x is thus equivalent to (quote x). 1183 compiler will compile an expression quoted with `function', but it will
1184 1184 never do so for an expression quoted with `quote'. These issues are most
1185 Do not use `quote' or the single apostrophe for lambda expressions that you 1185 important for lambda expressions (see `lambda').
1186 would prefer to be byte-compiled. Use `function', which see, or take 1186
1187 advantage of the fact that lambda expressions are self-quoting and such 1187 There is an alternative, more readable, reader syntax for `quote': a Lisp
1188 lambda expressions will be automatically byte-compiled. 1188 object preceded by `''. Thus, `'x' is equivalent to `(quote x)', in all
1189 contexts. A print function may use either. Internally the expression is
1190 represented as `(quote x)').
1189 */ 1191 */
1190 (args)) 1192 (args))
1191 { 1193 {
1192 return XCAR (args); 1194 return XCAR (args);
1193 } 1195 }
1194 1196
1195 DEFUN ("function", Ffunction, 1, UNEVALLED, 0, /* 1197 DEFUN ("function", Ffunction, 1, UNEVALLED, 0, /*
1196 Like `quote', but preferred for objects which are functions. 1198 Return the argument, without evaluating it. `(function x)' yields `x'.
1197 1199
1198 As with `quote' there is an alternative reader syntax for `function' which 1200 `function' differs from `quote' in that it is a hint that an expression is
1199 in practice is used more often. Writing #'OBJECT is equivalent to writing 1201 a function, not data. In particular, under some circumstances the byte
1200 \(function OBJECT), where OBJECT is some Lisp object. 1202 compiler will compile an expression quoted with `function', but it will
1201 1203 never do so for an expression quoted with `quote'. However, the byte
1202 In byte compilation, `function' causes a lambda expression argument to be 1204 compiler will not compile an expression buried in a data structure such as
1203 compiled. `quote' cannot do that. lambda expressions are, however, 1205 a vector or a list which is not syntactically a function. These issues are
1204 self-quoting, and self-quoted lambda expressions will be byte-compiled. 1206 most important for lambda expressions (see `lambda').
1205 Only lambda expressions explicitly quoted with `quote' or that occur in 1207
1206 nested data lists will not be byte-compiled. 1208 There is an alternative, more readable, reader syntax for `function': a Lisp
1209 object preceded by `#''. Thus, #'x is equivalent to (function x), in all
1210 contexts. A print function may use either. Internally the expression is
1211 represented as `(function x)').
1207 */ 1212 */
1208 (args)) 1213 (args))
1209 { 1214 {
1210 return XCAR (args); 1215 return XCAR (args);
1211 } 1216 }