. .

smalltalk

More Upgrade Fun with VisualWorks

January 3, 2013 18:28:36.000

This change happened back in 7.8, but since we are only now upgrading, we ran into it while going from 7.6 to 7.9.1. Take code that looks like this in VW 7.6:


point := 4@-5.

In 7.6, that gives you a point object. In newer VW? It gives you the message #@- sent to 4 with an argument of 5. Same thing with fractions. Not hard to fix - just look for senders of #@- and #/- and then use a rewrite rule to fix them. Better yet, it was turned up by our unit test suite :)

Tags: ,

posted by James Robertson

Comments

Re: More Upgrade Fun with VisualWorks

[Frank Shearar] January 4, 2013 6:41:17.997

Squeak has for a while had a special case in the Parser for things like this. If you try print-it "4@-5" you get a popup complaining of an ambiguous selector, and asking what you meant. That at least prevents _new_ code from being ambiguous.

Of course "4 @- 5" is still unambiguous, and hence valid.

Re: More Upgrade Fun with VisualWorks

[nicolas.cellier.aka.nice] January 4, 2013 9:43:54.652

To complete Frank comment, squeak only pops up a dis-disambiguating menu when the compiler is interactive. When you import code, the non interactive compiler assumes the - belongs to number literal for backward compatibility.

 Share Tweet This