Re: Why does the example on page 8 of TDPL work without importing std.algorithm for splitter?

2011-01-03 Thread Ellery Newcomer
If you're importing some other phobos module, I would guess an instance 
of this bug: http://d.puremagic.com/issues/show_bug.cgi?id=314


On 01/03/2011 10:56 AM, Bryce Watkins wrote:

However when I use splitter in my code it works without having imported
std.algorithm.

Thanks,
Bryce.


Re: Problem with D calling C.

2011-01-03 Thread bearophile
Bob Cowdery:

I don't know what your bug is, but this is bad D code:
> r = lib_speex_encode(cast(short*)smpls, cast(char*)bytes);

Use the "ptr" field of D arrays:
r = lib_speex_encode(smpls.ptr, bytes.ptr);

Bye,
bearophile


Why does the example on page 8 of TDPL work without importing std.algorithm for splitter?

2011-01-03 Thread Bryce Watkins

Hi all,

Can someone explain this to me please?

I have been trying to understand why you would use splitter over split 
between the examples on page 8 and page 12, as an errata has been 
posted: http://erdani.com/tdpl/errata/index.php?title=Main_Page which 
states that splitter should be used for better efficiency.


However when I use splitter in my code it works without having imported 
std.algorithm.


Thanks,
Bryce.