Nicolas Cellier uploaded a new version of FlexibleVocabularies to project The Trunk:
http://source.squeak.org/trunk/FlexibleVocabularies-nice.10.mcz ==================== Summary ==================== Name: FlexibleVocabularies-nice.10 Author: nice Time: 27 December 2009, 8:40:06 am UUID: c5ed1395-f5a0-4347-8596-8677a1921160 Ancestors: FlexibleVocabularies-nice.9 Cosmetic: move or remove a few temps inside closures =============== Diff against FlexibleVocabularies-nice.9 =============== Item was changed: ----- Method: EToyVocabulary>>initialize (in category '*flexibleVocabularies-flexiblevocabularies-initialization') ----- initialize "Initialize the receiver (automatically called when instances are created via 'new')" + | classes categorySymbols | - | classes aMethodCategory selector selectors categorySymbols aMethodInterface | super initialize. self vocabularyName: #eToy. self documentation: '"EToy" is a vocabulary that provides the equivalent of the 1997-2000 etoy prototype'. categorySymbols := Set new. classes := self class morphClassesDeclaringViewerAdditions. classes do: [:aMorphClass | categorySymbols addAll: aMorphClass unfilteredCategoriesForViewer]. self addCustomCategoriesTo: categorySymbols. "For benefit, e.g., of EToyVectorVocabulary" categorySymbols asOrderedCollection do: + [:aCategorySymbol | | selectors aMethodCategory | - [:aCategorySymbol | aMethodCategory := ElementCategory new categoryName: aCategorySymbol. selectors := Set new. classes do: [:aMorphClass | (aMorphClass additionsToViewerCategory: aCategorySymbol) do: + [:anElement | | selector aMethodInterface | - [:anElement | aMethodInterface := self methodInterfaceFrom: anElement. selectors add: (selector := aMethodInterface selector). (methodInterfaces includesKey: selector) ifFalse: [methodInterfaces at: selector put: aMethodInterface]. self flag: #deferred. "NB at present, the *setter* does not get its own method interface. Need to revisit"]. (selectors copyWithout: #unused) asSortedArray do: [:aSelector | aMethodCategory elementAt: aSelector put: (methodInterfaces at: aSelector)]]. self addCategory: aMethodCategory]. self addCategoryNamed: ScriptingSystem nameForInstanceVariablesCategory. self addCategoryNamed: ScriptingSystem nameForScriptsCategory. self setCategoryDocumentationStrings. (self respondsTo: #applyMasterOrdering) ifTrue: [ self applyMasterOrdering ].! Item was changed: ----- Method: EToyVocabulary class>>vocabularySummary (in category '*flexibleVocabularies-flexiblevocabularies-scripting') ----- vocabularySummary "Answer a string describing all the vocabulary defined anywhere in the system." " (StringHolder new contents: EToyVocabulary vocabularySummary) openLabel: 'EToy Vocabulary' translated " + | etoyVocab | - | etoyVocab rt interfaces allAdditions | etoyVocab := Vocabulary eToyVocabulary. etoyVocab initialize. "just to make sure that it's unfiltered." ^ String streamContents: [:s | + self morphClassesDeclaringViewerAdditions do: [:cl | | allAdditions | - self morphClassesDeclaringViewerAdditions do: [:cl | s nextPutAll: cl name; cr. allAdditions := cl allAdditionsToViewerCategories. cl unfilteredCategoriesForViewer do: [ :cat | + allAdditions at: cat ifPresent: [ :additions | | interfaces | - allAdditions at: cat ifPresent: [ :additions | interfaces := ((etoyVocab categoryAt: cat) ifNil: [ ElementCategory new ]) elementsInOrder. interfaces := interfaces select: [:ea | additions anySatisfy: [:tuple | (tuple first = #slot ifTrue: [tuple at: 7] ifFalse: [tuple at: 2]) = ea selector]]. s tab; nextPutAll: cat translated; cr. interfaces + do: [:if | | rt | - do: [:if | s tab: 2. rt := if resultType. rt = #unknown ifTrue: [s nextPutAll: 'command' translated] ifFalse: [s nextPutAll: 'property' translated; nextPut: $(; nextPutAll: (if companionSetterSelector ifNil: ['RO'] ifNotNil: ['RW']) translated; space; nextPutAll: rt translated; nextPutAll: ') ']. s tab; print: if wording; space. if argumentVariables do: [:av | s nextPutAll: av variableName; nextPut: $(; nextPutAll: av variableType asString; nextPut: $)] separatedBy: [s space]. s tab; nextPutAll: if helpMessage; cr]]]]]! |
Free forum by Nabble | Edit this page |