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 larg

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 Bou

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 bi

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 prog

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 à 12:2

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 bool

Re: [Pharo-users] Slots and Metalink

2019-04-10 Thread Marcus Denker
> On 4 Apr 2019, at 15:04, Vitor Medina Cruz wrote: > > Steven: > > Oh! I was unaware of these methods under reflection protocol! I manage to > make it work, and it is simply AWESOME!! :) > > Marcus: > > I wanted to intercept the store generally, with any kind of slot, kind of an > AOP ap

Re: [Pharo-users] Slots and Metalink

2019-04-04 Thread Vitor Medina Cruz
Steven: Oh! I was unaware of these methods under reflection protocol! I manage to make it work, and it is simply AWESOME!! :) Marcus: I wanted to intercept the store generally, with any kind of slot, kind of an AOP aproach. I did this: | slotLink | slotLink := (MetaLink new metaObject:

Re: [Pharo-users] Slots and Metalink

2019-04-04 Thread Marcus Denker
> On 3 Apr 2019, at 15:57, Vitor Medina Cruz wrote: > > Hello, > > Is it possible to intercept a slot store? I tried with a before metalink into > #write:to selector, but it don't seems to work. Should I use another selector? > The #write:to: method is the reflective read method that imple

Re: [Pharo-users] Slots and Metalink

2019-04-03 Thread Steven Costiou
Also, I do not think metalinks could work on #write:to: method from slots, because that method is not used at runtime (I do not remember exactly but maybe somebody knows the details...). Le 2019-04-03 16:20, Steven Costiou a écrit : > Hi, > > if you are using Pharo7, you could do either on a c

Re: [Pharo-users] Slots and Metalink

2019-04-03 Thread Steven Costiou
Hi, if you are using Pharo7, you could do either on a class (affects all instances) or on an object (affects only the target instance): > classOrObject link: yourMetaLink toSlotNamed: #slotName option: #write It will install the metalink on all write accesses to the slot. Note that if you tar

Re: [Pharo-users] Slots doc

2019-02-06 Thread Marcus Denker
> On 6 Feb 2019, at 18:17, Vitor Medina Cruz wrote: > > > Ok, thanks, I think I am understanding. > > I was trying to create a class to experiment but if I try to: > > Object subclass: #TestClassWithSlots > slots: { } > classVariables: { } > package: 'Experiment-Slots' > > Cod

Re: [Pharo-users] Slots doc

2019-02-06 Thread Vitor Medina Cruz
Ok, thanks, I think I am understanding. I was trying to create a class to experiment but if I try to: Object subclass: #TestClassWithSlots slots: { } classVariables: { } package: 'Experiment-Slots' Code is reversed to: Object subclass: #TestClassWithSlots instanceVariableNames:

Re: [Pharo-users] Slots doc

2019-02-06 Thread Marcus Denker
> On 6 Feb 2019, at 13:25, Vitor Medina Cruz wrote: > > Thanks, I was looking for usages of InstanceVariableSlot. All instance variables are InstanceVariableSlots. But to make it less verbose, we have a way to specify these without having to put the name. Object subclass: #Point

Re: [Pharo-users] Slots doc

2019-02-06 Thread Vitor Medina Cruz
Thanks, I was looking for usages of InstanceVariableSlot. In the case of SlotExampleMovie, #name and #year are of IntanceVariableSlot layout (this definition is correct? A slot is or has some Layout defined by the Slot class?) On Wed, Feb 6, 2019 at 10:14 AM Marcus Denker wrote: > > > > On 6 Fe

Re: [Pharo-users] Slots doc

2019-02-06 Thread Marcus Denker
> On 6 Feb 2019, at 12:41, Denis Kudriashov wrote: > > Would be nice to have a command in browser to show users of selected slot > Yes! Marcus

Re: [Pharo-users] Slots doc

2019-02-06 Thread Marcus Denker
> On 6 Feb 2019, at 12:30, Vitor Medina Cruz wrote: > > I couldn't find examples of Slot usage. Is there any ackage I can load that > use it so that I can look as an example? The Slot-Tests has some. But most tests there are creating classes not he fly (to test the creation) The only clas

Re: [Pharo-users] Slots doc

2019-02-06 Thread Denis Kudriashov
Would be nice to have a command in browser to show users of selected slot 6 февр. 2019 г. 11:32 пользователь "Vitor Medina Cruz" написал: I couldn't find examples of Slot usage. Is there any ackage I can load that use it so that I can look as an example? On Mon, Feb 4, 2019 at 6:17 PM webwarrio

Re: [Pharo-users] Slots doc

2019-02-06 Thread Vitor Medina Cruz
I couldn't find examples of Slot usage. Is there any ackage I can load that use it so that I can look as an example? On Mon, Feb 4, 2019 at 6:17 PM webwarrior wrote: > Vitor Medina Cruz wrote > > Thanks, I had already read this paper, which got me interested in the > > concept of slots :) . Is i

Re: [Pharo-users] Slots doc

2019-02-05 Thread Marcus Denker
>>> > > Slots are already part of Pharo and are totally useable. > Some example slots are buggy though. > Yes, I have a list of issues to fix. Especially related to instance migration when changing class definitions. (among others). I sometimes wonder how to find the concentrate time to real

Re: [Pharo-users] Slots doc

2019-02-04 Thread webwarrior
Vitor Medina Cruz wrote > Thanks, I had already read this paper, which got me interested in the > concept of slots :) . Is it a prototype in Pharo or is ready to use? it > will become as an official part of it? > > > On Sun, Feb 3, 2019 at 10:13 AM Ben Coman < > btc@ > > wrote: > >> >> >> On S

