[Vm-dev] Add primitiveMillisecondClockMask?

Andreas Raab andreas.raab at gmx.de
Thu Apr 14 12:39:37 UTC 2011


On 4/14/2011 13:21, David T. Lewis wrote:
>
> On Thu, Apr 14, 2011 at 11:27:48AM +0200, Andreas Raab wrote:
>>
>>
>> On 4/13/2011 20:09, David T. Lewis wrote:
>>> Agreed, the millisecondClockMask should be available from a primitive.
>>> Should I make it so?
>> Sure. I would do it via a vm attribute.
>>
>> Cheers,
>>    - Andreas
> The named primitive is trivial, so I think this is probably the simplest
> thing to do:
>
> primitiveMillisecondClockMask
> 	"Provide access to the millisecond clock mask to support calculation
> 	of durations based on the millisecond clock value."
>
> 	<export: true>
> 	self pop: 1 thenPush: (self integerObjectOf: MillisecondClockMask)
>
> On the image side, call the primitive at #startUp: time, save the
> value in a class variable for speed, and use the default 16r1FFFFFFF
> if the primitive is not present.

You're right. It also makes it easier to remove the primitive later 
(i.e., the change is completely self-contained).

Cheers,
   - Andreas




More information about the Vm-dev mailing list