Mercurial > hg > xemacs-beta
annotate src/general-slots.h @ 4995:8431b52e43b1
Move the various map* functions to C; add #'map-into.
src/ChangeLog addition:
2010-01-31 Aidan Kehoe <kehoea@parhasard.net>
Move #'mapcar*, #'mapcan, #'mapc, #'map, #'mapl, #'mapcon to C;
extend #'mapvector, #'mapconcat, #'mapcar to support more
SEQUENCES; have them all error with circular lists.
* fns.c (Fsubseq): Call CHECK_SEQUENCE here; Flength can return
from the debugger if it errors with a non-sequence, leading to a
crash in Fsubseq if sequence really is *not* a sequence.
(mapcarX): Rename mapcar1 to mapcarX; rework it comprehensively to
take an optional lisp output argument, and a varying number of
sequences.
Special-case a single list argument, as we used to, saving its
elements in the stack space for the results before calling
FUNCTION, so FUNCTION can corrupt the list all it
wants. dead_wrong_type_argument() in the other cases if we
encounter a non-cons where we expected a cons.
(Fmapconcat):
Accept further SEQUENCES after separator here. Special-case
the idiom (mapconcat 'identity SEQUENCE), don't even funcall.
(FmapcarX): Rename this from Fmapcar. Accept optional SEQUENCES.
(Fmapvector): Accept optional SEQUENCES.
(Fmapcan, Fmapc, Fmap): Move these here from cl-extra.el.
(Fmap_into): New function, as specified by Common Lisp.
(maplist): New function, the guts of the implementation of
Fmaplist and Fmapl.
(Fmaplist, Fmapl, Fmapcon): Move these from cl-extra.el.
(syms_of_fns):
Add a few needed symbols here, for the type tests
used by #'map. Add the new subrs, with aliases for #'mapc-internal
and #'mapcar.
* general-slots.h: Declare Qcoerce here, now it's used in both
indent.c and fns.c
* indent.c (syms_of_indent): Qcoerce is gone from here.
* lisp.h: Add ARRAYP(), SEQUENCEP(), and the corresponding CHECK_*
macros. Declare Fbit_vector, Fstring, FmapcarX, now other files
need to use them.
* data.c (Farrayp, Fsequencep): Use ARRAYP and SEQUENCEP, just
added to lisp.h
* buffer.c (Fbuffer_list): Now Fmapcar has been renamed FmapcarX
and takes MANY arguments, update this function to reflect that.
lisp/ChangeLog addition:
2010-01-31 Aidan Kehoe <kehoea@parhasard.net>
* cl.el (mapcar*): Delete; this is now in fns.c.
Use #'mapc, not #'mapc-internal in a couple of places.
* cl-macs.el (mapc, mapcar*, map): Delete these compiler macros
now the corresponding functions are in fns.c; there's no run-time
advantage to the macros.
* cl-extra.el (coerce): Extend the possible conversions here a
little; it's not remotely comprehensive yet, though it does allow
running slightly more Common Lisp code than previously.
(cl-mapcar-many): Delete.
(map, maplist, mapc, mapl, mapcan, mapcon): Move these to fns.c.
* bytecomp.el (byte-compile-maybe-mapc):
Use #'mapc itself, not #'mapc-internal, now the former is in C.
(mapcar*): Use #'byte-compile-maybe-mapc as this function's
byte-compile method, now a #'mapc that can take more than one
sequence is in C.
* obsolete.el (cl-mapc): Move this compatibility alias to this file.
* update-elc.el (do-autoload-commands): Use #'mapc, not
#'mapc-internal here.
author | Aidan Kehoe <kehoea@parhasard.net> |
---|---|
date | Sun, 31 Jan 2010 18:29:48 +0000 |
parents | 3ba90c659d01 |
children | 6afe991b8135 |
rev | line source |
---|---|
442 | 1 /* Commonly-used symbols -- include file |
2 Copyright (C) 1995 Sun Microsystems. | |
1318 | 3 Copyright (C) 1995, 1996, 2000, 2001, 2002, 2003 Ben Wing. |
442 | 4 |
5 This file is part of XEmacs. | |
6 | |
7 XEmacs is free software; you can redistribute it and/or modify it | |
8 under the terms of the GNU General Public License as published by the | |
9 Free Software Foundation; either version 2, or (at your option) any | |
10 later version. | |
11 | |
12 XEmacs is distributed in the hope that it will be useful, but WITHOUT | |
13 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | |
14 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License | |
15 for more details. | |
16 | |
17 You should have received a copy of the GNU General Public License | |
18 along with XEmacs; see the file COPYING. If not, write to | |
19 the Free Software Foundation, Inc., 59 Temple Place - Suite 330, | |
20 Boston, MA 02111-1307, USA. */ | |
21 | |
22 /* Synched up with: Not in FSF. */ | |
23 | |
24 /* The purpose of this file is as a central place to stick symbols | |
25 that don't have any obvious connection to any particular module | |
26 and might be used in many different contexts. | |
27 | |
1632 | 28 Four types of declarations are allowed here: |
442 | 29 |
30 SYMBOL (Qfoo); declares a symbol "foo" | |
1632 | 31 SYMBOL_MODULE_API (Qfoo); declares a symbol "foo" that is visible to modules |
442 | 32 SYMBOL_KEYWORD (Q_foo); declares a keyword symbol ":foo" |
33 SYMBOL_GENERAL (Qfoo, "bar"); declares a symbol named "bar" but stored in | |
34 the variable Qfoo | |
35 | |
36 To sort the crap in this file, use the following: | |
37 | |
38 (sort-regexp-fields nil | |
39 "^.*(Q_?\\(.*\\));$" "\\1" | |
40 (progn | |
41 (search-forward "SYMBOL") | |
42 (match-beginning 0)) | |
43 (point-max)) | |
44 */ | |
45 | |
46 SYMBOL (Qabort); | |
47 SYMBOL_KEYWORD (Q_accelerator); | |
48 SYMBOL_KEYWORD (Q_active); | |
49 SYMBOL (Qactually_requested); | |
50 SYMBOL (Qafter); | |
51 SYMBOL (Qall); | |
52 SYMBOL (Qand); | |
53 SYMBOL (Qappend); | |
771 | 54 SYMBOL (Qascii); |
442 | 55 SYMBOL (Qassoc); |
56 SYMBOL (Qat); | |
57 SYMBOL (Qautodetect); | |
58 SYMBOL (Qbad_variable); | |
59 SYMBOL (Qbefore); | |
1983 | 60 SYMBOL (Qbigfloat); |
442 | 61 SYMBOL (Qbinary); |
62 SYMBOL (Qbitmap); | |
63 SYMBOL (Qboolean); | |
64 SYMBOL_KEYWORD (Q_border); | |
65 SYMBOL (Qbottom); | |
66 SYMBOL (Qbottom_margin); | |
67 SYMBOL (Qbuffer); | |
1318 | 68 SYMBOL (Qbuffers); |
442 | 69 SYMBOL (Qbuilt_in); |
70 SYMBOL (Qbutton); | |
71 SYMBOL_KEYWORD (Q_buttons); | |
72 SYMBOL_KEYWORD (Q_callback); | |
73 SYMBOL_KEYWORD (Q_callback_ex); | |
74 SYMBOL (Qcancel); | |
75 SYMBOL (Qcategory); | |
3439 | 76 SYMBOL (Qccl_program); |
442 | 77 SYMBOL (Qcenter); |
771 | 78 SYMBOL (Qchain); |
1333 | 79 SYMBOL (Qchange); |
442 | 80 SYMBOL (Qchannel); |
81 SYMBOL (Qchar); | |
82 SYMBOL (Qcharacter); | |
83 SYMBOL (Qchars); | |
771 | 84 SYMBOL (Qcode_page); |
85 SYMBOL (Qcoding_system); | |
4995
8431b52e43b1
Move the various map* functions to C; add #'map-into.
Aidan Kehoe <kehoea@parhasard.net>
parents:
4691
diff
changeset
|
86 SYMBOL (Qcoerce); |
442 | 87 SYMBOL (Qcolor); |
88 SYMBOL (Qcolumns); | |
89 SYMBOL (Qcommand); | |
90 SYMBOL_KEYWORD (Q_config); | |
91 SYMBOL (Qconsole); | |
771 | 92 SYMBOL (Qcontrol_1); |
442 | 93 SYMBOL (Qcopies); |
1927 | 94 SYMBOL_MODULE_API (Qcritical); |
442 | 95 SYMBOL (Qctext); |
771 | 96 SYMBOL (Qcurrent); |
442 | 97 SYMBOL (Qcursor); |
98 SYMBOL (Qdata); | |
903 | 99 SYMBOL (Qdde); |
442 | 100 SYMBOL (Qdead); |
793 | 101 SYMBOL (Qdebug); |
442 | 102 SYMBOL (Qdefault); |
1927 | 103 SYMBOL_MODULE_API (Qdelete); |
442 | 104 SYMBOL (Qdelq); |
771 | 105 SYMBOL (Qdescription); |
442 | 106 SYMBOL_KEYWORD (Q_descriptor); |
107 SYMBOL (Qdevice); | |
1318 | 108 SYMBOL (Qdevices); |
442 | 109 SYMBOL_KEYWORD (Q_device); |
110 SYMBOL (Qdialog); | |
673 | 111 SYMBOL (Qdirectory); |
442 | 112 SYMBOL (Qdimension); |
113 SYMBOL (Qdisplay); | |
114 SYMBOL (Qdoc_string); | |
771 | 115 SYMBOL (Qdocumentation); |
442 | 116 SYMBOL (Qduplex); |
117 SYMBOL (Qdynarr_overhead); | |
793 | 118 SYMBOL (Qemergency); |
442 | 119 SYMBOL (Qempty); |
3439 | 120 SYMBOL (Qencode_as_utf_8); |
442 | 121 SYMBOL (Qeq); |
122 SYMBOL (Qeql); | |
123 SYMBOL (Qequal); | |
124 SYMBOL (Qeval); | |
853 | 125 SYMBOL (Qevent); |
442 | 126 SYMBOL (Qextents); |
563 | 127 SYMBOL (Qexternal); |
442 | 128 SYMBOL (Qface); |
1318 | 129 SYMBOL (Qfaces); |
442 | 130 SYMBOL (Qfallback); |
131 SYMBOL (Qfile); | |
1632 | 132 SYMBOL_MODULE_API (Qfile_name); |
442 | 133 SYMBOL_KEYWORD (Q_filter); |
3659 | 134 SYMBOL (Qfinal); |
1983 | 135 SYMBOL (Qfixnum); |
136 SYMBOL (Qfloat); | |
442 | 137 SYMBOL (Qfont); |
138 SYMBOL (Qframe); | |
1318 | 139 SYMBOL (Qframes); |
442 | 140 SYMBOL (Qfrom_page); |
4691
3ba90c659d01
Move Qfrom_unicode to general-slots.h, fix the native Win32 build.
Aidan Kehoe <kehoea@parhasard.net>
parents:
4690
diff
changeset
|
141 SYMBOL (Qfrom_unicode); |
442 | 142 SYMBOL (Qfull_assoc); |
143 SYMBOL (Qfuncall); | |
144 SYMBOL (Qfunction); | |
145 SYMBOL (Qgap_overhead); | |
1333 | 146 SYMBOL (Qgarbage_collection); |
442 | 147 SYMBOL (Qgeneric); |
148 SYMBOL (Qgeometry); | |
149 SYMBOL (Qglobal); | |
853 | 150 SYMBOL (Qglyph); |
462 | 151 SYMBOL (Qgtk); |
853 | 152 SYMBOL (Qgui_item); |
442 | 153 SYMBOL (Qgutter); |
154 SYMBOL (Qheight); | |
155 SYMBOL_KEYWORD (Q_height); | |
156 SYMBOL (Qhelp); | |
771 | 157 SYMBOL (Qhigh); |
442 | 158 SYMBOL (Qhighlight); |
159 SYMBOL (Qhorizontal); | |
160 SYMBOL (Qicon); | |
161 SYMBOL (Qid); | |
162 SYMBOL (Qignore); | |
3659 | 163 SYMBOL (Qinitial); |
442 | 164 SYMBOL (Qimage); |
165 SYMBOL_KEYWORD (Q_image); | |
166 SYMBOL_KEYWORD (Q_included); | |
167 SYMBOL (Qinfo); | |
168 SYMBOL (Qinherit); | |
169 SYMBOL_KEYWORD (Q_initial_focus); | |
170 SYMBOL (Qinteger); | |
171 SYMBOL (Qinternal); | |
172 SYMBOL_KEYWORD (Q_items); | |
173 SYMBOL_KEYWORD (Q_justify); | |
863 | 174 SYMBOL_KEYWORD (Q_vertically_justify); |
175 SYMBOL_KEYWORD (Q_horizontally_justify); | |
442 | 176 SYMBOL (Qkey); |
177 SYMBOL (Qkey_assoc); | |
2842 | 178 SYMBOL (Qkey_mapping); |
442 | 179 SYMBOL_KEYWORD (Q_key_sequence); |
180 SYMBOL (Qkeyboard); | |
181 SYMBOL (Qkeymap); | |
182 SYMBOL_KEYWORD (Q_keys); | |
183 SYMBOL_KEYWORD (Q_label); | |
184 SYMBOL (Qlandscape); | |
185 SYMBOL (Qlast_command); | |
186 SYMBOL (Qleft); | |
187 SYMBOL (Qleft_margin); | |
188 SYMBOL (Qlet); | |
771 | 189 SYMBOL (Qlevel); |
442 | 190 SYMBOL (Qlist); |
771 | 191 SYMBOL (Qlittle_endian); |
192 SYMBOL (Qlocale); | |
193 SYMBOL (Qlow); | |
442 | 194 SYMBOL (Qmagic); |
195 SYMBOL (Qmalloc_overhead); | |
196 SYMBOL_KEYWORD (Q_margin_width); | |
197 SYMBOL (Qmarkers); | |
198 SYMBOL (Qmax); | |
199 SYMBOL (Qmemory); | |
200 SYMBOL (Qmenubar); | |
201 SYMBOL (Qmessage); | |
202 SYMBOL_GENERAL (Qminus, "-"); | |
203 SYMBOL (Qmodifiers); | |
204 SYMBOL (Qmotion); | |
205 SYMBOL (Qmsprinter); | |
206 SYMBOL (Qmswindows); | |
207 SYMBOL (Qname); | |
1632 | 208 SYMBOL_MODULE_API (Qnative); |
442 | 209 SYMBOL (Qnatnum); |
210 SYMBOL (Qno); | |
211 SYMBOL (Qnone); | |
212 SYMBOL (Qnot); | |
213 SYMBOL (Qnothing); | |
1632 | 214 SYMBOL_MODULE_API (Qnotice); |
442 | 215 SYMBOL (Qobject); |
216 SYMBOL (Qok); | |
217 SYMBOL (Qold_assoc); | |
218 SYMBOL (Qold_delete); | |
219 SYMBOL (Qold_delq); | |
220 SYMBOL (Qold_rassoc); | |
221 SYMBOL (Qold_rassq); | |
222 SYMBOL (Qonly); | |
223 SYMBOL (Qor); | |
224 SYMBOL (Qorientation); | |
225 SYMBOL_KEYWORD (Q_orientation); | |
226 SYMBOL (Qother); | |
227 SYMBOL (Qpage_setup); | |
510 | 228 SYMBOL (Qpages); |
442 | 229 SYMBOL (Qpeer); |
230 SYMBOL (Qpointer); | |
231 SYMBOL (Qpopup); | |
232 SYMBOL (Qportrait); | |
233 SYMBOL (Qprepend); | |
234 SYMBOL (Qprint); | |
235 SYMBOL (Qprinter); | |
236 SYMBOL_KEYWORD (Q_printer_settings); | |
237 SYMBOL (Qprocess); | |
238 SYMBOL_KEYWORD (Q_properties); | |
239 SYMBOL (Qprovide); | |
4690
257b468bf2ca
Move the #'query-coding-region implementation to C.
Aidan Kehoe <kehoea@parhasard.net>
parents:
3767
diff
changeset
|
240 SYMBOL (Qquery_coding_clear_highlights); |
257b468bf2ca
Move the #'query-coding-region implementation to C.
Aidan Kehoe <kehoea@parhasard.net>
parents:
3767
diff
changeset
|
241 SYMBOL (Qquery_coding_warning_face); |
442 | 242 SYMBOL (Qquestion); |
243 SYMBOL_KEYWORD (Q_question); | |
244 SYMBOL (Qradio); | |
245 SYMBOL (Qrassoc); | |
246 SYMBOL (Qrassq); | |
1983 | 247 SYMBOL (Qratio); |
1318 | 248 SYMBOL (Qredisplay); |
442 | 249 SYMBOL (Qremove_all); |
250 SYMBOL (Qrequire); | |
251 SYMBOL (Qresource); | |
252 SYMBOL (Qretry); | |
253 SYMBOL (Qreturn); | |
254 SYMBOL (Qreverse); | |
255 SYMBOL (Qright); | |
256 SYMBOL (Qright_margin); | |
1927 | 257 SYMBOL_MODULE_API (Qsearch); |
442 | 258 SYMBOL (Qselected); |
259 SYMBOL_KEYWORD (Q_selected); | |
510 | 260 SYMBOL (Qselection); |
442 | 261 SYMBOL (Qset_glyph_image); |
262 SYMBOL (Qsignal); | |
1927 | 263 SYMBOL_MODULE_API (Qsimple); |
442 | 264 SYMBOL (Qsize); |
563 | 265 SYMBOL (Qsound); |
442 | 266 SYMBOL (Qspace); |
267 SYMBOL (Qspecifier); | |
268 SYMBOL (Qstandard); | |
269 SYMBOL (Qstream); | |
270 SYMBOL (Qstring); | |
271 SYMBOL_KEYWORD (Q_style); | |
272 SYMBOL_KEYWORD (Q_suffix); | |
771 | 273 SYMBOL (Qsubtype); |
4690
257b468bf2ca
Move the #'query-coding-region implementation to C.
Aidan Kehoe <kehoea@parhasard.net>
parents:
3767
diff
changeset
|
274 SYMBOL (Qsucceeded); |
442 | 275 SYMBOL (Qsymbol); |
276 SYMBOL (Qsyntax); | |
771 | 277 SYMBOL (Qsystem_default); |
442 | 278 SYMBOL (Qterminal); |
279 SYMBOL (Qtest); | |
280 SYMBOL (Qtext); | |
281 SYMBOL_KEYWORD (Q_text); | |
282 SYMBOL (Qthis_command); | |
283 SYMBOL (Qtimeout); | |
284 SYMBOL (Qtimestamp); | |
285 SYMBOL_KEYWORD (Q_title); | |
286 SYMBOL (Qto_page); | |
287 SYMBOL (Qtoggle); | |
288 SYMBOL (Qtoolbar); | |
289 SYMBOL (Qtop); | |
290 SYMBOL (Qtop_margin); | |
291 SYMBOL (Qtty); | |
292 SYMBOL (Qtype); | |
293 SYMBOL (Qundecided); | |
294 SYMBOL (Qundefined); | |
4690
257b468bf2ca
Move the #'query-coding-region implementation to C.
Aidan Kehoe <kehoea@parhasard.net>
parents:
3767
diff
changeset
|
295 SYMBOL (Qunencodable); |
257b468bf2ca
Move the #'query-coding-region implementation to C.
Aidan Kehoe <kehoea@parhasard.net>
parents:
3767
diff
changeset
|
296 SYMBOL (Qinvalid_sequence); |
442 | 297 SYMBOL (Qunimplemented); |
3659 | 298 SYMBOL (Qunicode_registries); |
3767 | 299 SYMBOL (Qunicode_type); |
771 | 300 SYMBOL (Quser_default); |
442 | 301 SYMBOL_KEYWORD (Q_value); |
302 SYMBOL (Qvalue_assoc); | |
303 SYMBOL (Qvertical); | |
304 SYMBOL (Qwarning); | |
305 SYMBOL (Qwidget); | |
306 SYMBOL (Qwidth); | |
307 SYMBOL_KEYWORD (Q_width); | |
308 SYMBOL (Qwindow); | |
1318 | 309 SYMBOL (Qwindows); |
310 SYMBOL (Qwindow_id); | |
442 | 311 SYMBOL (Qwindow_system); |
312 SYMBOL (Qx); | |
313 SYMBOL (Qy); | |
314 SYMBOL (Qyes); |