Sunday, April 1, 2012

Xonses

I think I finally had the breakthrough regarding named parameters and conses: Xonses.

In short:

(open-file "README" :mode "rw" :create-if-not-exists #t)
===
{ :mode "rw" :create-if-not-exists #t :car "open-file" :cdr { :car "README" :cdr {} } }

A bit more here on the klisp group, and I'll keep you posted here, of course.

2 comments:

John Shutt said...

I did think about the named-parameter thing (on request) a while back, but the bottom line for me was that name-to-value mappings are the province of a different data type, environment. Each Kernel primitive structured type has its own very distinct function, and forming tree structures isn't what environments are there for. I'd started a Lisp-variant language, a sort of altlang in which McCarthy had used environments as his basic data structure instead of pairs. Figuring it would have a catchy name just as LISP does, I supposed it was "Processing SYmbols" --- PSY. But the very powerful concept of generalized definiend becomes rather confusing when the two distinct data types involved (pairs and environments, in their very different Kernel roles) are actually the same type. So I tabled the idea.

Anonymous said...

This is like a proper realisation of some of that half-baked note I wrote: http://www.hxa.name/notes/note-hxa7241-20110515T0907Z.html . . . good!