4 ms·
Ya, it's not actually a lisp. I can't find the source but José has stated part of the idea was to give you lisp-like metaprogramming with a non-lisp syntax (so
by sodapopcan 3y ago
Ya, it's not actually a lisp. I can't find the source but José has stated part of the idea was to give you lisp-like metaprogramming with a non-lisp syntax (sorry, José, if I have mis-quoted).
Even the regular syntax is sort of lispish, though, if you remove the syntactic sugar. It's all macros and datastructres.
defmodule Foo do
def bar do
"baz"
end
end
is really:
defmodule Foo, do: (def bar, do: "baz")
...which is lispish if you squint the right way.
- zambal 3y agoA bit pedantic I guess, but that still uses some syntactic sugar (optional brackets and keyword syntax). Removing all syntactic sugar would look like this: defmodule(Foo, [{:do, def(:bar, [{:do, "baz"}])}]) Even aliases (like Foo) are also a kind of syntactic sugar for a specific type of atom (Foo is actually the atom :"Elixir.Foo")
- sodapopcan 3y agoHa, ya I meant remove the `do` sugar.