On Wed, 14 May 2014 05:13:42 -0400, Jonathan M Davis via
Digitalmars-d-learn digitalmars-d-learn@puremagic.com wrote:
On Wed, 14 May 2014 08:27:45 +
monarch_dodra via Digitalmars-d-learn
digitalmars-d-learn@puremagic.com wrote:
On Monday, 12 May 2014 at 18:44:22 UTC, Jonathan M Davis
On Wednesday, 14 May 2014 at 09:01:23 UTC, John Colvin wrote:
Why would anyone ever want to sort code-points?
Why not? To remove duplicate characters?
They might want to sort graphemes, but that's difficult to do
in-place (needs O(n) memory, I think...). If out-of-place is
good enough
On Thursday, 15 May 2014 at 13:26:45 UTC, Steven Schveighoffer
wrote:
On Wed, 14 May 2014 05:13:42 -0400, Jonathan M Davis via
Digitalmars-d-learn digitalmars-d-learn@puremagic.com wrote:
On Wed, 14 May 2014 08:27:45 +
monarch_dodra via Digitalmars-d-learn
On Thu, 15 May 2014 11:37:07 -0400, monarch_dodra monarchdo...@gmail.com
wrote:
On Thursday, 15 May 2014 at 13:26:45 UTC, Steven Schveighoffer
wrote:
On Wed, 14 May 2014 05:13:42 -0400, Jonathan M Davis via
Digitalmars-d-learn digitalmars-d-learn@puremagic.com wrote:
On Wed, 14 May 2014
On Thursday, 15 May 2014 at 17:46:52 UTC, Steven Schveighoffer
wrote:
As far as I'm concerned, if we *can* do it in n.log(n), and
somebody provides the implementation, then there is no reason
to not offer dchar sorting for char[]/wchar.
I think there is nothing wrong with requiring the steps
On Monday, 12 May 2014 at 18:44:22 UTC, Jonathan M Davis via
Digitalmars-d-learn wrote:
Sure, you can cast char[] to ubyte[] and sort that if you know
that the array
only holds pure ASCII. In fact, you can use
std.string.representation to do it
- e.g.
auto ascii = str.representation;
and if
monarch_dodra:
As a matter of fact, the built in sort property does it.
It's going to be deprecated soon.
Bye,
bearophile
On Wednesday, 14 May 2014 at 08:27:46 UTC, monarch_dodra wrote:
On Monday, 12 May 2014 at 18:44:22 UTC, Jonathan M Davis via
Digitalmars-d-learn wrote:
Sure, you can cast char[] to ubyte[] and sort that if you know
that the array
only holds pure ASCII. In fact, you can use
On Wed, 14 May 2014 08:27:45 +
monarch_dodra via Digitalmars-d-learn
digitalmars-d-learn@puremagic.com wrote:
On Monday, 12 May 2014 at 18:44:22 UTC, Jonathan M Davis via
Digitalmars-d-learn wrote:
Sure, you can cast char[] to ubyte[] and sort that if you know
that the array
only
On Monday, 12 May 2014 at 14:56:46 UTC, John Colvin wrote:
char[] is a rather special type of array: the language has
unicode support and iterates over it by code-point (i.e. not
guaranteed to be a single char per iteration).
If you want to sort chars and are assuming ASCII, you can just
use
and is there any way to sort char array with algorithm.sort?
---
import std.algorithm;
import std.range;
void main()
{
int[] arr = [5, 3, 7];
sort(arr); // OK
char[] arr2 = ['z', 'g', 'c'];
sort(arr2); // error
sort!q{ a[0] b[0] }(zip(arr, arr2)); // error
}
---
I don't know what's
On Monday, 12 May 2014 at 14:49:53 UTC, hane wrote:
and is there any way to sort char array with algorithm.sort?
---
import std.algorithm;
import std.range;
void main()
{
int[] arr = [5, 3, 7];
sort(arr); // OK
char[] arr2 = ['z', 'g', 'c'];
sort(arr2); // error
sort!q{ a[0] b[0]
On Monday, 12 May 2014 at 14:56:46 UTC, John Colvin wrote:
On Monday, 12 May 2014 at 14:49:53 UTC, hane wrote:
and is there any way to sort char array with algorithm.sort?
---
import std.algorithm;
import std.range;
void main()
{
int[] arr = [5, 3, 7];
sort(arr); // OK
char[] arr2 = ['z',
On Mon, 12 May 2014 14:49:52 +
hane via Digitalmars-d-learn digitalmars-d-learn@puremagic.com wrote:
and is there any way to sort char array with algorithm.sort?
---
import std.algorithm;
import std.range;
void main()
{
int[] arr = [5, 3, 7];
sort(arr); // OK
char[] arr2 =
On 05/12/2014 09:29 AM, Jonathan M Davis via Digitalmars-d-learn wrote:
On Mon, 12 May 2014 14:49:52 +
hane via Digitalmars-d-learn digitalmars-d-learn@puremagic.com wrote:
and is there any way to sort char array with algorithm.sort?
---
import std.algorithm;
import std.range;
void main()
On Mon, 12 May 2014 11:08:47 -0700
Charles Hixson via Digitalmars-d-learn
digitalmars-d-learn@puremagic.com wrote:
On 05/12/2014 09:29 AM, Jonathan M Davis via Digitalmars-d-learn
wrote:
On Mon, 12 May 2014 14:49:52 +
hane via Digitalmars-d-learn digitalmars-d-learn@puremagic.com
16 matches
Mail list logo