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

Re: Issue: TAGBODY-CONTENTS (Version 3)



 Is anybody concerned about macros that expand to a tagbody with NIL forms?
If NIL is a statement in a tagbody then they disappear quietly,
especially after a pass by a good compiler.
With the current proposal, though, one will get:
  "ERROR: Multiple appearances of tag NIL."

I don't know what current practice is, if code like this has 
always signalled an error then this is a total non-issue.
If not, it might be noted as a possible conversion cost.

Code like FOO1 will need to be rewritten to splice like in FOO2.
  [sometimes it may not be this easy...]

(defmacro foo1 (&rest args)
  `(do () ((test-fn))
     ,(when (member :bar args) '(do-bar-thing))
     ,(when (member :baz args) '(do-baz-things))
     (do-regular-things)))


(defmacro foo2 (&rest args)
  `(do () ((test-fn))
     ,@(when (member :bar args) '((do-bar-thing)))
     ,@(when (member :baz args) '((do-baz-things)))
     (do-regular-things)))