great, 
just wanted to make sure this was the intented behaviour.
Good to know and remember the are not the same.


On Wed, 1 Jun 2016 09:07:50 +0200
José Valim <jose.va...@plataformatec.com.br> wrote:

> No because interpolation uses the Strint.Chars protocol that defines a
> different behavior for nil while Atom.to_string keeps a literal
> conversion.
> 
> On Wednesday, June 1, 2016, eksperimental
> <eksperimen...@autistici.org> wrote:
> 
> > I came across when writing a macro that created functions after
> > atoms. I had the idead that to convert from atom to string, we could
> > interpolate the atom into the string, or we could use
> > Atom.to_string/1.
> >
> > Interactive Elixir (1.2.4) - press Ctrl+C to exit (type h() ENTER
> > for help) iex(1)> atom = :foo :foo iex(2)> atom |> Atom.to_string
> > "foo"  
> > iex(3)> "#{atom}"  
> > "foo"  
> > iex(4)> atom = :nil  
> > nil  
> > iex(5)> atom |> Atom.to_string  
> > "nil"  
> > iex(6)> "#{atom}"  
> > ""
> >
> >
> > Is this a bug?
> >
> > --
> > 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 elixir-lang-core+unsubscr...@googlegroups.com
> > <javascript:;>. To view this discussion on the web visit
> > https://groups.google.com/d/msgid/elixir-lang-core/20160601065326.4fd4c576.eksperimental%40autistici.org
> > .
> > 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 elixir-lang-core+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/elixir-lang-core/20160602042131.79b0c126.eksperimental%40autistici.org.
For more options, visit https://groups.google.com/d/optout.

Reply via email to