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

Richard Sargent richard.sargent at gemtalksystems.com
Tue Oct 5 13:41:31 PDT 2021


On Tue, Oct 5, 2021 at 1:04 PM David Shaffer via GemStone-Smalltalk <
gemstone-smalltalk at lists.gemtalksystems.com> wrote:

> 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
>
>
It looks like you are on the right track. See the section anmed Customized
Flushing and Faulting starting on page 52 in the GBS for VisualWorks User
Guide. It's part of section 3.4 Replicates.

> 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
>
> _______________________________________________
> GemStone-Smalltalk mailing list
> GemStone-Smalltalk at lists.gemtalksystems.com
> https://lists.gemtalksystems.com/mailman/listinfo/gemstone-smalltalk
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.gemtalksystems.com/mailman/archives/gemstone-smalltalk/attachments/20211005/4ab30ce3/attachment.htm>


More information about the GemStone-Smalltalk mailing list