Mercurial > hg > xemacs-beta
comparison lisp/cl-seq.el @ 410:de805c49cfc1 r21-2-35
Import from CVS: tag r21-2-35
author | cvs |
---|---|
date | Mon, 13 Aug 2007 11:19:21 +0200 |
parents | cc15677e0335 |
children | 697ef44129c6 |
comparison
equal
deleted
inserted
replaced
409:301b9ebbdf3b | 410:de805c49cfc1 |
---|---|
63 | 63 |
64 ;;; Keyword parsing. This is special-cased here so that we can compile | 64 ;;; Keyword parsing. This is special-cased here so that we can compile |
65 ;;; this file independent from cl-macs. | 65 ;;; this file independent from cl-macs. |
66 | 66 |
67 (defmacro cl-parsing-keywords (kwords other-keys &rest body) | 67 (defmacro cl-parsing-keywords (kwords other-keys &rest body) |
68 "Helper macro for functions with keyword arguments. | |
69 This is a temporary solution, until keyword arguments are natively supported. | |
70 Declare your function ending with (... &rest cl-keys), then wrap the | |
71 function body in a call to `cl-parsing-keywords'. | |
72 | |
73 KWORDS is a list of keyword definitions. Each definition should be | |
74 either a keyword or a list (KEYWORD DEFAULT-VALUE). In the former case, | |
75 the default value is nil. The keywords are available in BODY as the name | |
76 of the keyword, minus its initial colon and prepended with `cl-'. | |
77 | |
78 OTHER-KEYS specifies other keywords that are accepted but ignored. It | |
79 is either the value 't' (ignore all other keys, equivalent to the | |
80 &allow-other-keys argument declaration in Common Lisp) or a list in the | |
81 same format as KWORDS. If keywords are given that are not in KWORDS | |
82 and not allowed by OTHER-KEYS, an error will normally be signalled; but | |
83 the caller can override this by specifying a non-nil value for the | |
84 keyword :allow-other-keys (which defaults to t)." | |
68 (cons | 85 (cons |
69 'let* | 86 'let* |
70 (cons (mapcar | 87 (cons (mapcar |
71 (function | 88 (function |
72 (lambda (x) | 89 (lambda (x) |