preferred version to get 1st indexable field

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

preferred version to get 1st indexable field

Martin Kuball
Hi!

What is the preferred version to get the pointer to the first
indexable field of an indexable object:
        dstStrPointer := interpreterProxy firstIndexableField: string.
or
        dstStrPointer := interpreterProxy arrayValueOf: string.

Thanks.

Martin

Reply | Threaded
Open this post in threaded view
|

Re: preferred version to get 1st indexable field

Bert Freudenberg-3
Am 19.08.2006 um 19:25 schrieb Martin Kuball:

> What is the preferred version to get the pointer to the first
> indexable field of an indexable object:
> dstStrPointer := interpreterProxy firstIndexableField: string.
> or
> dstStrPointer := interpreterProxy arrayValueOf: string.

Depends. #arrayValueOf: works only for non-pointer objects, but is  
faster. #firstIndexableField: handles everything, including mixed  
fixed/indexable field object formats.

- Bert -


Reply | Threaded
Open this post in threaded view
|

Re: preferred version to get 1st indexable field

Martin Kuball
Am Saturday, 19. August 2006 19:56 schrieb Bert Freudenberg:

> Am 19.08.2006 um 19:25 schrieb Martin Kuball:
> > What is the preferred version to get the pointer to the first
> > indexable field of an indexable object:
> > dstStrPointer := interpreterProxy firstIndexableField: string.
> > or
> > dstStrPointer := interpreterProxy arrayValueOf: string.
>
> Depends. #arrayValueOf: works only for non-pointer objects, but is
> faster. #firstIndexableField: handles everything, including mixed
> fixed/indexable field object formats.

So for objects of class String or ByteArray I could use the first one and
for objects of class Array I would use the second one?

Martin

Reply | Threaded
Open this post in threaded view
|

Re: preferred version to get 1st indexable field

Bert Freudenberg-3

Am 19.08.2006 um 21:19 schrieb Martin Kuball:

>
> Am Saturday, 19. August 2006 19:56 schrieb Bert Freudenberg:
>> Am 19.08.2006 um 19:25 schrieb Martin Kuball:
>>> What is the preferred version to get the pointer to the first
>>> indexable field of an indexable object:
>>> dstStrPointer := interpreterProxy firstIndexableField: string.
>>> or
>>> dstStrPointer := interpreterProxy arrayValueOf: string.
>>
>> Depends. #arrayValueOf: works only for non-pointer objects, but is
>> faster. #firstIndexableField: handles everything, including mixed
>> fixed/indexable field object formats.
>
> So for objects of class String or ByteArray I could use the first  
> one and
> for objects of class Array I would use the second one?

Yes.

- Bert -