( )

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))))))
Be Sociable, Share!
This entry was posted in Inventing the Future, metaphysics. Bookmark the permalink. Post a comment or leave a trackback: Trackback URL.

Post a Comment

There are three ways you can comment:

Your email is never published nor shared. Required fields are marked *

*
*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

What is 9 + 5 ?
Please leave these two fields as-is:
IMPORTANT! To be able to proceed, you need to solve the following simple math (so we know that you are a human) :-)
  • Archives

    • 2012 (32)
    • 2011 (97)
    • 2010 (146)
    • 2009 (239)
    • 2008 (378)
    • 2007 (250)
    • 2006 (228)
    • 2005 (198)
    • 2004 (158)
    • 2003 (19)
Username
Password

If you do not have an account: Register

Username
Password