Re: [Pharo-users] Slots doc

2019-02-04 Thread Esteban Lorenzano
> On 4 Feb 2019, at 20:11, Vitor Medina Cruz wrote: > > Thanks, I had already read this paper, which got me interested in the concept > of slots :) . Is it a prototype in Pharo or is ready to use? it will become > as an official part of it? Is ready, is official, is there :) Esteban > >

Re: [Pharo-users] Slots doc

2019-02-04 Thread Vitor Medina Cruz
Thanks, I had already read this paper, which got me interested in the concept of slots :) . Is it a prototype in Pharo or is ready to use? it will become as an official part of it? On Sun, Feb 3, 2019 at 10:13 AM Ben Coman wrote: > > > On Sun, 3 Feb 2019 at 17:50, Todd Blanchard via Pharo-users

Re: [Pharo-users] Slots docs?

2019-02-04 Thread Marcus Denker
> On 1 Feb 2019, at 14:16, Vitor Medina Cruz wrote: > > Hello, > > Where I can find documentation for slots? > Sadly not… It is on the todo for far too long. I will put it on higher priority and hope to have some documentation soon. Marcus

Re: [Pharo-users] Slots doc

2019-02-03 Thread Ben Coman
On Sun, 3 Feb 2019 at 17:50, Todd Blanchard via Pharo-users < pharo-users@lists.pharo.org> wrote: > Seems like an opportunity...I have no idea what the addition of slots does > but I would like to learn. > > On Feb 3, 2019, at 1:33 AM, ducasse wrote: > > Hello, > > Where I can find documentation

Re: [Pharo-users] Slots doc

2019-02-03 Thread Todd Blanchard via Pharo-users
--- Begin Message --- Seems like an opportunity...I have no idea what the addition of slots does but I would like to learn. > On Feb 3, 2019, at 1:33 AM, ducasse wrote: > >> Hello, >> >> Where I can find documentation for slots? >> >> I am trying to access the pharo books site but it is unrea

Re: [Pharo-users] Slots in Pharo 5

2016-09-28 Thread Denis Kudriashov
2016-09-28 17:06 GMT+02:00 Jan Cada : > Hi, > > I have opened the issue #19153 > > . > Thank's

Re: [Pharo-users] Slots in Pharo 5

2016-09-28 Thread Denis Kudriashov
Hi. It looks like bug. Could you open issue? 2016-09-28 15:36 GMT+02:00 Jan Cada : > Hi, > > I started to play with slots and I am observing odd behaviour after the > class structure gets changed. > > I am having classes: > > Object subclass: #*CTA* > slots: { #x. #*b* => ToManyRelationSlot inve

Re: [Pharo-users] Slots in Pharo 5

2016-09-28 Thread Jan Cada
Hi, I have opened the issue #19153 . Thanks, Jan > On 28 Sep 2016, at 16:10, Denis Kudriashov wrote: > > Hi. > > It looks like bu

Re: [Pharo-users] Slots in Pharo

2015-03-24 Thread Juraj Kubelka
Hi, maybe class comments could help you. But I understand that we have to reveal use cases :-) Cheers, Juraj > 24. 3. 2015 v 4:08, Jigyasa Grover : > > Hi ! > I was a bit confused with the concept of 'Slots' in Pharo. > Could anyone please explain it or refer to some resources where it has be

Re: [Pharo-users] Slots in Pharo

