Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /* THE CLASS */
- StoreThis {
- classvar <>storage;
- //this class is run during library compile time.
- *initClass{
- //this method makes sure that the IDict is compiled before
- //trying to make an instance of it
- Class.initClassTree(IdentityDictionary);
- storage = IdentityDictionary.new;
- }
- *adder {|addThis|
- "adding: %".format(addThis).postln;
- // i originalen var denne initiert til 'nil'
- //storage = addThis.asEvent ++ storage.asEvent;
- //ta en titt paa denne forskjellen:
- //funker ikke
- // (hej: "hello", yo: "hej") ++ nil;
- //funker
- // [hej: "hello", yo: "hej"] ++ nil;
- //kan alternativt bruke denne:
- storage.putAll(storage.asEvent);
- "resulting storage: %".format(storage).postln;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement