On Wednesday, 6 December 2017 at 15:12:22 UTC, Steven
Schveighoffer wrote:
On 12/6/17 4:34 AM, Ola Fosheim Grøstad wrote:
On Wednesday, 6 December 2017 at 09:24:33 UTC, Jonathan M
Davis wrote:
UTF-32 on the other hand is guaranteed to have a code unit be
a full code point.
I don't think the s
On Wednesday, 6 December 2017 at 09:34:48 UTC, Ola Fosheim
Grøstad wrote:
On Wednesday, 6 December 2017 at 09:24:33 UTC, Jonathan M Davis
wrote:
UTF-32 on the other hand is guaranteed to have a code unit be
a full code point.
I don't think the standard says that? Isn't this only because
the c
On Wednesday, 6 December 2017 at 09:24:33 UTC, Jonathan M Davis
wrote:
a full code point (IIRC, 1 - 6 code units for UTF-8 and 1 - 2
for UTF-16),
YDNRC, 1 - 4 code units for UTF-8. Unicode is defined only up to
U+10. Everything above is illegal.
On Wednesday, 6 December 2017 at 12:43:09 UTC, Fredrik Boulund
wrote:
On Wednesday, 6 December 2017 at 10:42:31 UTC, Dgame wrote:
Or you simply do
writeln("longword".array.sort);
This is so strange. I was dead sure I tried that but it failed
for some reason. But after trying it ju
On Wed, Dec 06, 2017 at 10:32:03AM -0800, Ali Çehreli via Digitalmars-d-learn
wrote:
> On 12/06/2017 04:43 AM, Fredrik Boulund wrote:
> > On Wednesday, 6 December 2017 at 10:42:31 UTC, Dgame wrote:
> >
> >>
> >> Or you simply do
> >>
> >> writeln("longword".array.sort);
> >>
> >
> > This
On 12/06/2017 04:43 AM, Fredrik Boulund wrote:
> On Wednesday, 6 December 2017 at 10:42:31 UTC, Dgame wrote:
>
>>
>> Or you simply do
>>
>> writeln("longword".array.sort);
>>
>
> This is so strange. I was dead sure I tried that but it failed for some
> reason. But after trying it just no
On 12/6/17 4:34 AM, Ola Fosheim Grøstad wrote:
On Wednesday, 6 December 2017 at 09:24:33 UTC, Jonathan M Davis wrote:
UTF-32 on the other hand is guaranteed to have a code unit be a full
code point.
I don't think the standard says that? Isn't this only because the
current set is small enough
On Wednesday, 6 December 2017 at 10:42:31 UTC, Dgame wrote:
Or you simply do
writeln("longword".array.sort);
This is so strange. I was dead sure I tried that but it failed
for some reason. But after trying it just now it also seems to
work just fine. Thanks! :)
On Wednesday, 6 December 2017 at 09:25:20 UTC, Biotronic wrote:
On Wednesday, 6 December 2017 at 08:59:09 UTC, Fredrik Boulund
wrote:
string word = "longword";
writeln(sort(word));
But that doesn't work because I guess a string is not the type
of range required for sort?
Yeah, narrow (non-UT
On Wednesday, 6 December 2017 at 09:25:20 UTC, Biotronic wrote:
In addition, sort does in-place sorting, so the input range is
changed. Since D strings are immutable(char)[], changing the
elements is disallowed. So in total, you'll need to convert
from a string (immutable(char)[]) to a dchar[].
On Wednesday, 6 December 2017 at 09:24:33 UTC, Jonathan M Davis
wrote:
If you have a string, and you _know_ that it's only ASCII, then
either use representation or byCodeUnit to wrap it for the call
to sort, but it _will_ have to be mutable, so string won't
actually work. e.g.
char[] str =
On Wednesday, December 06, 2017 09:34:48 Ola Fosheim Grøstad via
Digitalmars-d-learn wrote:
> On Wednesday, 6 December 2017 at 09:24:33 UTC, Jonathan M Davis
>
> wrote:
> > UTF-32 on the other hand is guaranteed to have a code unit be a
> > full code point.
>
> I don't think the standard says that
On Wednesday, 6 December 2017 at 09:24:33 UTC, Jonathan M Davis
wrote:
UTF-32 on the other hand is guaranteed to have a code unit be a
full code point.
I don't think the standard says that? Isn't this only because the
current set is small enough to fit? So this may change as Unicode
grows?
On Wednesday, 6 December 2017 at 08:59:09 UTC, Fredrik Boulund
wrote:
string word = "longword";
writeln(sort(word));
But that doesn't work because I guess a string is not the type
of range required for sort?
Yeah, narrow (non-UTF-32) strings are not random-access, since
characters like 💩 tak
On Wednesday, December 06, 2017 08:59:09 Fredrik Boulund via Digitalmars-d-
learn wrote:
> Hi,
>
> I'm having some trouble sorting the individual characters in a
> string. Searching around, I found this thread
> (http://forum.dlang.org/post/mailman.612.1331659665.4860.digitalmars-d-lea
> r...@purem
Hi,
I'm having some trouble sorting the individual characters in a
string. Searching around, I found this thread
(http://forum.dlang.org/post/mailman.612.1331659665.4860.digitalmars-d-le...@puremagic.com) about a similar issue, but it feels quite old so I wanted to check if there is a clear cut
16 matches
Mail list logo