Re: [Pharo-users] Initializing a class with a Dictionary

2014-05-23 Thread stepharo
Hi sergio what do you want to do? Object subclass: #MyClass instanceVarNames: 'dict' MyClass>>initialize [ super initialize. dict := Dictionary new. ] MyClass>>atKey: aKey put: aVal [ dict at: aKey put: aVal ] MyClass>>atKey: aKey [ ^ dict at: aKey

Re: [Pharo-users] Initializing a class with a Dictionary

2014-05-22 Thread Clément Bera
2014-05-22 21:11 GMT+02:00 sergio_101 : > great! looking at STON next! thanks! > > You can find it in the configuration browser > > On Thu, May 22, 2014 at 2:26 PM, Clément Bera wrote: > >> Hello, >> >> I think you should look at the STON framework. STON looks like JSON for >> smalltalk objects.

Re: [Pharo-users] Initializing a class with a Dictionary

2014-05-22 Thread sergio_101
great! looking at STON next! thanks! On Thu, May 22, 2014 at 2:26 PM, Clément Bera wrote: > Hello, > > I think you should look at the STON framework. STON looks like JSON for > smalltalk objects. Basically it does the same as your idea but instead of a > dictionary it loads fields of an objects

Re: [Pharo-users] Initializing a class with a Dictionary

2014-05-22 Thread Clément Bera
Hello, I think you should look at the STON framework. STON looks like JSON for smalltalk objects. Basically it does the same as your idea but instead of a dictionary it loads fields of an objects from a STON file which looks like a JSON file (a STON is kind of an extended Dictionary exported as a

[Pharo-users] Initializing a class with a Dictionary

2014-05-22 Thread sergio_101
is it possible to initialize a class with a dictionary? my first thought would be to create a method like: intializeWithDictionary: aDictionary then, loop through the elements and do something like: instVarNamed: key put: value but the book says: Caveat: Although these methods are useful for b