> From a developer consistency perspective, though, I’m not as sold on this.

I tend to agree, this feels like nice parameter sugar but makes it harder 
to interface consistently with extended options. Maybe it makes more sense 
for an application-level helper?

On Thursday, April 22, 2021 at 7:14:59 AM UTC-7 [email protected] wrote:

> Every time I forget to add the `label: ` and get a compile error (which is 
> *often*), I agree with you. From a developer consistency perspective, 
> though, I’m not as sold on this. With this convenience, people may forget 
> to switch back to the keyword list when they need to add other options like 
> :limit, and try `IO.inspect(something, "Message", limit: 300)`.
>
> -a
>
> On Wed, Apr 21, 2021 at 11:56 PM Faisal Alghurayri <[email protected]> 
> wrote:
>
>> Yes. šŸ‘  
>>
>> I'm proposing:
>>
>> def inspect(item, message) when is_binary(message)  do 
>> inspect(:stdio, item, label: message) 
>> end 
>>
>>
>> https://github.com/elixir-lang/elixir/blob/v1.11.4/lib/elixir/lib/io.ex#L421
>>
>> The reason is just a small quality of life improvement. šŸ˜„ Please let me 
>> know what you think!
>>
>> - Faisal
>>
>> On Wednesday, April 21, 2021 at 11:42:53 PM UTC-4 [email protected] 
>> wrote:
>>
>>> There's already a label option in the docs:
>>>
>>> IO.inspect(1..100, label: "a wonderful range")
>>>
>>> On Thu, Apr 22, 2021 at 11:35 AM Faisal Alghurayri <[email protected]> 
>>> wrote:
>>>
>>>> Hello friends,
>>>>
>>>> Thank you for your great work in developing and maintaining Elixir. šŸ™Œ
>>>>
>>>> I propose adding another signature to the IO.inspect/2 function where 
>>>> the second argument is a binary:
>>>>
>>>> IO.inspect(something, "This message should get shown in console")
>>>>
>>>> I think this is a small quality of life improvement since the developer 
>>>> won't need to explicitly pass the `label` option to see an associated 
>>>> message.
>>>>
>>>> Best Regards,
>>>> Faisal
>>>>
>>>> -- 
>>>> 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 [email protected].
>>>> To view this discussion on the web visit 
>>>> https://groups.google.com/d/msgid/elixir-lang-core/64793786-deea-4902-b450-39f53896c945n%40googlegroups.com
>>>>  
>>>> <https://groups.google.com/d/msgid/elixir-lang-core/64793786-deea-4902-b450-39f53896c945n%40googlegroups.com?utm_medium=email&utm_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 [email protected].
>>
> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/elixir-lang-core/06452689-f476-456a-afeb-9a7fc58752abn%40googlegroups.com
>>  
>> <https://groups.google.com/d/msgid/elixir-lang-core/06452689-f476-456a-afeb-9a7fc58752abn%40googlegroups.com?utm_medium=email&utm_source=footer>
>> .
>>
>
>
> -- 
> Austin Ziegler • [email protected] • [email protected]
> http://www.halostatue.ca/ • http://twitter.com/halostatue
>

-- 
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 [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/elixir-lang-core/49aba501-ef0c-495f-b355-3a277fe8e20dn%40googlegroups.com.

Reply via email to