Language Reference
IchorDev
zxinsworld at gmail.com
Sun Aug 18 08:28:48 UTC 2024
On Saturday, 17 August 2024 at 22:17:59 UTC, Pete wrote:
> Trying some examples, I noted that the compilers are flagging
> some things as deprecated while the Language Reference has no
> indication of this.
Could you send a link to those examples?
> Main example, the cent/ucent data types. The compiler
> (ldc2 at 1.39.0) indicated cent/ucent as obsolete
Yes, the keywords are deprecated:
https://dlang.org/spec/lex.html#keywords
`cent`/`ucent` as built-in types were never implemented.
> and to use core.int128.Cent, but I couldn't find that in the
> standard library site (in core)...but found std.Int128.
You probably didn’t find it because you were looking under the
`std` package, not the `core` package.
However,
[`core.int128`](https://dlang.org/phobos/core_int128.html) is
just a plain data type & a bunch of maths functions like
`add`/`div`/`mul`/etc. that operate on it—it’s a set of building
blocks.
[`std.int128.Int128`](https://dlang.org/phobos/std_int128.html#.Int128) turns those functions into appropriate operator overloads. However, I would actually recommend [this library](https://codemirror.dlang.org/packages/speedy-int128) because it’s exactly the same except that when using LDC2 it produces significantly faster code.
> Am I missing something?
> Is the Language Reference not being updated or the compilers
> running way ahead of it?
Sometimes the spec misses some information, it’s just human
error. In general dmd’s implementation is a higher authority, but
sometimes it has bugs too. If you notice something missing from
the spec, then please file an issue or submit a PR.
More information about the Digitalmars-d
mailing list