Re: SELs in arrays
Re: SELs in arrays
- Subject: Re: SELs in arrays
- From: Ondra Cada <email@hidden>
- Date: Tue, 25 Sep 2001 21:13:30 +0200
John,
>
>>>>> John C. Randolph (JCR) wrote at Tue, 25 Sep 2001 12:05:19 -0700:
JCR> >JCR> This won't work, since on Mac OS X and NEXTSTEP, selectors aren't
JCR> >JCR> integers, but uniqued C strings:
JCR> >
JCR> >This *will* work, since in any ObjC implementation selectors are
JCR> >convertible
JCR> >to int. In NeXT (and therefore Apple) ObjC they are just pointers --
JCR> >which
JCR> >is a type convertible to int all right.
JCR>
JCR> I stand corrected. I didn't think it through.
Nevertheless, storing them as strings _HAS_ advantages, _if you don't mind
the performance loss_. Assigning the selector numbers (addresses) is somewhat
a magic(*), whilst message names are quite unequivocal: they can be freely
stored and used later, or sent through DO, or whatever.
(*) I regret to say I even don't fully understand the mechanism which is
used to unique selectors during dynamic loading. Well, it does work, that's
important ;)))
---
Ondra Cada
OCSoftware: email@hidden
http://www.ocs.cz
private email@hidden
http://www.ocs.cz/oc