What have I missed?
Era Scarecrow via Digitalmars-d
digitalmars-d at puremagic.com
Thu Aug 7 12:40:21 PDT 2014
On Thursday, 7 August 2014 at 10:08:30 UTC, Marc Schütz wrote:
> I haven't looked at your rewrite, but from what I've seen the
> current implementation is indeed very awkward and full of bugs.
> ... This seems to imply that not even the semantics are
> completely clear. I guess a complete rewrite would be
> appropriate in such a situation.
On Thursday, 7 August 2014 at 14:24:13 UTC, Andrei Alexandrescu
wrote:
> Welcome back!
Thanks i guess :)
> I wanted to sit down and extract the abstraction at some point,
> but didn't get to it yet. Sounds like a great thing to include
> in std.bitmanip.
So the gist of it, is there's still interest in the rewrite.
Interesting...
As for being able to find x number of bits that are 0 or 1 in a
row, that both sounds easy and hard at the same time (easy if you
don't mind it being slow). In my rewrite there was a bulk
template I created that was intended to do huge speedups with
binary data (when the data was naturally aligned correctly and
large enough to use the binary operators on normal types). Some
of the unittests and example code also used them in a read-only
fashion that could be specialized for finding a certain type of
pattern...
As I'm trying to recall, I think the largest bug in my
implementation was the confusion of when it should be reference
vs value type, since when it was small enough it didn't need to
allocate any data (64/128 bits or less) but larger than that it
had to allocate data. Naturally this causes problems...
Of course I also implemented it to be able to pass around a
slice of a BitArray which was always reference...
I guess the things to do is make sure the current bug fixes are
included in my implementation (including BitFields, I had it
programmed to accept default values), get it to merge with
phobos, afterwards continue forward and try to make improvements
and further bug fixes...
More information about the Digitalmars-d
mailing list