[LA.pm] coding guidlines, inline functions

Ofer Nave ofer at netapt.com
Tue Dec 7 13:41:44 CST 2004


On Tue, 7 Dec 2004, Jeremy Leader wrote:

> Ofer Nave wrote:
> > 1) coding guidlines
> > 
> > I just finished reading this document entitled "Conventions and Guidelines 
> > for Parrot Source Code":
> > 
> > 	http://dev.perl.org/perl6/pdd/pdd07_codingstd.html
> > 
> > Has anyone seen a document similar to this for Perl development?
> 
> Damian Conway is working on a book on "Perl Best Practices", which
> I believe he said would be published sometime soon.  I think it
> would be fair to describe the material as conventions and guidelines
> for Perl.

Excellent!

> > 2) inline functions
> > 
> > Is there any analog in perl to C inline functions (i.e., macros)?  In 
> > other words, is there an elegant way in perl to make things modular for 
> > code maintenance purposes, but empower the perl parser/compiler to 
> > optimize away unnecessary function call overhead?
> 
> A quick look at CPAN turned up Filter::Macro
> (http://cpan.org/authors/id/A/AU/AUTRIJUS/), which is a source filter
> for making macros which are expanded inline.

Will check it out, thanks for the lead.

> Along the way, I was intrigued to find the "Inline" module
> (http://cpan.org/authors/id/I/IN/INGY/), which provides the ability
> to write Perl subroutines in other languages (analogous to the
> support some C compilers provide for inline assembly language).

Yes, I've read about Inline::C as an alternative to XS.  Haven't had an 
opportunity to use it yet.

-ofer



More information about the Losangeles-pm mailing list