[elixir-core:6394] Re: Proposal: Introduce `use GenServer, strict: true`

2016-09-23 Thread OvermindDL1
There is a library that simplifies the process of making GenServers: 
 https://hex.pm/packages/exactor
It in fact has such a 'strict' mode similar to this, for showing prior 
design.

You could also do it yourself as a user, don't use GenServer, instead 
'implement' GenServer, I.E.
```elixir
@behaviour GenServer
```
Then at least Dialyzer will yell at you if not everything is implemented.

I, personally, would like a strict mode, however I'm unsure of just how it 
should be done.  Your changes are good but I'd probably also add an 
after_compile hook to walk the module AST (not hard to do, but it is erlang 
AST at that point, not elixir) and verify the functions exist in addition 
to your changes.  Make a `defmodule_GenServer` macro would be easier 
though, and that could be done easily as a library.



On Friday, September 23, 2016 at 1:26:46 PM UTC-6, alco wrote:
>
> Hi,
>
> We all love the ability to `use GenServer` in order to provide default 
> stubs for callback functions, saving us time and effort of writing the same 
> boilerplate over and over again.
>
> However, I'm sure many of you have also been bitten by this very feature 
> where you made a typo in the signature of init/1 or handle_info/2 and was 
> left scratching your head wondering why the gen server's state looks so 
> weird or whether it receives any messages sent to it.
>
> I'd like to propose an addition that will make the default stubs stricter 
> in terms of handling unexpected input. The idea is basically adding the 
> `strict` option to the `use GenServer` call. When that option is supplied 
> with value `true`, the following changes will take effect:
>
>   1. There will be no default implementation of init/1. If the user 
> forgets to implement it or implements it incorrectly by supplying a 
> different number of arguments, the compiler will warn about the missing 
> init/1 implementation.
>
>   2. The default implementation of handle_info/1 will exit on any incoming 
> message, in the same way handle_cast/2 and handle_call/3 already do.
>
> The change will be backwards-compatible if we make `strict: false` the 
> default. However, we should mention in the docs that calling `use 
> GenServer, strict: true` is the recommended way for any serious purpose and 
> that `use GenServer` should be reserved for playground or throw-away code.
>
> Here's a proof of concept – 
> https://github.com/elixir-lang/elixir/compare/master...alco:alco/strict-gen-server
>
> Best regards,
> Alex
>

-- 
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/21309273-bf4f-47c7-a4d3-f480df39a822%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[elixir-core:6392] Proposal: Introduce `use GenServer, strict: true`

2016-09-23 Thread Alexei Sholik
Hi,

We all love the ability to `use GenServer` in order to provide default
stubs for callback functions, saving us time and effort of writing the same
boilerplate over and over again.

However, I'm sure many of you have also been bitten by this very feature
where you made a typo in the signature of init/1 or handle_info/2 and was
left scratching your head wondering why the gen server's state looks so
weird or whether it receives any messages sent to it.

I'd like to propose an addition that will make the default stubs stricter
in terms of handling unexpected input. The idea is basically adding the
`strict` option to the `use GenServer` call. When that option is supplied
with value `true`, the following changes will take effect:

  1. There will be no default implementation of init/1. If the user forgets
to implement it or implements it incorrectly by supplying a different
number of arguments, the compiler will warn about the missing init/1
implementation.

  2. The default implementation of handle_info/1 will exit on any incoming
message, in the same way handle_cast/2 and handle_call/3 already do.

The change will be backwards-compatible if we make `strict: false` the
default. However, we should mention in the docs that calling `use
GenServer, strict: true` is the recommended way for any serious purpose and
that `use GenServer` should be reserved for playground or throw-away code.

Here's a proof of concept –
https://github.com/elixir-lang/elixir/compare/master...alco:alco/strict-gen-server

Best regards,
Alex

-- 
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/CAAPY6eOSggAn6T3k3E0crKx1H381XUdrccw7KTZhqA9iod6jhA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [elixir-core:6391] Re: Deprecate 'single quotes for char lists'

2016-09-23 Thread Chris Keele
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



-- 
Chris Keele
Web Developer

On September 23, 2016 at 11:08:47 AM, Peter Hamilton (
peterghamil...@gmail.com) wrote:

We could also reclaim ' as a macro quote syntax. Just a thought.

On Fri, Sep 23, 2016 at 10:40 AM OvermindDL1  wrote:

