At first blush I'm not a fan, I'm not sure that the use of ~c"foo" will be
any less confusing than 'foo' - it will still look like a string, and
behave like a list, but now with a sigil by it which new Elixir programmers
will not remember and will need to look up. I also suspect this means there
will be a great deal of code which needs to be updated to handle this
deprecation as well. Another question I have is what happens to single
quotes? Will they be used for some other purpose once removed? Reserved?
To be honest, I didn't even know about ~c"foo", I've never used it, and
haven't seen it in the wild. If you hadn't just now explained what it was,
I would've had to go look it up. One of the very first things in the Elixir
docs is the discussion of data types, especially string-like ones - if one
doesn't read those docs, the confusion is going to occur regardless of what
syntax is used to express charlists.
To me it seems like a huge change with little to no real benefit. Of
course, that's just my perspective/opinion, maybe the community at large
disagrees with that sentiment.
On Thu, Sep 22, 2016 at 12:03 PM, José Valim <
> Hello everyone,
> I have mentioned a couple times we would start a discussion for
> deprecating 'single quotes as char lists' from the language.
> The use of single quotes to specify something that looks like a string but
> isn't really a string is often a source confusion. This is specially
> frustrating given the expectation brought from other languages where double
> and single quoted strings can be used almost interchangeably.
> We already have a quite decent way of writing char lists, which is by
> using sigils: ~c"foo". For new developers, printing a char list as a
> ~c"foo" will likely give them better clues the type is not the same as
> Of course we should not drive decisions based purely on the getting
> started experience but I believe the sigil approach will be clearer for
> beginner and advanced programmers alike.
> The plan is not to deprecate them now but rather in the long term.
> Something like this:
> 1. Elixir v1.4 will inspect 'abc' as ~c"abc"
> 2. Elixir v1.6 will effectively deprecate 'abc'
> 3. Elixir v2.0 "who knows when" will remove single-quotes
> *José Valim*
> Skype: jv.ptec
> Founder and Director of R&D
> 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/
> For more options, visit https://groups.google.com/d/optout.
You received this message because you are subscribed to the Google Groups
To unsubscribe from this group and stop receiving emails from it, send an email
To view this discussion on the web visit
For more options, visit https://groups.google.com/d/optout.