in reply to treemap

Why: sub treemap (&$) { &_treemap }? I've seen similar things done where the called function does some preliminary initialization, etc. But this is just creating an extra stack level.

japhy -- Perl and Regex Hacker

Replies are listed 'Best First'.
Re: Re: treemap
by merlyn (Sage) on Feb 26, 2001 at 20:56 UTC
    I saw it as a way of getting the public interface to be prototyped, but the private (recursive) interface to have that extra $refs parameter.

    And then I was thinking there should be a way to do it with a coderef alias, but the prototype is hooked into the coderef, not the symbolname, so I stopped thinking about that. {grin}

    -- Randal L. Schwartz, Perl hacker

      I'd probably just have the one entry point and call it recursively via &treemap( $code, $$node, $refs ), where the & should disable the prototype.

              - tye (but my friends call me "Tye")
Re: Re: treemap
by bsb (Priest) on Oct 01, 2003 at 02:01 UTC
    It could goto &_treemap to avoid the stack level.

    Or, have sub treemap (&$) { ... &treemap(..) }
    to avoid the prototype internally