Cent/ucent why should we implement?
Dukc
ajieskola at gmail.com
Mon Aug 31 11:58:58 UTC 2026
On Friday, 14 August 2026 at 16:27:50 UTC, Richard (Rikki) Andrew
Cattermole wrote:
> Another monthly meeting has occurred, this time one of the
> things I presented was for my PR to implement cent/ucent.
>
> The reception was not the warmest, with questioning on why to
> do it.
>
> Does anyone have reasons for they may want it in language?
It isn't really any added language complexity from design or user
perspective, because all it's rules are reused from
`byte`/`short`/`int`/`long`. We need all the language rules for
built-in integers, `cent` or no `cent`, so we might as well have
it.
It probably does make sense to _internally_ implement it in
DRuntime so that the user can swap or leave out its
implementation without using a custom compiler, but having a
language keyword to actually use that implementation is only
consistent with how other integer types are used, especially as
we already have a keyword pair reserved for that.
More information about the Digitalmars-d
mailing list