Mercurial > hg > xemacs-beta
comparison src/eval.c @ 5207:1096ef427b56
Error on too many arguments to #'function, #'quote.
2010-04-29 Aidan Kehoe <kehoea@parhasard.net>
* eval.c (Fquote, Ffunction): Error on more than one argument to
these special operators.
* data.c (syms_of_data): Move Qquote to general-slots.h from this
file, now it's used in eval.c
author | Aidan Kehoe <kehoea@parhasard.net> |
---|---|
date | Thu, 29 Apr 2010 15:49:21 +0100 |
parents | 88bd4f3ef8e4 |
children | 18c0b5909d16 |
comparison
equal
deleted
inserted
replaced
5206:39d74978fd32 | 5207:1096ef427b56 |
---|---|
1271 contexts. A print function may use either. Internally the expression is | 1271 contexts. A print function may use either. Internally the expression is |
1272 represented as `(quote x)'). | 1272 represented as `(quote x)'). |
1273 */ | 1273 */ |
1274 (args)) | 1274 (args)) |
1275 { | 1275 { |
1276 int nargs; | |
1277 | |
1278 GET_LIST_LENGTH (args, nargs); | |
1279 if (nargs != 1) | |
1280 { | |
1281 Fsignal (Qwrong_number_of_arguments, | |
1282 list2 (Qquote, make_int (nargs))); | |
1283 } | |
1284 | |
1276 return XCAR (args); | 1285 return XCAR (args); |
1277 } | 1286 } |
1278 | 1287 |
1279 /* Originally, this was just a function -- but `custom' used a garden- | 1288 /* Originally, this was just a function -- but `custom' used a garden- |
1280 variety version, so why not make it a subr? */ | 1289 variety version, so why not make it a subr? */ |
1342 contexts. A print function may use either. Internally the expression is | 1351 contexts. A print function may use either. Internally the expression is |
1343 represented as `(function x)'). | 1352 represented as `(function x)'). |
1344 */ | 1353 */ |
1345 (args)) | 1354 (args)) |
1346 { | 1355 { |
1356 int nargs; | |
1357 | |
1358 GET_LIST_LENGTH (args, nargs); | |
1359 if (nargs != 1) | |
1360 { | |
1361 Fsignal (Qwrong_number_of_arguments, | |
1362 list2 (Qfunction, make_int (nargs))); | |
1363 } | |
1364 | |
1347 return XCAR (args); | 1365 return XCAR (args); |
1348 } | 1366 } |
1349 | 1367 |
1350 | 1368 |
1351 /************************************************************************/ | 1369 /************************************************************************/ |