Tilde (~) is already used for sigils, so it can't be used for this.

Allen Madsen
http://www.allenmadsen.com


On Fri, Jan 3, 2020 at 5:41 PM Kevin Johnson <[email protected]>
wrote:

> Thank you Alexei for clarifying.
>
> I did not see that you could use the macro in a pattern match like that.
> The following is also possible if you want to avoid using a guard:
>
> defmodule B do
>   import Record
>   defrecord(:bb, a: 1)
>
>   def set(record = bb(), i) do
>     bb(record, a: i)
>   end
> end
>
> The `macro` does provide all the convenience you need.
>
> The only matters outstanding are:
>
>    1. Usage of  `__MODULE__` as the `record` `atom`(without losing the
>    macro convenience)
>    2. Having the syntax resemble that of defstruct more notation wise,
>    e.g. `~B{a: i}` including in terms of updating
>
> Those would make it easier to pick up `defrecord` with all its nuances but
> are certainly not critical.
>
> `defrecord` functionality wise is feature complete so I withdraw my
> proposal.
>
> --
> 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/CAAkfbUo2PyQRbFK5gHSj0h6D3cSj6_6NoDt%3DnNrYzaGDnPEjqA%40mail.gmail.com
> <https://groups.google.com/d/msgid/elixir-lang-core/CAAkfbUo2PyQRbFK5gHSj0h6D3cSj6_6NoDt%3DnNrYzaGDnPEjqA%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/CAK-y3CsMhiQGNJ4-yckRPK5OK9%2BEKNTER-cDcPP43QPuiHjUqQ%40mail.gmail.com.

Reply via email to