>So this:
> my $class = "My::Class";
> print("$class");
>is:
> main::print("My::Class");
Oh, I don't know. *If* you assume that f(x) is always x->f(), then,
it would invoke some STRING::print method--being there as one would
be in an all-the-world's-an-object world. I suppose maybe
that's STRING->print("My::Class") or maybe SCALAR->... instead.
Currently, of course, there is no "main::print". And whether
CORE::print is a real function is quite open to debate.
>but this:
> my $class = "My::Class";
> print($class);
>is:
> My::Class->print();
Likewise, if there are no function calls, and f(x) is x->f, then
print($class) is really $class->print(), then yes, that's
My::Class->print("My::Class"), or barring inheritance,
My::Class::print("My::Class").
I'm truly not clear on what you're yucking there. That an invocant
that is not a class or object should end up calling a general print
function? Would you be any happier if one were to permit UNIVERSAL
methods on "invalid" invocants, making that UNIVERSAL::print instead
of CORE::print?
--tom
- RFC 174 (v1) Parse C<func($obj, @args)> as C<... Perl6 RFC Librarian
- Re: RFC 174 (v1) Parse C<func($obj, @args)>... Michael G Schwern
- Re: RFC 174 (v1) Parse C<func($obj, @args)... Tom Christiansen
- Re: RFC 174 (v1) Parse C<func($obj, @args)>... Chaim Frenkel
- Re: RFC 174 (v1) Parse C<func($obj, @args)... Tom Christiansen
- Re: RFC 174 (v1) Parse C<func($obj, @args)>... Damian Conway
- Re: RFC 174 (v1) Parse C<func($obj, @args)... Nathan Wiger
- Re: RFC 174 (v1) Parse C<func($obj, @args)... Damian Conway
- Re: RFC 174 (v1) Parse C<func($obj, @a... Tom Christiansen
- Re: RFC 174 (v1) Parse C<func($obj, @args)>... Damian Conway
- Re: RFC 174 (v1) Parse C<func($obj, @args)... Tom Christiansen
- Re: RFC 174 (v1) Parse C<func($obj, @a... Tom Christiansen
- Re: RFC 174 (v1) Parse C<func($obj, @args)... Nathan Wiger
- Re: RFC 174 (v1) Parse C<func($obj, @a... Tom Christiansen
- Re: RFC 174 (v1) Parse C<func($obj... Nathan Wiger
- Re: RFC 174 (v1) Parse C<func($obj, @args)... Damian Conway
- Re: RFC 174 (v1) Parse C<func($obj, @args)>... Damian Conway
- Re: RFC 174 (v1) Parse C<func($obj, @args)... Tom Christiansen
- Re: RFC 174 (v1) Parse C<func($obj, @a... Nathan Wiger
- Re: RFC 174 (v1) Parse C<func($obj... Bart Lateur
- Re: RFC 174 (v1) Parse C<func... Nathan Wiger
