Re: File test ops as string methods

2008-11-08 Thread Xiao Yafeng
>
> I've been thinking about that.  One interesting ramification of
> the current matching rule is that you could say either of:
>
>"foo".io ~~ :r :x
>
> or
>
>"foo" ~~ :io(:r :x)
>
> where .io is whatever your "casting" method of choice is for turning
> a string into an object with the correct methods.  Somehow I think
> .filename is a bit too long, huffmanwise.


If io is casting method, which statement below is correct:

say ok if "1234".io > 1000;

or

say ok if "1234".int >1000;


Re: .perl and other methods on Junctions?

2008-11-08 Thread Patrick R. Michaud
On Wed, Nov 05, 2008 at 11:28:00AM -0800, Larry Wall wrote:
> But it seems to me that if stringification of a junction returns a
> correct .perlish syntax, it's probably better to just let that happen
> lazily, on the assumption someone might want .perl to autothread for
> some reason, perhaps because .perl performs some kind of useful
> canonicalization prior to comparison.
> 
> So I think the actual choice is driven by the fact that Str(Junction)
> is defined to work like you'd expect .perl to do if .perl did it,
> which it doesn't...

This all works for me, thanks for the clarification!

Pm