Re: [elixir-core:8431] [Proposal] Deprecate unless-else

2019-01-04 Thread Ryan Winchester
> SHOULD NOT DO!
That’s why I had the smiley devil face for that part.

I agree with Chris, it _should_ be left alone, as much as I’d like to think
people using unless/else deserve to have their code broken...


On January 3, 2019 at 4:57:17 PM, eksperimental (eksperimen...@autistici.org)
wrote:

On Fri, 4 Jan 2019 07:54:44 +0700
eksperimental  wrote:

> On Thu, 3 Jan 2019 11:25:13 -0800
> Ryan Winchester  wrote:
> > Have the formatter change it to an if/else , or just leave it for
tools
> > like Credo to yell at you for an unless/else.
>
> This is definitely something the formatter should do.
SHOULD NOT DO!

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


[elixir-core:8431] Re: Proposal: add get_env/2, fetch_env/1 and fetch_env!/1

2019-01-04 Thread thia . mdossantos
Hylke Alons good point, thanks! But this only applies to my proposal for 
System.get_env/3. 

But I think we still need some discussion around System.fetch_env/1 and 
System.fetch_env!. I assume that the use cases for these functions are 
quite common, we usually want to raise an error in case a environment 
variable is missing.

What do you think?

Thanks, 
Thiago

Em terça-feira, 18 de dezembro de 2018 15:03:49 UTC-2, Hylke Alons escreveu:
>
> It has been proposed various times.
>
> Checkout https://github.com/elixir-lang/elixir/pull/7172
>
> On Tuesday, 18 December 2018 17:09:12 UTC+1, thia.md...@gmail.com wrote:
>>
>> Hi,
>>
>> Would be great if we had in the System module functions similar to those 
>> that we have right now in the Application module.
>>
>> `System.get_env/2` could accept a default value similar to 
>> `Application.get_env/3`. I always find myself using System.get_env("VAR") 
>> || "DEFAULT VALUE".
>>
>> And we could have `System.fetch_env/1` and `System.fetch_env!/1`. The 
>> fetch_env!/1 I would use a lot. Normally you want to raise an error if the 
>> variable does not exists and would be great if the already existed an 
>> function to do that. Right we have to use Map.fetch! 
>> `Map.fetch!(System.get_env(), "VAR")` or create our own custom function 
>> that raises an error. I think that as it is a common use case would make 
>> sense to include this functions in the language.
>>
>> What do you guys think?
>>
>> Thanks,
>> Thiago
>>
>

-- 
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/be01fecc-08f6-474b-909e-a0717ce9b874%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [elixir-core:8429] [Proposal] Deprecate unless-else

2019-01-04 Thread José Valim
It does, but it requires a special option to do it, which we are
considering removing because it is not as useful as we thought it would be.
:(


*José Valim*
www.plataformatec.com.br
Skype: jv.ptec
Founder and Director of R


On Fri, Jan 4, 2019 at 10:34 AM Louis Pilfold 
wrote:

> I might be wrong, but I think the formatter already updates the AST in
> some places to fix deprecation warnings.
>
> On Fri, 4 Jan 2019, 00:57 eksperimental, 
> wrote:
>
>> On Fri, 4 Jan 2019 07:54:44 +0700
>> eksperimental  wrote:
>>
>> > On Thu, 3 Jan 2019 11:25:13 -0800
>> > Ryan Winchester  wrote:
>> > > Have the formatter change it to an if/else , or just leave it for
>> tools
>> > > like Credo to yell at you for an unless/else.
>> >
>> > This is definitely something the formatter should do.
>> SHOULD NOT DO!
>>
>> --
>> 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/20190104075710.7cb95c4f.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/CABu8xFDwh37nVYno5BCBqsu0US90EyM_GXwwh_ErefoEA%2B3UCg%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/CAGnRm4%2B4WaMcbU663579KGsvp64%3DXtsWSyO4BdJuGcygBZh%2BdQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [elixir-core:8428] [Proposal] Deprecate unless-else

2019-01-04 Thread Louis Pilfold
I might be wrong, but I think the formatter already updates the AST in some
places to fix deprecation warnings.

On Fri, 4 Jan 2019, 00:57 eksperimental, 
wrote:

> On Fri, 4 Jan 2019 07:54:44 +0700
> eksperimental  wrote:
>
> > On Thu, 3 Jan 2019 11:25:13 -0800
> > Ryan Winchester  wrote:
> > > Have the formatter change it to an if/else , or just leave it for
> tools
> > > like Credo to yell at you for an unless/else.
> >
> > This is definitely something the formatter should do.
> SHOULD NOT DO!
>
> --
> 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/20190104075710.7cb95c4f.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/CABu8xFDwh37nVYno5BCBqsu0US90EyM_GXwwh_ErefoEA%2B3UCg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.