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

Re: [MacPerl] Mac::Glue?



pudge@pobox.com (Chris Nandor) wrote:
>At 8:47 -0500 1999.10.16, Ken Williams wrote:
>>pudge@pobox.com (Chris Nandor) wrote:
>>
>>>At 19:35 -0700 1999.10.15, Enrique Terrazas wrote:
>>>>What if $_ is not just plain text?  I seem to remember from the
>>>>prior code that @raw_accounts might contain applescript objects. 
>>>>But the double quotes still would not make a difference, right? 
>>>>Confusing.
>>>
>>>In that case, quoting them would probably break it entirely, because the
>>>object would be turned into a string like "AEObjDesc=HASH(0x77aa66bb)"[*],
>>>which would be useless.
>>
>>Unless the "" operator is overloaded.
>
>You can't do that in MacPerl, I am pretty sure.  overload does not support
>overloading " I think.  Maybe it can in other versions, I don't know.


It works for me:

    package SomeThing;
    use overload ('""' => sub { 'yo' });

    package main;
    $thing = bless {}, 'SomeThing';
    print "$thing\n";

This prints "yo\n" under MacPerl 5.2.1a1.

  -------------------                            -------------------
  Ken Williams                             Last Bastion of Euclidity
  ken@forum.swarthmore.edu                            The Math Forum



# ===== Want to unsubscribe from this list?
# ===== Send mail with body "unsubscribe" to macperl-request@macperl.org