2015-03-24 Thread Marcus Denker
> On 24 Mar 2015, at 08:08, Jigyasa Grover wrote: > > Hi ! > I was a bit confused with the concept of 'Slots' in Pharo. > Could anyone please explain it or refer to some resources where it has been > elucidated clearly ? > It would be a great help. Sadly this does not yet exist. This is in Pha

Re: [Pharo-users] Slots

2014-06-09 Thread Johan Fabry
On Jun 9, 2014, at 8:28 AM, Marcus Denker wrote: > In general, I do not think that we should make Pharo more static. To the > extreme opposite, we should explore what a dynamic > (reflective, late bound) system can do that a static one can not do… and this > means actually using the dynamic fe

Re: [Pharo-users] Slots

2014-06-09 Thread Marcus Denker
On 09 Jun 2014, at 14:20, Marcus Denker wrote: > > On 09 Jun 2014, at 13:55, Bob Williams wrote: > >> Camille and Marcus, thank you for your response. I thought something was >> missing, so the testing of Slots will be shelved for now; however, while it >> is in the planning stage, I would

Re: [Pharo-users] Slots

2014-06-09 Thread Marcus Denker
On 09 Jun 2014, at 13:55, Bob Williams wrote: > Camille and Marcus, thank you for your response. I thought something was > missing, so the testing of Slots will be shelved for now; however, while it > is in the planning stage, I would like to add some thoughts on targets and > deliverable pro

Re: [Pharo-users] Slots

2014-06-08 Thread Marcus Denker
On 07 Jun 2014, at 19:32, Camille Teruel wrote: > You can use the old syntax for class declaration for creating classes, i.e. : > > Superclass subclass: #MyClass > instanceVariableNames: 'x y z' > classVariableNames: '' > category: 'MyProject' > > However, the compiler does

Re: [Pharo-users] Slots

2014-06-07 Thread Camille Teruel
You can use the old syntax for class declaration for creating classes, i.e. : Superclass subclass: #MyClass instanceVariableNames: 'x y z' classVariableNames: '' category: 'MyProject' However, the compiler does not take slots into account yet, so custom slots will only

Re: [Pharo-users] Slots

2014-05-19 Thread Johan Fabry
On May 19, 2014, at 4:15 PM, Norbert Hartl wrote: > Am 19.05.2014 um 21:59 schrieb Johan Fabry : > >> Doru, the correct way to follow up on that is: >> >> Me, three! >> >> :-P >> > Ou, you have to like this: > > Two men walk into a bar. The first man said „I like to have some H20“. The >

Re: [Pharo-users] Slots

2014-05-19 Thread Norbert Hartl
Am 19.05.2014 um 21:59 schrieb Johan Fabry : > Doru, the correct way to follow up on that is: > > Me, three! > > :-P > Ou, you have to like this: Two men walk into a bar. The first man said „I like to have some H20“. The second man said „I like to have some H20, too“. The second man died!

Re: [Pharo-users] Slots

2014-05-19 Thread Johan Fabry
Doru, the correct way to follow up on that is: Me, three! :-P On May 19, 2014, at 3:54 PM, Tudor Girba wrote: > So am I :) > > Doru > > > On Mon, May 19, 2014 at 9:03 PM, Norbert Hartl wrote: > > > > Am 19.05.2014 um 19:58 schrieb Johan Fabry : > > > > > > On May 19, 2014, at 8:06 AM, M

Re: [Pharo-users] Slots

2014-05-19 Thread Tudor Girba
So am I :) Doru On Mon, May 19, 2014 at 9:03 PM, Norbert Hartl wrote: > > > > Am 19.05.2014 um 19:58 schrieb Johan Fabry : > > > > > > On May 19, 2014, at 8:06 AM, Marcus Denker > wrote: > > > >>> This so that I can transparently redirect them to a dictionary lookup. > >> > >> there will be D

Re: [Pharo-users] Slots

2014-05-19 Thread Norbert Hartl
> Am 19.05.2014 um 19:58 schrieb Johan Fabry : > > > On May 19, 2014, at 8:06 AM, Marcus Denker wrote: > >>> This so that I can transparently redirect them to a dictionary lookup. >> >> there will be Dictionay based slots coming with Pharo4, no need to roll your >> own for that. >> >> In a

Re: [Pharo-users] Slots

2014-05-19 Thread Johan Fabry
On May 19, 2014, at 8:06 AM, Marcus Denker wrote: >> This so that I can transparently redirect them to a dictionary lookup. > > there will be Dictionay based slots coming with Pharo4, no need to roll your > own for that. > > In addition, I want to add support for Reflectivity meta links on sl

