pharo-users@lists.pharo.org

Any question about pharo is welcome

View all threads

Pharo 12 and instanceVariables

HV
Herve Verjus
Sun, Sep 22, 2024 3:00 PM

Hi Everybody,

I try to be up-to-date with Pharo trends and releases. In Pharo 12, we
are switching to use fluid class declaration. Its' not easy to find
stuffs illustrating fluid API. I have spend many hours to browse Pharo
documentation, Github repos, slides, MOOcs, books, papers finding a way
to clearly explain this "new way" of declaring a class. All Pharo
introduction resources and Pharo 12 videos do not use fluid class
declaration but the "old" way. I also use (and let's say teach) Pharo in
my OOP lectures 😉

If I'm not wrong, the fluid class declaration does no more explicitly
deal with instance (and class) variables. Instead, it deals now with
slots, tags, shared variables, traits,...At a fist look, I was
understanding that slots was a dynamic way to declare instance
variables. After reading some pieces of paper, and if I'm not wrong ,
slots are not really instance variables and shared variables are not
class variables.

Avoiding the old class declaration, i.e.

      Object subclass #SomeClassName instanceVariableNames: 'instaVar1
instVar2 ...' ...

is there a simple way to add an instance (or class) variable? Are
instance variables gone in Pharo? I assume I missed something, but what?

Many thanks. Cheers,

Herve

Hi Everybody, I try to be up-to-date with Pharo trends and releases. In Pharo 12, we are switching to use fluid class declaration. Its' not easy to find stuffs illustrating fluid API. I have spend many hours to browse Pharo documentation, Github repos, slides, MOOcs, books, papers finding a way to clearly explain this "new way" of declaring a class. All Pharo introduction resources and Pharo 12 videos do not use fluid class declaration but the "old" way. I also use (and let's say teach) Pharo in my OOP lectures 😉 If I'm not wrong, the fluid class declaration does no more explicitly deal with instance (and class) variables. Instead, it deals now with slots, tags, shared variables, traits,...At a fist look, I was understanding that slots was a dynamic way to declare instance variables. After reading some pieces of paper, and if I'm not wrong , slots are not really instance variables and shared variables are not class variables. Avoiding the old class declaration, i.e.       Object subclass #SomeClassName instanceVariableNames: 'instaVar1 instVar2 ...' ... is there a simple way to add an instance (or class) variable? Are instance variables gone in Pharo? I assume I missed something, but what? Many thanks. Cheers, Herve
SD
stephane ducasse
Sun, Sep 22, 2024 5:17 PM

Hello Herve

I will add a description in the doc/ folder in P13 and may be P12.

If you need you can bring the menu on the class definition (put the caret on the class name) and select expand and you will see all the definition possibilities.

ïżŒïżŒ

  • layout: is for the different class formats

For example
ArrayedCollection << #Array
layout: VariableLayout;
tag: 'Base';
package: 'Collections-Sequenceable’

is the same as

ArrayedCollection variableSubclass: #Array
instanceVariableNames: ''
classVariableNames: ''
package: 'Collections-Sequenceable-Base'

  • traits:  for traits

For the rest, consider that this is the same with different names (because slots are compatible with instance variables).

So

