> > Just wanted to clarify this, as I think this may be the part that > > overlaps with what you're doing. Under this syntax, the object would be > > called for you automatically, so your prototypes wouldn't have to deal > > with optional first arguments at all: > > > > print($FILE, "$stuff"); # $FILE->print($stuff) > > print("$stuff"); # main::print($stuff) >How does it know that the second version isn't: > $stuff->print(); [coming in on the middle of this, so context may be muddled] But for the double quotes, it wouldn't. But double quotes are going to trigger a stringification, which in most worlds produces something that isn't overloaded. I presume it invokes SCALAR->print or STRING->print or something. $stuff->as_string->print() Of course, the q/""/ overload for whatever class $stuff is actually *could* return something that were itself overloaded, at which point you'd presumably run through all that again. But eventually this would have to end if you expect your program to advance. :-) --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