This does bring up an alternative sigil, the post numerical type hint.

10d
12f

Etc.

They wouldn't have to be first class citizens in Elixir, but they would
have to be lexically supported so macros can use them.

On Wed, Jun 29, 2016, 4:09 PM José Valim <[email protected]>
wrote:

> from https://github.com/ericmj/decimal
>>
>> iex> alias Decimal, as: D
>> nil
>> iex> D.add(D.new(6), D.new(7))
>> #Decimal<13>
>> iex> D.div(D.new(1), D.new(3))
>> #Decimal<0.333333333>
>>
>>
> I definitely agree it is non-ideal. One option would to at least add a
> sigil so we can create decimals without going through Decimal.new.
>
> 6.75d + 7.293d
>>
>> 6.75d / 3.2d
>>
>
> The issue with this is that we would make the + operator slower for
> regular operations AND it would still not be allowed in guards, as Norbert
> mentioned. This has been, as a matter of fact, the biggest blocker for
> adding Decimals to Elixir itself.
>
> --
> 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/CAGnRm4%2ByufavV2SKWpBPx0kiqbtS4CD%2BDn0adD8BHi%2BpZc6jxA%40mail.gmail.com
> <https://groups.google.com/d/msgid/elixir-lang-core/CAGnRm4%2ByufavV2SKWpBPx0kiqbtS4CD%2BDn0adD8BHi%2BpZc6jxA%40mail.gmail.com?utm_medium=email&utm_source=footer>
> .
> 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 [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/elixir-lang-core/CAOMhEnx5C%3D4k0HBx%2BRj8YmOwghZVg5m%2BVvk0qGw%2Bx%3DnsPV7T_Q%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to