Could this be rendered an aside for newbies, by way of
documentation, specifically the Unicode portion of the Dlang
tour? Just never bring up auto-decoding at all, point out
UTF8/16/32 and point out the fast correct primitive (byCodeUnit)
that lets you iterate over a string's contents
On Tuesday, December 11, 2018 2:11:49 PM MST H. S. Teoh via Digitalmars-d-
learn wrote:
> On Tue, Dec 11, 2018 at 09:02:41PM +, bauss via Digitalmars-d-learn
wrote:
> > On Tuesday, 11 December 2018 at 18:10:48 UTC, H. S. Teoh wrote:
> [...]
>
> > > Autodecoding raises its ugly head again. :-/
On Tue, Dec 11, 2018 at 09:02:41PM +, bauss via Digitalmars-d-learn wrote:
> On Tuesday, 11 December 2018 at 18:10:48 UTC, H. S. Teoh wrote:
[...]
> > Autodecoding raises its ugly head again. :-/
[...]
> Has it ever had anything else?
LOL... well, we (or some of us) were deceived by its
> writeln(
> typeid(ElementType!(char[2]))
> );
>
> static assert(is(ElementType!(char[2]) == dchar)); //
> why?
> }
>
> ?
>
> https://run.dlang.io/is/Q74yHm
Because docs:
https://dlang.org/phobos/std_range_primitives.html#ElementType
What
On Tuesday, 11 December 2018 at 17:51:56 UTC, Denis Feklushkin
wrote:
import std.stdio;
import std.range.primitives;
void main()
{
writeln(
typeid(ElementType!(char[2]))
);
static assert(is(ElementType!(char[2]) == dchar)); // why?
}
?
https://run.dlang.io/is/Q74yHm
> > typeid(ElementType!(char[2]))
> > );
> >
> > static assert(is(ElementType!(char[2]) == dchar)); // why?
> > }
> >
> > ?
> >
> > https://run.dlang.io/is/Q74yHm
>
> Because docs: https://dlang.org/phobos/std_range_primitives.html
On 12/12/2018 6:51 AM, Denis Feklushkin wrote:
import std.stdio;
import std.range.primitives;
void main()
{
writeln(
typeid(ElementType!(char[2]))
);
static assert(is(ElementType!(char[2]) == dchar)); // why?
}
?
https://run.dlang.io/is/Q74yHm
Because docs: https
import std.stdio;
import std.range.primitives;
void main()
{
writeln(
typeid(ElementType!(char[2]))
);
static assert(is(ElementType!(char[2]) == dchar)); // why?
}
?
https://run.dlang.io/is/Q74yHm