3 ms·
Factor is interesting, because it tries to be Lisp in concatentive form. Because of this, it has a lot of interesting and powerful abstractions that make you re
by dkersten 16y ago
Factor is interesting, because it tries to be Lisp in concatentive form. Because of this, it has a lot of interesting and powerful abstractions that make you rely on the order of the stack a lot lot less (as they like to say idiomatic factor doesnt use the stack and Factor has more in common with Lisp than with Forth). Its well worth a try, though its got a pretty steep learning curve.
- gruseom 16y agoWhat's Factor's approach to macros?
- Avshalom 16y agoEDIT: whether anything I say below is actually true, making new syntax is totally supported in Factor both in the language and in the community. http://factor-language.blogspot.com/2009/09/survey-of-domain-specific-languages-in.html http://factor-language.blogspot.com/2009/09/survey-of-domain... pretty much the same as lisp's. MACRO: defines a lisp style macro, http://docs.factorcode.org/content/word-MACRO__colon__%2Cmacros.html http://docs.factorcode.org/content/word-MACRO__colon__%2Cmac... (MACRO:: defines a macro with local variables) SYNTAX: defines a 'parsing word' http://docs.factorcode.org/content/article-parsing-words.html http://docs.factorcode.org/content/article-parsing-words.htm... which I think is basically the same as a lisp Reader Macro Though you don't seem to need macros very often because you tend to pass things around as lambdas, cond for instance is implemented as a normal function.
- dkersten 16y agoOne commonly used parsing word is INFIX: which, as you would expect from the name, allows you to write equations in infix notation rather than the default postfix. Macros work exactly like someone familiar with lisp would expect them to.