Hello, Where I can find documentation for slots? I am trying to access the pharo books site but it is unreachable from my network right now, I got a connection time out (It works from my 3G though (??) ), but if I remember correctly the is no slot description in any book. Regards, Vitor There is no documentation about slots that I know. I’m sorry. Marcus may want to write one in the future. Stef
|
Seems like an opportunity...I have no idea what the addition of slots does but I would like to learn.
|
On Sun, 3 Feb 2019 at 17:50, Todd Blanchard via Pharo-users <[hidden email]> wrote:
I believe its an implementation of this paper... cheers -ben |
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 <[hidden email]> wrote:
|
Is ready, is official, is there :) Esteban
|
In reply to this post by Vitor Medina Cruz
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 Sun, 3 Feb 2019 at 17:50, Todd Blanchard via Pharo-users < >> > pharo-users@.pharo >> 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 < > stepharo@ > > wrote: >>> >>> Hello, >>> >>> Where I can find documentation for slots? >>> >>> I am trying to access the pharo books site but it is unreachable from my >>> network right now, I got a connection time out (It works from my 3G >>> though >>> (??) ), but if I remember correctly the is no slot description in any >>> book. >>> >>> Regards, >>> Vitor >>> >>> >>> Hello victor >>> >>> There is no documentation about slots that I know. I’m sorry. >>> Marcus may want to write one in the future. >>> >>> Stef >>> >>> >> I believe its an implementation of this paper... >> >> https://rmod.inria.fr/archives/papers/Verw11a-OOSPLA11-FlexibleObjectLayouts.pdf >> >> >> cheers -ben >> Slots are already part of Pharo and are totally useable. Some example slots are buggy though. Explore Slot and subclasses, their class comments and methods. One thing to note is if you change #emitStore: or #emitValue: methods in your slot class, you need to trigger change in classes that use it. -- Sent from: http://forum.world.st/Pharo-Smalltalk-Users-f1310670.html |
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 really looks as all this.. there is already so much todo...
Yes, we need to recompile method that use slots with code generation if the code gen methods change. I think there should be even a way to do that automatically. Marcus |
In reply to this post by webwarrior
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 <[hidden email]> wrote: Vitor Medina Cruz wrote |
Would be nice to have a command in browser to show users of selected slot 6 февр. 2019 г. 11:32 пользователь "Vitor Medina Cruz" <[hidden email]> написал:
|
In reply to this post by Vitor Medina Cruz
> On 6 Feb 2019, at 12:30, Vitor Medina Cruz <[hidden email]> 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 classes using slots are for now SlotExampleMovie SlotExamplePerson which test the RelationSlot examples. We should make a package which has more classes that use them… Marcus |
In reply to this post by Denis Kudriashov
> On 6 Feb 2019, at 12:41, Denis Kudriashov <[hidden email]> wrote: > > Would be nice to have a command in browser to show users of selected slot > Yes! Marcus |
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 <[hidden email]> wrote:
|
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 slots: { #x. #y } classVariables: { } package: 'Kernel-BasicObjects’ is the same as Object subclass: #Point slots: { #x => InstanceVariableSlot . #y => InstanceVariableSlot} classVariables: { } package: 'Kernel-BasicObjects' If you evaluate: Point slotNamed: #x you see that it returns a #x => InstanceVariableSlot Slot instance. (with all that: I sometime wonder if we should not get rid of the name “Slot” and just use the term “Variable”… because that is what they are…)
No, the class has a Layout. See subclasses of AbstractLayout. This reifies the magic number that is in the “format” ivar of Behaviors (third ivar of all class like objects). In addition it makes class definition *explicitly* specify the layout. So Array in ST 80 is something like: ArrayedCollection variableSubclass: #Array instanceVariableNames: '' classVariableNames: '' package: 'Collections-Sequenceable-Base' so the layout chosen is hidden in the class creation method (variableSubclass…), while with the reified layouts, it explicit: ArrayedCollection subclass: #Array layout: VariableLayout slots: { } classVariables: { } package: 'Collections-Sequenceable-Base’ e.g. for CompiledMethod it makes clear that is a very special class: CompiledCode subclass: #CompiledMethod layout: CompiledMethodLayout slots: { } classVariables: { } package: 'Kernel-Methods’
|
Ok, thanks, I think I am understanding. Object subclass: #TestClassWithSlots slots: { } classVariables: { } package: 'Experiment-Slots' Code is reversed to: Even if I do:Object subclass: #TestClassWithSlots instanceVariableNames: '' classVariableNames: '' package: 'Experiment-Slots' Object subclass: #TestClassWithSlots slots: { #tests => BaseSlot } classVariables: { } package: ''Experiment-Slots' It reverts back to the instanceVariableNames version. Putting BooleanSlot avoids this reversion. I also tried to put RelationSlot just to see what happens and it entered in an infinite loop error. All those things are errors? If so, where should I report? On Wed, Feb 6, 2019 at 10:46 AM Marcus Denker <[hidden email]> wrote:
|
> On 6 Feb 2019, at 18:17, Vitor Medina Cruz <[hidden email]> 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' > > Code is reversed to: > > Object subclass: #TestClassWithSlots > instanceVariableNames: '' > classVariableNames: '' > package: 'Experiment-Slots' > > Even if I do: Right now if you want to *always* see the slot class definition, you need to turn it on in the preferences. (The browser has a shortcut radio button down on the right down, too). > > Object subclass: #TestClassWithSlots > slots: { #tests => BaseSlot } > classVariables: { } > package: ''Experiment-Slots' > > It reverts back to the instanceVariableNames version. Putting BooleanSlot avoids this reversion. I also tried to put RelationSlot just to see what happens and it entered in an infinite loop error.BaseSlot BaseSlot is an internal slot used e.g. for BooleanSlot (to store the data). It is a hidden slot, that is, one that is not visible in the class definition. (I will add a comment to make clear that this is not meant to be used directly). Marcus |
Free forum by Nabble | Edit this page |