Object << #Point
slots: { #x . #y };
tag: 'BasicObjects';
package: ‘Kernel'

is the same as

Object subclass: #Point
instanceVariableNames: 'x y'
classVariableNames: ''
package: 'Kernel-BasicObjects’

and

WeakIdentityKeyDictionary << #ASTCache
sharedVariables: { #CacheMissStrategy };
tag: 'Parser';
package: 'AST-Core'

is the same as

WeakIdentityKeyDictionary subclass: #ASTCache
instanceVariableNames: ''
classVariableNames: 'CacheMissStrategy'
package: 'AST-Core-Parser'

What you see is that we do not have to specify empty lists :)

The only mandatary information is the class name and the package

Object << #Foo
package: ‘MyPackage’

is a nice class definition.

The template show empty slots: {}; but this is not needed this is because some people do not like that type of slots: { };

BTW we use the new syntax in the Advanced Design Mooc and I started to migrate books too (not Pharo by Example because it is a big amount of work).

Tell us if this is clear for you.
I plan to change the slides of the Pharo mooc (I’m currently converting them to use a nice slide syntax)
to use the fluid syntax.

Hi Everybody,

I try to be up-to-date with Pharo trends and releases. In Pharo 12, we are switching to use fluid class declaration. Its' not easy to find stuffs illustrating fluid API. I have spend many hours to browse Pharo documentation, Github repos, slides, MOOcs, books, papers finding a way to clearly explain this "new way" of declaring a class. All Pharo introduction resources and Pharo 12 videos do not use fluid class declaration but the "old" way. I also use (and let's say teach) Pharo in my OOP lectures 😉

If you have links please send them and we will convert them.

If I'm not wrong, the fluid class declaration does no more explicitly deal with instance (and class) variables. Instead, it deals now with slots, tags, shared variables, traits,...At a fist look, I was understanding that slots was a dynamic way to declare instance variables.

A Slot is first an object representing an instance variable.
Now by default the programmer should use a symbol
so you go from

