why remove octal literal support?
Jonathan M Davis
newsgroup.d at jmdavisprog.com
Mon Nov 6 06:20:43 UTC 2023
On Sunday, November 5, 2023 9:59:22 PM MST d007 via Digitalmars-d-learn wrote:
> On Friday, 3 November 2023 at 15:34:37 UTC, Steven Schveighoffer
>
> wrote:
> > On Friday, 3 November 2023 at 15:07:41 UTC, d007 wrote:
> >> dlang is know for compile speed, but in reality d project
> >> compile slow because so much ctfe and tempalte.
> >>
> >>
> >> Why bring more ctfe call by remmove octal literal ?
> >
> > octal literals are extremely error prone, because people
> > sometimes use leading zeroes for alignment, not realizing that
> > it means the number is completely different.
> >
> > Actual correct octal literal use is vanishingly small. Banning
> > C-style octal literals just makes it so the compiler flags
> > unintended errors like this.
> >
> > -Steve
>
> Thanks you all for explain.
>
>
> In my opinion, use some thing like 0o700 will be a better
> solution compare to template.
I general, D's approach at this point is to have a solution be in the
standard library rather than in the language if it doesn't need to be in the
language. And in this case, not only does a template solve the problem quite
easily, but it's solving a problem that only rarely needs to be solved these
days.
So, while some might prefer a language solution, this really isn't the sort
of problem that D is likely to solve in the language at this point.
- Jonathan M Davis
More information about the Digitalmars-d-learn
mailing list