Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > Lisp > define-modify-m...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 1 of 6 Topic 12455 of 13402
Post > Topic >>

define-modify-macro

by rocco.rossi@[EMAIL PROTECTED] May 10, 2008 at 03:03 AM

I was just reading the chapter on macros in Paul Graham's ANSI Common
Lisp, and I came across the part regarding define-modify-macro. It
explains why a custom definition of incf like the following is no
good:

(defmacro incf* (x feoptional (y 1))
  ' ( setf ,x (+ ,x , y ) ) )

because then things like (incf* (car (push 1 lst))), assuming lst were
initially NIL for instance, would not expand correctly.

Now, that's all fine and well, and I see the point perfectly. But I
was just a little curious about something that the book actually
doesn't explain:

Is define-modify-macro just a shortcut macro that we use as "syntactic
sugar" (and thus implementable somehow with DEFMACRO for example) or
is its presence inevitable because the rest of the macro system is not
powerful enough to encompass the previous situation concerning INCF
and others analogous to it?
 




 6 Posts in Topic:
define-modify-macro
rocco.rossi@[EMAIL PROTEC  2008-05-10 03:03:24 
Re: define-modify-macro
rocco.rossi@[EMAIL PROTEC  2008-05-10 03:28:07 
Re: define-modify-macro
Kent M Pitman <pitman@  2008-05-10 09:34:49 
Re: define-modify-macro
rocco.rossi@[EMAIL PROTEC  2008-05-10 06:53:49 
Re: define-modify-macro
Alan Crowe <alan@[EMAI  2008-05-10 18:28:16 
Re: define-modify-macro
"Alex Mizrahi"   2008-05-11 12:19:49 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Sat Sep 6 23:12:55 CDT 2008.