Subject: Re: need help for a simple macro
From: rpw3@rpw3.org (Rob Warnock)
Date: Thu, 21 Feb 2008 23:42:17 -0600
Newsgroups: comp.lang.lisp
Message-ID: <u6WdnTUwjf0k_SPanZ2dnUVZ_tuonZ2d@speakeasy.net>
Kaz Kylheku  <kkylheku@gmail.com> wrote:
+---------------
| I'd give a different name to the macro version, like CHATTY-PROGN. The
| macro version should handle multiple values from each form, in
| particular the last one. I'd make it like this:
| 
|   (defmacro chatty-progn (&body forms)  ...[trimmed]... )
+---------------

Interesting that you added the multiple values support.
I've had a version of this in my toolbox for some years
*without* the multiple values support, and never missed it:

    (defmacro dbgv ((&optional (where "Some Unknown Location...")) &rest forms)
      `(progn
	 (format t "~&DBGV: @~a:~%" ',where)
	 ,@(loop for form in forms
	     collect `(format t "~s = ~s~%" ',form ,form))))

used like this:

    > (let ((x 3) (y 17))
	(dbgv (let-demo)
	  x
	  y
	  (1+ x)
	  (* 3 (- y 9))
	  (floor y x)))
    DBGV: @LET-DEMO:
    X = 3
    Y = 17
    (1+ X) = 4
    (* 3 (- Y 9)) = 24
    (FLOOR Y X) = 5
    NIL
    > (floor 17 3)

    5
    2
    > 

Oops. Now I have to figure out how to cleanly integrate multiple
values without cluttering up the simple case... (*grumph!*)  ;-}


-Rob

-----
Rob Warnock			<rpw3@rpw3.org>
627 26th Avenue			<URL:http://rpw3.org/>
San Mateo, CA 94403		(650)572-2607