[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index][Thread Index][Top&Search][Original]
RE: __DIE__ and exception hooks
At 01:03 PM 1/21/00 -0500, Redford, John wrote:
>From: Larry Wall [mailto:larry@wall.org]
>>Redford, John writes:
>>: What would that mean for my currently running code:
>>: die [ 1, 2 ];
>>
>>Objecthood in Perl is orthogonal to data structure. Perl could turn [1,2]
>>into an object, and you'd be none the wiser until you tried to call a
>>method on it. Mind you, the default STRINGIFY method for the default
>>exception class might be a little surprised to get such a value, but
>>at worst you'd get an error message like ARRAY(0x239d8), and at best,
>>we will have provided a way to set a default ARRAY->STRINGIFY method
>>by then.
>No, as Pete pointed out, my current code tests to see if 'ref $@' is
>'ARRAY'. That would break.
Well, we could just change our definitions... consider [] to give you an
anonymous ARRAY object, and the translation to ARRAY(0xdeadbeef) to be done
by its (system provided) STRINGIFY method. (And it might be interesting to
override the default stringify method for references. Implicit
Data::Dumping, anyone? :)
Dan
--------------------------------------"it's like this"-------------------
Dan Sugalski even samurai
dan@sidhe.org have teddy bears and even
teddy bears get drunk
- References to:
-
"Redford, John" <John.Redford@fmr.com>
[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index][Thread Index][Top&Search][Original]