An alternative possibility, and not the only one, is to model the bits as part of an integer, small or large.
Of course, for performance, a ByteArray might be a good way to store bits. It has the benefit that every instance *can* represent bits. But, the inherited API operates on the bytes, not the bits.
Encapsulation may be the answer. e.g. a Bits object that holds a ByteArray and provides the API that is needed.
That's a rather long answer, admittedly.
Noury
> On 20 Mar 2020, at 13:56, Julien Delplanque <julien.delplanque@inria.fr> wrote:
>
> Hello,
>
> There is a work in progress prototype slot named BooleanSlot in the Slot-Example package built-in the image.
>
> I think this slot does what you want.
>
> So, the answer is yes, it is possible to do that. But you will need to fix todos left in BooleanSlot methods.
>
> Julien
>
> Le 20/03/20 �� 12:24, N. Bouraqadi a ��crit :
>> Hi,
>>
>> Suppose I have an instance variable referencing a collection of booleans.
>> I want to have all elements of the collection be stored as bits.
>> Is there a way I can express it using slots?
>>
>> This idea can be generalized to other types of slots.
>>
>> Noury
>>
>