annotate lisp/emacs-lisp/cl-specs.el @ 30524:62ed067637af

*** empty log message ***
author Gerd Moellmann <gerd@gnu.org>
date Sun, 30 Jul 2000 11:50:38 +0000
parents 90bcf7fbdc57
children 3cfd3dc474b8
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
13337
84acc3adcd63 Comment change.
Richard M. Stallman <rms@gnu.org>
parents: 11489
diff changeset
1 ;;; cl-specs.el --- Edebug specs for cl.el
6491
21d52b9fd783 Initial revision
Daniel LaLiberte <liberte@gnu.org>
parents:
diff changeset
2
21d52b9fd783 Initial revision
Daniel LaLiberte <liberte@gnu.org>
parents:
diff changeset
3 ;; Copyright (C) 1993 Free Software Foundation, Inc.
21d52b9fd783 Initial revision
Daniel LaLiberte <liberte@gnu.org>
parents:
diff changeset
4 ;; Author: Daniel LaLiberte <liberte@cs.uiuc.edu>
21d52b9fd783 Initial revision
Daniel LaLiberte <liberte@gnu.org>
parents:
diff changeset
5 ;; Keywords: lisp, tools, maint
21d52b9fd783 Initial revision
Daniel LaLiberte <liberte@gnu.org>
parents:
diff changeset
6
21d52b9fd783 Initial revision
Daniel LaLiberte <liberte@gnu.org>
parents:
diff changeset
7 ;; LCD Archive Entry:
21d52b9fd783 Initial revision
Daniel LaLiberte <liberte@gnu.org>
parents:
diff changeset
8 ;; cl-specs.el|Daniel LaLiberte|liberte@cs.uiuc.edu
21d52b9fd783 Initial revision
Daniel LaLiberte <liberte@gnu.org>
parents:
diff changeset
9 ;; |Edebug specs for cl.el
28571
90bcf7fbdc57 Remove when, unless.
Dave Love <fx@gnu.org>
parents: 27526
diff changeset
10 ;; |$Date: 2000/01/30 21:20:14 $|1.1|
6491
21d52b9fd783 Initial revision
Daniel LaLiberte <liberte@gnu.org>
parents:
diff changeset
11
21d52b9fd783 Initial revision
Daniel LaLiberte <liberte@gnu.org>
parents:
diff changeset
12 ;; This file is part of GNU Emacs.
21d52b9fd783 Initial revision
Daniel LaLiberte <liberte@gnu.org>
parents:
diff changeset
13
21d52b9fd783 Initial revision
Daniel LaLiberte <liberte@gnu.org>
parents:
diff changeset
14 ;; GNU Emacs is free software; you can redistribute it and/or modify
21d52b9fd783 Initial revision
Daniel LaLiberte <liberte@gnu.org>
parents:
diff changeset
15 ;; it under the terms of the GNU General Public License as published by
21d52b9fd783 Initial revision
Daniel LaLiberte <liberte@gnu.org>
parents:
diff changeset
16 ;; the Free Software Foundation; either version 2, or (at your option)
21d52b9fd783 Initial revision
Daniel LaLiberte <liberte@gnu.org>
parents:
diff changeset
17 ;; any later version.
21d52b9fd783 Initial revision
Daniel LaLiberte <liberte@gnu.org>
parents:
diff changeset
18
21d52b9fd783 Initial revision
Daniel LaLiberte <liberte@gnu.org>
parents:
diff changeset
19 ;; GNU Emacs is distributed in the hope that it will be useful,
21d52b9fd783 Initial revision
Daniel LaLiberte <liberte@gnu.org>
parents:
diff changeset
20 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
21d52b9fd783 Initial revision
Daniel LaLiberte <liberte@gnu.org>
parents:
diff changeset
21 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21d52b9fd783 Initial revision
Daniel LaLiberte <liberte@gnu.org>
parents:
diff changeset
22 ;; GNU General Public License for more details.
21d52b9fd783 Initial revision
Daniel LaLiberte <liberte@gnu.org>
parents:
diff changeset
23
21d52b9fd783 Initial revision
Daniel LaLiberte <liberte@gnu.org>
parents:
diff changeset
24 ;; You should have received a copy of the GNU General Public License
14169
83f275dcd93a Update FSF's address.
Erik Naggum <erik@naggum.no>
parents: 14040
diff changeset
25 ;; along with GNU Emacs; see the file COPYING. If not, write to the
83f275dcd93a Update FSF's address.
Erik Naggum <erik@naggum.no>
parents: 14040
diff changeset
26 ;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
83f275dcd93a Update FSF's address.
Erik Naggum <erik@naggum.no>
parents: 14040
diff changeset
27 ;; Boston, MA 02111-1307, USA.
6491
21d52b9fd783 Initial revision
Daniel LaLiberte <liberte@gnu.org>
parents:
diff changeset
28
21d52b9fd783 Initial revision
Daniel LaLiberte <liberte@gnu.org>
parents:
diff changeset
29 ;;;; Commentary:
21d52b9fd783 Initial revision
Daniel LaLiberte <liberte@gnu.org>
parents:
diff changeset
30
21d52b9fd783 Initial revision
Daniel LaLiberte <liberte@gnu.org>
parents:
diff changeset
31 ;; These specs are to be used with edebug.el version 3.3 or later and
21d52b9fd783 Initial revision
Daniel LaLiberte <liberte@gnu.org>
parents:
diff changeset
32 ;; cl.el version 2.03 or later, by Dave Gillespie <daveg@synaptics.com>.
21d52b9fd783 Initial revision
Daniel LaLiberte <liberte@gnu.org>
parents:
diff changeset
33
14040
187735b53d52 Comment fixes.
Karl Heuer <kwzh@gnu.org>
parents: 13337
diff changeset
34 ;; This file need not be byte-compiled, but it shouldn't hurt.
6491
21d52b9fd783 Initial revision
Daniel LaLiberte <liberte@gnu.org>
parents:
diff changeset
35
21d52b9fd783 Initial revision
Daniel LaLiberte <liberte@gnu.org>
parents:
diff changeset
36 (provide 'cl-specs)
21d52b9fd783 Initial revision
Daniel LaLiberte <liberte@gnu.org>
parents:
diff changeset
37 ;; Do the above provide before the following require.
21d52b9fd783 Initial revision
Daniel LaLiberte <liberte@gnu.org>
parents:
diff changeset
38 ;; Otherwise if you load this before edebug if cl is already loaded
21d52b9fd783 Initial revision
Daniel LaLiberte <liberte@gnu.org>
parents:
diff changeset
39 ;; an infinite loading loop would occur.
21d52b9fd783 Initial revision
Daniel LaLiberte <liberte@gnu.org>
parents:
diff changeset
40 (require 'edebug)
21d52b9fd783 Initial revision
Daniel LaLiberte <liberte@gnu.org>
parents:
diff changeset
41
21d52b9fd783 Initial revision
Daniel LaLiberte <liberte@gnu.org>
parents:
diff changeset
42 ;; Blocks
21d52b9fd783 Initial revision
Daniel LaLiberte <liberte@gnu.org>
parents:
diff changeset
43
21d52b9fd783 Initial revision
Daniel LaLiberte <liberte@gnu.org>
parents:
diff changeset
44 (def-edebug-spec block (symbolp body))
21d52b9fd783 Initial revision
Daniel LaLiberte <liberte@gnu.org>
parents:
diff changeset
45 (def-edebug-spec return (&optional form))
21d52b9fd783 Initial revision
Daniel LaLiberte <liberte@gnu.org>
parents:
diff changeset
46 (def-edebug-spec return-from (symbolp &optional form))
21d52b9fd783 Initial revision
Daniel LaLiberte <liberte@gnu.org>
parents:
diff changeset
47
21d52b9fd783 Initial revision
Daniel LaLiberte <liberte@gnu.org>
parents:
diff changeset
48 ;; Loops
21d52b9fd783 Initial revision
Daniel LaLiberte <liberte@gnu.org>
parents:
diff changeset
49
21d52b9fd783 Initial revision
Daniel LaLiberte <liberte@gnu.org>
parents:
diff changeset
50 (def-edebug-spec case (form &rest (sexp body)))
21d52b9fd783 Initial revision
Daniel LaLiberte <liberte@gnu.org>
parents:
diff changeset
51 (def-edebug-spec ecase case)
21d52b9fd783 Initial revision
Daniel LaLiberte <liberte@gnu.org>
parents:
diff changeset
52 (def-edebug-spec do
21d52b9fd783 Initial revision
Daniel LaLiberte <liberte@gnu.org>
parents:
diff changeset
53 ((&rest &or symbolp (symbolp &optional form form))
21d52b9fd783 Initial revision
Daniel LaLiberte <liberte@gnu.org>
parents:
diff changeset
54 (form body)
21d52b9fd783 Initial revision
Daniel LaLiberte <liberte@gnu.org>
parents:
diff changeset
55 cl-declarations body))
21d52b9fd783 Initial revision
Daniel LaLiberte <liberte@gnu.org>
parents:
diff changeset
56 (def-edebug-spec do* do)
21d52b9fd783 Initial revision
Daniel LaLiberte <liberte@gnu.org>
parents:
diff changeset
57 (def-edebug-spec dolist
21d52b9fd783 Initial revision
Daniel LaLiberte <liberte@gnu.org>
parents:
diff changeset
58 ((symbolp form &optional form) cl-declarations body))
21d52b9fd783 Initial revision
Daniel LaLiberte <liberte@gnu.org>
parents:
diff changeset
59 (def-edebug-spec dotimes dolist)
21d52b9fd783 Initial revision
Daniel LaLiberte <liberte@gnu.org>
parents:
diff changeset
60 (def-edebug-spec do-symbols
21d52b9fd783 Initial revision
Daniel LaLiberte <liberte@gnu.org>
parents:
diff changeset
61 ((symbolp &optional form form) cl-declarations body))
21d52b9fd783 Initial revision
Daniel LaLiberte <liberte@gnu.org>
parents:
diff changeset
62 (def-edebug-spec do-all-symbols
21d52b9fd783 Initial revision
Daniel LaLiberte <liberte@gnu.org>
parents:
diff changeset
63 ((symbolp &optional form) cl-declarations body))
21d52b9fd783 Initial revision
Daniel LaLiberte <liberte@gnu.org>
parents:
diff changeset
64
21d52b9fd783 Initial revision
Daniel LaLiberte <liberte@gnu.org>
parents:
diff changeset
65 ;; Multiple values
21d52b9fd783 Initial revision
Daniel LaLiberte <liberte@gnu.org>
parents:
diff changeset
66
21d52b9fd783 Initial revision
Daniel LaLiberte <liberte@gnu.org>
parents:
diff changeset
67 (def-edebug-spec multiple-value-list (form))
21d52b9fd783 Initial revision
Daniel LaLiberte <liberte@gnu.org>
parents:
diff changeset
68 (def-edebug-spec multiple-value-call (function-form body))
21d52b9fd783 Initial revision
Daniel LaLiberte <liberte@gnu.org>
parents:
diff changeset
69 (def-edebug-spec multiple-value-bind
21d52b9fd783 Initial revision
Daniel LaLiberte <liberte@gnu.org>
parents:
diff changeset
70 ((&rest symbolp) form cl-declarations body))
21d52b9fd783 Initial revision
Daniel LaLiberte <liberte@gnu.org>
parents:
diff changeset
71 (def-edebug-spec multiple-value-setq ((&rest symbolp) form))
21d52b9fd783 Initial revision
Daniel LaLiberte <liberte@gnu.org>
parents:
diff changeset
72 (def-edebug-spec multiple-value-prog1 (form body))
21d52b9fd783 Initial revision
Daniel LaLiberte <liberte@gnu.org>
parents:
diff changeset
73
21d52b9fd783 Initial revision
Daniel LaLiberte <liberte@gnu.org>
parents:
diff changeset
74 ;; Bindings
21d52b9fd783 Initial revision
Daniel LaLiberte <liberte@gnu.org>
parents:
diff changeset
75
21d52b9fd783 Initial revision
Daniel LaLiberte <liberte@gnu.org>
parents:
diff changeset
76 (def-edebug-spec lexical-let let)
21d52b9fd783 Initial revision
Daniel LaLiberte <liberte@gnu.org>
parents:
diff changeset
77 (def-edebug-spec lexical-let* let)
21d52b9fd783 Initial revision
Daniel LaLiberte <liberte@gnu.org>
parents:
diff changeset
78
21d52b9fd783 Initial revision
Daniel LaLiberte <liberte@gnu.org>
parents:
diff changeset
79 (def-edebug-spec psetq setq)
21d52b9fd783 Initial revision
Daniel LaLiberte <liberte@gnu.org>
parents:
diff changeset
80 (def-edebug-spec progv (form form body))
21d52b9fd783 Initial revision
Daniel LaLiberte <liberte@gnu.org>
parents:
diff changeset
81
21d52b9fd783 Initial revision
Daniel LaLiberte <liberte@gnu.org>
parents:
diff changeset
82 (def-edebug-spec flet ((&rest (defun*)) cl-declarations body))
21d52b9fd783 Initial revision
Daniel LaLiberte <liberte@gnu.org>
parents:
diff changeset
83 (def-edebug-spec labels flet)
21d52b9fd783 Initial revision
Daniel LaLiberte <liberte@gnu.org>
parents:
diff changeset
84
21d52b9fd783 Initial revision
Daniel LaLiberte <liberte@gnu.org>
parents:
diff changeset
85 (def-edebug-spec macrolet
21d52b9fd783 Initial revision
Daniel LaLiberte <liberte@gnu.org>
parents:
diff changeset
86 ((&rest (&define name (&rest arg) cl-declarations-or-string def-body))
21d52b9fd783 Initial revision
Daniel LaLiberte <liberte@gnu.org>
parents:
diff changeset
87 cl-declarations body))
21d52b9fd783 Initial revision
Daniel LaLiberte <liberte@gnu.org>
parents:
diff changeset
88
21d52b9fd783 Initial revision
Daniel LaLiberte <liberte@gnu.org>
parents:
diff changeset
89 (def-edebug-spec symbol-macrolet
21d52b9fd783 Initial revision
Daniel LaLiberte <liberte@gnu.org>
parents:
diff changeset
90 ((&rest (symbol sexp)) cl-declarations body))
21d52b9fd783 Initial revision
Daniel LaLiberte <liberte@gnu.org>
parents:
diff changeset
91
21d52b9fd783 Initial revision
Daniel LaLiberte <liberte@gnu.org>
parents:
diff changeset
92 (def-edebug-spec destructuring-bind
21d52b9fd783 Initial revision
Daniel LaLiberte <liberte@gnu.org>
parents:
diff changeset
93 (&define cl-macro-list form cl-declarations def-body))
21d52b9fd783 Initial revision
Daniel LaLiberte <liberte@gnu.org>
parents:
diff changeset
94
21d52b9fd783 Initial revision
Daniel LaLiberte <liberte@gnu.org>
parents:
diff changeset
95 ;; Setf
21d52b9fd783 Initial revision
Daniel LaLiberte <liberte@gnu.org>
parents:
diff changeset
96
21d52b9fd783 Initial revision
Daniel LaLiberte <liberte@gnu.org>
parents:
diff changeset
97 (def-edebug-spec setf (&rest [place form])) ;; sexp is not specific enough
21d52b9fd783 Initial revision
Daniel LaLiberte <liberte@gnu.org>
parents:
diff changeset
98 (def-edebug-spec psetf setf)
21d52b9fd783 Initial revision
Daniel LaLiberte <liberte@gnu.org>
parents:
diff changeset
99
21d52b9fd783 Initial revision
Daniel LaLiberte <liberte@gnu.org>
parents:
diff changeset
100 (def-edebug-spec letf ;; *not* available in Common Lisp
21d52b9fd783 Initial revision
Daniel LaLiberte <liberte@gnu.org>
parents:
diff changeset
101 ((&rest (gate place &optional form))
21d52b9fd783 Initial revision
Daniel LaLiberte <liberte@gnu.org>
parents:
diff changeset
102 body))
21d52b9fd783 Initial revision
Daniel LaLiberte <liberte@gnu.org>
parents:
diff changeset
103 (def-edebug-spec letf* letf)
21d52b9fd783 Initial revision
Daniel LaLiberte <liberte@gnu.org>
parents:
diff changeset
104
21d52b9fd783 Initial revision
Daniel LaLiberte <liberte@gnu.org>
parents:
diff changeset
105
21d52b9fd783 Initial revision
Daniel LaLiberte <liberte@gnu.org>
parents:
diff changeset
106 (def-edebug-spec defsetf
21d52b9fd783 Initial revision
Daniel LaLiberte <liberte@gnu.org>
parents:
diff changeset
107 (&define name
21d52b9fd783 Initial revision
Daniel LaLiberte <liberte@gnu.org>
parents:
diff changeset
108 [&or [symbolp &optional stringp]
21d52b9fd783 Initial revision
Daniel LaLiberte <liberte@gnu.org>
parents:
diff changeset
109 [cl-lambda-list (symbolp)]]
21d52b9fd783 Initial revision
Daniel LaLiberte <liberte@gnu.org>
parents:
diff changeset
110 cl-declarations-or-string def-body))
21d52b9fd783 Initial revision
Daniel LaLiberte <liberte@gnu.org>
parents:
diff changeset
111
21d52b9fd783 Initial revision
Daniel LaLiberte <liberte@gnu.org>
parents:
diff changeset
112 (def-edebug-spec define-setf-method
21d52b9fd783 Initial revision
Daniel LaLiberte <liberte@gnu.org>
parents:
diff changeset
113 (&define name cl-lambda-list cl-declarations-or-string def-body))
21d52b9fd783 Initial revision
Daniel LaLiberte <liberte@gnu.org>
parents:
diff changeset
114
21d52b9fd783 Initial revision
Daniel LaLiberte <liberte@gnu.org>
parents:
diff changeset
115 (def-edebug-spec define-modify-macro
21d52b9fd783 Initial revision
Daniel LaLiberte <liberte@gnu.org>
parents:
diff changeset
116 (&define name cl-lambda-list ;; should exclude &key
21d52b9fd783 Initial revision
Daniel LaLiberte <liberte@gnu.org>
parents:
diff changeset
117 symbolp &optional stringp))
21d52b9fd783 Initial revision
Daniel LaLiberte <liberte@gnu.org>
parents:
diff changeset
118
21d52b9fd783 Initial revision
Daniel LaLiberte <liberte@gnu.org>
parents:
diff changeset
119 (def-edebug-spec callf (function* place &rest form))
21d52b9fd783 Initial revision
Daniel LaLiberte <liberte@gnu.org>
parents:
diff changeset
120 (def-edebug-spec callf2 (function* form place &rest form))
21d52b9fd783 Initial revision
Daniel LaLiberte <liberte@gnu.org>
parents:
diff changeset
121
21d52b9fd783 Initial revision
Daniel LaLiberte <liberte@gnu.org>
parents:
diff changeset
122 ;; Other operations on places
21d52b9fd783 Initial revision
Daniel LaLiberte <liberte@gnu.org>
parents:
diff changeset
123
21d52b9fd783 Initial revision
Daniel LaLiberte <liberte@gnu.org>
parents:
diff changeset
124 (def-edebug-spec remf (place form))
21d52b9fd783 Initial revision
Daniel LaLiberte <liberte@gnu.org>
parents:
diff changeset
125
21d52b9fd783 Initial revision
Daniel LaLiberte <liberte@gnu.org>
parents:
diff changeset
126 (def-edebug-spec incf (place &optional form))
21d52b9fd783 Initial revision
Daniel LaLiberte <liberte@gnu.org>
parents:
diff changeset
127 (def-edebug-spec decf incf)
28571
90bcf7fbdc57 Remove when, unless.
Dave Love <fx@gnu.org>
parents: 27526
diff changeset
128 (def-edebug-spec push (form place)) ; different for CL
6491
21d52b9fd783 Initial revision
Daniel LaLiberte <liberte@gnu.org>
parents:
diff changeset
129 (def-edebug-spec pushnew
21d52b9fd783 Initial revision
Daniel LaLiberte <liberte@gnu.org>
parents:
diff changeset
130 (form place &rest
21d52b9fd783 Initial revision
Daniel LaLiberte <liberte@gnu.org>
parents:
diff changeset
131 &or [[&or ":test" ":test-not" ":key"] function-form]
11489
cfb899623032 (pushnew): Use edebug-keywordp.
Richard M. Stallman <rms@gnu.org>
parents: 6686
diff changeset
132 [edebug-keywordp form]))
28571
90bcf7fbdc57 Remove when, unless.
Dave Love <fx@gnu.org>
parents: 27526
diff changeset
133 (def-edebug-spec pop (place)) ; different for CL
6491
21d52b9fd783 Initial revision
Daniel LaLiberte <liberte@gnu.org>
parents:
diff changeset
134
21d52b9fd783 Initial revision
Daniel LaLiberte <liberte@gnu.org>
parents:
diff changeset
135 (def-edebug-spec shiftf (&rest place)) ;; really [&rest place] form
21d52b9fd783 Initial revision
Daniel LaLiberte <liberte@gnu.org>
parents:
diff changeset
136 (def-edebug-spec rotatef (&rest place))
21d52b9fd783 Initial revision
Daniel LaLiberte <liberte@gnu.org>
parents:
diff changeset
137
21d52b9fd783 Initial revision
Daniel LaLiberte <liberte@gnu.org>
parents:
diff changeset
138
21d52b9fd783 Initial revision
Daniel LaLiberte <liberte@gnu.org>
parents:
diff changeset
139 ;; Functions with function args. These are only useful if the
21d52b9fd783 Initial revision
Daniel LaLiberte <liberte@gnu.org>
parents:
diff changeset
140 ;; function arg is quoted with ' instead of function.
21d52b9fd783 Initial revision
Daniel LaLiberte <liberte@gnu.org>
parents:
diff changeset
141
21d52b9fd783 Initial revision
Daniel LaLiberte <liberte@gnu.org>
parents:
diff changeset
142 (def-edebug-spec some (function-form form &rest form))
21d52b9fd783 Initial revision
Daniel LaLiberte <liberte@gnu.org>
parents:
diff changeset
143 (def-edebug-spec every some)
21d52b9fd783 Initial revision
Daniel LaLiberte <liberte@gnu.org>
parents:
diff changeset
144 (def-edebug-spec notany some)
21d52b9fd783 Initial revision
Daniel LaLiberte <liberte@gnu.org>
parents:
diff changeset
145 (def-edebug-spec notevery some)
21d52b9fd783 Initial revision
Daniel LaLiberte <liberte@gnu.org>
parents:
diff changeset
146
21d52b9fd783 Initial revision
Daniel LaLiberte <liberte@gnu.org>
parents:
diff changeset
147 ;; Mapping
21d52b9fd783 Initial revision
Daniel LaLiberte <liberte@gnu.org>
parents:
diff changeset
148
21d52b9fd783 Initial revision
Daniel LaLiberte <liberte@gnu.org>
parents:
diff changeset
149 (def-edebug-spec map (form function-form form &rest form))
21d52b9fd783 Initial revision
Daniel LaLiberte <liberte@gnu.org>
parents:
diff changeset
150 (def-edebug-spec maplist (function-form form &rest form))
21d52b9fd783 Initial revision
Daniel LaLiberte <liberte@gnu.org>
parents:
diff changeset
151 (def-edebug-spec mapc maplist)
21d52b9fd783 Initial revision
Daniel LaLiberte <liberte@gnu.org>
parents:
diff changeset
152 (def-edebug-spec mapl maplist)
21d52b9fd783 Initial revision
Daniel LaLiberte <liberte@gnu.org>
parents:
diff changeset
153 (def-edebug-spec mapcan maplist)
21d52b9fd783 Initial revision
Daniel LaLiberte <liberte@gnu.org>
parents:
diff changeset
154 (def-edebug-spec mapcon maplist)
21d52b9fd783 Initial revision
Daniel LaLiberte <liberte@gnu.org>
parents:
diff changeset
155
21d52b9fd783 Initial revision
Daniel LaLiberte <liberte@gnu.org>
parents:
diff changeset
156 ;; Sequences
21d52b9fd783 Initial revision
Daniel LaLiberte <liberte@gnu.org>
parents:
diff changeset
157
21d52b9fd783 Initial revision
Daniel LaLiberte <liberte@gnu.org>
parents:
diff changeset
158 (def-edebug-spec reduce (function-form form &rest form))
21d52b9fd783 Initial revision
Daniel LaLiberte <liberte@gnu.org>
parents:
diff changeset
159
21d52b9fd783 Initial revision
Daniel LaLiberte <liberte@gnu.org>
parents:
diff changeset
160 ;; Types and assertions
21d52b9fd783 Initial revision
Daniel LaLiberte <liberte@gnu.org>
parents:
diff changeset
161
21d52b9fd783 Initial revision
Daniel LaLiberte <liberte@gnu.org>
parents:
diff changeset
162 (def-edebug-spec cl-type-spec (sexp)) ;; not worth the trouble to specify, yet.
21d52b9fd783 Initial revision
Daniel LaLiberte <liberte@gnu.org>
parents:
diff changeset
163
21d52b9fd783 Initial revision
Daniel LaLiberte <liberte@gnu.org>
parents:
diff changeset
164 (def-edebug-spec deftype defmacro*)
21d52b9fd783 Initial revision
Daniel LaLiberte <liberte@gnu.org>
parents:
diff changeset
165 (def-edebug-spec check-type (place cl-type-spec &optional stringp))
21d52b9fd783 Initial revision
Daniel LaLiberte <liberte@gnu.org>
parents:
diff changeset
166 ;; (def-edebug-spec assert (form &optional form stringp &rest form))
21d52b9fd783 Initial revision
Daniel LaLiberte <liberte@gnu.org>
parents:
diff changeset
167 (def-edebug-spec assert (form &rest form))
21d52b9fd783 Initial revision
Daniel LaLiberte <liberte@gnu.org>
parents:
diff changeset
168 (def-edebug-spec typecase (form &rest ([&or cl-type-spec "otherwise"] body)))
21d52b9fd783 Initial revision
Daniel LaLiberte <liberte@gnu.org>
parents:
diff changeset
169 (def-edebug-spec etypecase typecase)
21d52b9fd783 Initial revision
Daniel LaLiberte <liberte@gnu.org>
parents:
diff changeset
170
21d52b9fd783 Initial revision
Daniel LaLiberte <liberte@gnu.org>
parents:
diff changeset
171 (def-edebug-spec ignore-errors t)
21d52b9fd783 Initial revision
Daniel LaLiberte <liberte@gnu.org>
parents:
diff changeset
172
21d52b9fd783 Initial revision
Daniel LaLiberte <liberte@gnu.org>
parents:
diff changeset
173 ;; Time of Evaluation
21d52b9fd783 Initial revision
Daniel LaLiberte <liberte@gnu.org>
parents:
diff changeset
174
21d52b9fd783 Initial revision
Daniel LaLiberte <liberte@gnu.org>
parents:
diff changeset
175 (def-edebug-spec eval-when
21d52b9fd783 Initial revision
Daniel LaLiberte <liberte@gnu.org>
parents:
diff changeset
176 ((&rest &or "compile" "load" "eval") body))
21d52b9fd783 Initial revision
Daniel LaLiberte <liberte@gnu.org>
parents:
diff changeset
177 (def-edebug-spec load-time-value (form &optional &or "t" "nil"))
21d52b9fd783 Initial revision
Daniel LaLiberte <liberte@gnu.org>
parents:
diff changeset
178
21d52b9fd783 Initial revision
Daniel LaLiberte <liberte@gnu.org>
parents:
diff changeset
179 ;; Declarations
21d52b9fd783 Initial revision
Daniel LaLiberte <liberte@gnu.org>
parents:
diff changeset
180
21d52b9fd783 Initial revision
Daniel LaLiberte <liberte@gnu.org>
parents:
diff changeset
181 (def-edebug-spec cl-decl-spec
21d52b9fd783 Initial revision
Daniel LaLiberte <liberte@gnu.org>
parents:
diff changeset
182 ((symbolp &rest sexp)))
21d52b9fd783 Initial revision
Daniel LaLiberte <liberte@gnu.org>
parents:
diff changeset
183
21d52b9fd783 Initial revision
Daniel LaLiberte <liberte@gnu.org>
parents:
diff changeset
184 (def-edebug-spec cl-declarations
21d52b9fd783 Initial revision
Daniel LaLiberte <liberte@gnu.org>
parents:
diff changeset
185 (&rest ("declare" &rest cl-decl-spec)))
21d52b9fd783 Initial revision
Daniel LaLiberte <liberte@gnu.org>
parents:
diff changeset
186
21d52b9fd783 Initial revision
Daniel LaLiberte <liberte@gnu.org>
parents:
diff changeset
187 (def-edebug-spec cl-declarations-or-string
21d52b9fd783 Initial revision
Daniel LaLiberte <liberte@gnu.org>
parents:
diff changeset
188 (&or stringp cl-declarations))
21d52b9fd783 Initial revision
Daniel LaLiberte <liberte@gnu.org>
parents:
diff changeset
189
21d52b9fd783 Initial revision
Daniel LaLiberte <liberte@gnu.org>
parents:
diff changeset
190 (def-edebug-spec declaim (&rest cl-decl-spec))
21d52b9fd783 Initial revision
Daniel LaLiberte <liberte@gnu.org>
parents:
diff changeset
191 (def-edebug-spec declare (&rest cl-decl-spec)) ;; probably not needed.
21d52b9fd783 Initial revision
Daniel LaLiberte <liberte@gnu.org>
parents:
diff changeset
192 (def-edebug-spec locally (cl-declarations &rest form))
21d52b9fd783 Initial revision
Daniel LaLiberte <liberte@gnu.org>
parents:
diff changeset
193 (def-edebug-spec the (cl-type-spec form))
21d52b9fd783 Initial revision
Daniel LaLiberte <liberte@gnu.org>
parents:
diff changeset
194
21d52b9fd783 Initial revision
Daniel LaLiberte <liberte@gnu.org>
parents:
diff changeset
195 ;;======================================================
21d52b9fd783 Initial revision
Daniel LaLiberte <liberte@gnu.org>
parents:
diff changeset
196 ;; Lambda things
21d52b9fd783 Initial revision
Daniel LaLiberte <liberte@gnu.org>
parents:
diff changeset
197
21d52b9fd783 Initial revision
Daniel LaLiberte <liberte@gnu.org>
parents:
diff changeset
198 (def-edebug-spec cl-lambda-list
21d52b9fd783 Initial revision
Daniel LaLiberte <liberte@gnu.org>
parents:
diff changeset
199 (([&rest arg]
21d52b9fd783 Initial revision
Daniel LaLiberte <liberte@gnu.org>
parents:
diff changeset
200 [&optional ["&optional" cl-&optional-arg &rest cl-&optional-arg]]
21d52b9fd783 Initial revision
Daniel LaLiberte <liberte@gnu.org>
parents:
diff changeset
201 [&optional ["&rest" arg]]
21d52b9fd783 Initial revision
Daniel LaLiberte <liberte@gnu.org>
parents:
diff changeset
202 [&optional ["&key" [cl-&key-arg &rest cl-&key-arg]
27526
a71509a64082 (cl-lambda-list, cl-macro-list)
Gerd Moellmann <gerd@gnu.org>
parents: 23513
diff changeset
203 &optional "&allow-other-keys"]]
6491
21d52b9fd783 Initial revision
Daniel LaLiberte <liberte@gnu.org>
parents:
diff changeset
204 [&optional ["&aux" &rest
21d52b9fd783 Initial revision
Daniel LaLiberte <liberte@gnu.org>
parents:
diff changeset
205 &or (symbolp &optional def-form) symbolp]]
21d52b9fd783 Initial revision
Daniel LaLiberte <liberte@gnu.org>
parents:
diff changeset
206 )))
21d52b9fd783 Initial revision
Daniel LaLiberte <liberte@gnu.org>
parents:
diff changeset
207
21d52b9fd783 Initial revision
Daniel LaLiberte <liberte@gnu.org>
parents:
diff changeset
208 (def-edebug-spec cl-&optional-arg
21d52b9fd783 Initial revision
Daniel LaLiberte <liberte@gnu.org>
parents:
diff changeset
209 (&or (arg &optional def-form arg) arg))
21d52b9fd783 Initial revision
Daniel LaLiberte <liberte@gnu.org>
parents:
diff changeset
210
21d52b9fd783 Initial revision
Daniel LaLiberte <liberte@gnu.org>
parents:
diff changeset
211 (def-edebug-spec cl-&key-arg
21d52b9fd783 Initial revision
Daniel LaLiberte <liberte@gnu.org>
parents:
diff changeset
212 (&or ([&or (symbolp arg) arg] &optional def-form arg) arg))
21d52b9fd783 Initial revision
Daniel LaLiberte <liberte@gnu.org>
parents:
diff changeset
213
21d52b9fd783 Initial revision
Daniel LaLiberte <liberte@gnu.org>
parents:
diff changeset
214 ;; The lambda list for macros is different from that of normal lambdas.
21d52b9fd783 Initial revision
Daniel LaLiberte <liberte@gnu.org>
parents:
diff changeset
215 ;; Note that &environment is only allowed as first or last items in the
21d52b9fd783 Initial revision
Daniel LaLiberte <liberte@gnu.org>
parents:
diff changeset
216 ;; top level list.
21d52b9fd783 Initial revision
Daniel LaLiberte <liberte@gnu.org>
parents:
diff changeset
217
21d52b9fd783 Initial revision
Daniel LaLiberte <liberte@gnu.org>
parents:
diff changeset
218 (def-edebug-spec cl-macro-list
21d52b9fd783 Initial revision
Daniel LaLiberte <liberte@gnu.org>
parents:
diff changeset
219 (([&optional "&environment" arg]
21d52b9fd783 Initial revision
Daniel LaLiberte <liberte@gnu.org>
parents:
diff changeset
220 [&rest cl-macro-arg]
21d52b9fd783 Initial revision
Daniel LaLiberte <liberte@gnu.org>
parents:
diff changeset
221 [&optional ["&optional" &rest
21d52b9fd783 Initial revision
Daniel LaLiberte <liberte@gnu.org>
parents:
diff changeset
222 &or (cl-macro-arg &optional def-form cl-macro-arg) arg]]
21d52b9fd783 Initial revision
Daniel LaLiberte <liberte@gnu.org>
parents:
diff changeset
223 [&optional [[&or "&rest" "&body"] cl-macro-arg]]
21d52b9fd783 Initial revision
Daniel LaLiberte <liberte@gnu.org>
parents:
diff changeset
224 [&optional ["&key" [&rest
21d52b9fd783 Initial revision
Daniel LaLiberte <liberte@gnu.org>
parents:
diff changeset
225 [&or ([&or (symbolp cl-macro-arg) arg]
21d52b9fd783 Initial revision
Daniel LaLiberte <liberte@gnu.org>
parents:
diff changeset
226 &optional def-form cl-macro-arg)
21d52b9fd783 Initial revision
Daniel LaLiberte <liberte@gnu.org>
parents:
diff changeset
227 arg]]
27526
a71509a64082 (cl-lambda-list, cl-macro-list)
Gerd Moellmann <gerd@gnu.org>
parents: 23513
diff changeset
228 &optional "&allow-other-keys"]]
6491
21d52b9fd783 Initial revision
Daniel LaLiberte <liberte@gnu.org>
parents:
diff changeset
229 [&optional ["&aux" &rest
21d52b9fd783 Initial revision
Daniel LaLiberte <liberte@gnu.org>
parents:
diff changeset
230 &or (symbolp &optional def-form) symbolp]]
21d52b9fd783 Initial revision
Daniel LaLiberte <liberte@gnu.org>
parents:
diff changeset
231 [&optional "&environment" arg]
21d52b9fd783 Initial revision
Daniel LaLiberte <liberte@gnu.org>
parents:
diff changeset
232 )))
21d52b9fd783 Initial revision
Daniel LaLiberte <liberte@gnu.org>
parents:
diff changeset
233
21d52b9fd783 Initial revision
Daniel LaLiberte <liberte@gnu.org>
parents:
diff changeset
234 (def-edebug-spec cl-macro-arg
21d52b9fd783 Initial revision
Daniel LaLiberte <liberte@gnu.org>
parents:
diff changeset
235 (&or arg cl-macro-list1))
21d52b9fd783 Initial revision
Daniel LaLiberte <liberte@gnu.org>
parents:
diff changeset
236
21d52b9fd783 Initial revision
Daniel LaLiberte <liberte@gnu.org>
parents:
diff changeset
237 (def-edebug-spec cl-macro-list1
21d52b9fd783 Initial revision
Daniel LaLiberte <liberte@gnu.org>
parents:
diff changeset
238 (([&optional "&whole" arg] ;; only allowed at lower levels
21d52b9fd783 Initial revision
Daniel LaLiberte <liberte@gnu.org>
parents:
diff changeset
239 [&rest cl-macro-arg]
21d52b9fd783 Initial revision
Daniel LaLiberte <liberte@gnu.org>
parents:
diff changeset
240 [&optional ["&optional" &rest
21d52b9fd783 Initial revision
Daniel LaLiberte <liberte@gnu.org>
parents:
diff changeset
241 &or (cl-macro-arg &optional def-form cl-macro-arg) arg]]
21d52b9fd783 Initial revision
Daniel LaLiberte <liberte@gnu.org>
parents:
diff changeset
242 [&optional [[&or "&rest" "&body"] cl-macro-arg]]
21d52b9fd783 Initial revision
Daniel LaLiberte <liberte@gnu.org>
parents:
diff changeset
243 [&optional ["&key" [&rest
21d52b9fd783 Initial revision
Daniel LaLiberte <liberte@gnu.org>
parents:
diff changeset
244 [&or ([&or (symbolp cl-macro-arg) arg]
21d52b9fd783 Initial revision
Daniel LaLiberte <liberte@gnu.org>
parents:
diff changeset
245 &optional def-form cl-macro-arg)
21d52b9fd783 Initial revision
Daniel LaLiberte <liberte@gnu.org>
parents:
diff changeset
246 arg]]
27526
a71509a64082 (cl-lambda-list, cl-macro-list)
Gerd Moellmann <gerd@gnu.org>
parents: 23513
diff changeset
247 &optional "&allow-other-keys"]]
6491
21d52b9fd783 Initial revision
Daniel LaLiberte <liberte@gnu.org>
parents:
diff changeset
248 [&optional ["&aux" &rest
21d52b9fd783 Initial revision
Daniel LaLiberte <liberte@gnu.org>
parents:
diff changeset
249 &or (symbolp &optional def-form) symbolp]]
21d52b9fd783 Initial revision
Daniel LaLiberte <liberte@gnu.org>
parents:
diff changeset
250 . [&or arg nil])))
21d52b9fd783 Initial revision
Daniel LaLiberte <liberte@gnu.org>
parents:
diff changeset
251
21d52b9fd783 Initial revision
Daniel LaLiberte <liberte@gnu.org>
parents:
diff changeset
252
21d52b9fd783 Initial revision
Daniel LaLiberte <liberte@gnu.org>
parents:
diff changeset
253 (def-edebug-spec defun*
21d52b9fd783 Initial revision
Daniel LaLiberte <liberte@gnu.org>
parents:
diff changeset
254 ;; Same as defun but use cl-lambda-list.
21d52b9fd783 Initial revision
Daniel LaLiberte <liberte@gnu.org>
parents:
diff changeset
255 (&define [&or name
21d52b9fd783 Initial revision
Daniel LaLiberte <liberte@gnu.org>
parents:
diff changeset
256 ("setf" :name setf name)]
21d52b9fd783 Initial revision
Daniel LaLiberte <liberte@gnu.org>
parents:
diff changeset
257 cl-lambda-list
21d52b9fd783 Initial revision
Daniel LaLiberte <liberte@gnu.org>
parents:
diff changeset
258 cl-declarations-or-string
21d52b9fd783 Initial revision
Daniel LaLiberte <liberte@gnu.org>
parents:
diff changeset
259 [&optional ("interactive" interactive)]
21d52b9fd783 Initial revision
Daniel LaLiberte <liberte@gnu.org>
parents:
diff changeset
260 def-body))
21d52b9fd783 Initial revision
Daniel LaLiberte <liberte@gnu.org>
parents:
diff changeset
261 (def-edebug-spec defsubst* defun*)
21d52b9fd783 Initial revision
Daniel LaLiberte <liberte@gnu.org>
parents:
diff changeset
262
21d52b9fd783 Initial revision
Daniel LaLiberte <liberte@gnu.org>
parents:
diff changeset
263 (def-edebug-spec defmacro*
21d52b9fd783 Initial revision
Daniel LaLiberte <liberte@gnu.org>
parents:
diff changeset
264 (&define name cl-macro-list cl-declarations-or-string def-body))
21d52b9fd783 Initial revision
Daniel LaLiberte <liberte@gnu.org>
parents:
diff changeset
265 (def-edebug-spec define-compiler-macro defmacro*)
21d52b9fd783 Initial revision
Daniel LaLiberte <liberte@gnu.org>
parents:
diff changeset
266
21d52b9fd783 Initial revision
Daniel LaLiberte <liberte@gnu.org>
parents:
diff changeset
267
21d52b9fd783 Initial revision
Daniel LaLiberte <liberte@gnu.org>
parents:
diff changeset
268 (def-edebug-spec function*
21d52b9fd783 Initial revision
Daniel LaLiberte <liberte@gnu.org>
parents:
diff changeset
269 (&or symbolp cl-lambda-expr))
21d52b9fd783 Initial revision
Daniel LaLiberte <liberte@gnu.org>
parents:
diff changeset
270
21d52b9fd783 Initial revision
Daniel LaLiberte <liberte@gnu.org>
parents:
diff changeset
271 (def-edebug-spec cl-lambda-expr
21d52b9fd783 Initial revision
Daniel LaLiberte <liberte@gnu.org>
parents:
diff changeset
272 (&define ("lambda" cl-lambda-list
21d52b9fd783 Initial revision
Daniel LaLiberte <liberte@gnu.org>
parents:
diff changeset
273 ;;cl-declarations-or-string
21d52b9fd783 Initial revision
Daniel LaLiberte <liberte@gnu.org>
parents:
diff changeset
274 ;;[&optional ("interactive" interactive)]
21d52b9fd783 Initial revision
Daniel LaLiberte <liberte@gnu.org>
parents:
diff changeset
275 def-body)))
21d52b9fd783 Initial revision
Daniel LaLiberte <liberte@gnu.org>
parents:
diff changeset
276
21d52b9fd783 Initial revision
Daniel LaLiberte <liberte@gnu.org>
parents:
diff changeset
277 ;; Redefine function-form to also match function*
21d52b9fd783 Initial revision
Daniel LaLiberte <liberte@gnu.org>
parents:
diff changeset
278 (def-edebug-spec function-form
21d52b9fd783 Initial revision
Daniel LaLiberte <liberte@gnu.org>
parents:
diff changeset
279 ;; form at the end could also handle "function",
21d52b9fd783 Initial revision
Daniel LaLiberte <liberte@gnu.org>
parents:
diff changeset
280 ;; but recognize it specially to avoid wrapping function forms.
21d52b9fd783 Initial revision
Daniel LaLiberte <liberte@gnu.org>
parents:
diff changeset
281 (&or ([&or "quote" "function"] &or symbolp lambda-expr)
23513
0a3fa36b323b (function-form): Fix spec for
Andreas Schwab <schwab@suse.de>
parents: 14169
diff changeset
282 ("function*" function*)
6491
21d52b9fd783 Initial revision
Daniel LaLiberte <liberte@gnu.org>
parents:
diff changeset
283 form))
21d52b9fd783 Initial revision
Daniel LaLiberte <liberte@gnu.org>
parents:
diff changeset
284
21d52b9fd783 Initial revision
Daniel LaLiberte <liberte@gnu.org>
parents:
diff changeset
285 ;;======================================================
21d52b9fd783 Initial revision
Daniel LaLiberte <liberte@gnu.org>
parents:
diff changeset
286 ;; Structures
21d52b9fd783 Initial revision
Daniel LaLiberte <liberte@gnu.org>
parents:
diff changeset
287 ;; (def-edebug-spec defstruct (&rest sexp)) would be sufficient, but...
21d52b9fd783 Initial revision
Daniel LaLiberte <liberte@gnu.org>
parents:
diff changeset
288
21d52b9fd783 Initial revision
Daniel LaLiberte <liberte@gnu.org>
parents:
diff changeset
289 ;; defstruct may contain forms that are evaluated when a structure is created.
21d52b9fd783 Initial revision
Daniel LaLiberte <liberte@gnu.org>
parents:
diff changeset
290 (def-edebug-spec defstruct
21d52b9fd783 Initial revision
Daniel LaLiberte <liberte@gnu.org>
parents:
diff changeset
291 (&define ; makes top-level form not be wrapped
21d52b9fd783 Initial revision
Daniel LaLiberte <liberte@gnu.org>
parents:
diff changeset
292 [&or symbolp
21d52b9fd783 Initial revision
Daniel LaLiberte <liberte@gnu.org>
parents:
diff changeset
293 (gate
21d52b9fd783 Initial revision
Daniel LaLiberte <liberte@gnu.org>
parents:
diff changeset
294 symbolp &rest
21d52b9fd783 Initial revision
Daniel LaLiberte <liberte@gnu.org>
parents:
diff changeset
295 (&or [":conc-name" &or stringp "nil"]
21d52b9fd783 Initial revision
Daniel LaLiberte <liberte@gnu.org>
parents:
diff changeset
296 [":constructor" symbolp &optional cl-lambda-list]
21d52b9fd783 Initial revision
Daniel LaLiberte <liberte@gnu.org>
parents:
diff changeset
297 [":copier" symbolp]
21d52b9fd783 Initial revision
Daniel LaLiberte <liberte@gnu.org>
parents:
diff changeset
298 [":predicate" symbolp]
21d52b9fd783 Initial revision
Daniel LaLiberte <liberte@gnu.org>
parents:
diff changeset
299 [":include" symbolp &rest sexp];; not finished
21d52b9fd783 Initial revision
Daniel LaLiberte <liberte@gnu.org>
parents:
diff changeset
300 ;; The following are not supported.
21d52b9fd783 Initial revision
Daniel LaLiberte <liberte@gnu.org>
parents:
diff changeset
301 ;; [":print-function" ...]
21d52b9fd783 Initial revision
Daniel LaLiberte <liberte@gnu.org>
parents:
diff changeset
302 ;; [":type" ...]
21d52b9fd783 Initial revision
Daniel LaLiberte <liberte@gnu.org>
parents:
diff changeset
303 ;; [":initial-offset" ...]
21d52b9fd783 Initial revision
Daniel LaLiberte <liberte@gnu.org>
parents:
diff changeset
304 ))]
21d52b9fd783 Initial revision
Daniel LaLiberte <liberte@gnu.org>
parents:
diff changeset
305 [&optional stringp]
21d52b9fd783 Initial revision
Daniel LaLiberte <liberte@gnu.org>
parents:
diff changeset
306 ;; All the above is for the following def-form.
21d52b9fd783 Initial revision
Daniel LaLiberte <liberte@gnu.org>
parents:
diff changeset
307 &rest &or symbolp (symbolp def-form &optional ":read-only" sexp)))
21d52b9fd783 Initial revision
Daniel LaLiberte <liberte@gnu.org>
parents:
diff changeset
308
21d52b9fd783 Initial revision
Daniel LaLiberte <liberte@gnu.org>
parents:
diff changeset
309 ;;======================================================
21d52b9fd783 Initial revision
Daniel LaLiberte <liberte@gnu.org>
parents:
diff changeset
310 ;; Loop
21d52b9fd783 Initial revision
Daniel LaLiberte <liberte@gnu.org>
parents:
diff changeset
311
21d52b9fd783 Initial revision
Daniel LaLiberte <liberte@gnu.org>
parents:
diff changeset
312 ;; The loop macro is very complex, and a full spec is found below.
21d52b9fd783 Initial revision
Daniel LaLiberte <liberte@gnu.org>
parents:
diff changeset
313 ;; The following spec only minimally specifies that
21d52b9fd783 Initial revision
Daniel LaLiberte <liberte@gnu.org>
parents:
diff changeset
314 ;; parenthesized forms are executable, but single variables used as
21d52b9fd783 Initial revision
Daniel LaLiberte <liberte@gnu.org>
parents:
diff changeset
315 ;; expressions will be missed. You may want to use this if the full
21d52b9fd783 Initial revision
Daniel LaLiberte <liberte@gnu.org>
parents:
diff changeset
316 ;; spec causes problems for you.
21d52b9fd783 Initial revision
Daniel LaLiberte <liberte@gnu.org>
parents:
diff changeset
317
21d52b9fd783 Initial revision
Daniel LaLiberte <liberte@gnu.org>
parents:
diff changeset
318 (def-edebug-spec loop
21d52b9fd783 Initial revision
Daniel LaLiberte <liberte@gnu.org>
parents:
diff changeset
319 (&rest &or symbolp form))
21d52b9fd783 Initial revision
Daniel LaLiberte <liberte@gnu.org>
parents:
diff changeset
320
21d52b9fd783 Initial revision
Daniel LaLiberte <liberte@gnu.org>
parents:
diff changeset
321 ;; Below is a complete spec for loop, in several parts that correspond
21d52b9fd783 Initial revision
Daniel LaLiberte <liberte@gnu.org>
parents:
diff changeset
322 ;; to the syntax given in CLtL2. The specs do more than specify where
21d52b9fd783 Initial revision
Daniel LaLiberte <liberte@gnu.org>
parents:
diff changeset
323 ;; the forms are; it also specifies, as much as Edebug allows, all the
21d52b9fd783 Initial revision
Daniel LaLiberte <liberte@gnu.org>
parents:
diff changeset
324 ;; syntactically legal loop clauses. The disadvantage of this
21d52b9fd783 Initial revision
Daniel LaLiberte <liberte@gnu.org>
parents:
diff changeset
325 ;; completeness is rigidity, but the "for ... being" clause allows
21d52b9fd783 Initial revision
Daniel LaLiberte <liberte@gnu.org>
parents:
diff changeset
326 ;; arbitrary extensions of the form: [symbolp &rest &or symbolp form].
21d52b9fd783 Initial revision
Daniel LaLiberte <liberte@gnu.org>
parents:
diff changeset
327
21d52b9fd783 Initial revision
Daniel LaLiberte <liberte@gnu.org>
parents:
diff changeset
328 (def-edebug-spec loop
21d52b9fd783 Initial revision
Daniel LaLiberte <liberte@gnu.org>
parents:
diff changeset
329 ([&optional ["named" symbolp]]
21d52b9fd783 Initial revision
Daniel LaLiberte <liberte@gnu.org>
parents:
diff changeset
330 [&rest
21d52b9fd783 Initial revision
Daniel LaLiberte <liberte@gnu.org>
parents:
diff changeset
331 &or
21d52b9fd783 Initial revision
Daniel LaLiberte <liberte@gnu.org>
parents:
diff changeset
332 ["repeat" form]
21d52b9fd783 Initial revision
Daniel LaLiberte <liberte@gnu.org>
parents:
diff changeset
333 loop-for-as
21d52b9fd783 Initial revision
Daniel LaLiberte <liberte@gnu.org>
parents:
diff changeset
334 loop-with
21d52b9fd783 Initial revision
Daniel LaLiberte <liberte@gnu.org>
parents:
diff changeset
335 loop-initial-final]
21d52b9fd783 Initial revision
Daniel LaLiberte <liberte@gnu.org>
parents:
diff changeset
336 [&rest loop-clause]
21d52b9fd783 Initial revision
Daniel LaLiberte <liberte@gnu.org>
parents:
diff changeset
337 ))
21d52b9fd783 Initial revision
Daniel LaLiberte <liberte@gnu.org>
parents:
diff changeset
338
21d52b9fd783 Initial revision
Daniel LaLiberte <liberte@gnu.org>
parents:
diff changeset
339 (def-edebug-spec loop-with
21d52b9fd783 Initial revision
Daniel LaLiberte <liberte@gnu.org>
parents:
diff changeset
340 ("with" loop-var
21d52b9fd783 Initial revision
Daniel LaLiberte <liberte@gnu.org>
parents:
diff changeset
341 loop-type-spec
21d52b9fd783 Initial revision
Daniel LaLiberte <liberte@gnu.org>
parents:
diff changeset
342 [&optional ["=" form]]
21d52b9fd783 Initial revision
Daniel LaLiberte <liberte@gnu.org>
parents:
diff changeset
343 &rest ["and" loop-var
21d52b9fd783 Initial revision
Daniel LaLiberte <liberte@gnu.org>
parents:
diff changeset
344 loop-type-spec
21d52b9fd783 Initial revision
Daniel LaLiberte <liberte@gnu.org>
parents:
diff changeset
345 [&optional ["=" form]]]))
21d52b9fd783 Initial revision
Daniel LaLiberte <liberte@gnu.org>
parents:
diff changeset
346
21d52b9fd783 Initial revision
Daniel LaLiberte <liberte@gnu.org>
parents:
diff changeset
347 (def-edebug-spec loop-for-as
21d52b9fd783 Initial revision
Daniel LaLiberte <liberte@gnu.org>
parents:
diff changeset
348 ([&or "for" "as"] loop-for-as-subclause
21d52b9fd783 Initial revision
Daniel LaLiberte <liberte@gnu.org>
parents:
diff changeset
349 &rest ["and" loop-for-as-subclause]))
21d52b9fd783 Initial revision
Daniel LaLiberte <liberte@gnu.org>
parents:
diff changeset
350
21d52b9fd783 Initial revision
Daniel LaLiberte <liberte@gnu.org>
parents:
diff changeset
351 (def-edebug-spec loop-for-as-subclause
21d52b9fd783 Initial revision
Daniel LaLiberte <liberte@gnu.org>
parents:
diff changeset
352 (loop-var
21d52b9fd783 Initial revision
Daniel LaLiberte <liberte@gnu.org>
parents:
diff changeset
353 loop-type-spec
21d52b9fd783 Initial revision
Daniel LaLiberte <liberte@gnu.org>
parents:
diff changeset
354 &or
21d52b9fd783 Initial revision
Daniel LaLiberte <liberte@gnu.org>
parents:
diff changeset
355 [[&or "in" "on" "in-ref" "across-ref"]
21d52b9fd783 Initial revision
Daniel LaLiberte <liberte@gnu.org>
parents:
diff changeset
356 form &optional ["by" function-form]]
21d52b9fd783 Initial revision
Daniel LaLiberte <liberte@gnu.org>
parents:
diff changeset
357
21d52b9fd783 Initial revision
Daniel LaLiberte <liberte@gnu.org>
parents:
diff changeset
358 ["=" form &optional ["then" form]]
21d52b9fd783 Initial revision
Daniel LaLiberte <liberte@gnu.org>
parents:
diff changeset
359 ["across" form]
21d52b9fd783 Initial revision
Daniel LaLiberte <liberte@gnu.org>
parents:
diff changeset
360 ["being"
21d52b9fd783 Initial revision
Daniel LaLiberte <liberte@gnu.org>
parents:
diff changeset
361 [&or "the" "each"]
21d52b9fd783 Initial revision
Daniel LaLiberte <liberte@gnu.org>
parents:
diff changeset
362 &or
21d52b9fd783 Initial revision
Daniel LaLiberte <liberte@gnu.org>
parents:
diff changeset
363 [[&or "element" "elements"]
21d52b9fd783 Initial revision
Daniel LaLiberte <liberte@gnu.org>
parents:
diff changeset
364 [&or "of" "in" "of-ref"] form
21d52b9fd783 Initial revision
Daniel LaLiberte <liberte@gnu.org>
parents:
diff changeset
365 &optional "using" ["index" symbolp]];; is this right?
21d52b9fd783 Initial revision
Daniel LaLiberte <liberte@gnu.org>
parents:
diff changeset
366 [[&or "hash-key" "hash-keys"
21d52b9fd783 Initial revision
Daniel LaLiberte <liberte@gnu.org>
parents:
diff changeset
367 "hash-value" "hash-values"]
21d52b9fd783 Initial revision
Daniel LaLiberte <liberte@gnu.org>
parents:
diff changeset
368 [&or "of" "in"]
21d52b9fd783 Initial revision
Daniel LaLiberte <liberte@gnu.org>
parents:
diff changeset
369 hash-table-p &optional ["using" ([&or "hash-value" "hash-values"
21d52b9fd783 Initial revision
Daniel LaLiberte <liberte@gnu.org>
parents:
diff changeset
370 "hash-key" "hash-keys"] sexp)]]
21d52b9fd783 Initial revision
Daniel LaLiberte <liberte@gnu.org>
parents:
diff changeset
371
21d52b9fd783 Initial revision
Daniel LaLiberte <liberte@gnu.org>
parents:
diff changeset
372 [[&or "symbol" "present-symbol" "external-symbol"
21d52b9fd783 Initial revision
Daniel LaLiberte <liberte@gnu.org>
parents:
diff changeset
373 "symbols" "present-symbols" "external-symbols"]
21d52b9fd783 Initial revision
Daniel LaLiberte <liberte@gnu.org>
parents:
diff changeset
374 [&or "in" "of"] package-p]
21d52b9fd783 Initial revision
Daniel LaLiberte <liberte@gnu.org>
parents:
diff changeset
375
21d52b9fd783 Initial revision
Daniel LaLiberte <liberte@gnu.org>
parents:
diff changeset
376 ;; Extensions for Emacs Lisp, including Lucid Emacs.
21d52b9fd783 Initial revision
Daniel LaLiberte <liberte@gnu.org>
parents:
diff changeset
377 [[&or "frame" "frames"
21d52b9fd783 Initial revision
Daniel LaLiberte <liberte@gnu.org>
parents:
diff changeset
378 "screen" "screens"
21d52b9fd783 Initial revision
Daniel LaLiberte <liberte@gnu.org>
parents:
diff changeset
379 "buffer" "buffers"]]
21d52b9fd783 Initial revision
Daniel LaLiberte <liberte@gnu.org>
parents:
diff changeset
380
21d52b9fd783 Initial revision
Daniel LaLiberte <liberte@gnu.org>
parents:
diff changeset
381 [[&or "window" "windows"]
21d52b9fd783 Initial revision
Daniel LaLiberte <liberte@gnu.org>
parents:
diff changeset
382 [&or "of" "in"] form]
21d52b9fd783 Initial revision
Daniel LaLiberte <liberte@gnu.org>
parents:
diff changeset
383
21d52b9fd783 Initial revision
Daniel LaLiberte <liberte@gnu.org>
parents:
diff changeset
384 [[&or "overlay" "overlays"
21d52b9fd783 Initial revision
Daniel LaLiberte <liberte@gnu.org>
parents:
diff changeset
385 "extent" "extents"]
21d52b9fd783 Initial revision
Daniel LaLiberte <liberte@gnu.org>
parents:
diff changeset
386 [&or "of" "in"] form
21d52b9fd783 Initial revision
Daniel LaLiberte <liberte@gnu.org>
parents:
diff changeset
387 &optional [[&or "from" "to"] form]]
21d52b9fd783 Initial revision
Daniel LaLiberte <liberte@gnu.org>
parents:
diff changeset
388
21d52b9fd783 Initial revision
Daniel LaLiberte <liberte@gnu.org>
parents:
diff changeset
389 [[&or "interval" "intervals"]
21d52b9fd783 Initial revision
Daniel LaLiberte <liberte@gnu.org>
parents:
diff changeset
390 [&or "in" "of"] form
21d52b9fd783 Initial revision
Daniel LaLiberte <liberte@gnu.org>
parents:
diff changeset
391 &optional [[&or "from" "to"] form]
21d52b9fd783 Initial revision
Daniel LaLiberte <liberte@gnu.org>
parents:
diff changeset
392 ["property" form]]
21d52b9fd783 Initial revision
Daniel LaLiberte <liberte@gnu.org>
parents:
diff changeset
393
21d52b9fd783 Initial revision
Daniel LaLiberte <liberte@gnu.org>
parents:
diff changeset
394 [[&or "key-code" "key-codes"
21d52b9fd783 Initial revision
Daniel LaLiberte <liberte@gnu.org>
parents:
diff changeset
395 "key-seq" "key-seqs"
21d52b9fd783 Initial revision
Daniel LaLiberte <liberte@gnu.org>
parents:
diff changeset
396 "key-binding" "key-bindings"]
21d52b9fd783 Initial revision
Daniel LaLiberte <liberte@gnu.org>
parents:
diff changeset
397 [&or "in" "of"] form
21d52b9fd783 Initial revision
Daniel LaLiberte <liberte@gnu.org>
parents:
diff changeset
398 &optional ["using" ([&or "key-code" "key-codes"
21d52b9fd783 Initial revision
Daniel LaLiberte <liberte@gnu.org>
parents:
diff changeset
399 "key-seq" "key-seqs"
21d52b9fd783 Initial revision
Daniel LaLiberte <liberte@gnu.org>
parents:
diff changeset
400 "key-binding" "key-bindings"]
21d52b9fd783 Initial revision
Daniel LaLiberte <liberte@gnu.org>
parents:
diff changeset
401 sexp)]]
21d52b9fd783 Initial revision
Daniel LaLiberte <liberte@gnu.org>
parents:
diff changeset
402 ;; For arbitrary extensions, recognize anything else.
21d52b9fd783 Initial revision
Daniel LaLiberte <liberte@gnu.org>
parents:
diff changeset
403 [symbolp &rest &or symbolp form]
21d52b9fd783 Initial revision
Daniel LaLiberte <liberte@gnu.org>
parents:
diff changeset
404 ]
21d52b9fd783 Initial revision
Daniel LaLiberte <liberte@gnu.org>
parents:
diff changeset
405
21d52b9fd783 Initial revision
Daniel LaLiberte <liberte@gnu.org>
parents:
diff changeset
406 ;; arithmetic - must be last since all parts are optional.
21d52b9fd783 Initial revision
Daniel LaLiberte <liberte@gnu.org>
parents:
diff changeset
407 [[&optional [[&or "from" "downfrom" "upfrom"] form]]
21d52b9fd783 Initial revision
Daniel LaLiberte <liberte@gnu.org>
parents:
diff changeset
408 [&optional [[&or "to" "downto" "upto" "below" "above"] form]]
21d52b9fd783 Initial revision
Daniel LaLiberte <liberte@gnu.org>
parents:
diff changeset
409 [&optional ["by" form]]
21d52b9fd783 Initial revision
Daniel LaLiberte <liberte@gnu.org>
parents:
diff changeset
410 ]))
21d52b9fd783 Initial revision
Daniel LaLiberte <liberte@gnu.org>
parents:
diff changeset
411
21d52b9fd783 Initial revision
Daniel LaLiberte <liberte@gnu.org>
parents:
diff changeset
412 (def-edebug-spec loop-initial-final
21d52b9fd783 Initial revision
Daniel LaLiberte <liberte@gnu.org>
parents:
diff changeset
413 (&or ["initially"
14040
187735b53d52 Comment fixes.
Karl Heuer <kwzh@gnu.org>
parents: 13337
diff changeset
414 ;; [&optional &or "do" "doing"] ;; CLtL2 doesn't allow this.
6491
21d52b9fd783 Initial revision
Daniel LaLiberte <liberte@gnu.org>
parents:
diff changeset
415 &rest loop-non-atomic-expr]
21d52b9fd783 Initial revision
Daniel LaLiberte <liberte@gnu.org>
parents:
diff changeset
416 ["finally" &or
21d52b9fd783 Initial revision
Daniel LaLiberte <liberte@gnu.org>
parents:
diff changeset
417 [[&optional &or "do" "doing"] &rest loop-non-atomic-expr]
21d52b9fd783 Initial revision
Daniel LaLiberte <liberte@gnu.org>
parents:
diff changeset
418 ["return" form]]))
21d52b9fd783 Initial revision
Daniel LaLiberte <liberte@gnu.org>
parents:
diff changeset
419
21d52b9fd783 Initial revision
Daniel LaLiberte <liberte@gnu.org>
parents:
diff changeset
420 (def-edebug-spec loop-and-clause
21d52b9fd783 Initial revision
Daniel LaLiberte <liberte@gnu.org>
parents:
diff changeset
421 (loop-clause &rest ["and" loop-clause]))
21d52b9fd783 Initial revision
Daniel LaLiberte <liberte@gnu.org>
parents:
diff changeset
422
21d52b9fd783 Initial revision
Daniel LaLiberte <liberte@gnu.org>
parents:
diff changeset
423 (def-edebug-spec loop-clause
21d52b9fd783 Initial revision
Daniel LaLiberte <liberte@gnu.org>
parents:
diff changeset
424 (&or
21d52b9fd783 Initial revision
Daniel LaLiberte <liberte@gnu.org>
parents:
diff changeset
425 [[&or "while" "until" "always" "never" "thereis"] form]
21d52b9fd783 Initial revision
Daniel LaLiberte <liberte@gnu.org>
parents:
diff changeset
426
21d52b9fd783 Initial revision
Daniel LaLiberte <liberte@gnu.org>
parents:
diff changeset
427 [[&or "collect" "collecting"
21d52b9fd783 Initial revision
Daniel LaLiberte <liberte@gnu.org>
parents:
diff changeset
428 "append" "appending"
21d52b9fd783 Initial revision
Daniel LaLiberte <liberte@gnu.org>
parents:
diff changeset
429 "nconc" "nconcing"
21d52b9fd783 Initial revision
Daniel LaLiberte <liberte@gnu.org>
parents:
diff changeset
430 "concat" "vconcat"] form
21d52b9fd783 Initial revision
Daniel LaLiberte <liberte@gnu.org>
parents:
diff changeset
431 [&optional ["into" loop-var]]]
21d52b9fd783 Initial revision
Daniel LaLiberte <liberte@gnu.org>
parents:
diff changeset
432
21d52b9fd783 Initial revision
Daniel LaLiberte <liberte@gnu.org>
parents:
diff changeset
433 [[&or "count" "counting"
21d52b9fd783 Initial revision
Daniel LaLiberte <liberte@gnu.org>
parents:
diff changeset
434 "sum" "summing"
21d52b9fd783 Initial revision
Daniel LaLiberte <liberte@gnu.org>
parents:
diff changeset
435 "maximize" "maximizing"
21d52b9fd783 Initial revision
Daniel LaLiberte <liberte@gnu.org>
parents:
diff changeset
436 "minimize" "minimizing"] form
21d52b9fd783 Initial revision
Daniel LaLiberte <liberte@gnu.org>
parents:
diff changeset
437 [&optional ["into" loop-var]]
21d52b9fd783 Initial revision
Daniel LaLiberte <liberte@gnu.org>
parents:
diff changeset
438 loop-type-spec]
21d52b9fd783 Initial revision
Daniel LaLiberte <liberte@gnu.org>
parents:
diff changeset
439
21d52b9fd783 Initial revision
Daniel LaLiberte <liberte@gnu.org>
parents:
diff changeset
440 [[&or "if" "when" "unless"]
21d52b9fd783 Initial revision
Daniel LaLiberte <liberte@gnu.org>
parents:
diff changeset
441 form loop-and-clause
21d52b9fd783 Initial revision
Daniel LaLiberte <liberte@gnu.org>
parents:
diff changeset
442 [&optional ["else" loop-and-clause]]
21d52b9fd783 Initial revision
Daniel LaLiberte <liberte@gnu.org>
parents:
diff changeset
443 [&optional "end"]]
21d52b9fd783 Initial revision
Daniel LaLiberte <liberte@gnu.org>
parents:
diff changeset
444
21d52b9fd783 Initial revision
Daniel LaLiberte <liberte@gnu.org>
parents:
diff changeset
445 [[&or "do" "doing"] &rest loop-non-atomic-expr]
21d52b9fd783 Initial revision
Daniel LaLiberte <liberte@gnu.org>
parents:
diff changeset
446
21d52b9fd783 Initial revision
Daniel LaLiberte <liberte@gnu.org>
parents:
diff changeset
447 ["return" form]
21d52b9fd783 Initial revision
Daniel LaLiberte <liberte@gnu.org>
parents:
diff changeset
448 loop-initial-final
21d52b9fd783 Initial revision
Daniel LaLiberte <liberte@gnu.org>
parents:
diff changeset
449 ))
21d52b9fd783 Initial revision
Daniel LaLiberte <liberte@gnu.org>
parents:
diff changeset
450
21d52b9fd783 Initial revision
Daniel LaLiberte <liberte@gnu.org>
parents:
diff changeset
451 (def-edebug-spec loop-non-atomic-expr
21d52b9fd783 Initial revision
Daniel LaLiberte <liberte@gnu.org>
parents:
diff changeset
452 ([&not atom] form))
21d52b9fd783 Initial revision
Daniel LaLiberte <liberte@gnu.org>
parents:
diff changeset
453
21d52b9fd783 Initial revision
Daniel LaLiberte <liberte@gnu.org>
parents:
diff changeset
454 (def-edebug-spec loop-var
21d52b9fd783 Initial revision
Daniel LaLiberte <liberte@gnu.org>
parents:
diff changeset
455 ;; The symbolp must be last alternative to recognize e.g. (a b . c)
21d52b9fd783 Initial revision
Daniel LaLiberte <liberte@gnu.org>
parents:
diff changeset
456 ;; loop-var =>
21d52b9fd783 Initial revision
Daniel LaLiberte <liberte@gnu.org>
parents:
diff changeset
457 ;; (loop-var . [&or nil loop-var])
21d52b9fd783 Initial revision
Daniel LaLiberte <liberte@gnu.org>
parents:
diff changeset
458 ;; (symbolp . [&or nil loop-var])
21d52b9fd783 Initial revision
Daniel LaLiberte <liberte@gnu.org>
parents:
diff changeset
459 ;; (symbolp . loop-var)
21d52b9fd783 Initial revision
Daniel LaLiberte <liberte@gnu.org>
parents:
diff changeset
460 ;; (symbolp . (symbolp . [&or nil loop-var]))
21d52b9fd783 Initial revision
Daniel LaLiberte <liberte@gnu.org>
parents:
diff changeset
461 ;; (symbolp . (symbolp . loop-var))
21d52b9fd783 Initial revision
Daniel LaLiberte <liberte@gnu.org>
parents:
diff changeset
462 ;; (symbolp . (symbolp . symbolp)) == (symbolp symbolp . symbolp)
21d52b9fd783 Initial revision
Daniel LaLiberte <liberte@gnu.org>
parents:
diff changeset
463 (&or (loop-var . [&or nil loop-var]) [gate symbolp]))
21d52b9fd783 Initial revision
Daniel LaLiberte <liberte@gnu.org>
parents:
diff changeset
464
21d52b9fd783 Initial revision
Daniel LaLiberte <liberte@gnu.org>
parents:
diff changeset
465 (def-edebug-spec loop-type-spec
21d52b9fd783 Initial revision
Daniel LaLiberte <liberte@gnu.org>
parents:
diff changeset
466 (&optional ["of-type" loop-d-type-spec]))
21d52b9fd783 Initial revision
Daniel LaLiberte <liberte@gnu.org>
parents:
diff changeset
467
21d52b9fd783 Initial revision
Daniel LaLiberte <liberte@gnu.org>
parents:
diff changeset
468 (def-edebug-spec loop-d-type-spec
21d52b9fd783 Initial revision
Daniel LaLiberte <liberte@gnu.org>
parents:
diff changeset
469 (&or (loop-d-type-spec . [&or nil loop-d-type-spec]) cl-type-spec))
21d52b9fd783 Initial revision
Daniel LaLiberte <liberte@gnu.org>
parents:
diff changeset
470