3 ms·
Julia is not lisp like, and has macros [1]. The way it works is that your code is first interpreted to get the AST that looks like LISP code (`a+bc+1` becomes `
by S4M 12y ago
Julia is not lisp like, and has macros [1]. The way it works is that your code is first interpreted to get the AST that looks like LISP code (`a+bc+1` becomes `+(a,(b,c),1)`) and your macro operates on that. So basically it works like a lisp macro (until you want to create a macro that creates macro, which is something I haven't done but heard about).
http://docs.julialang.org/en/release-0.2/manual/metaprogramming/ http://docs.julialang.org/en/release-0.2/manual/metaprogramm...
- S4M 12y agoCORRECTION: `+(a,*(b,c),1)` is NOT like LISP code. However, Julia helps you to get the head of an expression (in this case, +) and it's args.