[Q] accessing an OrderedCollection from c source plugin

James Gjerde jgjerde at contrarymotion.com
Sat Mar 13 21:42:30 UTC 2004


hello,

i am trying to access some string literals in a smalltalk OrderedCollection that is passed as an arg to a named primtive.

in smalltalk:

    primMyPrimitive: anOrderedCollectionOfStrings
        <primtive:'primMyPrimitive' module:'foo'>

the c source:

    EXPORT(int) primMyPrimitive(void) {
    
        int collectionOop, strElementOop;

        collectionOop = interpreterProxy->stackObjectValue(0);
        strElementOop = interpreterProxy->stObjectat(collectionOop, 1);
}

now i know there is data at index 1, but this method is erroring out in squeak. i am writing the c source myself. is there some sort of cast i need to do with the origianl collectionOop in order for it to work with stObjectat? does stObjectat not know that collectionOop represents an OrderedCollection? i just want to be able to get the oops of the elements in the OrderedCollection, i would know how to extract the string values once i got them, problem is i cannot get the oops.

i would certainly appreciate any help.

jamie
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20040313/838dad21/attachment.htm


More information about the Squeak-dev mailing list