[squeak-dev] The Inbox: Graphics-cbc.372.mcz
cunningham.cb at gmail.com
Wed Mar 29 21:54:47 UTC 2017
On Wed, Mar 29, 2017 at 12:58 PM, Eliot Miranda <eliot.miranda at gmail.com>
> Hi Hannes,
> On Wed, Mar 29, 2017 at 8:45 AM, H. Hirzel <hannes.hirzel at gmail.com>
>> Hi Chris,
>> On 3/29/17, Chris Cunningham <cunningham.cb at gmail.com> wrote:
>> > Hi,
> The kind of thinking which restricts the system, such as adding methods
>> that logically belong to SequenceableCollection to, say, String, simply
>> because the programmer wanted a String method and didn't think about
>> generality, is at best regrettable.
> I've been guilty of this in the past, and probably will in the future, but
I try not to be.
> > A better question is should I be using Rectangle for this. Maybe we
>> > create a 'TrueRectangle' class or something similar so that we can
>> > talk about and share what can really be done with rectangles, instead of
>> > the 'ScreenRectangle' that we have today called Rectangle.
> Why not the other way around? Add IntegralRectangle and have it specialize
Let me re-state what I think you are saying, and please correct me if I am
Make Rectangle more generic, and for instance, have the method
#center:extent: use #/ instead of #//.
Then, have a new class, IntegralRectangle, that re-implements that method
and sends #// to ensure that the extents are integral.
(and in general do whatever else is needed to relax Rectangle, and tighten
If so, the main reason not to do proceed is that Rectangle is used
extensively in the system for today, and we'd have to replace those uses
with IntegralRectangle, not to mention all of the indirect uses (such as
#corner: that you used above, and make variants creating IntegralRectangle
and generic Rectangle, or otherwise resolve those ambiguities).
That said, I'm all for it. I'd like a less strict Rectangle for, well,
As a side note, if you look up Integral Rectangle in Google, you'll fine
lots of discussions that have nothing to do with this question. But
Integral (integer) and Rectangle make perfect sense here in any case.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Squeak-dev