>>18
pardon my ignorance of forth, but does forth even have a macro/procedure distinction?
It doesn't have neither "macros" nor "procedures" in the conventional sense.
It does however have the distinction between normal and IMMEDIATE words, calls to the former are compiled as is, the latter are executed during compilation in the same environment as the core compiler code, i.e. they can compile what they want, read words from the input stream, temporary override any core words (including ": ;") etc.
For example, "
condition IF branch1 ELSE branch2 THEN" is not a core construct, these are defined in pure Forth in terms of BRANCH/CBRANCH (jump and conditional jump), where IF compiles the CBRANCH with dummy address and pushes the address of the address on a special stack; optional ELSE inserts the BRANCH with dummy address, patches the preceding CBRANCH and replaces its operand's address with the address of the BRANCH's operand on the stack. THEN pops the address of the operand (pushed by IF or ELSE) and patches it, thus finalizing the construct.
And of course you can build any "procedure" or "macro" abstraction you want on top of it.
I really wish people didn't get all their info about what lispers are like from paul graham
Well, you
are ignorant of Forth and you
do show unmistakable signs of elitism.
By the way, if perchance you realize that that's wrong, I recommend reading the literate jonesforth system:
http://www.annexia.org/forth
how true
There's this interesting peculiarity: if you're a Lisp elitist, you can squint just right and it would look like increasing power, increasing expressiveness and decreasing built-in syntax gives a "better" language. Automatically.
But when you get to the other end of the rabbit hole, you look back and discover that in terms of expressiveness and openness Lisp is as far behind Forth as Visual Basic is behind Lisp. At the same time you can't but acknowledge that Visual Basic is more useful that Forth for most tasks. This realization makes it somewhat difficult to be a "Forth elitist", as you might imagine, or any language elitist actually.
That's why you don't see lots of Forth weenies preaching about how Forth is da best and how it's unpopular because most of the programmers are too dumb or too set in their ways to understand it.