Larry Wall wrote:
> Well, we can't use -> because we're using that for something else.
> But it's certainly true that we'll have to have some mechanism for
> disambiguating Color.green from Blackberry.green.  After all,
> 
>     Blackberry.green == Color.red
> 
> Or maybe it's
> 
>     Blackberry::green == Color::red

[...]

> I don't know the syntax for
> disambiguating on the green end yet.  Maybe one of
> 
>     $foo ~~ Color::green
>     $foo ~~ Color.green
>     $foo ~~ Color[green]
> 
> Or maybe something else.

How about a single colon?

     Color:green 

This is the same syntax employed in XML namespaces and URIs, for example:

    <xml xmlns:color="http://example.com/xml/color.xsd";>
      <color:green/>
    </xml>

Don't tell me, we can't use : because we're using that for something
else.  :-)

Presumably, the parser could be smart enough to entuit the 
role on either side of a comparison if the other is specified.

   $foo:Color ~~ Color:green

   $foo ~~ Color:green          # assumes $foo:Color

   $foo:Color ~~ green          # assumes Color:green

> I'm thinking the ordinary method
> 
>     $foo.Color
> 
> implies
> 
>     $foo.as(Color)

What if your $foo object has a regular method called Color?  Would it 
get called in preference?

A

Reply via email to