( )

Jobs. Ritchie. McCarthy. What’s God up to? When do you think it will be out?

The 40th Anniversary of Lisp was 13 years ago. I remember being mostly relieved that the old man didn’t attend my presentation, as it wasn’t really very good. But I’ll remember McCarthy. I haven’t programmed Lisp on a computer in a decade, but I still think in it. About a week ago, I had a sudden urge to play with it again. Here’s the coolest thing I ever wrote in any language, with comments removed. It’s sort of a y-combinator for a fixed-point of three levels of eval/apply.

(defmacro eclipse::WITH-UNIQUE-NAMES (vars &body body)
  `(let ,(loop for var in vars
	       collect `(,var (make-symbol ,(symbol-name var))))
     ,@body))

(defmacro eclipse::REBINDING (vars &body body)
  (loop for var in vars
	for name = (make-symbol (symbol-name var))
	collect `(,name ,var) into renames
	collect ``(,,var ,,name) into temps
	finally (return `(let ,renames
			   (eclipse::with-unique-names ,vars
				`(let (,,@temps)
				   ,,@body))))))
This entry was posted in Inventing the Future, metaphysics. Bookmark the permalink. Both comments and trackbacks are currently closed.
  • Connect With Us

    Follow Wetmachine on Twitter!

Username
Password

If you do not have an account: Register