binary selectors ambiguity and space
nicolas cellier
ncellier at ifrance.com
Sun May 14 09:13:10 UTC 2006
Le Dimanche 14 Mai 2006 10:22, nicolas cellier a écrit :
> It is simple to detect the case in Scanner>>xBinary and have an Exception
> raised in that case. The exception defaultAction would be to proceed
> simply. But this Exception can also be caught and pop up a warning. I will
> try today to parse a 3.9 image, a kind of statistical test just to check if
> this ambiguity is hypothetic or is really hurting squeakers.
>
> Nicolas
OK, i just checked, the compatibility problems are not hypothetical.
Notification subclass: #AmbiguousBinarySelectorNotification
instanceVariableNames: ''
classVariableNames: ''
poolDictionaries: ''
category: 'Exceptions-Kernel'.
Scanner>>xBinary
tokenType := #binary.
token := self step asSymbol.
[| type |
type := typeTable at: hereChar asciiValue ifAbsent: [#xLetter].
type == #xBinary and: [hereChar ~= $- or: [aheadChar isDigit
ifTrue: [AmbiguousBinarySelectorNotification signal. false]
ifFalse: [true]]]] whileTrue: [
token := (token, (String with: self step)) asSymbol].
| report |
report := (String new: 128) writeStream.
Smalltalk keysAndValuesDo: [:name :cls |
(cls isKindOf: Behavior)
ifTrue: [(Array with: cls with: cls class) do: [:class |
class selectorsDo: [:selector |
[class compilerClass new
parse: (class sourceCodeAt: selector)
in: class notifying: nil]
on: AmbiguousBinarySelectorNotification
do: [:exc |
report
print: class; nextPutAll: #'>>';
print: selector; cr]]]]].
report contents inspect
That gave me this list in 3.9a7029,
most problems coming from (1 at -1) constructs:
PaintBoxMorph>>#init4
PaintBoxMorph>>#fixUpColorPicker
StandardSystemView>>#closeBoxFrame
StandardSystemView>>#growBoxFrame
PostscriptDummyWarp>>#subCanvas:
PNGReadWriterTest>>#drawTransparentStuffOn:
PNGReadWriterTest>>#drawStuffOn:
ViewerLine>>#addGetterFeedback
Point>>#fourNeighbors
Point>>#eightNeighbors
ScriptEditorMorph>>#createThreadShowing
ScriptEditorMorph>>#extent:
MethodFinder>>#testRandom
MethodFinder>>#testFromTuple:
Form>>#findShapeAroundSeedBlock:
Form>>#pageImage:at:corner:
Form class>>#xorHack:
Form class>>#toothpaste:
Morph>>#changeColorTarget:selector:originalColor:hand:
TTSampleStringMorph>>#computeTransform
FractionTest>>#testFractionPrinting
LipsMorph>>#openness:
PianoKeyboardMorph>>#buildKeyboard
FlashPlayerWindow>>#adjustBookControls
FloatMathPluginTests>>#md5HashStream:
TTSampleFontMorph>>#drawCharactersOn:
GraphicSymbolInstance class>>#example
AlignmentMorph>>#addUpDownArrowsFor:
PreDebugWindow>>#adjustBookControls
SyntaxMorph>>#selectorMenuAsk:
SyntaxMorph>>#drawOn:
SyntaxMorph class>>#standardInset
PointTest>>#testBearingToPoint
PointTest>>#testTheta
Cursor class>>#initBottomRight
Cursor class>>#initResizeLeft
Cursor class>>#initNormalWithMask
Cursor class>>#initResizeTopLeft
Cursor class>>#initCorner
Cursor class>>#initCrossHair
Cursor class>>#initSquare
Cursor class>>#initResizeTop
Cursor class>>#initResizeTopRight
Cursor class>>#initBottomLeft
PolygonMorph>>#nudgeForLabel:
FlapTab>>#fitContents
StandardSystemController>>#cursorOnBorder
More information about the Squeak-dev
mailing list
|