[squeak-dev] The Inbox: Tests-ct.425.mcz

Thiede, Christoph Christoph.Thiede at student.hpi.uni-potsdam.de
Tue Dec 31 01:21:04 UTC 2019


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 <squeak-dev-bounces at lists.squeakfoundation.org> im Auftrag von Levente Uzonyi <leves at caesar.elte.hu>
Gesendet: Dienstag, 31. Dezember 2019 02:09:24
An: squeak-dev at lists.squeakfoundation.org
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, commits at source.squeak.org 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").!

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20191231/3d4f4c87/attachment.html>


More information about the Squeak-dev mailing list