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

Igor Stasenko siguctua at gmail.com
Fri May 14 03:15:24 UTC 2010


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.



More information about the Squeak-dev mailing list