Elixir has a pretty good lisp-inspired macro system. And it's hygienic by default, too.
And Elixir's pattern matching actually makes manipulating the forms even easier.
Elixir has a pretty good lisp-inspired macro system. And it's hygienic by default, too.
And Elixir's pattern matching actually makes manipulating the forms even easier.
To quote, Robert Virding, one of Erlang's creators and the creator of LFE:
I would say that one restriction with the type of macros that elixir has, irrespective of whether we call it homoiconic or not, is that they can only manipulate existing forms in the AST, they can't define new syntactic forms. In elixir this means that you basically work with function calls. There is syntactic support for making the function calls look less like function calls but the macros you define are basically function calls. In Lisp you are free to create completely new syntactic forms. Whether this is a feature of the homoiconicity of Lisp or of Lisp itself is another question as the Lisp syntax is very simple and everything basically has the same structure anyway. Some people say Lisp has no syntax. [2]
[1] http://stackoverflow.com/questions/35060080/erlang-vs-elixir... [2] https://news.ycombinator.com/item?id=7623991
I like Elixir a lot, but I have the luxury of not depending on coding for a living, so I am learning LFE because I like how it is as much a Lisp as it can be when constrained by the BEAM. Truthfully, I could stay away from all of the distributed languages like Erlang, Elixir, LFE, Pony and others, since I don't really have a use for them (yet - looking at ABM Agent-Based Modeling).
But I keep at LFE by trying to duplicate the book 'The Handbook of Neuroevolution Through Erlang'. There are at least a couple of other people who have started it in LFE and the other in Elixir. A good fit for ANNs.
He; I don't have multiple personalities
I was using the singular they: https://en.wikipedia.org/wiki/Singular_they
Till this point I haven't seen anything similar in languages other than Lisp. Maybe Elixir can do this but I lack enough knowledge to judge.
BTW: that does not mean I'm a Lisp zealot, been there but has been away for quite some time.
{:ok, result} = compute_data(some_value, another_value)
If compute_data doesn't return a pair where the first value is :ok, it will throw an error.