3 ms·
I played with it a bit, it's homoiconic, has macros, and papers over the difference between Python statements and expressions (so that everything is expressions
by greenshackle2 7y ago
I played with it a bit, it's homoiconic, has macros, and papers over the difference between Python statements and expressions (so that everything is expressions).
Seems pretty neat, if you ask me.
- fouric 7y agoDoes Hy add its own "symbol" datatype, or use something in the standard library?
- greenshackle2 7y agoOwn symbol type => 'foo HySymbol(u'foo') Assignment and conditionals are expressions, however assignment returns None. => (setv bar (setv foo (if True True False))) => (type bar) <type 'NoneType'> Quoted expressions evaluate to Hy AST. => '(+ 1 2 3) HyExpression([ HySymbol(u'+'), HyInteger(1L), HyInteger(2L), HyInteger(3L)] ) So it's kind of a frontend for the Python compiler, it goes: Hy AST -> Python AST -> Python bytecode
- kazinator 7y agoUsers of Hy who don't know Lisp deserve to be informed that in an actual Lisp, it goes more like this: => 'foo foo (or, at worst FOO rather than foo). => '(+ 1 2 3) (1 2 3)