> Hmm, I quite like that, I wonder how `~[foobar]` would work too...
>
>
> On Friday, September 23, 2016 at 11:17:09 AM UTC-6, Chris Keele wrote:
>>
>> 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+unsubscr...@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
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>
--
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-core+unsubscr...@googlegroups.com.
To view this discussion on the web visit
https://groups.google.com/d/msgid/elixir-lang-core/CAOMhEnxdEaHsb%3DnSj7tqw03gz1q5KmJxyHKmSwoyG9OZHPSCww%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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/elixir-lang-core/CAOtzO5Jdp-2GsxnSfkbGkoLP8MRmX5%3DX1DhKe_GfNqBnbbaPZQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [elixir-core:6390] Re: Deprecate 'single quotes for char lists'

2016-09-23 Thread Peter Hamilton
We could also reclaim ' as a macro quote syntax. Just a thought.

On Fri, Sep 23, 2016 at 10:40 AM OvermindDL1  wrote:

> Hmm, I quite like that, I wonder how `~[foobar]` would work too...
>
>
> On Friday, September 23, 2016 at 11:17:09 AM UTC-6, Chris Keele wrote:
>>
>> 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+unsubscr...@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
> 
> .
> 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/CAOMhEnxdEaHsb%3DnSj7tqw03gz1q5KmJxyHKmSwoyG9OZHPSCww%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [elixir-core:6388] Re: Deprecate 'single quotes for char lists'

2016-09-23 Thread Louis Pilfold
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

On 23 Sep 2016 18:17, "Chris Keele"  wrote:

> 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+unsubscr...@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
> 
> .
> 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/CAM-pwt7jZu3WoWTBM%2BDQrrjDwy0Mb2i9DNcVauhakYbh2CMHfg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


[elixir-core:6388] Re: Deprecate 'single quotes for char lists'

2016-09-23 Thread Chris Keele
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+unsubscr...@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.
For more options, visit https://groups.google.com/d/optout.


[elixir-core:6386] Re: Deprecate 'single quotes for char lists'

2016-09-23 Thread Tallak Tveide
You have my vote.

Never used single tick lists much, and they were confusing to me, much due 
to baggage from Ruby/Perl where they are all strings. Making the syntax 
more explicit makes sense.

Tallak

-- 
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/892922fb-9790-4b4e-8b68-36d340ffc05c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [elixir-core:6384] Re: Deprecate 'single quotes for char lists'

2016-09-23 Thread Drew Olson
This change sounds great, I am very much in favor of it.

On Fri, Sep 23, 2016 at 10:43 AM, Parker Selbert 
wrote:

