News for hackers. Stuff that matters.
Re:Why Lisp macros are cool, a Perl perspective (2005) by stevelosh on Tuesday December 17, 2019 @01:09PM (#21816553)
This would save me literally thousands of lines of code at my day job:

    (defmacro ?= (symbol-or-symbols expr)
      (let* ((symbols (etypecase symbol-or-symbols
                        (cons symbol-or-symbols)
                        (symbol (list symbol-or-symbols))))
             (tmps (loop :for s :in symbols :collect (gensym (symbol-name s))))
             (err (gensym "ERROR")))
        `(multiple-value-bind (,@tmps ,err) ,expr
           (if (not (null ,err))
             (return ,err)
             (setf (values ,@symbols) (values ,@tmps))))))

There are no comments on this comment yet.