[squeak-dev] [Squeak protocol] Proposal: Interval>>#@

Levente Uzonyi leves at caesar.elte.hu
Fri Aug 9 20:39:33 UTC 2019


On Fri, 9 Aug 2019, Christoph Thiede wrote:

> Hi all,
>
> in a recent project, we introduced a shorthand for creating rectangles:
>
>
>
> As applying @ on two numbers converts them into a point, I think it would be
> somehow analogical to apply @ on two ranges to convert them into a
> rectangle. Above all, I experienced enough cases where I personally find it
> much more convenient to create a rectangle using
> (2 to: 4) @ (3 to: 6)

@ is not intuitive at all. Why would one expect to get 2 @ 3 corner: 4 @ 6 
instead of 2 @ 3 extent: 4 @ 6?

Also, why not just use #rect:? The comment says "This is the most general 
infix way to create a rectangle.".

Levente

> instead of
> 2 @ 3 corner: 4 @ 6.
>
> On the other hand, it is a bit weird that [(2 to: 4) @ (3 to: 5)] would
> produce a different output than [(2 to: 4) asArray @ (3 to: 5)]. But imho
> the rectangle construction would just be more intuitive. In general, are
> there any real senders of SequenceableCollection>>#@ which could not just
> call [aCollection with: anotherCollection collect: #@]?
>
> Looking forward to your opinions :)
>
> Best,
> Christoph
>
>
>
> --
> Sent from: http://forum.world.st/Squeak-Dev-f45488.html


More information about the Squeak-dev mailing list