On Thu, Jul 21, 2005 at 11:58:41AM -0300, Adriano Ferreira wrote:
: Larry said:
: > So I guess I agree that .tailcall is probably just a bad synonym for 
"return".
: 
: But is there any other case where we need an explicit tail call with "goto"?

I suppose that depends on whether the tail-call optimization is
general enough to work indirectly at run time.

: And about a way to curry a method with its receiver to a sub, is there
: a shorthand?

    $sub = &ThatClass::meth.assuming($obj);

is the shortest thing that specifies the other class.

    $sub = &meth.assuming($obj);

should work if the method would be selected by MMD.  I'd think a lot of
these cases are actually covered by currying the class to have an
implicit invocant, turning it into a module.  Other than that, there's
always something like:

    $sub = -> [EMAIL PROTECTED] { $obj.meth(@args) };

which presumably can optimize the tailcall away.  Possibly

    $sub = { $obj.meth(@_) };

could be forced to recognize that @_ is the slurpy arg to the closure.

Larry

Reply via email to