Administrator
|
I tried both programmatically ("Scanner allowUnderscoreAsAssignment: true") and via the settings browser to allow underscore assignments, but I still got errors loading AtomMorph. e.g.
"Syntax Error" randomPositionIn: aRectangle maxVelocity: maxVelocity "Give this atom a random position and velocity." | origin extent | origin _ aRectangle origin. extent _ ***Nothing more expected ->***(aRectangle extent - self bounds extent) rounded. self position: (origin x + extent x atRandom) @ (origin y + extent y atRandom). velocity _ (maxVelocity - (2 * maxVelocity) atRandom) @ (maxVelocity - (2 * maxVelocity) atRandom).
Cheers,
Sean |
Administrator
|
Is there a way for fix underscores via OB in lieu of the programmatic way shown at http://book.pharo-project.org/book/Tidbits/TipsAndTricks/FixingUnderscores ?
Cheers,
Sean |
Yes, the refactoring engine contains a code transformation that fixes
automatically and preserves all formatting. Just run Code Critics on your package and apply the suggested transformations for "Transformations > Underscore assignements should be avoided". Again you must evaluate "Scanner allowUnderscoreAsAssignment: true" before running Code Critics, otherwise the refactoring engine does not parse methods with underscore assignments. Lukas On 29 January 2012 05:32, Sean P. DeNigris <[hidden email]> wrote: > Is there a way for fix underscores via OB in lieu of the programmatic way > shown at > http://book.pharo-project.org/book/Tidbits/TipsAndTricks/FixingUnderscores ? > > -- > View this message in context: http://forum.world.st/Problems-loading-underscore-assignments-tp4337617p4337618.html > Sent from the Pharo Smalltalk mailing list archive at Nabble.com. > -- Lukas Renggli www.lukas-renggli.ch |
The programmatic way described on
http://book.pharo-project.org/book/Tidbits/TipsAndTricks/FixingUnderscores does the same as what I described below. It should just be updated to work with a more recent version of the refactoring engine: Gofer new squeaksource: 'rb'; package: 'AST-Core'; package: 'Refactoring-Core'; package: 'Refactoring-Changes'; package: 'Refactoring-Critics'; package: 'Refactoring-Environment'; package: 'Refactoring-Pharo-Platform'; load. And the class references must be replaced like this: BrowserEnvironment -> RBBrowserEnvironment SmalllintChecker -> RBSmalllintChecker CompositeRefactoryChange -> RBCompositeRefactoryChange After the programmatic instructions should work as well. Lukas On 29 January 2012 10:48, Lukas Renggli <[hidden email]> wrote: > Yes, the refactoring engine contains a code transformation that fixes > automatically and preserves all formatting. Just run Code Critics on > your package and apply the suggested transformations for > "Transformations > Underscore assignements should be avoided". > > Again you must evaluate "Scanner allowUnderscoreAsAssignment: true" > before running Code Critics, otherwise the refactoring engine does not > parse methods with underscore assignments. > > Lukas > > On 29 January 2012 05:32, Sean P. DeNigris <[hidden email]> wrote: >> Is there a way for fix underscores via OB in lieu of the programmatic way >> shown at >> http://book.pharo-project.org/book/Tidbits/TipsAndTricks/FixingUnderscores ? >> >> -- >> View this message in context: http://forum.world.st/Problems-loading-underscore-assignments-tp4337617p4337618.html >> Sent from the Pharo Smalltalk mailing list archive at Nabble.com. >> > > > > -- > Lukas Renggli > www.lukas-renggli.ch -- Lukas Renggli www.lukas-renggli.ch |
In reply to this post by Sean P. DeNigris
On Sun, Jan 29, 2012 at 5:31 AM, Sean P. DeNigris <[hidden email]> wrote: I tried both programmatically ("Scanner allowUnderscoreAsAssignment: true") I don't know which image version you are using but in last sprint I fixed this: http://code.google.com/p/pharo/issues/detail?id=4636 Cheers
-- Mariano http://marianopeck.wordpress.com |
Administrator
|
1.3 Great, thanks.
Cheers,
Sean |
Free forum by Nabble | Edit this page |