Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

Inlining functions

by mirod (Canon)
on Dec 27, 2000 at 20:52 UTC ( #48443=note: print w/ replies, xml ) Need Help??


in reply to Re: Re: When do you function?
in thread When do you function?

I add my voice to this: the should be a way to inline functions and method calls.

Granted you can use the pre-processor (perl -P) to inline functions but this does not work for method calls. This is really bad when designing OO Perl, where I find myself using straight hash access ($o->{field}) instead of accessors ($o->field) for some often-called methods (or writing painfull and risky kludges), which makes maintenance much harder

I am actually very surprised this is not even a Perl 6 RFC, I would think that this is a simple (I would think it is quite easy to implement) way to enhance speed or maintainability of OO Perl programs.


Comment on Inlining functions
Re: Inlining functions
by merlyn (Sage) on Dec 27, 2000 at 21:43 UTC
    Well, since it'd probably be just an attribute on a subroutine, and we already have those, there's nothing really to RFC. {grin}

    Ideally, the Perl compiler would just recognize when a subroutine qualifies as an open-coded version, and "do the right thing". I'd prefer that. Just like how certain subroutines are recognized as "constant" now, and pre-evaluated.

    -- Randal L. Schwartz, Perl hacker

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://48443]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others having an uproarious good time at the Monastery: (6)
As of 2014-07-26 13:38 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite superfluous repetitious redundant duplicative phrase is:









    Results (177 votes), past polls