Now classes with special Slots are shown with a special class definition (this is just a stand-in, not final⦠e.g. we need to add first class globals and think about what to do with #category⦠so we will see. For now please treat this as just a stand-in for playing with things. The idea is that we need to actually use it and then see what to change in the next iteration. And it should stay always compatible: if you do not use special slots, it is compatible, if you do, you get more power at the price of not being portable to other systems. But even in this case, the slots do give value: e.g. we will be able to add very very easily breakpoints or reflectively change behaviour for a slot (without chaining its definition). This will be very powerful. Marcus
On 03.07.2014, at 10:21, Marcus Denker <marcus.denker@inria.fr> wrote:
Now classes with special Slots are shown with a special class definition (this is just a stand-in, not final⦠e.g. we need to add first class globals and think about what to do with #category⦠so we will see. For now please treat this as just a stand-in for playing with things.
<slots.png>
The idea is that we need to actually use it and then see what to change in the next iteration.
And it should stay always compatible: if you do not use special slots, it is compatible, if you do, you get more power at the price of not being portable to other systems. But even in this case, the slots do give value: e.g. we will be able to add very very easily breakpoints or reflectively change behaviour for a slot (without chaining its definition). This will be very powerful.
Marcus
Sounds exciting! But I donât quite get what âspecial slotsâ are and what they can do. Is there any resource I can take a look at to get a better understanding? Cheers, Max
On 03 Jul 2014, at 10:52, Max Leske <maxleske@gmail.com> wrote:
On 03.07.2014, at 10:21, Marcus Denker <marcus.denker@inria.fr> wrote:
Now classes with special Slots are shown with a special class definition (this is just a stand-in, not final⦠e.g. we need to add first class globals and think about what to do with #category⦠so we will see. For now please treat this as just a stand-in for playing with things.
<slots.png>
The idea is that we need to actually use it and then see what to change in the next iteration.
And it should stay always compatible: if you do not use special slots, it is compatible, if you do, you get more power at the price of not being portable to other systems. But even in this case, the slots do give value: e.g. we will be able to add very very easily breakpoints or reflectively change behaviour for a slot (without chaining its definition). This will be very powerful.
Marcus
Sounds exciting! But I donât quite get what âspecial slotsâ are and what they can do. Is there any resource I can take a look at to get a better understanding?
The paper has some examples: http://rmod.lille.inria.fr/archives/papers/Verw11a-OOSPLA11-FlexibleObjectLa... Another direction that is interesting is Magritte: instead of meta-describing instance variables with some convention of class side methods, you could just define Slots that have all the Magritte style meta data. Marcus
Thanks Marcus. Iâve read the paper and now Iâm REALLY excited! YAY for Pharo :) On 03.07.2014, at 11:01, Marcus Denker <marcus.denker@inria.fr> wrote:
On 03 Jul 2014, at 10:52, Max Leske <maxleske@gmail.com> wrote:
On 03.07.2014, at 10:21, Marcus Denker <marcus.denker@inria.fr> wrote:
Now classes with special Slots are shown with a special class definition (this is just a stand-in, not final⦠e.g. we need to add first class globals and think about what to do with #category⦠so we will see. For now please treat this as just a stand-in for playing with things.
<slots.png>
The idea is that we need to actually use it and then see what to change in the next iteration.
And it should stay always compatible: if you do not use special slots, it is compatible, if you do, you get more power at the price of not being portable to other systems. But even in this case, the slots do give value: e.g. we will be able to add very very easily breakpoints or reflectively change behaviour for a slot (without chaining its definition). This will be very powerful.
Marcus
Sounds exciting! But I donât quite get what âspecial slotsâ are and what they can do. Is there any resource I can take a look at to get a better understanding?
The paper has some examples: http://rmod.lille.inria.fr/archives/papers/Verw11a-OOSPLA11-FlexibleObjectLa...
Another direction that is interesting is Magritte: instead of meta-describing instance variables with some convention of class side methods, you could just define Slots that have all the Magritte style meta data.
Marcus
This is now in 4.0 060. to play with it, execute: Object subclass: #B slots: {#iv => TestSlot} classVariableNames: '' category: âPlayground' On 03 Jul 2014, at 10:21, Marcus Denker <marcus.denker@inria.fr> wrote:
Now classes with special Slots are shown with a special class definition (this is just a stand-in, not final⦠e.g. we need to add first class globals and think about what to do with #category⦠so we will see. For now please treat this as just a stand-in for playing with things.
<slots.png>
The idea is that we need to actually use it and then see what to change in the next iteration.
I cannot wait to get to play with this. Btw, is it possible to have a slot per object? Or are slots only part of the class definition? I am thinking of several performance optimization scenarios that I saw in Moose where we need to store a temporary value in an object as a cache as part of a larger computation. Typically, for things like this you create another structure in between, but the problem with that approach is that you lose object identity and things become immediately too complicated. If we would have a slot per object, we could use this mechanism in such a way. I think there is a class of scenarios that can be simplified significantly. If per object is not possible, we could somehow think of a special slot that would hold a dictionary with instances as keys. Cheers, Doru On Thu, Jul 3, 2014 at 11:32 AM, Marcus Denker <marcus.denker@inria.fr> wrote:
This is now in 4.0 060.
to play with it, execute:
Object subclass: #B slots: {#iv => TestSlot} classVariableNames: '' category: âPlayground'
On 03 Jul 2014, at 10:21, Marcus Denker <marcus.denker@inria.fr> wrote:
Now classes with special Slots are shown with a special class definition (this is just a stand-in, not final⦠e.g. we need to add first class globals and think about what to do with #category⦠so we will see. For now please treat this as just a stand-in for playing with things.
<slots.png>
The idea is that we need to actually use it and then see what to change in the next iteration.
-- www.tudorgirba.com "Every thing has its own flow"
On 03 Jul 2014, at 13:15, Tudor Girba <tudor@tudorgirba.com> wrote:
I cannot wait to get to play with this.
Btw, is it possible to have a slot per object? Or are slots only part of the class definition?
They are part of the class definition. The idea is to get lots of power *without* changing the underlying object modelâ¦
I am thinking of several performance optimization scenarios that I saw in Moose where we need to store a temporary value in an object as a cache as part of a larger computation. Typically, for things like this you create another structure in between, but the problem with that approach is that you lose object identity and things become immediately too complicated.
If we would have a slot per object, we could use this mechanism in such a way. I think there is a class of scenarios that can be simplified significantly. If per object is not possible, we could somehow think of a special slot that would hold a dictionary with instances as keys.
You could do a slot that saves object state in a such a dictionary, adding such a slot to the class would mean that you would not need to #become all the instances⦠but else it is the same as adding an instance variable reflectively in standard smalltalk, with the downside that it would be slow and memory intensive. So the better way is to use the same trick that is possible now: anonyous subclass, add the slot there, change class of your object to that anonymous class. We should add a nice API on Object (#addInstanceSlot: or something that hides the whole complexity and makes it easy to useâ¦) I want to look at instance specific mechanisms later, after a) Slots are there and b) we have MetaLinks for both Slots, Globals and AST nodes... Marcus
participants (3)
-
Marcus Denker -
Max Leske -
Tudor Girba