emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Building Emacs overflowed pure space


From: Richard Stallman
Subject: Re: Building Emacs overflowed pure space
Date: Wed, 19 Jul 2006 17:15:53 -0400

I see no good reason why each expansion of `dolist' should use a
different symbol.  Maybe we can arrange to use one symbol over and
over again.  Does this work?



(defvar dolist-temp-var nil)

(defmacro dolist (spec &rest body)
  "Loop over a list.
Evaluate BODY with VAR bound to each car from LIST, in turn.
Then evaluate RESULT to get return value, default nil.

\(fn (VAR LIST [RESULT]) BODY...)"
  (declare (indent 1) (debug ((symbolp form &optional form) body)))
  (unless dolist-temp-var
    (setq dolist-temp-var (make-symbol "--dolist-temp--")))
  (let ((temp dolist-temp-var))
    `(let ((,temp ,(nth 1 spec))
           ,(car spec))
       (while ,temp
         (setq ,(car spec) (car ,temp))
         (setq ,temp (cdr ,temp))
         ,@body)
       ,@(if (cdr (cdr spec))
             `((setq ,(car spec) nil) ,@(cdr (cdr spec)))))))




reply via email to

[Prev in Thread] Current Thread [Next in Thread]