Re: [Pharo-users] Slots

2014-05-19 Thread Camille Teruel
On 19 mai 2014, at 14:11, Marcus Denker wrote: > > On 19 May 2014, at 07:24, Clément Bera wrote: > >> >> >> >> 2014-05-18 21:42 GMT+02:00 Johan Fabry : >> >> I understand, thanks for the info. >> >> Let me simplify my question: Using slots is there a reasonably >> straightforward way fo

Re: [Pharo-users] Slots

2014-05-19 Thread Marcus Denker
On 19 May 2014, at 14:38, Yuriy Tymchuk wrote: > One more question. Can all this provide a possibility (in the future) to add > inst vars to classes of the foreign packages? > it definitly would be easier to do as ivars (like all slots) are objects… that could be “part” of a package, like me

Re: [Pharo-users] Slots

2014-05-19 Thread Marcus Denker
On 19 May 2014, at 14:33, Camille Teruel wrote: > > On 19 mai 2014, at 14:06, Marcus Denker wrote: > >> >> On 18 May 2014, at 21:42, Johan Fabry wrote: >> >>> >>> I understand, thanks for the info. >>> >>> Let me simplify my question: Using slots is there a reasonably >>> straightforwa

Re: [Pharo-users] Slots

2014-05-19 Thread Yuriy Tymchuk
One more question. Can all this provide a possibility (in the future) to add inst vars to classes of the foreign packages? Uko On 19 May 2014, at 14:33, Camille Teruel wrote: > > On 19 mai 2014, at 14:06, Marcus Denker wrote: > >> >> On 18 May 2014, at 21:42, Johan Fabry wrote: >> >>> >

Re: [Pharo-users] Slots

2014-05-19 Thread Camille Teruel
On 19 mai 2014, at 14:06, Marcus Denker wrote: > > On 18 May 2014, at 21:42, Johan Fabry wrote: > >> >> I understand, thanks for the info. >> >> Let me simplify my question: Using slots is there a reasonably >> straightforward way for me to intercept variable accesses in all methods >> w

Re: [Pharo-users] Slots

2014-05-19 Thread Marcus Denker
On 19 May 2014, at 07:24, Clément Bera wrote: > > > > 2014-05-18 21:42 GMT+02:00 Johan Fabry : > > I understand, thanks for the info. > > Let me simplify my question: Using slots is there a reasonably > straightforward way for me to intercept variable accesses in all methods > within a cl

Re: [Pharo-users] Slots

2014-05-19 Thread Marcus Denker
On 18 May 2014, at 21:42, Johan Fabry wrote: > > I understand, thanks for the info. > > Let me simplify my question: Using slots is there a reasonably > straightforward way for me to intercept variable accesses in all methods > within a class? Yes, you can make a special slot subclass and

Re: [Pharo-users] Slots

2014-05-18 Thread Clément Bera
2014-05-18 21:42 GMT+02:00 Johan Fabry : > > I understand, thanks for the info. > > Let me simplify my question: Using slots is there a reasonably > straightforward way for me to intercept variable accesses in all methods > within a class? Yes. This is easy to do with slots. Basically you need

Re: [Pharo-users] Slots

2014-05-18 Thread Johan Fabry
I understand, thanks for the info. Let me simplify my question: Using slots is there a reasonably straightforward way for me to intercept variable accesses in all methods within a class? This so that I can transparently redirect them to a dictionary lookup. Or am I going to have to override i

Re: [Pharo-users] Slots

2014-05-18 Thread Clément Bera
Hello, Actually slots are introduced so we can use them the next Pharo iteration (Pharo 4). It is difficult to use as it is, you need to change a bit the compiler so that it asks the class slots for field access byte code generation (a field being typically an instance variable) and you also need

Re: [Pharo-users] Slots

2014-05-17 Thread Johan Fabry
+1 on the question actually, I think it may help with some hacky stuff that I am doing right now for my research :-) On May 17, 2014, at 5:10 PM, webwarrior wrote: > So Pharo 3 is out, slots are listed in changelog, but how to use them? Any > examples (those in paper don't work)? > > > > --

Re: [Pharo-users] Slots

2014-05-17 Thread webwarrior
So Pharo 3 is out, slots are listed in changelog, but how to use them? Any examples (those in paper don't work)? -- View this message in context: http://forum.world.st/Slots-tp4679183p4759385.html Sent from the Pharo Smalltalk Users mailing list archive at Nabble.com.