Re:Three unique features of Lisp in 2010
by silentbicycle on Friday January 28, 2011 @10:15AM
(#2152073)
Not really. The first has to do with how variable scope is managed. The second involves exception handling, and if your language unwinds the stack while looking for a handler, it's usually already too late.
The third has to do with how local variables are managed for functions defined at runtime - while you could rewrite code with macros to pass an implicit closure value array to the function at all points of use, it would be quite a bit less awkward to have it part of the language proper. Heck, it's not that unusual to have C functions that take a void * argument for "userdata"; the function/userdata combination is one way of representing closures when compiling to C.
Re:Three unique features of Lisp in 2010
by spacemanaki on Friday January 28, 2011 @10:32AM
(#2152155)
Yeah I was waiting for someone to call me on this. I thought it might not be possible but wasn't sure. Mostly it was cool to see a "unique features of Lisp" blog post which didn't even mention macros.
I guess in theory you could do it using macros, but if the underlying language lacks certain features you end up with compiler-in-a-macro-style macros. I'm not sure you are really extending the language at that point...
Re:Three unique features of Lisp in 2010
by technomancy on Friday January 28, 2011 @04:51PM
(#2153670)
Elisp does this; it has no language-level lexical scope, but you can get it using the lexical-let macro. From a functionality perspective it works surprisingly well, but if you look at the macroexpansion you'll go blind.
Of course, this would be possible if they had macros!