$- in binary selectors

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

$- in binary selectors

Nicolas Cellier
Lukas suggested to not provide backward compatibility and compile 1@-2
as 1 @- (2)
That's what Igor expect, and that's what VW did.
In my image this would mean changing:

AlignmentMorph>>#addUpDownArrowsFor:
BalloonCanvas>>#makeRoundRectShape:radius:
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
FlapTab>>#fitContents
FontChooserMorph>>#createWindow
Form>>#findShapeAroundSeedBlock:
Form>>#pageImage:at:corner:
Form class>>#xorHack:
Form class>>#toothpaste:
FractionTest>>#testFractionPrinting
GraphicSymbolInstance class>>#example
MethodFinder>>#testRandom
MethodFinder>>#testFromTuple:
Morph>>#changeColorTarget:selector:originalColor:hand:
PNGReadWriterTest>>#drawTransparentStuffOn:
PNGReadWriterTest>>#drawStuffOn:
PaintBoxMorph>>#init4
PaintBoxMorph>>#fixUpColorPicker
PianoKeyboardMorph>>#buildKeyboard
Point>>#fourNeighbors
Point>>#eightNeighbors
PointTest>>#testBearingToPoint
PointTest>>#testTheta
PolygonMorph>>#nudgeForLabel:
PostscriptDummyWarp>>#subCanvas:
PreDebugWindow>>#adjustBookControls
ScriptEditorMorph>>#createThreadShowing
ScriptEditorMorph>>#extent:
ScrollPane>>#vResizeScrollBar
StandardSystemController>>#cursorOnBorder
StandardSystemView>>#closeBoxFrame
StandardSystemView>>#growBoxFrame
SyntaxMorph>>#selectorMenuAsk:
SyntaxMorph>>#drawOn:
SyntaxMorph class>>#standardInset
TTSampleFontMorph>>#drawCharactersOn:
TTSampleStringMorph>>#computeTransform
ViewerLine>>#addGetterFeedback

This would also mean breaking some packages.
One known workaround is to implement @- (main cause of error)

Nicolas

Reply | Threaded
Open this post in threaded view
|

Re: $- in binary selectors

Eliot Miranda-2


On Wed, Feb 24, 2010 at 4:20 PM, Nicolas Cellier <[hidden email]> wrote:
Lukas suggested to not provide backward compatibility and compile 1@-2
as 1 @- (2)
That's what Igor expect, and that's what VW did.
In my image this would mean changing:

AlignmentMorph>>#addUpDownArrowsFor:
BalloonCanvas>>#makeRoundRectShape:radius:
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
FlapTab>>#fitContents
FontChooserMorph>>#createWindow
Form>>#findShapeAroundSeedBlock:
Form>>#pageImage:at:corner:
Form class>>#xorHack:
Form class>>#toothpaste:
FractionTest>>#testFractionPrinting
GraphicSymbolInstance class>>#example
MethodFinder>>#testRandom
MethodFinder>>#testFromTuple:
Morph>>#changeColorTarget:selector:originalColor:hand:
PNGReadWriterTest>>#drawTransparentStuffOn:
PNGReadWriterTest>>#drawStuffOn:
PaintBoxMorph>>#init4
PaintBoxMorph>>#fixUpColorPicker
PianoKeyboardMorph>>#buildKeyboard
Point>>#fourNeighbors
Point>>#eightNeighbors
PointTest>>#testBearingToPoint
PointTest>>#testTheta
PolygonMorph>>#nudgeForLabel:
PostscriptDummyWarp>>#subCanvas:
PreDebugWindow>>#adjustBookControls
ScriptEditorMorph>>#createThreadShowing
ScriptEditorMorph>>#extent:
ScrollPane>>#vResizeScrollBar
StandardSystemController>>#cursorOnBorder
StandardSystemView>>#closeBoxFrame
StandardSystemView>>#growBoxFrame
SyntaxMorph>>#selectorMenuAsk:
SyntaxMorph>>#drawOn:
SyntaxMorph class>>#standardInset
TTSampleFontMorph>>#drawCharactersOn:
TTSampleStringMorph>>#computeTransform
ViewerLine>>#addGetterFeedback

This would also mean breaking some packages.
One known workaround is to implement @- (main cause of error)

This should be done anyway.  But IMO @- should be implemented to raise an error /not/ sign-invert!  We want people to clean up, not rely on a crutch.

BTW, I've long thought that period should be followed by white-space or the end of a method to be legal as a statement terminator.  e.g. 1.1 is a float with value ~= 1 + (1/10).  It is not the statement 1 followed by the statement 1.  Further, whitespace should be required after a literal number and before a keyword.  With VisualWorks I got bitten badly by something like the following
   first: 1second: expr
which had at one time worked but when I recompiled the system caused an infinite recursion due to first:econd: not being understood because in the mean-time the compiler had been changed to accept digits 's' as representing a fixed-point number.

I've not thought through this in any systematic manner but if there's anyone else who agrees that ambiguity is to be avoided and that this is worth thinking about then I'd happily discuss it further.

best
Eliot


Nicolas




Reply | Threaded
Open this post in threaded view
|

Re: $- in binary selectors

Nicolas Cellier
2010/2/25 Eliot Miranda <[hidden email]>:

