Re: [Pharo-users] Pharo and instance variables ...

2017-10-18 Thread Ben Coman
Hi James, As an offshoot to your question, when I wanted to understand the difference between "instance variables", "class variables" and "class instance variables" I made this quick demo... http://forum.world.st/Class-vars-and-inst-vars-of-a-class-tp4749910p4749914.html that could make a good te

Re: [Pharo-users] Pharo and instance variables ...

2017-10-18 Thread James Ladd
That said from memory I think it was Digitalk or Enfin that used to automatically generate accessors and mutators Sent from my Commodore 64 > On 18 Oct 2017, at 4:34 pm, Markus Stumptner wrote: > > It would break code all over the place... > >> On 18/10/2017 16:02, James Ladd wrote: >> What

Re: [Pharo-users] Pharo and instance variables ...

2017-10-18 Thread Dimitris Chloupis
Well the method of the receiver can check for the type of the object from which you receive a message, technically you can restrict the access even to a particular instance object. You can enforce a ton of restrictions as the entire system is modifiable and live. On Wed, Oct 18, 2017 at 8:37 AM Pr

Re: [Pharo-users] Pharo and instance variables ...

2017-10-17 Thread James Ladd
Good point - thank you Sent from my Commodore 64 > On 18 Oct 2017, at 4:36 pm, Prof. Andrew P. Black wrote: > > >> On 18 Oct 2017, at 08:32 , James Ladd wrote: >> >> What if accessors were generated but not mutators? >> > > The point is that, once a method exists, there is not way to rest

Re: [Pharo-users] Pharo and instance variables ...

2017-10-17 Thread James Ladd
Good point thanks Sent from my Commodore 64 > On 18 Oct 2017, at 4:34 pm, Markus Stumptner wrote: > > It would break code all over the place... > >> On 18/10/2017 16:02, James Ladd wrote: >> What if accessors were generated but not mutators? >> >> Sent from my Commodore 64 >> >> On 18 Oct 2

Re: [Pharo-users] Pharo and instance variables ...

2017-10-17 Thread Prof. Andrew P. Black
> On 18 Oct 2017, at 08:32 , James Ladd wrote: > > What if accessors were generated but not mutators? > The point is that, once a method exists, there is not way to restrict who can send a message that will execute it. So if one were forces to generate a reader method, or a writer method, j

Re: [Pharo-users] Pharo and instance variables ...

2017-10-17 Thread Markus Stumptner
It would break code all over the place... On 18/10/2017 16:02, James Ladd wrote: What if accessors were generated but not mutators? Sent from my Commodore 64 On 18 Oct 2017, at 4:21 pm, Clément Bera > wrote: On Wed, Oct 18, 2017 at 7:07 AM, James Ladd

Re: [Pharo-users] Pharo and instance variables ...

2017-10-17 Thread James Ladd
What if accessors were generated but not mutators? Sent from my Commodore 64 > On 18 Oct 2017, at 4:21 pm, Clément Bera wrote: > > > >> On Wed, Oct 18, 2017 at 7:07 AM, James Ladd wrote: >> Hey David, >> >> If you could only access instance variables in the class that defined them >> and t

Re: [Pharo-users] Pharo and instance variables ...

2017-10-17 Thread Clément Bera
On Wed, Oct 18, 2017 at 7:07 AM, James Ladd wrote: > Hey David, > > If you could only access instance variables in the class that defined them > and therefore only in a subclass via an accessor / mutator method w that be > a big problem in your view? > Yes. I don't want to have to define access

Re: [Pharo-users] Pharo and instance variables ...

2017-10-17 Thread James Ladd
Hey David, If you could only access instance variables in the class that defined them and therefore only in a subclass via an accessor / mutator method w that be a big problem in your view? Sent from my Commodore 64 > On 18 Oct 2017, at 2:41 pm, David Mason wrote: > > In Pharo, open a browse

Re: [Pharo-users] Pharo and instance variables ...

2017-10-17 Thread James Ladd
Ah that is very helpful - thank you. addFirst: newObject "Add newObject to the beginning of the receiver. Answer newObject." firstIndex = 1 ifTrue: [self makeRoomAtFirst]. firstIndex := firstIndex - 1. *array* at: firstIndex put: newObject. ^ newObject On Wed, Oct 18, 2017 at 2:41 PM, David Ma

Re: [Pharo-users] Pharo and instance variables ...

2017-10-17 Thread David Mason
In Pharo, open a browser on OrderedCollection, then click "Variables" in the top left of the window and then "array"... if you scroll through you can see that mostly OrderedCollection methods use it, but some SortedCollection (a subclass) methods also use it. The model is similar to protected in J

Re: [Pharo-users] Pharo and instance variables ...

2017-10-17 Thread James Ladd
Please could you provide an example? On Wed, Oct 18, 2017 at 2:16 PM, David Mason wrote: > Any instance method in the class where the instance variable is defined or > in a subclass can access the instance variable. Similarly for class > methods to access class-side variables, and for class a

Re: [Pharo-users] Pharo and instance variables ...

2017-10-17 Thread David Mason
Any instance method in the class where the instance variable is defined or in a subclass can access the instance variable. Similarly for class methods to access class-side variables, and for class and instance methods to access class variables. On 17 October 2017 at 23:04, James Ladd wrote: > H