Thiago, thanks for your eye to detail, and I'm glad you see that 
complexity/simplicity balance that is Elixir. Your excitement is great to see 
and I hope it continues. If minor naming of 7 functions/macros is the only 
difference between Elixir and perfection, we are doing an awesome job! (Wait 
until you find out how list of integers are indistinguishable from Erlang 
strings. You might change your judgement on how close we are to perfection, but 
I digress...)

I love Elixir. I earn my living coding Elixir. Please be aware that while it is 
brand new to you, some of us have been dealing with it for 3, 4, even 5 years 
(I'm nearly 4 years, and José, of course, plus others were here ahead of me). 
These names are fairly fundamental. Sure, I can see how the 'def' part of those 
macros could be removed, but to be fair they really do represent a 'definition' 
of those concepts. The 'hd' and 'tl' come straight from our parent language of 
Erlang and are very convenient for those migrating from there (and I tend to 
use the [head | tail] syntax much more often anyway).

You might get better answers than mine concerning the reasons the names are as 
they are, but I don't expect there's going to be support for changing them due 
to aesthetics. There's been a lot of code written based upon them.

Since Elixir is so macro based, I suspect you could in fact perform that 
aliasing you want in your own projects, but I worry that sets you on the path 
into a special dialect of the language. Still, it's your choice to make.

-Greg Vaughn

> On Apr 27, 2017, at 7:25 PM, Thiago Majesk <[email protected]> wrote:
> 
> Hello everyone,
> First of all, I'd like to apologize if this is not the right place for this 
> kind of question, please be patient :)
> 
> I'm finishing my reading through the Getting Started section and I have to 
> say that I'm kinda amazed right now. 
> Elixir feels complex and simple at the same time. I have to take off my hat 
> to this remarkable project. 
> Without further ado... I was wondering about Elixir syntax, and I'd like to 
> know if there is a particular reason why to use some of the bellow notations: 
> 
> defmacro, 
> defmodule, 
> defstructure, 
> defimpl
> defprotocol,
> hd() and tl()
> 
> instead of just
> 
> macro, 
> module, 
> structure, 
> impl,
> protocol,
> head() and tail()
> 
> I know that sometimes I care too much about syntax and code aesthetics, but 
> when I see thoose in particular, I have the impression that perfection was 
> missed by a tiny bit.
> IMHO, the first ones would look a lot more clean and the last two a little 
> bit more verbose but a lot more explicit (don't looking like magic functions).
> Would one gentleman consider change something like this in the future, maybe 
> with somekind of "alias" for compatibility?
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "elixir-lang-core" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to [email protected].
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/elixir-lang-core/ccb62a31-5048-45db-a019-bc1215771713%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

-- 
You received this message because you are subscribed to the Google Groups 
"elixir-lang-core" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/elixir-lang-core/165DA8FA-D810-497A-96F5-CA9C71AF8C3A%40gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to