‘x y’ to {#x . #y}

This syntax let us write more complex class definitions such as

SpPresenter << #SpDialogPresenter
slots: {
#parentWindow => WeakSlot .
#acceptAction .
#cancelAction .
#image };
package: 'Spec2-Dialogs'

here #parentWindow => WeakSlot creates a slot of the class WeakSlot (does not count for garbage collector)

After reading some pieces of paper, and if I'm not wrong , slots are not really instance variables and shared variables are not class variables.

Avoiding the old class declaration, i.e.

   Object subclass #SomeClassName instanceVariableNames: 'instaVar1 instVar2 ...' ...

is there a simple way to add an instance (or class) variable?

you use slots: {  .  };
and

sharedVariables: are for classVarNames:
This is because sharedVariables are shared between the instance and class side
and like that we do not have the confusion of
class variables and metaclass instance variables.

For example TextConstants defines the following sharedVariables:

SharedPool << #TextConstants
slots: {};
sharedVariables: { #Ctrls . #Ctrlh . #CtrlR . #CtrlG . #DefaultMarginTabsArray . #Ctrlx . #Ctrlm . #Ctrlb . #BS . #CtrlL . #CtrlA . #CtrlW . #DefaultRule . #DefaultFontFamilySize . #Ctrlr . #Ctrlg . #CtrlQ . #EndOfRun . #CtrlF . #Italic . #Basal . #Ctrlw . #Ctrll . #Ctrla . #CtrlV . #CtrlK . #Bold . #Justified . #Ctrlf . #Ctrlq . #CtrlP . #CtrlE . #LeftMarginTab . #CtrlOpenBrackets . #DefaultSpace . #Ctrlv . #Ctrlk . #CtrlU . #CtrlJ . #Ctrlp . #Ctrle . #CtrlZ . #CtrlO . #CtrlD . #DefaultBaseline . #CrossedX . #LeftFlush . #Space . #Ctrlj . #CtrlT . #CtrlI . #RightFlush . #DefaultTab . #Ctrlu . #Centered . #Ctrlz . #Ctrlo . #Ctrld . #CtrlY . #CtrlN . #CtrlC . #Enter . #DefaultLineGrid . #ESC . #Ctrlt . #Ctrli . #CtrlS . #CtrlH . #Clear . #CR . #CtrlDigits . #DefaultMask . #Ctrln . #Ctrlc . #RightMarginTab . #CtrlM . #CtrlX . #BS2 . #Tab . #TextSharedInformation . #DefaultTabsArray . #Ctrly . #CtrlB };
tag: 'Base';
package: 'Text-Core'

ArrayedCollection subclass: #Text
instanceVariableNames: 'string runs'
classVariableNames: ''
poolDictionaries: 'TextConstants'
package: 'Text-Core-Base'

is now

ArrayedCollection << #Text
slots: { #string . #runs };
sharedPools: { TextConstants };
tag: 'Base';
package: 'Text-Core'

Because this is years that poolDictionaries do not exist anymore (they have SharedPool e.g. a special class holding sharedVariables)

Are instance variables gone in Pharo? I assume I missed something, but what?

No just empowered and backwards compatible.

Many thanks. Cheers,

Herve

Stéphane Ducasse
http://stephane.ducasse.free.fr
06 30 93 66 73

"If you knew today was your last day on earth, what would you do differently? ....ESPECIALLY if, by doing something different, today might not be your last day on earth.” Calvin & Hobbes

Hello Herve I will add a description in the doc/ folder in P13 and may be P12. If you need you can bring the menu on the class definition (put the caret on the class name) and select expand and you will see all the definition possibilities. ïżŒïżŒ - layout: is for the different class formats For example ArrayedCollection << #Array layout: VariableLayout; tag: 'Base'; package: 'Collections-Sequenceable’ is the same as ArrayedCollection variableSubclass: #Array instanceVariableNames: '' classVariableNames: '' package: 'Collections-Sequenceable-Base' - traits: for traits For the rest, consider that this is the same with different names (because slots are compatible with instance variables). So Object << #Point slots: { #x . #y }; tag: 'BasicObjects'; package: ‘Kernel' is the same as Object subclass: #Point instanceVariableNames: 'x y' classVariableNames: '' package: 'Kernel-BasicObjects’ and WeakIdentityKeyDictionary << #ASTCache sharedVariables: { #CacheMissStrategy }; tag: 'Parser'; package: 'AST-Core' is the same as WeakIdentityKeyDictionary subclass: #ASTCache instanceVariableNames: '' classVariableNames: 'CacheMissStrategy' package: 'AST-Core-Parser' What you see is that we do not have to specify empty lists :) The only mandatary information is the class name and the package Object << #Foo package: ‘MyPackage’ is a nice class definition. The template show empty slots: {}; but this is not needed this is because some people do not like that type of slots: { }; BTW we use the new syntax in the Advanced Design Mooc and I started to migrate books too (not Pharo by Example because it is a big amount of work). Tell us if this is clear for you. I plan to change the slides of the Pharo mooc (I’m currently converting them to use a nice slide syntax) to use the fluid syntax. > > Hi Everybody, > > I try to be up-to-date with Pharo trends and releases. In Pharo 12, we are switching to use fluid class declaration. Its' not easy to find stuffs illustrating fluid API. I have spend many hours to browse Pharo documentation, Github repos, slides, MOOcs, books, papers finding a way to clearly explain this "new way" of declaring a class. All Pharo introduction resources and Pharo 12 videos do not use fluid class declaration but the "old" way. I also use (and let's say teach) Pharo in my OOP lectures 😉 If you have links please send them and we will convert them. > If I'm not wrong, the fluid class declaration does no more explicitly deal with instance (and class) variables. Instead, it deals now with slots, tags, shared variables, traits,...At a fist look, I was understanding that slots was a dynamic way to declare instance variables. A Slot is first an object representing an instance variable. Now by default the programmer should use a symbol so you go from ‘x y’ to {#x . #y} This syntax let us write more complex class definitions such as SpPresenter << #SpDialogPresenter slots: { #parentWindow => WeakSlot . #acceptAction . #cancelAction . #image }; package: 'Spec2-Dialogs' here #parentWindow => WeakSlot creates a slot of the class WeakSlot (does not count for garbage collector) > After reading some pieces of paper, and if I'm not wrong , slots are not really instance variables and shared variables are not class variables. > > Avoiding the old class declaration, i.e. > > Object subclass #SomeClassName instanceVariableNames: 'instaVar1 instVar2 ...' ... > > is there a simple way to add an instance (or class) variable? you use slots: { . }; and sharedVariables: are for classVarNames: This is because sharedVariables are shared between the instance and class side and like that we do not have the confusion of class variables and metaclass instance variables. For example TextConstants defines the following sharedVariables: SharedPool << #TextConstants slots: {}; sharedVariables: { #Ctrls . #Ctrlh . #CtrlR . #CtrlG . #DefaultMarginTabsArray . #Ctrlx . #Ctrlm . #Ctrlb . #BS . #CtrlL . #CtrlA . #CtrlW . #DefaultRule . #DefaultFontFamilySize . #Ctrlr . #Ctrlg . #CtrlQ . #EndOfRun . #CtrlF . #Italic . #Basal . #Ctrlw . #Ctrll . #Ctrla . #CtrlV . #CtrlK . #Bold . #Justified . #Ctrlf . #Ctrlq . #CtrlP . #CtrlE . #LeftMarginTab . #CtrlOpenBrackets . #DefaultSpace . #Ctrlv . #Ctrlk . #CtrlU . #CtrlJ . #Ctrlp . #Ctrle . #CtrlZ . #CtrlO . #CtrlD . #DefaultBaseline . #CrossedX . #LeftFlush . #Space . #Ctrlj . #CtrlT . #CtrlI . #RightFlush . #DefaultTab . #Ctrlu . #Centered . #Ctrlz . #Ctrlo . #Ctrld . #CtrlY . #CtrlN . #CtrlC . #Enter . #DefaultLineGrid . #ESC . #Ctrlt . #Ctrli . #CtrlS . #CtrlH . #Clear . #CR . #CtrlDigits . #DefaultMask . #Ctrln . #Ctrlc . #RightMarginTab . #CtrlM . #CtrlX . #BS2 . #Tab . #TextSharedInformation . #DefaultTabsArray . #Ctrly . #CtrlB }; tag: 'Base'; package: 'Text-Core' ArrayedCollection subclass: #Text instanceVariableNames: 'string runs' classVariableNames: '' poolDictionaries: 'TextConstants' package: 'Text-Core-Base' is now ArrayedCollection << #Text slots: { #string . #runs }; sharedPools: { TextConstants }; tag: 'Base'; package: 'Text-Core' Because this is years that poolDictionaries do not exist anymore (they have SharedPool e.g. a special class holding sharedVariables) > Are instance variables gone in Pharo? I assume I missed something, but what? No just empowered and backwards compatible. > > Many thanks. Cheers, > > Herve StĂ©phane Ducasse http://stephane.ducasse.free.fr 06 30 93 66 73 "If you knew today was your last day on earth, what would you do differently? ....ESPECIALLY if, by doing something different, today might not be your last day on earth.” Calvin & Hobbes
HV
Herve Verjus
Sun, Sep 22, 2024 6:54 PM

Hello Steph,

many thanks. It's now clear I think 😃. My first understanding considering slots as objects representing instance variables wasn't bad. I wasn't sure because I was reading something to not consider slots as instance vars. Your answer lights me a lot 😉.

HVE

Sep 22, 2024 19:18:24 stephane ducasse stephane.ducasse@inria.fr:

Hello Herve

I will add a description in the doc/ folder in P13 and may be P12.

If you need you can bring the menu on the class definition (put the caret on the class name) and select expand and you will see all the definition possibilities. 

[cid:0A8FCA81-F1A9-490A-B051-8DE6F56A4E00][Capture 2024-09-22 at 19.06.35.png][cid:0A8FCA81-F1A9-490A-B051-8DE6F56A4E00][cid:EAC3AD2D-8376-429F-A59C-EE02E4ED5275][Capture 2024-09-22 at 19.06.44.png][cid:EAC3AD2D-8376-429F-A59C-EE02E4ED5275]

  • layout: is for the different class formats

For example 
ArrayedCollection << #Array
layout: VariableLayout;
tag: 'Base';
package: 'Collections-Sequenceable’

is the same as 

ArrayedCollection variableSubclass: #Array
instanceVariableNames: ''
classVariableNames: ''
package: 'Collections-Sequenceable-Base'

  • traits:  for traits

For the rest, consider that this is the same with different names (because slots are compatible with instance variables).

So 

Object << #Point
slots: { #x . #y };
tag: 'BasicObjects';
package: ‘Kernel'

is the same as

Object subclass: #Point
instanceVariableNames: 'x y'
classVariableNames: ''
package: 'Kernel-BasicObjects’

and 

WeakIdentityKeyDictionary << #ASTCache
sharedVariables: { #CacheMissStrategy };
tag: 'Parser';
package: 'AST-Core'

is the same as 

WeakIdentityKeyDictionary subclass: #ASTCache
instanceVariableNames: ''
classVariableNames: 'CacheMissStrategy'
package: 'AST-Core-Parser'

What you see is that we do not have to specify empty lists :)

The only mandatary information is the class name and the package

Object << #Foo
package: ‘MyPackage’

is a nice class definition.

The template show empty slots: {}; but this is not needed this is because some people do not like that type of slots: { };

BTW we use the new syntax in the Advanced Design Mooc and I started to migrate books too (not Pharo by Example because it is a big amount of work). 

Tell us if this is clear for you. 
I plan to change the slides of the Pharo mooc (I’m currently converting them to use a nice slide syntax) 
to use the fluid syntax. 

Hi Everybody,

I try to be up-to-date with Pharo trends and releases. In Pharo 12, we are switching to use fluid class declaration. Its' not easy to find stuffs illustrating fluid API. I have spend many hours to browse Pharo documentation, Github repos, slides, MOOcs, books, papers finding a way to clearly explain this "new way" of declaring a class. All Pharo introduction resources and Pharo 12 videos do not use fluid class declaration but the "old" way. I also use (and let's say teach) Pharo in my OOP lectures 😉

If you have links please send them and we will convert them. 

If I'm not wrong, the fluid class declaration does no more explicitly deal with instance (and class) variables. Instead, it deals now with slots, tags, shared variables, traits,...At a fist look, I was understanding that slots was a dynamic way to declare instance variables.

A Slot is first an object representing an instance variable. 
Now by default the programmer should use a symbol 
so you go from

‘x y’ to {#x . #y}

This syntax let us write more complex class definitions such as

SpPresenter << #SpDialogPresenter
slots: {
#parentWindow => WeakSlot .
#acceptAction .
#cancelAction .
#image };
package: 'Spec2-Dialogs'

here #parentWindow => WeakSlot creates a slot of the class WeakSlot (does not count for garbage collector)

After reading some pieces of paper, and if I'm not wrong , slots are not really instance variables and shared variables are not class variables.

Avoiding the old class declaration, i.e.

      Object subclass #SomeClassName instanceVariableNames: 'instaVar1 instVar2 ...' ...

is there a simple way to add an instance (or class) variable?

you use slots: {  .  };
and 

sharedVariables: are for classVarNames: 
This is because sharedVariables are shared between the instance and class side
and like that we do not have the confusion of 
class variables and metaclass instance variables. 

For example TextConstants defines the following sharedVariables:

SharedPool << #TextConstants
slots: {};
sharedVariables: { #Ctrls . #Ctrlh . #CtrlR . #CtrlG . #DefaultMarginTabsArray . #Ctrlx . #Ctrlm . #Ctrlb . #BS . #CtrlL . #CtrlA . #CtrlW . #DefaultRule . #DefaultFontFamilySize . #Ctrlr . #Ctrlg . #CtrlQ . #EndOfRun . #CtrlF . #Italic . #Basal . #Ctrlw . #Ctrll . #Ctrla . #CtrlV . #CtrlK . #Bold . #Justified . #Ctrlf . #Ctrlq . #CtrlP . #CtrlE . #LeftMarginTab . #CtrlOpenBrackets . #DefaultSpace . #Ctrlv . #Ctrlk . #CtrlU . #CtrlJ . #Ctrlp . #Ctrle . #CtrlZ . #CtrlO . #CtrlD . #DefaultBaseline . #CrossedX . #LeftFlush . #Space . #Ctrlj . #CtrlT . #CtrlI . #RightFlush . #DefaultTab . #Ctrlu . #Centered . #Ctrlz . #Ctrlo . #Ctrld . #CtrlY . #CtrlN . #CtrlC . #Enter . #DefaultLineGrid . #ESC . #Ctrlt . #Ctrli . #CtrlS . #CtrlH . #Clear . #CR . #CtrlDigits . #DefaultMask . #Ctrln . #Ctrlc . #RightMarginTab . #CtrlM . #CtrlX . #BS2 . #Tab . #TextSharedInformation . #DefaultTabsArray . #Ctrly . #CtrlB };
tag: 'Base';
package: 'Text-Core'

ArrayedCollection subclass: #Text
instanceVariableNames: 'string runs'
classVariableNames: ''
poolDictionaries: 'TextConstants'
package: 'Text-Core-Base'

is now

ArrayedCollection << #Text
slots: { #string . #runs };
sharedPools: { TextConstants };
tag: 'Base';
package: 'Text-Core'

Because this is years that poolDictionaries do not exist anymore (they have SharedPool e.g. a special class holding sharedVariables)

Are instance variables gone in Pharo? I assume I missed something, but what?

No just empowered and backwards compatible. 

Many thanks. Cheers,

Herve

Stéphane Ducasse
http://stephane.ducasse.free.fr
06 30 93 66 73

"If you knew today was your last day on earth, what would you do differently? ....ESPECIALLY if, by doing something different, today might not be your last day on earth.” Calvin & Hobbes

Hello Steph, many thanks. It's now clear I think 😃. My first understanding considering slots as objects representing instance variables wasn't bad. I wasn't sure because I was reading something to not consider slots as instance vars. Your answer lights me a lot 😉. HVE Sep 22, 2024 19:18:24 stephane ducasse <stephane.ducasse@inria.fr>: > Hello Herve > > I will add a description in the doc/ folder in P13 and may be P12. > > If you need you can bring the menu on the class definition (put the caret on the class name) and select expand and you will see all the definition possibilities.  > > > [cid:0A8FCA81-F1A9-490A-B051-8DE6F56A4E00][Capture 2024-09-22 at 19.06.35.png][cid:0A8FCA81-F1A9-490A-B051-8DE6F56A4E00][cid:EAC3AD2D-8376-429F-A59C-EE02E4ED5275][Capture 2024-09-22 at 19.06.44.png][cid:EAC3AD2D-8376-429F-A59C-EE02E4ED5275] > > > > - layout: is for the different class formats > > For example  > ArrayedCollection << #Array > layout: VariableLayout; > tag: 'Base'; > package: 'Collections-Sequenceable’ > > is the same as  > > ArrayedCollection variableSubclass: #Array > instanceVariableNames: '' > classVariableNames: '' > package: 'Collections-Sequenceable-Base' > > - traits:  for traits > > > For the rest, consider that this is the same with different names (because slots are compatible with instance variables). > > So  > > Object << #Point > slots: { #x . #y }; > tag: 'BasicObjects'; > package: ‘Kernel' > > is the same as > > Object subclass: #Point > instanceVariableNames: 'x y' > classVariableNames: '' > package: 'Kernel-BasicObjects’ > > > and  > > WeakIdentityKeyDictionary << #ASTCache > sharedVariables: { #CacheMissStrategy }; > tag: 'Parser'; > package: 'AST-Core' > > is the same as  > > WeakIdentityKeyDictionary subclass: #ASTCache > instanceVariableNames: '' > classVariableNames: 'CacheMissStrategy' > package: 'AST-Core-Parser' > > > What you see is that we do not have to specify empty lists :) > > The only mandatary information is the class name and the package > > Object << #Foo > package: ‘MyPackage’ > > is a nice class definition. > > The template show empty slots: {}; but this is not needed this is because some people do not like that type of slots: { }; > > > BTW we use the new syntax in the Advanced Design Mooc and I started to migrate books too (not Pharo by Example because it is a big amount of work).  > > > Tell us if this is clear for you.  > I plan to change the slides of the Pharo mooc (I’m currently converting them to use a nice slide syntax)  > to use the fluid syntax.  > >> >> Hi Everybody, >> >> I try to be up-to-date with Pharo trends and releases. In Pharo 12, we are switching to use fluid class declaration. Its' not easy to find stuffs illustrating fluid API. I have spend many hours to browse Pharo documentation, Github repos, slides, MOOcs, books, papers finding a way to clearly explain this "new way" of declaring a class. All Pharo introduction resources and Pharo 12 videos do not use fluid class declaration but the "old" way. I also use (and let's say teach) Pharo in my OOP lectures 😉 > > If you have links please send them and we will convert them.  > > >> If I'm not wrong, the fluid class declaration does no more explicitly deal with instance (and class) variables. Instead, it deals now with slots, tags, shared variables, traits,...At a fist look, I was understanding that slots was a dynamic way to declare instance variables. > > A Slot is first an object representing an instance variable.  > Now by default the programmer should use a symbol  > so you go from > > ‘x y’ to {#x . #y} > > This syntax let us write more complex class definitions such as > > SpPresenter << #SpDialogPresenter > slots: { > #parentWindow => WeakSlot . > #acceptAction . > #cancelAction . > #image }; > package: 'Spec2-Dialogs' > > here #parentWindow => WeakSlot creates a slot of the class WeakSlot (does not count for garbage collector) > > >> After reading some pieces of paper, and if I'm not wrong , slots are not really instance variables and shared variables are not class variables. >> >> Avoiding the old class declaration, i.e. >> >>       Object subclass #SomeClassName instanceVariableNames: 'instaVar1 instVar2 ...' ... >> >> is there a simple way to add an instance (or class) variable? > > you use slots: {  .  }; > and  > > sharedVariables: are for classVarNames:  > This is because sharedVariables are shared between the instance and class side > and like that we do not have the confusion of  > class variables and metaclass instance variables.  > > > > > For example TextConstants defines the following sharedVariables: > > SharedPool << #TextConstants > slots: {}; > sharedVariables: { #Ctrls . #Ctrlh . #CtrlR . #CtrlG . #DefaultMarginTabsArray . #Ctrlx . #Ctrlm . #Ctrlb . #BS . #CtrlL . #CtrlA . #CtrlW . #DefaultRule . #DefaultFontFamilySize . #Ctrlr . #Ctrlg . #CtrlQ . #EndOfRun . #CtrlF . #Italic . #Basal . #Ctrlw . #Ctrll . #Ctrla . #CtrlV . #CtrlK . #Bold . #Justified . #Ctrlf . #Ctrlq . #CtrlP . #CtrlE . #LeftMarginTab . #CtrlOpenBrackets . #DefaultSpace . #Ctrlv . #Ctrlk . #CtrlU . #CtrlJ . #Ctrlp . #Ctrle . #CtrlZ . #CtrlO . #CtrlD . #DefaultBaseline . #CrossedX . #LeftFlush . #Space . #Ctrlj . #CtrlT . #CtrlI . #RightFlush . #DefaultTab . #Ctrlu . #Centered . #Ctrlz . #Ctrlo . #Ctrld . #CtrlY . #CtrlN . #CtrlC . #Enter . #DefaultLineGrid . #ESC . #Ctrlt . #Ctrli . #CtrlS . #CtrlH . #Clear . #CR . #CtrlDigits . #DefaultMask . #Ctrln . #Ctrlc . #RightMarginTab . #CtrlM . #CtrlX . #BS2 . #Tab . #TextSharedInformation . #DefaultTabsArray . #Ctrly . #CtrlB }; > tag: 'Base'; > package: 'Text-Core' > > > ArrayedCollection subclass: #Text > instanceVariableNames: 'string runs' > classVariableNames: '' > poolDictionaries: 'TextConstants' > package: 'Text-Core-Base' > > is now > > ArrayedCollection << #Text > slots: { #string . #runs }; > sharedPools: { TextConstants }; > tag: 'Base'; > package: 'Text-Core' > > Because this is years that poolDictionaries do not exist anymore (they have SharedPool e.g. a special class holding sharedVariables) > >> Are instance variables gone in Pharo? I assume I missed something, but what? > > No just empowered and backwards compatible.  > > >> >> Many thanks. Cheers, >> >> Herve > > StĂ©phane Ducasse > http://stephane.ducasse.free.fr > 06 30 93 66 73 > > "If you knew today was your last day on earth, what would you do differently? ....ESPECIALLY if, by doing something different, today might not be your last day on earth.” Calvin & Hobbes > > > > >
SD
stephane ducasse
Sun, Sep 22, 2024 8:01 PM

Thanks for your question.
I will add the following to the doc folder :)

Thanks for your question. I will add the following to the doc folder :)
SD
stephane ducasse
Sun, Sep 22, 2024 8:11 PM

On 22 Sep 2024, at 22:01, stephane ducasse stephane.ducasse@inria.fr wrote:

Thanks for your question.
I will add the following to the doc folder :)

<fluid.pdf>

Stéphane Ducasse
http://stephane.ducasse.free.fr
06 30 93 66 73

"If you knew today was your last day on earth, what would you do differently? ....ESPECIALLY if, by doing something different, today might not be your last day on earth.” Calvin & Hobbes

https://github.com/pharo-project/pharo/pull/17151 with less typos :) > On 22 Sep 2024, at 22:01, stephane ducasse <stephane.ducasse@inria.fr> wrote: > > Thanks for your question. > I will add the following to the doc folder :) > > <fluid.pdf> StĂ©phane Ducasse http://stephane.ducasse.free.fr 06 30 93 66 73 "If you knew today was your last day on earth, what would you do differently? ....ESPECIALLY if, by doing something different, today might not be your last day on earth.” Calvin & Hobbes
HV
Herve Verjus
Sun, Sep 22, 2024 8:36 PM

Great! 😃

Herve

Sep 22, 2024 22:11:55 stephane ducasse stephane.ducasse@inria.fr:

On 22 Sep 2024, at 22:01, stephane ducasse stephane.ducasse@inria.fr wrote:

Thanks for your question.
I will add the following to the doc folder :)

<fluid.pdf>

Stéphane Ducasse
http://stephane.ducasse.free.fr
06 30 93 66 73

"If you knew today was your last day on earth, what would you do differently? ....ESPECIALLY if, by doing something different, today might not be your last day on earth.” Calvin & Hobbes

Great! 😃 Herve Sep 22, 2024 22:11:55 stephane ducasse <stephane.ducasse@inria.fr>: > > https://github.com/pharo-project/pharo/pull/17151 with less typos :) > > > > > >> On 22 Sep 2024, at 22:01, stephane ducasse <stephane.ducasse@inria.fr> wrote: >> >> Thanks for your question. >> I will add the following to the doc folder :) >> >> <fluid.pdf> > > StĂ©phane Ducasse > http://stephane.ducasse.free.fr > 06 30 93 66 73 > > "If you knew today was your last day on earth, what would you do differently? ....ESPECIALLY if, by doing something different, today might not be your last day on earth.” Calvin & Hobbes > > > > >