Re: [Pharo-users] Slots vs collections

2020-03-20 Thread Ben Coman
On Sat, 21 Mar 2020 at 01:54, Noury Bouraqadi wrote: > Hi Richard, > > My example was about having a collection of bits. So, #do: and #select: do > continue to have the very same semantics. > The whole point is to save memory behind the scenes, while keeping the > same API. > Consider a very

Re: [Pharo-users] Slots vs collections

2020-03-20 Thread Tim Mackinnon
Wow - I hadn’t quite understood the implications here- can you explain that 2DArray reference a bit more? I keep thinking slots are cool but haven’t quite spotted when to use them and this seems like a compelling example that I haven’t quite grasped... Tim > On 20 Mar 2020, at 17:54, Noury

Re: [Pharo-users] Slots vs collections

2020-03-20 Thread Noury Bouraqadi
Hi Richard, My example was about having a collection of bits. So, #do: and #select: do continue to have the very same semantics. The whole point is to save memory behind the scenes, while keeping the same API. Consider a very large matrix of booleans. It would save memory to store booleans as

Re: [Pharo-users] Slots vs collections

2020-03-20 Thread Richard Sargent
On Fri, Mar 20, 2020, 06:53 Noury Bouraqadi wrote: > Thanks Julien. So, what I did experienced is because BooleanSlot is work > in progress. > To address my issue using slots, I guess collections should implement > asBit method (Sent by BooleanSlot). > Noury, when modelling something like this,

Re: [Pharo-users] Slots vs collections

2020-03-20 Thread Noury Bouraqadi
Thanks Julien. So, what I did experienced is because BooleanSlot is work in progress. To address my issue using slots, I guess collections should implement asBit method (Sent by BooleanSlot). Noury > On 20 Mar 2020, at 13:56, Julien Delplanque > wrote: > > Hello, > > There is a work in

Re: [Pharo-users] Slots vs collections

2020-03-20 Thread Julien Delplanque
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 à

Re: [Pharo-users] Slots vs collections

2020-03-20 Thread K K Subbu
On 20/03/20 4:54 PM, N. Bouraqadi wrote: 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? What do the bits represent? Is there an ordering among these

[Pharo-users] Slots vs collections

2020-03-20 Thread N. Bouraqadi
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