News for hackers. Stuff that matters.
Re:Why Lisp macros are cool, a Perl perspective (2005) by tumult on Monday August 31, 2009 @02:12AM (#795512)
I'm not a CL guy so I don't know how defsetf actually works, but I skipped down in that link to where that Lisp macro is, and if defsetf works like he describes (and I don't know if it does), then

    (setf (f1 arg1) arg2)
will cause an error, but

    (setf (sqrt arg1) arg2)
will expand into

    (setf arg1 (* v v))
which, as you can see, is nonsensical in terms of what it looks like he was trying to do.
Re:Why Lisp macros are cool, a Perl perspective (2005) by diiq on Monday August 31, 2009 @10:40AM (#795988)
Yes, as has been pointed out, he is missing a pair of commas (or more correctly, a patch to ensure that v is evaluated once and only once --- right now it is evaluated 0 times, and adding 2 commas would make it eval twice. Using the definition of (square x) is the cleanest way to fix this).