Slash Boxes
NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.

All the Perl that's Practical to Extract and Report

use Perl Log In

Log In

[ Create a new account ]

pudge (1)

  (email not shown publicly)
AOL IM: Crimethnk (Add Buddy, Send Message)

I run this joint, see?

Journal of pudge (1)

Thursday August 01, 2002
05:10 PM

Mac::Memory, Mac::Carbon

[ #6846 ]

Warning: everything here is subject to change. I am just picking names and moving code around arbitrarily, more as a proof of concept.

In Mac OS X:

pudge% perl -Iblib/arch -Iblib/lib -MMac::Carbon -MMac::Memory -wle '$x = new Handle "abc"; print $x->get(0, -1); $y = new Handle ("x" x 2**30); print Mac::Carbon::Error(); print $y->size'
Can't call method "size" on an undefined value at -e line 1.

In MacPerl on Classic, to look up the error:

print $^E = -116
Size check failed (OS error -116)

So I got everything to compile and work. It'd be nice to have Error() be $^E, but that isn't likely for right now, as I believe it needs core support, and even then, I don't know if it would be feasible (are Carbon/Cocoa values compatible? how do you tell them apart, if not?). If they are the same, great, I can set $^E now via SETERRNO, and perhaps add the needed support later to get the text of the error message, and in the meantime supply a function to look up the text of the error message.

I am probably going to implement the missing C functions in Mac::Carbon (name, like everything else, subject to change), and require Mac::Carbon be loaded at the beginning of all other modules that need it. That'll work.

So the next step is to implement those missing GUSI functions and compile more extensions.

I'll need to redo most of this, though; I am modifying the generated C files, because MacPerl uses a custom xsubpp, and these .xs files won't currently work. Matthias at one point suggested a separate preprocessor, such as macxsubpp or somesuch, to generate the XS files. I think that might be the way to go.

Again, this is all subject to change. :-)

The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
More | Login | Reply
Loading... please wait.