News for hackers. Stuff that matters.
Re:Is Scheme as good as Common Lisp? by vegashacker on Friday August 31, 2007 @12:00PM (#48753)
One example is the magical introduction of special variables. Here's "aif", implemented in PLT Scheme:

 (require (lib "defmacro.ss"))

 (define-macro (aif a b c)
   `(let ((it ,a))
      (if it ,b ,c)))

  (aif (* 10 10) (+ it 1) 'oops) ==> 101
The "aif" form makes it so you don't have to create a temporary variable name first -- the temp var is just assumed to be named "it".

If you're thinking, "whatever, I don't need that" you are wrong. :) Somehow this turns into the most wonderful little line-saver. At my last company, we used it all over the place.

Re:Is Scheme as good as Common Lisp? by abstractbill on Friday August 31, 2007 @12:18PM (#48761)
Yup, I've used aif a lot, but had never got around to implementing it for myself and so hadn't made the connection with variable capture.