[email protected] writes:

> however seeing similar code as above is quite disappointing

Why? It is explicit about its type. And also it makes clear that there
are things not allowed with Decimals.

> 6.75d + 7.293d
>
> 6.75d / 3.2d

In theory, the maintainer of the `decimal` package, could implement some
macros and sigils which allow you to write something like this
(pseudocode):

| D.eval 6.75 + 7.293
| D.eval 6.75 / 3.2

While I am not quite sure right now if the AST of a float were accurate
enough, but a sigil could be used instead:

| D.eval ~d(6.75) + ~d(7.293)

I do not think that it is a necessary addition to core, since the
changes as you suggest them would change parts of the parser to
recognize something new that is just syntactic sugar around a module and
its functions, where most of that is already available in a package on
hex.

Also I do think, that it is easier to enhence `decimal` package like
described above than to integrate the syntax and the functionallity into
elixir itself.

Also regardless how you try it, you will never be able to use them in
guards, your change would create the illusion that they were treatened
by elixir as every other kind of numbers.

-- 
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/871t3flmt7.fsf%40norbert-tuxedo.news.nobbz.de.
For more options, visit https://groups.google.com/d/optout.

Reply via email to