On 26 Oct 2008, at 12:42, Günther Noack wrote:

> Hi!
>
> Am 25.10.2008 um 20:15 schrieb David Chisnall:
>> You shouldn't call selValue directly - the compiler will insert this
>> call for you.
>
> You're right. It works now. :-)

Great.

>>> Segfault.st:
>>> 'a string' class name log.
>>> This produces a segfault in objc_msg_dispatch.
>>
>> Do you get any warnings about name being a polymorphic selector?  I
>> suspect name is returning a char*, but the compiler is finding one
>> that returns an object, so it's trying to send a message to it
>> directly.  Also, is there a reason you didn't do:
>>
>> 'a string' className log.
>
> I don't get the polymorphic selector warning. However, it works when I
> use the className method instead. :-) Thanks for the hint!

That's odd then.  I'll have to poke around and see what it's actually  
doing when it calls +name.  I couldn't find this method documented on  
NSObject or NSString.

> As I forgot to attach the Smalltalk files, here's the file  
> (Segfault.st) that produces the
> segfault when doing "'a string' class name log.". I also attached a  
> file
> with a couple of very simple SUnit-style tests. (Operators.st)

Do you want to commit these?  I think Eric or Truls was going to start  
working on unit tests for Smalltalk, but this looks like a good start.

> I also came across problems with -[NSArray select:] not working. In  
> the select:
> method, which is implemented in Objective-C, the block returns a  
> BigInt object
> pointer, which always evaluates to true. Inserting a call to - 
> boolValue fixes the
> issue. It's up to you to decide whether this is a clean solution  
> w.r.t to your
> automatic type conversion architecture.

Yup, that's my bug.  I forgot that nil and 0 are different in  
Smalltalk, but not in ObjC.  I've committed your fix.

David
_______________________________________________
Etoile-dev mailing list
[email protected]
https://mail.gna.org/listinfo/etoile-dev

Reply via email to