[squeak-dev] The Trunk: Protocols-nice.13.mcz

commits at source.squeak.org commits at source.squeak.org
Tue Oct 20 00:22:26 UTC 2009


Nicolas Cellier uploaded a new version of Protocols to project The Trunk:
http://source.squeak.org/trunk/Protocols-nice.13.mcz

==================== Summary ====================

Name: Protocols-nice.13
Author: nice
Time: 20 October 2009, 12:22:18 pm
UUID: 3fefb87a-483c-4d48-82b9-fff44c5082ee
Ancestors: Protocols-md.12

use #fasterKeys

=============== Diff against Protocols-md.12 ===============

Item was changed:
  ObjectWithDocumentation subclass: #Vocabulary
  	instanceVariableNames: 'vocabularyName categories methodInterfaces object limitClass translationTable'
+ 	classVariableNames: 'AllStandardVocabularies LanguageSymbols LanguageTable'
- 	classVariableNames: 'LanguageTable LanguageSymbols AllStandardVocabularies'
  	poolDictionaries: ''
  	category: 'Protocols-Kernel'!
  
  !Vocabulary commentStamp: '<historical>' prior: 0!
  Vocabulary
  
  vocabularyName	a Symbol -- the formal name by which this vocabulary is known.
  categories			a list of ElementCategory objects: the categories that comprise the vocabulary
  methodInterfaces 	an IdentityDictionary; keys are method selectors, values are MethodInterfaces
  
  A Vocabulary can be either be *abstract*, i.e. associated with a *class*, or it can be *bound to an instance*.  The form that is bound to an instance is still in its infancy however.
  
  object				in the *bound* form, an actual object is associated with the vocabulary
  limitClass			in the *bound* form, an actual limit class is assocaited with the vocabulary
  
  AllMethodInterfaces	This class variable is available to hold on to all method interfaces
  						defined in the system, regardless of class.  Not deployed in 
  						the first version of this code to be circulated externally.
  
  AllVocabularies		A dictionary associating symbols with actual abstract vocabulary instances
  
  ------
  Hints on making a vocabulary for a new foreign language.  You need build a method like #addGermanVocabulary.  Execute
  
  	Transcript show: Vocabulary eToyVocabulary strings.
  
  and copy the text from the transcript to the method you are building.
  	A cheap trick to get started is to use a web site that translates.  Here is how.  For an entry like:  
  
  (clearTurtleTrails			'clear pen trails'			'Clear all the pen trails in the interior.')
  
  	substitute exclamation points for single quotes by using Alt-shift-j.  Most of the statements are imperatives.
  
  (clearOwnersPenTrails !!clear all pen trails!! !!clear all pen trails in my containing play field!!) 
  
  	This translates to
  
  (ClearOwnersPenTrails!! reinigt allen Kugelschreiber verfolgt!! !! Reinigt allen Kugelschreiber Pfade in meinem enthaltenden Spiel Feld sind!!) 
  
  	Which is laughable, and will certainly stimulate the author to improve it.
  ------!

Item was changed:
  ----- Method: Vocabulary>>strings (in category 'initialization') -----
  strings
  	| strm |
  	"Get started making a vocabulary for a foreign language.  That is, build a method like #addGermanVocabulary, but for another language.  
  	Returns this vocabulary in the same form used as the input used for foreign languages.  To avoid string quote problems, execute
  	Transcript show: Vocabulary eToyVocabulary strings.
  and copy the text from the transcript to the method you are building."
  
  	"selector		wording			documentation"
  
  strm := WriteStream on: (String new: 400).
+ methodInterfaces fasterKeys sort do: [:sel |
- methodInterfaces keys asSortedCollection do: [:sel |
  	strm cr; nextPut: $(;
  		nextPutAll: sel; tab; tab; tab; nextPut: $';
  		nextPutAll: (methodInterfaces at: sel) wording;
  		nextPut: $'; tab; tab; tab; nextPut: $';
  		nextPutAll: (methodInterfaces at: sel) documentation;
  		nextPut: $'; nextPut: $)].
  ^ strm contents!




More information about the Squeak-dev mailing list