Christoph Thiede uploaded a new version of Tests to project The Inbox:
http://source.squeak.org/inbox/Tests-ct.425.mcz ==================== Summary ==================== Name: Tests-ct.425 Author: ct Time: 30 December 2019, 7:19:53.668602 pm UUID: fc85b43b-45f8-b340-b295-d43ee9de7a5f Ancestors: Tests-mt.424 Adds regression test for a compiler bug that was fixed in Compiler-ct.414 =============== Diff against Tests-mt.424 =============== Item was added: + ----- Method: CompilerTest>>testCascadeOnBlock (in category 'tests - syntax') ----- + testCascadeOnBlock + "Regression test. See http://forum.world.st/BUG-Cannot-compile-cascade-sent-to-block-td5108942.html" + + self + shouldnt: [Compiler + evaluate: '[true] whileFalse; whileFalse' + notifying: PluggableTextMorph new "dummy requestor"] + raise: Error. + self + assert: 2 + equals: (Compiler + evaluate: '| x | x := 0. [x := x + 1] doWhileTrue: [false]; doWhileFalse: [true]. x' + notifying: PluggableTextMorph new "dummy requestor").! |
Before we start using #doWhileTrue: and #doWhileFalse:, we should consider
deprecating them. This is the first time I've seen those methods, and they have no real users in the Trunk. Same applies to #whileNil: and #whileNotNil: too of BlockClosure's controlling category. Levente On Mon, 30 Dec 2019, [hidden email] wrote: > Christoph Thiede uploaded a new version of Tests to project The Inbox: > http://source.squeak.org/inbox/Tests-ct.425.mcz > > ==================== Summary ==================== > > Name: Tests-ct.425 > Author: ct > Time: 30 December 2019, 7:19:53.668602 pm > UUID: fc85b43b-45f8-b340-b295-d43ee9de7a5f > Ancestors: Tests-mt.424 > > Adds regression test for a compiler bug that was fixed in Compiler-ct.414 > > =============== Diff against Tests-mt.424 =============== > > Item was added: > + ----- Method: CompilerTest>>testCascadeOnBlock (in category 'tests - syntax') ----- > + testCascadeOnBlock > + "Regression test. See http://forum.world.st/BUG-Cannot-compile-cascade-sent-to-block-td5108942.html" > + > + self > + shouldnt: [Compiler > + evaluate: '[true] whileFalse; whileFalse' > + notifying: PluggableTextMorph new "dummy requestor"] > + raise: Error. > + self > + assert: 2 > + equals: (Compiler > + evaluate: '| x | x := 0. [x := x + 1] doWhileTrue: [false]; doWhileFalse: [true]. x' > + notifying: PluggableTextMorph new "dummy requestor").! |
Oh, I like to use them in some cases. #whileTrue: etc. are top-controlled loops (≥ 0 runs), whereas #doWhileTrue: is a bottom-controlled loop (> 0 runs). Both concepts can be relevant at different times. However, I agree the naming is a bit counter-intuitive. #doWhile: and #doUntil: might be better names.
Best, Christoph Von: Squeak-dev <[hidden email]> im Auftrag von Levente Uzonyi <[hidden email]>
Gesendet: Dienstag, 31. Dezember 2019 02:09:24 An: [hidden email] Betreff: Re: [squeak-dev] The Inbox: Tests-ct.425.mcz Before we start using #doWhileTrue: and #doWhileFalse:, we should consider
deprecating them. This is the first time I've seen those methods, and they have no real users in the Trunk. Same applies to #whileNil: and #whileNotNil: too of BlockClosure's controlling category. Levente On Mon, 30 Dec 2019, [hidden email] wrote: > Christoph Thiede uploaded a new version of Tests to project The Inbox: > http://source.squeak.org/inbox/Tests-ct.425.mcz > > ==================== Summary ==================== > > Name: Tests-ct.425 > Author: ct > Time: 30 December 2019, 7:19:53.668602 pm > UUID: fc85b43b-45f8-b340-b295-d43ee9de7a5f > Ancestors: Tests-mt.424 > > Adds regression test for a compiler bug that was fixed in Compiler-ct.414 > > =============== Diff against Tests-mt.424 =============== > > Item was added: > + ----- Method: CompilerTest>>testCascadeOnBlock (in category 'tests - syntax') ----- > + testCascadeOnBlock > + "Regression test. See http://forum.world.st/BUG-Cannot-compile-cascade-sent-to-block-td5108942.html" > + > + self > + shouldnt: [Compiler > + evaluate: '[true] whileFalse; whileFalse' > + notifying: PluggableTextMorph new "dummy requestor"] > + raise: Error. > + self > + assert: 2 > + equals: (Compiler > + evaluate: '| x | x := 0. [x := x + 1] doWhileTrue: [false]; doWhileFalse: [true]. x' > + notifying: PluggableTextMorph new "dummy requestor").!
Carpe Squeak!
|
Free forum by Nabble | Edit this page |