> Ever since getting involved in Elixir I have been relieved that there
> isn't any debate between ' and ", or remembering which supports
> interpolation. Learning the distinction between binaries and charlists is
> important when it comes to interfacing with Erlang modules, but that is
> something you do after you've learned the basic syntax of Elixir.
>
> Writing ~c"mycharlist" is precisely as verbose as <> would be in
> Erlang, but much less common in day to day elixir.
>
> I'm fully in favor of the change!
>
> — Parker
>
>
> On Fri, Sep 23, 2016, at 10:28 AM, Onorio Catenacci wrote:
>
> This is a great point José i. e. reading code vs. writing code.
>
> When I'm writing code I never expect ' to behave the same as ".  I guess
> it's just years of software development that have conditioned me to be
> surprised if they're interchangeable in a language.
>
> But when reading code it can be easy to conflate one with the other
> because there's not a lot of psychological distance between ' and " (and
> heaven help us with languages that use ` as well).  So I think from the
> standpoint of making the code less error-prone under maintenance there's a
> good argument to be made for forcing people to use ~c.  It will make the
> distinction more obvious for those reading the code later on.  Things like
> this and slashed zeros in programming fonts are small things but they can
> make a lot of difference to maintenance developers.
>
> oc
>
>
> On Thursday, September 22, 2016 at 3:13:12 PM UTC-4, José Valim wrote:
>
> Single quotes will become a syntax error in Elixir 2.0.
>
> We need to consider two scenarios here: reading code and writing code.
>
> I believe that when someone reads ~c"" for the first time compared to '',
> the sigil version will be more foreign, while the single quotes is more
> likely to be assumed to be *something*. I am not sure one experience is
> necessarily better than the other.
>
> However, when it comes to writing, I believe the ~c"" version will be less
> confusing. There is very little chance someone will write ~c"" meaning a
> string by mistake. Specially if single quotes raise a syntax error in the
> future. And they are both learnable syntaxes, you need to learn what they
> mean.
>
> For those who are skeptical because they use single quotes extensively, I
> have one suggestion: try a change in your project where you replace single
> quotes by the sigil, give it a week and let us know how it goes. I have
> done it in a couple of my projects already and I was pleased with the
> results.
>
> Thanks everyone for the feedback so far!
>
>
> --
>
>
>
> *José Valim*
>
> www.plataformatec.com.br
> Skype: jv.ptec
> Founder and Director of R
>
>
>
>
> --
> 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/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 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/1474645407.795782.735004081.047484B9%40webmail.
> messagingengine.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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/elixir-lang-core/CAN3B1jcki68FrM4ghc4Fb5%2B6kHyhHNtvBU-hDETcPSao3d_kQw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [elixir-core:6383] Re: Deprecate 'single quotes for char lists'

2016-09-23 Thread Parker Selbert
Ever since getting involved in Elixir I have been relieved that there
isn't any debate between ' and ", or remembering which supports
interpolation. Learning the distinction between binaries and charlists
is important when it comes to interfacing with Erlang modules, but that
is something you do after you've learned the basic syntax of Elixir.

Writing ~c"mycharlist" is precisely as verbose as <> would be
in Erlang, but much less common in day to day elixir.

I'm fully in favor of the change!

— Parker


On Fri, Sep 23, 2016, at 10:28 AM, Onorio Catenacci wrote:
> This is a great point José i. e. reading code vs. writing code.
>
> When I'm writing code I never expect ' to behave the same as ".  I
> guess it's just years of software development that have conditioned me
> to be surprised if they're interchangeable in a language.
>
> But when reading code it can be easy to conflate one with the other
> because there's not a lot of psychological distance between ' and "
> (and heaven help us with languages that use ` as well).  So I think
> from the standpoint of making the code less error-prone under
> maintenance there's a good argument to be made for forcing people to
> use ~c.  It will make the distinction more obvious for those reading
> the code later on.  Things like this and slashed zeros in programming
> fonts are small things but they can make a lot of difference to
> maintenance developers.
>
> oc
>
>
> On Thursday, September 22, 2016 at 3:13:12 PM UTC-4, José Valim wrote:
>> Single quotes will become a syntax error in Elixir 2.0.
>>
>> We need to consider two scenarios here: reading code and
>> writing code.
>>
>> I believe that when someone reads ~c"" for the first time compared to
>> '', the sigil version will be more foreign, while the single quotes
>> is more likely to be assumed to be *something*. I am not sure one
>> experience is necessarily better than the other.
>>
>> However, when it comes to writing, I believe the ~c"" version will be
>> less confusing. There is very little chance someone will write ~c""
>> meaning a string by mistake. Specially if single quotes raise a
>> syntax error in the future. And they are both learnable syntaxes, you
>> need to learn what they mean.
>>
>> For those who are skeptical because they use single quotes
>> extensively, I have one suggestion: try a change in your project
>> where you replace single quotes by the sigil, give it a week and let
>> us know how it goes. I have done it in a couple of my projects
>> already and I was pleased with the results.
>>
>> Thanks everyone for the feedback so far!
>>
>>
>> --
>>
>>
>>
>> *José Valim*
>>
>> www.plataformatec.com.br[1]
>> Skype: jv.ptec
>> Founder and Director of R
>>
>>
>>
>
> --
>  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/c13d91bb-dbd7-44de-a7b3-94479648906c%40googlegroups.com[2].
>  For more options, visit https://groups.google.com/d/optout.


Links:

  1. http://www.plataformatec.com.br/
  2. 
https://groups.google.com/d/msgid/elixir-lang-core/c13d91bb-dbd7-44de-a7b3-94479648906c%40googlegroups.com?utm_medium=email_source=footer

-- 
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/1474645407.795782.735004081.047484B9%40webmail.messagingengine.com.
For more options, visit https://groups.google.com/d/optout.


[elixir-core:6383] Re: Deprecate 'single quotes for char lists'

2016-09-23 Thread Onorio Catenacci
This is a great point José i. e. reading code vs. writing code.

When I'm writing code I never expect ' to behave the same as ".  I guess 
it's just years of software development that have conditioned me to be 
surprised if they're interchangeable in a language.

