Yes, the problem is that I wanted to preserve as much of the semantics of Objective C as possible. Like Java (actually, not really like Java at all), each Objective C class can have a number of class methods, which usually create an instance of the object. Because a user could concievably want to be able to do that, I wanted to preserve the availability of those methods in a Pike class.
so,
[ NSString stringWithCString: somestring ];
would translate to
Cocoa.NSString.stringWithCString(somestring);
Basically, for my purposes, what I needed is the class and method name. I suppose I another solution would be dynamically generated machine code, but that seems way more difficult than I want to get into for this.
I also considered a hair-brained idea of digging through the call stack to find the method name, but that seemed unreliable at best.
Consider this a vote for real java-style "static" methods in Pike :)
Bill
On Wed, 11 Oct 2006, Martin Stjernholm, Roxen IS @ Pike developers forum wrote:
Hmm, come to think about it, it actually is more difficult because there is no relevant Pike_fp->current_object in this case. Didn't realize that before.
Anyway, using non-constant functions seems simpler than objects with `().