Breaking news: std.uni changes!
Richard Andrew Cattermole (Rikki)
richard at cattermole.co.nz
Sat Dec 24 21:26:40 UTC 2022
Hello one and all on this merry of all days!
Today unfortunately I bring all but joy. For std.uni has had a
bout of work!
- Unicode tables have been updated to 15 from 6.2 (and with that
the generator is now in Phobos!).
- Unicode categories C aka Other have been brought in line with
TR44 specification. E.g. ``unicode.C``.
In both cases if you use std.uni directly or indirectly (say
std.regex), you may find yourself with code breakage on next
release.
If you do find yourself with problems, first check that you are
not referencing the C category, if you are, here is some code to
mitigate your circumstance however it would be better to prevent
such need.
```d
@property auto loadPropertyOriginal(string name)() pure
{
import std.uni : unicode;
static if (name == "C" || name == "c" || name == "other" ||
name == "Other")
{
auto target = unicode.Co;
target |= unicode.Lo;
target |= unicode.No;
target |= unicode.So;
target |= unicode.Po;
return target;
}
else
return unicode.opDispatch!name;
}
```
Lastly, the tables updating have already brought much joy to MIR,
with a broken test. A character that was being tested wasn't
allocated in 6.2 but was in 7 therefore results were different.
If your test suite is not part of the Phobos runners, please be
aware that once you update you may experience failed tests. These
are not avoidable due to external specification its based upon.
However in even worse news the table generator was not kept in a
working condition in the last 10 years, so there is a chance that
something may have been missed.
In all cases, please do contact me if you need assistance. I'm
available on Discord, OFTC #d and of course N.G. or even email if
you really need it (firstname at lastname.co.nz).
--- Happy holidays to those that are currently enjoying them or
about to!
More information about the Digitalmars-d-announce
mailing list