(This is a partial repost from D.learn.)
Some time ago after Andrei Alexandrescu talk "Iterators must Go"
someone asked about implementing the Dutch national flag sort
algorithm with D ranges. This is a version of mine (but
unfortunately currently I can't try it on the Dlist of Phobos),
it lo
FYI
I'm getting these compile errors, must be the compiler flags I'm
using?
source/main.d(19): Error: cannot implicitly convert expression
(dictionary.length() - 1LU) of type ulong to int
source/main.d(48): Error: cannot implicitly convert expression
(dictionary.length() - 1LU) of type ulong
On Thursday, 22 November 2012 at 01:14:23 UTC, bearophile wrote:
[SNIP]
Thank you,
bye,
bearophile
I'd argue that your first "compress1" isn't range correct either
anyways, because "w ~ ch;" (which will allocate) is not part of
the range interface.
Neither is "w = [ch];" (which will also
On Thursday, 22 November 2012 at 06:52:55 UTC, Rob T wrote:
FYI
I'm getting these compile errors, must be the compiler flags
I'm using?
Must be that bearophile and I are on windows (ergo 32), so
"length" is of type "size_t", which is a "uint". This matches the
key of the dictionary.
If yo
On 11/22/12 02:14, bearophile wrote:
> In the following program there are two versions of the compress function,
> that implement the same bare-bones version of the LZW
> (http://en.wikipedia.org/wiki/Lempel-Ziv-Welch ) compression algorithm.
>
> compress1 is the simpler version, while compress2
On 11/22/2012 11:25 AM, monarch_dodra wrote:
On Thursday, 22 November 2012 at 06:52:55 UTC, Rob T wrote:
FYI
I'm getting these compile errors, must be the compiler flags I'm using?
Must be that bearophile and I are on windows (ergo 32), so "length" is
of type "size_t", which is a "uint". This
On Friday, November 23, 2012 01:52:51 Timon Gehr wrote:
> On 11/22/2012 11:25 AM, monarch_dodra wrote:
> > On Thursday, 22 November 2012 at 06:52:55 UTC, Rob T wrote:
> >> FYI
> >>
> >> I'm getting these compile errors, must be the compiler flags I'm using?
> >
> > Must be that bearophile and I a
On 11/23/2012 03:01 AM, Jonathan M Davis wrote:
On Friday, November 23, 2012 01:52:51 Timon Gehr wrote:
On 11/22/2012 11:25 AM, monarch_dodra wrote:
On Thursday, 22 November 2012 at 06:52:55 UTC, Rob T wrote:
FYI
I'm getting these compile errors, must be the compiler flags I'm using?
Must b