But when reading code it can be easy to conflate one with the other because 
there's not a lot of psychological distance between ' and " (and heaven 
help us with languages that use ` as well).  So I think from the standpoint 
of making the code less error-prone under maintenance there's a good 
argument to be made for forcing people to use ~c.  It will make the 
distinction more obvious for those reading the code later on.  Things like 
this and slashed zeros in programming fonts are small things but they can 
make a lot of difference to maintenance developers. 

oc


On Thursday, September 22, 2016 at 3:13:12 PM UTC-4, José Valim wrote:
>
> Single quotes will become a syntax error in Elixir 2.0.
>
> We need to consider two scenarios here: reading code and writing code.
>
> I believe that when someone reads ~c"" for the first time compared to '', 
> the sigil version will be more foreign, while the single quotes is more 
> likely to be assumed to be *something*. I am not sure one experience is 
> necessarily better than the other.
>
> However, when it comes to writing, I believe the ~c"" version will be less 
> confusing. There is very little chance someone will write ~c"" meaning a 
> string by mistake. Specially if single quotes raise a syntax error in the 
> future. And they are both learnable syntaxes, you need to learn what they 
> mean.
>
> For those who are skeptical because they use single quotes extensively, I 
> have one suggestion: try a change in your project where you replace single 
> quotes by the sigil, give it a week and let us know how it goes. I have 
> done it in a couple of my projects already and I was pleased with the 
> results.
>
> Thanks everyone for the feedback so far!
>
>
> -- 
>
>
> *José Valim*
> www.plataformatec.com.br
> Skype: jv.ptec
> Founder and Director of R
>
>

-- 
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/c13d91bb-dbd7-44de-a7b3-94479648906c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [elixir-core:6380] Re: Deprecate 'single quotes for char lists'

2016-09-23 Thread eksperimental
Jose,
I will be good to hear what other major syntax changes are expected to happen 
in 2.0
Or any other changes.
thank you,

On Fri, 23 Sep 2016 06:40:02 -0700 (PDT)
Bagu Alexandru Bogdan  wrote:

> As new elixir developer I like single quotes, you can find them in many 
> languages like Java, C++ and they are like in elixir. For example I've used 
> them to call :httpc from erlang. 
> If you do this you will break backward compatibility, you will split elixir 
> into parts < version2.0 and >version2.0 like AngularJS do with <1.5 and 
> 2.0. 
> 
> 
> 
> On Thursday, 22 September 2016 20:04:07 UTC+3, José Valim 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
> >
> > Thoughts?
> >
> > *José Valim*
> > www.plataformatec.com.br
> > Skype: jv.ptec
> > Founder and Director of R
> >  
> 

-- 
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/20160923210603.67c79cf8.eksperimental%40autistici.org.
For more options, visit https://groups.google.com/d/optout.


Re: [elixir-core:6378] Re: Deprecate 'single quotes for char lists'

2016-09-23 Thread Pedro Medeiros
I liked the proposal overall single quotes is confusing to explain to
newbies and replace all I have for sigils is easy enough. But all single
quotes on 2.0 will be syntax error? even single char String, this is not a
good time to implements something similar to other languages where single
quotes represents a single char not a String.

On Thu, Sep 22, 2016 at 11:04 PM, Allen Madsen 
wrote:

> +1 from me. When I teach people Elixir, I skip over char lists. By the
> time they need to use them, they're typically at the point that
> they're mentally able to understand them without being overloaded.
> Allen Madsen
> http://www.allenmadsen.com
>
>
> On Thu, Sep 22, 2016 at 3:13 PM, José Valim
>  wrote:
> > Single quotes will become a syntax error in Elixir 2.0.
> >
> > We need to consider two scenarios here: reading code and writing code.
> >
> > I believe that when someone reads ~c"" for the first time compared to '',
> > the sigil version will be more foreign, while the single quotes is more
> > likely to be assumed to be *something*. I am not sure one experience is
> > necessarily better than the other.
> >
> > However, when it comes to writing, I believe the ~c"" version will be
> less
> > confusing. There is very little chance someone will write ~c"" meaning a
> > string by mistake. Specially if single quotes raise a syntax error in the
> > future. And they are both learnable syntaxes, you need to learn what they
> > mean.
> >
> > For those who are skeptical because they use single quotes extensively, I
> > have one suggestion: try a change in your project where you replace
> single
> > quotes by the sigil, give it a week and let us know how it goes. I have
> done
> > it in a couple of my projects already and I was pleased with the results.
> >
> > Thanks everyone for the feedback so far!
> >
> >
> > --
> >
> >
> > José Valim
> > www.plataformatec.com.br
> > Skype: jv.ptec
> > Founder and Director of R
> >
> > --
> > 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/
> 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 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/CAK-y3Ctc9upBe6xO6iZKVSjnX%
> 3DbvhgsNc%3D1HfPb_jQi_dLHL4A%40mail.gmail.com.
> For more options, visit https://groups.google.com/d/optout.
>



-- 
Pedro Henrique de Souza Medeiros
--
Cel: +55 (61) 9197-0993
Email: pedro...@gmail.com

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-core+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/elixir-lang-core/CAJbPmJP-VVtn_e_%2BzoFe7dBSGCPcUn3oTRfq6ahGXFuf40GfDg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.