4 ms·
I agree with spacemanaki. Your article introduces higher order functions, which is a big enough concept to keep those unfamiliar well-entertained without going
by jwhite 15y ago
I agree with spacemanaki. Your article introduces higher order functions, which is a big enough concept to keep those unfamiliar well-entertained without going a step too far and throwing in a not-particularly-useful macro. The last part of the article is an un-illuminating distraction. If I wasn't familiar with CL I would probably be scratching my head and asking why the hell that ugly #' is needed in the first place.
More seriously though, your macro is dangerous as a teaching example because it introduces variable capture (on i and ans) and unintentional repeated evaluation (of list), which are big gaping traps for the unwary.
Also, try passing #'(lambda (a b) (< a b)) as the pred argument to your macro, and see what happens.