Prevent cloning of clones

Brian Rice water at tunes.org
Mon Apr 25 08:25:58 PDT 2005


First, try looking at src/lib/dimensioned.slate which has a full units 
library. Also, use Oddball clone, which has this behavior that you 
cannot clone it again. Then, have it delegate 
(addImmutableDelegate:valued: or set what delegation slot it does have) 
to the intended parent. Normally, we don't bother with that level of 
control yet, though.

On Apr 25, 2005, at 5:56 AM, Adde wrote:

> I'm trying to create a representations for different units of 
> measurement in SVG and the best i could come up with was the 
> following:
>
> SVG addPrototype: #Unit derivedFrom: {Cloneable}.
> SVG Unit addSlot: #postfix.
> SVG Unit traits addSlot: #Pixels valued: (SVG Unit clone `>> [postfix: 
> 'px'.]).
> u@(SVG Unit traits) toXML [ u postfix ].
>
> However, there is no point in doing 'SVG Unit Pixels clone' so I was 
> wondering how I can make it behave like numbers, ie. '1 clone' gives 
> an error message.
>
> /Adde
>
>
--
Brian T. Rice
LOGOS Research and Development
http://tunes.org/~water/




More information about the Slate mailing list