Download Reference Manual
The Developer's Library for D
About Wiki Forums Source Search Contact

Array.split?

Posted:

Author Message

Posted: 11/03/07 02:09:21

What is it that patterns(src, pattern) returns?

Posted: 11/03/07 02:58:04

This is why I love tango: patterns returns a "Freachable" struct, so it has no heap activity. But while this means it returns something, it basically can only be used with a foreach loop (especially as the only public declaration the struct has is opApply).

I wish the tango version of Regex used something similar for matching, instead of a private member variable.

Posted: 11/03/07 21:21:53

r.lph50 wrote:

This is why I love tango: patterns returns a "Freachable" struct, so it has no heap activity. But while this means it returns something, it basically can only be used with a foreach loop (especially as the only public declaration the struct has is opApply).

I wish the tango version of Regex used something similar for matching, instead of a private member variable.

We'll be switching regex implementation ;)

Posted: 11/03/07 23:54:43

Mauer wrote:

Well, maybe the foreach-loop is needed, but IMO it should be at tango.core.Array.split

What about the rest of Util? Don't all those other functions deserve to belong to tango.core.Array also?

Posted: 11/04/07 01:53:22

kris wrote:

We'll be switching regex implementation ;)

Nice; the current one doesn't feel very tango-ish. Does the new one have anything to do with Jascha Wetzel's work?

I can see how the split function could be used on byte arrays, but I haven't seen much use of split beyond character or byte strings. Perhaps there could be a tango.core.Strings where Strings is the computer science definition. Hmm.