> 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
>
> Thoughts?
I love it.
--
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+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/elixir-lang-core/CAGnRm4%2BX9q9SAZjj4otmbjXRBhJyvQk0r%3D8pERwtrFcAczGNPQ%40mail.gmail.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 elixir-lang-core+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/elixir-lang-core/CAGnRm4%2BX9q9SAZjj4otmbjXRBhJyvQk0r%3D8pERwtrFcAczGNPQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
I've never had a problem with distinguishing between 'foo' and "foo", even as a newby.But, my question is, when '' is deprecated, will that mean that 'foo' is a syntax error?JimOn Thu, Sep 22, 2016 at 12:03 PM, José Valim <jose....@plataformatec.com.br> wrote:
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 "foo".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
--
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-co...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/elixir-lang-core/CAGnRm4%2BX9q9SAZjj4otmbjXRBhJyvQk0r%3D8pERwtrFcAczGNPQ%40mail.gmail.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 elixir-lang-co...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/elixir-lang-core/CAP1mN_xgfFm2Hueem407k994wAGnCvEupWRkOey8SCJnGPT6Jg%40mail.gmail.com.
To unsubscribe from this group and stop receiving emails from it, send an email to elixir-lang-co...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/elixir-lang-core/CAP1mN_xgfFm2Hueem407k994wAGnCvEupWRkOey8SCJnGPT6Jg%40mail.gmail.com.
--
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-co...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/elixir-lang-core/d7ce41bb-8a0b-4821-a403-4629dc30deee%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
> email to elixir-lang-core+unsubscribe@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/elixir-lang-core/CAGnRm4JNZ3x9ELz7NQaTNjp_wdMonv0%2BF2H4_Td%2BiGyLjbkHeg%40mail.gmail.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 view this discussion on the web visit https://groups.google.com/d/msgid/elixir-lang-core/CAK-y3Ctc9upBe6xO6iZKVSjnX%3DbvhgsNc%3D1HfPb_jQi_dLHL4A%40mail.gmail.com.To unsubscribe from this group and stop receiving emails from it, send an email to elixir-lang-core+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Beautiful is
better than ugly,
Explicit is better than implicit,
Simple is better than complex,
Complex is better than complicated.
The Zen of Python, by Tim Peters
--
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-co...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/elixir-lang-core/20160923210603.67c79cf8.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-co...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/elixir-lang-core/c13d91bb-dbd7-44de-a7b3-94479648906c%40googlegroups.com.
To unsubscribe from this group and stop receiving emails from it, send an email to elixir-lang-core+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/elixir-lang-core/c13d91bb-dbd7-44de-a7b3-94479648906c%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 view this discussion on the web visit https://groups.google.com/d/msgid/elixir-lang-core/1474645407.795782.735004081.047484B9%40webmail.messagingengine.com.To unsubscribe from this group and stop receiving emails from it, send an email to elixir-lang-core+unsubscribe@googlegroups.com.
--
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+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/elixir-lang-core/892922fb-9790-4b4e-8b68-36d340ffc05c%40googlegroups.com.
Hey
I'm +1 so long as single quotes are not then used for strings. I'd much rather avoid disagreements about which style of string syntax to use.
Cheers,
Louis
I have no strong opinions on this–although I do hope that useful ' character will eventually be reclaimed for some purpose. I assume inspecting 'abc' as ~c"abc" implies that the usual newcomer confusion of inspecting an integer list and seeing a 'string' will be a somewhat more searchable problem, which is nice.I did want to observe that, now that I know you can create charlists with sigils, I'll probably never use ' again, because to me ~c[foobar] is much more representative of the underlying data structure. Perhaps this could also be how it inspects, to enforce the 'list' connotation?
--
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+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/elixir-lang-core/22f6bc15-b232-4d04-87db-9dbc950a069c%40googlegroups.com.
--
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-co...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/elixir-lang-core/af9fc876-6b66-460a-95bf-b5e188109c95%40googlegroups.com.
I wonder how
~[foobar]
would work
In Ruby and Elixir I always try to take advantage of the flexible sigil delimiter syntax to hint at types: [
, ]
for arrays, "
for strings, |
for code and multiline strings like SQL, and {
, }
for nonliterals like Regex and Times.
We could also reclaim ’ as a macro quote syntax.
Haha, I thought of that but feared it would cause even more newcomer confusion. ;D
You received this message because you are subscribed to a topic in the Google Groups "elixir-lang-core" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/elixir-lang-core/_pAjPEayLLI/unsubscribe.
To unsubscribe from this group and all its topics, send an email to elixir-lang-co...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/elixir-lang-core/CAOMhEnxdEaHsb%3DnSj7tqw03gz1q5KmJxyHKmSwoyG9OZHPSCww%40mail.gmail.com.
I’m inclined to agree: sigils are just another tool. I think there’s a very happy path for discovery here, too:
It’s the same sort of surprise they get today when they notice a list of integers inspecting oddly, really, but more of a happy accident rather than confusing one.
It’s the same sort of surprise they get today when they notice a list of integers inspecting oddly, really, but more of a happy accident rather than confusing one.
--
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-co...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/elixir-lang-core/20160927154714.5de76f5c.eksperimental%40autistici.org.
For more options, visit https://groups.google.com/d/optout.
I would also like to add that the first step on all of this is to change inspect and the docs to use ~c[] on v1.4. The deprecation of 'foo' should come on v1.6, which is at least one year later. This means we have at least one year to collect feedback on those changes. If we end up believing they are not the way to go, we will simply not deprecate it.
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 "foo".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
Thoughts?
iex(1)> ~c[AGCT]
[65, 67, 71, 84] # this one?
iex(2)> ~c"AGCT"
~c[ACGT] # or this?
'.source.elixir':
'charlist':
'prefix': 'c['
'body': '~c[$1]$2'