[Date Prev][Date Next][Thread Prev][Thread Next] [Search] [Date Index] [Thread Index]

Re(2): [MacPerl] Glue::WebSTAR_301



pudge@pobox.com,Internet writes:
>
>What type does Suspend_Logging() request?  It should be in the POD of the
>module.  Does it say bool, or TEXT, or ... ?
>
    'Suspend_Logging'   => {'class' => 'WWW_', 'event' => 'flog',
                'reply' => ['null', 1, 0, 0],'params' => {
                    '----' => [keyDirectObject(), 'bool', 1, 0, 0, 0],
                }},
>

from the pod:
	$obj->Suspend_Logging(bool)	

		Turn logging on or off

I wondered about double-MacPacking (who hasn't?) and so I wrote this
little program:

#!perl
use Mac::Types;

$a = "0";
$b = "1";

# show the ord() of the MacPacked values
print "0 MacPacked: ", ord(MacPack('bool',$a)), "\n";
print "1 MacPacked: ", ord(MacPack('bool',$b)), "\n";

$c = MacPack('bool',$a);
$d = MacPack('bool',$b);

# show the ord() of the doubly packed values
print "0 MacPacked again: ", ord(MacPack('bool',$c)), "\n";
print "1 MacPacked again: ", ord(MacPack('bool',$d)), "\n";

exit(0);

RESULTS IN:

0 MacPacked: 0
1 MacPacked: 1
0 MacPacked again: 0
1 MacPacked again: 0

So this explains why typeTrue does nothing: it becomes reMacPacked into
typeFalse! What it doesn't explain is why sending 0 instead of typFalse
AppleProds WebSTAR into saying ouch...

Oh, well. I think you may want to do some checking in Glue anyways - for
whether or not a boolean has already been MacPacked.

-josh


***** Want to unsubscribe from this list?
***** Send mail with body "unsubscribe" to mac-perl-request@iis.ee.ethz.ch