[GemStone-Smalltalk] GemBuilder VW "Duration" class mapping

David Shaffer shaffer at shaffer-consulting.com
Tue Oct 5 13:03:54 PDT 2021


OK, so here’s what I have right now.  No idea if its the right way to do things but my instances seem to be replicating and faulting properly.  These are all VW methods:

Duration class>>instVarMap

	^super instVarMap , #(#(#period #seconds))


Duration>>namedValues

	| b |
	b := GbsBuffer new: 1.
	b namedValueAt: 1 put: self asSeconds.
	^b

Duration>>namedValues: anArray

	scale := Seconds

> On Oct 5, 2021, at 12:39 PM, David Shaffer <shaffer at SHAFFER-CONSULTING.COM> wrote:
> 
> Hey folks:
> 
> The GS version of Duration has different I-vars than the VW version (at least as of VW 9.0, can’t say if this is true in earlier versions).  I assume that there’s a way to deal with this but my GS-foo is pretty rusty.  It looks like a GS duration has #seconds and a VW duration has #period and #scale.  Based on VW Duration class>>fromSeconds: it looks like the translation is VW period := GS seconds and VW scale := Seconds with similar translation in the other direction.  What I can’t figure out is how to trigger this when instances of Duration are mapped.  So far what I have is:
> 
> Duration>>instVarMap
> 	^super instVarMap ,
> 		#( (period seconds) )
> 
> But this leaves #scale as nil in VW.  Is there a way to cause it to be set to Seconds?
> 
> Best,
> 
> David



More information about the GemStone-Smalltalk mailing list