[squeak-dev] My permanent source of confusion and therefore bugs

Casey Ransberger casey.obrien.r at gmail.com
Fri May 14 03:49:00 UTC 2010


This might be off topic, but why "To"? Why not "As"? Being ignorant of slang
might explain why I'm asking:)

On Thu, May 13, 2010 at 8:15 PM, Igor Stasenko <siguctua at gmail.com> wrote:

> On 14 May 2010 05:07, David T. Lewis <lewis at mail.msen.com> wrote:
> > On Fri, May 14, 2010 at 02:41:22AM +0300, Igor Stasenko wrote:
> >> Just want to share my experience working with Interpreter/
> >> interpreterProxy api using VMMaker.
> >>
> >> Make a guess (and answer quickly, in what direction each of these
> >> methods doing conversion)
> >>
> >> positive32BitValueOf:
> >> positive32BitIntegerFor:
> >>
> >>
> >> got the answer?
> >>
> >> These methods along with other xxxIntegerFor: and xxxValueOf:
> >> used most frequently in primitive conversion code.
> >> And i am really sick of such naming..
> >
> > If you think of a positive integer value stored in a 32-bit C variable
> > as a "positive32BitValue", and an integer object representing values
> > in the range 0 through 4294967295 as a "positive32BitInteger", then
> > the naming seems reasonable to me.
> >
> > Personally, I use MemoryAccess and SlangBrowser to look at things
> > like this in the browser and figure out what is really going on. This
> > shows that #positive32BitValueOf: answers an integer value (twos
> complement
> > 32-bit integer as in C or Fortran), and #positive32BitIntegerFor: answers
> > an object of type SmallInteger or LargePositiveInteger.
> >
> That's the point, each time i wasting time on that , to make sure i
> using right way of conversion.
> I didn't thought about better naming , but i think a more revealing
> names would be something like:
>
> positive32BitIntToOop
> oopToPositiveInt32
>
> or
>
> uint32ToOop
> integerOopToUint32
>
> the 'To' word is a key here, it leaves no options how to interpret the
> operation direction.
>
> >
>
> >
>
>
>
> --
> Best regards,
> Igor Stasenko AKA sig.
>
>


-- 
Casey Ransberger
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20100513/42122881/attachment.htm


More information about the Squeak-dev mailing list