returning a string from a primitive

Bert Freudenberg bert at freudenbergs.de
Mon Mar 5 16:23:14 UTC 2007


On Mar 5, 2007, at 17:14 , Diman Todorov wrote:

> Hello,
> I am currently struggling to return a string from a virtual machine  
> primitive. The only example derived from  
> SmarySyntaxInterpreterPlugin I was able to find in the Squeak  
> sources is in the InternetConfigPlugin (in  
> primitiveGetStringKeyedBy:). This Plugin instantiates a new string  
> object and explicitly iterates over the string to copy it to  
> squeak. Isn't there a more elegant way to return a string from a c  
> function?

You have to copy the data into a proper oop in Squeak's object  
memory. What "more elegant way" to do that are you proposing? You can  
write a helper function of course. But eventually it will have to copy.

- Bert -





More information about the Squeak-dev mailing list