comparison lisp/cl-macs.el @ 1123:37bdd24225ef

[xemacs-hg @ 2002-11-27 07:15:02 by ben] bug fixes, profiling debugging improvements configure.in: Check for GCC version and only use -Wpacked in v3. .cvsignore: Add .idb, .ilk for MS Windows VC++. cl-macs.el: Document better. cmdloop.el: Removed. Remove nonworking breakpoint-on-error now that debug-on-error works as documented. help.el: Extract out with-displaying-help-buffer into a more general mechanism. lib-complete.el: Support thunks in find-library-source-path. startup.el: Don't catch errors when noninteractive, because that makes stack traces from stack-trace-on-error useless. .cvsignore: Windows shit. alloc.c: Better redisplay-related assert. elhash.c: Comment change. eval.c: Don't generate large warning strings (e.g. backtraces) when they will be discarded. Implement debug-on-error as documented -- it will enter the debugger and crash when an uncaught signal happens noninteractively and we are --debug. Better redisplay-related asserts. frame-msw.c, frame.c, lisp.h, redisplay.c, scrollbar-gtk.c, scrollbar-x.c, signal.c, sysdep.c: Fix up documentation related to QUIT (which CANNOT garbage-collect under any circumstances), and to redisplay critical sections. lread.c: Add load-ignore-out-of-date-elc-files, load-always-display-messages, load-show-full-path-in-messages for more robust package compilation and debugging. profile.c: Overhaul profile code. Change format to include call count and be extensible for further info. Remove call-count-profile-table. Add set-profiling-info. See related profile.el changes (which SHOULD ABSOLUTELY be in the core! Get rid of xemacs-devel and xemacs-base packages *yesterday*!).
author ben
date Wed, 27 Nov 2002 07:15:36 +0000
parents 79c6ff3eef26
children 01c57eb70ae9
comparison
equal deleted inserted replaced
1122:7abc2b15a990 1123:37bdd24225ef
738 738
739 \(loop for (x y) on plist by #'cddr do ...) 739 \(loop for (x y) on plist by #'cddr do ...)
740 740
741 Destructuring is forgiving in that mismatches in the number of elements on 741 Destructuring is forgiving in that mismatches in the number of elements on
742 either size will be handled gracefully, either by ignoring or initializing 742 either size will be handled gracefully, either by ignoring or initializing
743 to nil. 743 to nil. Destructuring is extremely powerful, and is probably the single
744 most useful feature of `loop'.
745
746 Other useful features of loops are iterating over hash-tables, collecting values into lists, and being able to modify lists in-place as you iterate over them. As an example of the first two,
747
748 \(loop for x being the hash-key in table using (hash-value y)
749 collect (cons x y))
750
751 converts hash-table TABLE to an alist. (What `collect' actually does is
752 push its value onto the end of an internal list and establish this list as
753 the default return value of the loop. See below for more information.)
754
755 An example of in-place modification is
756
757 \(setq foo '(1 3 5))
758 \(loop for x in-ref foo do
759 (setf x (* x x)))
760
761 after which foo will contain '(1 9 25).
744 762
745 If you don't understand how a particular loop clause works, create an 763 If you don't understand how a particular loop clause works, create an
746 example and use `macroexpand-sexp' to expand the macro. 764 example and use `macroexpand-sexp' to expand the macro.
747 765
748 Valid clauses are: 766 Valid clauses are: