Re: explicit boolean accessor

[email protected] (Nathan Wiger)
Newsgroups perl.perl6.language.objects
Organization Sun Microsystems
Message-ID <[email protected]>
> Like:
> 
>   use overload
>     'bool' => \&my_truth;
> 
>   sub my_truth {
>     1;  # objects of this class are always true
>   }
> 
> This works in Perl5.

Right, a lot of this stuff (like STRING and BOOLEAN) can be accomplished
through overloading. However, having a standard builtin method similar
to tie and import makes things easier and more consistent I think. If we
make "everything an object" then these become necessities.

-Nate
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.