4 ms·
I am amazed that people say Lisp is about macros. I think it's about being homoiconic. You can make some ugly form of macros in ANY language. Homoiconic-ness is
by middayc 16y ago
I am amazed that people say Lisp is about macros. I think it's about being homoiconic. You can make some ugly form of macros in ANY language. Homoiconic-ness is what makes you want to make macros with Lisp. But it is much more than just about macros. Language REBOL is for example fully homoiconic.
>> a: [ 300 3 ]
>> insert a 'add
>> probe a
[ add 1 2 ]
>> print first a
add
>> do first a 100 1
== 101
>> do a
== 303
>> f: func [] a
>> f
== 3
>> change second :f 'subtract
>> f
== 297
all code is data (blocks of words and values).
From * Io * example below I would say it's a little different. It's more like it has a runtime api to change/generate it's runtime. I think SmallTalk has something similar to this.
* Factor * has compile time macros. At runtime it has quotations, which are blocks of code (separate from it's other data strucures I think, but don't shoot me if I'm wrong) that can be modified and executed by your code with few specific words like curry and compose. This means you have a little less freedom than in rebol where block of code is in no way different than a block of data. What is awesome about factor is that it also compiles quotations at runtime.
Otherwise Factor is very very cool, and I envy some runtime features of Io a lot.
And Python has as little to do with lisp as Visual Basic. Python is the world's best dynamic Imperative lang IMHO :)
- draegtun 16y agoFrom Io example below I would say it's a little different. It's more like it has a runtime api to change/generate it's runtime. I think SmallTalk has something similar to this. In Io, all code is data. Below is an example of changing a functions behaviour (from addition to subtraction): Io> plus := block (a, b, a + b) ==> method(a, b, a + b ) Io> plus call (1, 2) ==> 3 Io> plus message next setName ("-") ==> -(b) Io> plus ==> method(a, b, a - b ) Io> plus call (1, 2) ==> -1 ref: Io Has A Very Clean Mirror (WayBackMachine copy) - http://web.archive.org/web/20080212010904/http://hackety.org/2008/01/05/ioHasAVeryCleanMirror.html http://web.archive.org/web/20080212010904/http://hackety.org...
- middayc 16y agoVery cool! There are few properties about concurrency, coroutines, embed-ability, and I suppose nice process of making bindings that I value really a lot and Io HAS. Looking at your example, I will definitely look again at Io. Thanks!