I think sigils should only ever accept the extended format. Imagine reading
~D[2020-01-03] and then two lines below ~D[20200103]. :) My mind is not yet
made on the parsing one but I was thinking about an explicit flag :basic |
:extended | :ordinal.

On Thu, Feb 4, 2021 at 11:48 PM Christopher Keele <christheke...@gmail.com>
wrote:

> > I am not necessarily worried about sigils because sigils are always
> compile-time literals. It is probably fine to enforce a given format there
> rather than multiple ones.
>
> Agreed! What I am wondering here is if the sigils -- and other parsing
> functions -- should probably be universally accepting; ie not require
> specifying a format and letting any valid date through by default. Does
> that seem reasonable to you?
>
> On Thursday, February 4, 2021 at 2:45:27 PM UTC-8 José Valim wrote:
>
>>
>>
>>> I like José's suggesting of supporting a flag, but it gets kind of
>>> complicated as there are several dimensions here even in our reduced case.
>>> Dates, times, and datetimes support either basic or extended notations;
>>> dates and datetimes support calendar dates or ordinal dates; both are
>>> applicable to any parsing.
>>>
>>
>> Are we 100% sure that ordinal datetimes are part of ISO8601? Kip, can you
>> please confirm?
>>
>>
>>> If we went with this approach I'd lean towards always accepting either
>>> form for one of the dimensions, and using flags to the sigil and parsing
>>> functions to indicate intent for the other.
>>>
>>
>> I am not necessarily worried about sigils because sigils are always
>> compile-time literals. It is probably fine to enforce a given format there
>> rather than multiple ones.
>>
>> --
> 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/dbc36578-362b-4a4c-9a97-ac6026149267n%40googlegroups.com
> <https://groups.google.com/d/msgid/elixir-lang-core/dbc36578-362b-4a4c-9a97-ac6026149267n%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 elixir-lang-core+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/elixir-lang-core/CAGnRm4%2BhTMCs%2Bn%2BA6ASGVA45Ru8zzesNWufw2%2BZT8zwjvHEexQ%40mail.gmail.com.

Reply via email to