Does it make sense to remove slots ?

Pupeno pupeno at pupeno.com
Sun Nov 7 13:31:44 PST 2004


Thanks for the URLs... I'm reading them... in the meantime... I've also come 
out with this other solution:
Graphics addPrototype: #Ellipse derivedFrom: {Area}.
Ellipse addSlot: #center.
Ellipse addSlot: #xRadius.
Ellipse addSlot: #yRadius.

e@(Ellipse traits) center: c@(Point traits) xRadius: x yRadius: y
[e clone `>> [center: c. xRadius: x. yRadius: y.]].

e@(Ellipse traits) center: c@(Point traits) radius: r
[e clone `>> [center: c. xRadius: r. yRadius: r.]].

e@(Ellipse traits) radius
[ e xRadius == e yRadius ifTrue: [ e xRadius ] ].

e@(Ellipse traits) radius: r
[ e xRadius == e yRadius ifTrue: [ e xRadius: r. e yRadius: r ] ].

e@(Ellipse traits) isCircle
[ e xRadius == e yRadius ].

aside the fact the #radius and #radius: messages should raise exceptions (I 
still have to learn how to do that on Slate), what do you think about it ?
I think this reflects the truth in a very good way... a Circle is an Ellipse 
where the two radius are the same, no more, no less.
-- 
Pupeno: pupeno at pupeno.com - http://www.pupeno.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : /archives/slate/attachments/20041107/733059b1/attachment.pgp


More information about the Slate mailing list