GolfDic
@@golf_hash
class変数の追加方法が分からず試行錯誤。
Object.GolfDic := Dictionary new! " <= ?? " !Object methodsFor: 'golf'! doesNotUnderstand: m | a s k | a := m arguments size. s := m selector, '*' copyReplaceAll: ':' with: '*:'. k := {m selector. self class}. ^m selector: (GolfDic at: k ifAbsentPut: [ self class allSelectors asSortedCollection detect: [:x| (x occurrencesOf: $:) = a and: [ s match: x ignoreCase: false ] ] ]); sendTo: self! G ^GolfDic! !
こうしたら動いたのだが…。
$ gst gost.st -Q - st> Object.GolfDic! stdin:1: invalid scope resolution st> #O instV P! () st> #O classVarN P! IdentitySet (#FinalizableObjects #Dependencies ) st> (5i:1in:[:x :y|x*y])P! 120 st> 0G P! Dictionary ( (#instV Object class )->#instVarNames (#classVarN Object class )->#classVarNames (#i:in: Interval )->#inject:into: )
インスタンス変数でもクラス変数でも無い。何者?