pkgsrc-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc/pkgtools/pkglint/files/doc Parameters to subroutines a...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/f74594a2f4c7
branches:  trunk
changeset: 516442:f74594a2f4c7
user:      rillig <rillig%pkgsrc.org@localhost>
date:      Fri Jul 21 05:11:34 2006 +0000

description:
Parameters to subroutines are passed in @_, not in $@. Added a paragraph
explaining the extreme slowliness of the current Perl interpreter.

diffstat:

 pkgtools/pkglint/files/doc/chap.code.xml |  12 ++++++++++--
 1 files changed, 10 insertions(+), 2 deletions(-)

diffs (33 lines):

diff -r a5fedb50605f -r f74594a2f4c7 pkgtools/pkglint/files/doc/chap.code.xml
--- a/pkgtools/pkglint/files/doc/chap.code.xml  Fri Jul 21 05:06:06 2006 +0000
+++ b/pkgtools/pkglint/files/doc/chap.code.xml  Fri Jul 21 05:11:34 2006 +0000
@@ -1,4 +1,4 @@
-<!-- $NetBSD: chap.code.xml,v 1.4 2006/05/20 14:26:00 rillig Exp $ -->
+<!-- $NetBSD: chap.code.xml,v 1.5 2006/07/21 05:11:34 rillig Exp $ -->
 
 <chapter id="code">
 <title>Code structure</title>
@@ -235,7 +235,7 @@
        <para>The first example are subroutines and their parameters. In
        most other languages, the names of the parameters are mentioned in
        the subroutine definition. Not so in Perl. The parameters to each
-       subroutine are passed in the <literal>$@</literal> array. The usual
+       subroutine are passed in the <literal>@_</literal> array. The usual
        way to get named parameters is to write assign the parameter array
        to a list of local variables. This extra statement is a nuisance,
        but it is merely syntactical.</para>
@@ -282,6 +282,14 @@
        a string representation of the reference and match the regular
        expression against that.</para>
 
+       <para>The current Perl interpreter is very inefficient when
+       copying strings. This happens really often in pkglint, for
+       example when passing arguments to functions or saving the result
+       of a regular expression match in <quote>real</quote> variables.
+       For a great speed-up, an implementation that handles string
+       objects by reference-counting them would be better. (Lua comes
+       to mind.)</para>
+
 </sect1>
 <sect1 id="code.lang">
 <title>Switching to another language</title>



Home | Main Index | Thread Index | Old Index