'From Squeakland 3.8.5976 of 25 August 2004 [latest update: #381] on 4 January 2005 at 3:02:44 am'! "Change Set: literalChg-sw Date: 5 January 2005 Author: Scott Wallace Recovery from the recent language change that made '#(nil) first' parse to nil rather than to #nil, and similarly for #(true) and #(false). This update restores the pre-existing semantics of several methods affected by that change."! !DataType methodsFor: 'tiles' stamp: 'sw 1/4/2005 00:45'! updatingTileForTarget: aTarget partName: partName getter: getter setter: setter "Answer, for classic tiles, an updating readout tile for a part with the receiver's type, with the given getter and setter" | aTile displayer actualSetter | actualSetter _ setter ifNotNil: [(#(none #nil unused) includes: setter) ifTrue: [nil] ifFalse: [setter]]. aTile _ self newReadoutTile. displayer _ UpdatingStringMorph new getSelector: getter; target: aTarget; growable: true; minimumWidth: 24; putSelector: actualSetter. "Note that when typeSymbol = #number, the #target: call above will have dealt with floatPrecision details" self setFormatForDisplayer: displayer. aTile addMorphBack: displayer. (actualSetter notNil and: [self wantsArrowsOnTiles]) ifTrue: [aTile addArrows]. getter numArgs == 0 ifTrue: [aTile setLiteralInitially: (aTarget perform: getter)]. ^ aTile ! ! !ColorType methodsFor: 'tiles' stamp: 'sw 1/4/2005 00:39'! updatingTileForTarget: aTarget partName: partName getter: getter setter: setter "Answer, for classic tiles, an updating readout tile for a part with the receiver's type, with the given getter and setter" | readout | readout _ UpdatingRectangleMorph new. readout getSelector: getter; target: aTarget; borderWidth: 1; extent: 22@22. (setter isNil or: [#(unused none #nil) includes: setter]) ifFalse: [readout putSelector: setter]. ^ readout ! ! !MethodInterface class methodsFor: 'utilities' stamp: 'sw 1/4/2005 00:43'! isNullMarker: aMarker "Answer true if aMarker is nil or is one of the symbols in #(none nil unused missing) -- to service a variety of historical conventions" ^ aMarker isNil or: [#(none #nil unused missing) includes: aMarker] " MethodInterface isNullMarker: nil MethodInterface isNullMarker: #nil MethodInterface isNullMarker: #none MethodInterface isNullMarker: #znak "! ! !Player methodsFor: 'scripts-kernel' stamp: 'sw 1/4/2005 02:18'! acceptableScriptNameFrom: originalString forScriptCurrentlyNamed: currentName "Produce an acceptable script name, derived from the current name, for the receiver. This method will always return a valid script name that will be suitable for use in the given situation, though you might not like its beauty sometimes." | aString stemAndSuffix proscribed stem suffix withoutColon currentNumArgs withColon | withoutColon _ originalString copyWithoutAll: {$:. $ }. (currentName notNil and: [(currentName copyWithout: $:) = withoutColon]) ifTrue: [^ currentName]. "viz. no change; otherwise, the #respondsTo: check gets in the way" currentNumArgs _ currentName ifNil: [0] ifNotNil: [currentName numArgs]. aString _ withoutColon asIdentifier: false. "get an identifier starting with a lowercase letter" stemAndSuffix _ aString stemAndNumericSuffix. proscribed _ #(self super thisContext costume costumes dependents #true #false size). stem _ stemAndSuffix first. suffix _ stemAndSuffix last. withoutColon _ aString asSymbol. withColon _ (withoutColon, ':') asSymbol. [(proscribed includes: withoutColon) or: [self respondsTo: withoutColon] or: [self respondsTo: withColon] or: [Smalltalk includesKey: withoutColon] or: [Smalltalk includesKey: withColon]] whileTrue: [suffix _ suffix + 1. withoutColon _ (stem, suffix printString) asSymbol. withColon _ (withoutColon, ':') asSymbol]. ^ currentNumArgs = 0 ifTrue: [withoutColon] ifFalse: [withColon]! ! !StandardScriptingSystem methodsFor: 'universal slots & scripts' stamp: 'sw 1/4/2005 02:20'! acceptableSlotNameFrom: originalString forSlotCurrentlyNamed: currentName asSlotNameIn: aPlayer world: aWorld "Produce an acceptable slot name, derived from the current name, for aPlayer. This method will always return a valid slot name that will be suitable for use in the given situation, though you might not like its beauty sometimes." | aString stemAndSuffix proscribed stem suffix putative | aString _ originalString asIdentifier: false. "get an identifier not lowercase" stemAndSuffix _ aString stemAndNumericSuffix. proscribed _ #(self super thisContext costume costumes dependents #true #false size), aPlayer class allInstVarNames. stem _ stemAndSuffix first. suffix _ stemAndSuffix last. putative _ aString asSymbol. [(putative ~~ currentName) and: [(proscribed includes: putative) or: [(aPlayer respondsTo: putative) or: [Smalltalk includesKey: putative]]]] whileTrue: [suffix _ suffix + 1. putative _ (stem, suffix printString) asSymbol]. ^ putative! !