I agree with the idea in principle but I may be a symptom of a bigger problem, which is how to represent data constructors generally.
Sigils have served us well so far but we only have 26 of them. Doing both ~P (PID) and ~R (Ref) would reveal a conflict with regex. There is also a conflict between ~U (for UTC DateTime) and URIs (which could be sigil based). We could of course introduce two or three letter sigils (or remove the restriction altogether), but we may want to think closely if that's the direction we want to go and how we would want to handle the casing in said situations: should it all be uppercase or all lowercase? or only the first letter matters? *José Valim* www.plataformatec.com.br Founder and Director of R&D On Thu, Oct 24, 2019 at 10:27 PM Andrea Leopardi <[email protected]> wrote: > We would have to introduce a sigil for refs as well. Note that this is > primarily for the shell tough, so Im not sure it's an addition that we want > in the language. > > Andrea > > On Thu, 24 Oct 2019 at 14:54, Allen Madsen <[email protected]> > wrote: > >> I'm +1 for this. >> >> Allen Madsen >> http://www.allenmadsen.com >> >> >> On Thu, Oct 24, 2019 at 3:33 PM Kelvin Raffael Stinghen < >> [email protected]> wrote: >> >>> Maybe also, instead of using `[]` as delimiters we could use `<>`, so >>> it’s close to how it was before and also close to how erlang represent them >>> on `:erlang.pid_to_list`. >>> >>> Best, >>> Kelvin Stinghen >>> [email protected] >>> >>> On Oct 24, 2019, at 15:46, Kelvin Raffael Stinghen < >>> [email protected]> wrote: >>> >>> I find very useful sometimes to copy and paste the item from a result of >>> a query for example, and as for today, PID's are printed like >>> `#PID<0.106.0>`, my proposal would be to add a `sigil_P` to `Kernel` >>> module, so we could use `~P[0.106.0]` (pretty much like `Date`s are today), >>> and also put that as the result for `Inspect.PID.inspect/2`. >>> >>> If the proposal gets approved, I would be more than happy to send a PR >>> for it. >>> >>> Thanks! >>> >>> -- >>> 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/0c7807e6-d832-4853-8a70-5999789ef380%40googlegroups.com >>> <https://groups.google.com/d/msgid/elixir-lang-core/0c7807e6-d832-4853-8a70-5999789ef380%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/DFC222C8-A8F3-4D4F-A502-AB2FFD88D53A%40gmail.com >>> <https://groups.google.com/d/msgid/elixir-lang-core/DFC222C8-A8F3-4D4F-A502-AB2FFD88D53A%40gmail.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/CAK-y3Cu2C_vfmyWU13rAsHM3xy-KEBTUd-ey78Uj0JdC-3xg1Q%40mail.gmail.com >> <https://groups.google.com/d/msgid/elixir-lang-core/CAK-y3Cu2C_vfmyWU13rAsHM3xy-KEBTUd-ey78Uj0JdC-3xg1Q%40mail.gmail.com?utm_medium=email&utm_source=footer> >> . >> > -- > > Andrea Leopardi > [email protected] > > -- > 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/CAM9Rf%2B%2B%3DKjAuxjvaMiGArGpf4KvCNcvmXcOoBPfBo6HbxqG6mw%40mail.gmail.com > <https://groups.google.com/d/msgid/elixir-lang-core/CAM9Rf%2B%2B%3DKjAuxjvaMiGArGpf4KvCNcvmXcOoBPfBo6HbxqG6mw%40mail.gmail.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/CAGnRm4KGZ8REuwo1L4MdXm_wHhHAWXwaaTvrHCo_gaqo6ZwwRg%40mail.gmail.com.