>
>
> On Wed, Feb 24, 2010 at 4:20 PM, Nicolas Cellier
> <[hidden email]> wrote:
>>
>> Lukas suggested to not provide backward compatibility and compile 1@-2
>> as 1 @- (2)
>> That's what Igor expect, and that's what VW did.
>> In my image this would mean changing:
>>
>> AlignmentMorph>>#addUpDownArrowsFor:
>> BalloonCanvas>>#makeRoundRectShape:radius:
>> 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
>> FlapTab>>#fitContents
>> FontChooserMorph>>#createWindow
>> Form>>#findShapeAroundSeedBlock:
>> Form>>#pageImage:at:corner:
>> Form class>>#xorHack:
>> Form class>>#toothpaste:
>> FractionTest>>#testFractionPrinting
>> GraphicSymbolInstance class>>#example
>> MethodFinder>>#testRandom
>> MethodFinder>>#testFromTuple:
>> Morph>>#changeColorTarget:selector:originalColor:hand:
>> PNGReadWriterTest>>#drawTransparentStuffOn:
>> PNGReadWriterTest>>#drawStuffOn:
>> PaintBoxMorph>>#init4
>> PaintBoxMorph>>#fixUpColorPicker
>> PianoKeyboardMorph>>#buildKeyboard
>> Point>>#fourNeighbors
>> Point>>#eightNeighbors
>> PointTest>>#testBearingToPoint
>> PointTest>>#testTheta
>> PolygonMorph>>#nudgeForLabel:
>> PostscriptDummyWarp>>#subCanvas:
>> PreDebugWindow>>#adjustBookControls
>> ScriptEditorMorph>>#createThreadShowing
>> ScriptEditorMorph>>#extent:
>> ScrollPane>>#vResizeScrollBar
>> StandardSystemController>>#cursorOnBorder
>> StandardSystemView>>#closeBoxFrame
>> StandardSystemView>>#growBoxFrame
>> SyntaxMorph>>#selectorMenuAsk:
>> SyntaxMorph>>#drawOn:
>> SyntaxMorph class>>#standardInset
>> TTSampleFontMorph>>#drawCharactersOn:
>> TTSampleStringMorph>>#computeTransform
>> ViewerLine>>#addGetterFeedback
>>
>> This would also mean breaking some packages.
>> One known workaround is to implement @- (main cause of error)
>
> This should be done anyway.  But IMO @- should be implemented to raise an
> error /not/ sign-invert!  We want people to clean up, not rely on a crutch.
> BTW, I've long thought that period should be followed by white-space or the
> end of a method to be legal as a statement terminator.  e.g. 1.1 is a float
> with value ~= 1 + (1/10).  It is not the statement 1 followed by the
> statement 1.  Further, whitespace should be required after a literal number
> and before a keyword.  With VisualWorks I got bitten badly by something like
> the following
>    first: 1second: expr
> which had at one time worked but when I recompiled the system caused an
> infinite recursion due to first:econd: not being understood because in the
> mean-time the compiler had been changed to accept digits 's' as representing
> a fixed-point number.
> I've not thought through this in any systematic manner but if there's anyone
> else who agrees that ambiguity is to be avoided and that this is worth
> thinking about then I'd happily discuss it further.
> best
> Eliot

Ouch, I was just thinking of authorizing 1s which seems to be ANSI...

Nicolas

>>
>> Nicolas
>>
>
>
>
>
>

Reply | Threaded
Open this post in threaded view
|

Re: $- in binary selectors

Andreas.Raab
In reply to this post by Nicolas Cellier
Nicolas Cellier wrote:
> This would also mean breaking some packages.
> One known workaround is to implement @- (main cause of error)

A big fat +1 on this idea. I really don't like breaking packages for no
good reason and your list really gave me headaches (if a dozen packages
inside the image are affected one can't help but wonder about external
ones). How about implementing @- and signaling a deprecation warning as
well?

Cheers,
   - Andreas

Reply | Threaded
Open this post in threaded view
|

Re: $- in binary selectors

Nicolas Cellier
2010/2/25 Andreas Raab <[hidden email]>:
> Nicolas Cellier wrote:
>>
>> This would also mean breaking some packages.
>> One known workaround is to implement @- (main cause of error)
>

and the second one in trunk was //-2

> A big fat +1 on this idea. I really don't like breaking packages for no good
> reason and your list really gave me headaches (if a dozen packages inside
> the image are affected one can't help but wonder about external ones). How
> about implementing @- and signaling a deprecation warning as well?
>
> Cheers,
>  - Andreas
>
>

By now I very prudently insured backward compatibility in non
interactive mode...
But, yes, this would enable a smooth transition

Nicolas

Reply | Threaded
Open this post in threaded view
|

Re: $- in binary selectors

Bert Freudenberg
In reply to this post by Eliot Miranda-2
On 25.02.2010, at 01:52, Eliot Miranda wrote:


On Wed, Feb 24, 2010 at 4:20 PM, Nicolas Cellier <[hidden email]> wrote:
Lukas suggested to not provide backward compatibility and compile 1@-2
as 1 @- (2)
This should be done anyway.  But IMO @- should be implemented to raise an error /not/ sign-invert!  We want people to clean up, not rely on a crutch.

I for one would hate if I could't type -1@-1 interactively anymore. This syntax is so common and used almost as if it was a literal that I strongly feel @- should be implemented to do the expected (and Point's printOn: should generate text without parens).

- Bert -