freenode/#clasp - IRC Chatlog
Search
15:37:44
Bike
"error: cannot initialize a variable of type 'int ***' with an rvalue of type 'core::SimpleBaseString_O::value_type' (aka 'unsigned char')" well that seems pretty normal
15:40:08
Bike
it doesn't seem to be the case here - i mean unsigned char is what i'd expect - so i still don't really get it
16:10:37
drmeister
I pulled the changes and build iclasp-boehm - but slime still doesn't connect (sigh).
16:26:31
Bike
so i wanted operator[] to work on bit and sub-byte vectors. but operator[] returns a reference, and i can't really get a reference to a part of a word
16:26:48
Bike
C++ has a bitset object with this same problem, and what it does is define an entirely new kind of object that represents a reference to a bit
16:52:53
Bike
i wanted to use [] so it could use the same template algorithms that work for our more normal vector types
17:02:31
Bike
it also might be a little weird that the underlying GCBitUnitArray's operator[] returns words instead...
17:06:55
Bike
i mean what i'd be doing here is defining an inner class in GCBitUnitArray that has a pointer to inside the word vector, and when you do [] it'll make one of these things
17:09:22
drmeister
It will be two words, a pointer to the inside of the array and an index into a word.
17:09:27
Bike
incidentally, you can't define two functions with the same name differing only in return type, but if they differ in const that's fine? this language is weird
17:09:44
drmeister
The pointer will be on the stack or in a register - so it should keep the object alive and pinned in memory.
17:09:44
Bike
https://github.com/gcc-mirror/gcc/blob/master/libstdc%2B%2B-v3/include/std/bitset#L802-L808 here's gcc's, with characteristic unclarity
17:17:42
Bike
i mean what i want to do is write a[i] = b[j], and have it result in something like a_bits[i_] = (a_bits[i_] & ~mask) | ((b_bits[j_] & mask) << shift). i don't know if the compiler can reduce a bunch of reference stuff to that
19:12:47
Bike
if i compile the initial fill value thing by itself i get the results i expect... i'm not sure what would even cause this
19:12:58
Bike
if it was shifted by two, i'd assume something silly about fixnums. but it's shifted by one