[m-rev.] diff: mtags: use perl -w

Fergus Henderson fjh at cs.mu.OZ.AU
Mon Nov 24 22:05:08 AEDT 2003


On 24-Nov-2003, Peter Moulder <Peter.Moulder at infotech.monash.edu.au> wrote:
> On Mon, Nov 24, 2003 at 06:03:51PM +1100, Fergus Henderson wrote:
> > > Using &foo() rather than foo() disables prototype checking.
> 
> > Do you know when the foo() form was introduced?
> 
> Prototypes were introduced in 5.002 (1996-Feb-29 according to perlhist
> man page).  Comments in Changes5.002 suggest that foo() was accepted
> before then (and treated like &foo()).

Thanks.  I guess that is ancient enough ;-)

I have applied the following patch.

----------

Estimated hours taken: 0.25
Branches: main

scripts/mtags:
	Apply a review comment from Peter Moulder: use "foo()" rather than
	"&foo", since the latter disables prototype-checking.

Workspace: /home/jupiter/fjh/ws-jupiter/mercury
Index: scripts/mtags
===================================================================
RCS file: /home/mercury1/repository/mercury/scripts/mtags,v
retrieving revision 1.33
diff -u -d -r1.33 mtags
--- scripts/mtags	24 Nov 2003 03:59:10 -0000	1.33
+++ scripts/mtags	24 Nov 2003 06:54:34 -0000
@@ -224,7 +224,7 @@
 
 #---------------------------------------------------------------------------#
 
-sub output_name {
+sub output_name() {
 	# figure out the part of the body that is the name
 
 	$name =~ s/^[ \t]*//;
@@ -250,26 +250,26 @@
 	if (substr($name, 0, length($module)) ne $module) {
 		$name = "${module}__$name";
 	}
-	&output_single_name();
+	output_single_name();
 
 	# strip off the leading module qualifiers one by one,
 	# and output a tag for each partially qualified
 	# or unqualified name
 	while ($name =~ /__/) {
 		$name =~ s/[^_]*(_[^_]+)*__//;
-		&output_single_name();
+		output_single_name();
 	}
 }
 
 sub output_single_name() {
 	# Output tag using `__' as module qualifier.
-	&output_single_tag();
+	output_single_tag();
 
 	# Output tag using `.' as module qualifier.
 	if ($name =~ /__/) {
 		$save_name = $name;
 		$name =~ s/__/./g;
-		&output_single_tag();
+		output_single_tag();
 		$name = $save_name;
 	}
 }
@@ -423,7 +423,7 @@
 	# vim which assumes the kind attribute has at most 4 chars.
 	if ($kind eq "typeclass") { $kind = "tc"; }
 	if ($kind eq "instance") { $kind = "tci"; }
-	&output_name();
+	output_name();
 	
 	# for everything except type, typeclass and instance declarations,
 	# we're done
@@ -467,14 +467,14 @@
 		    $name = $body;
 		    $name =~ s/[ \t;.%].*//;
 		    $kind = "cons";
-		    &output_name();
+		    output_name();
 
 		    # Look for field names on the same line as the
 		    # constructor name
 		    while ($body =~ /([a-z][_a-zA-Z0-9]*)[ \t]*::/) {
 		    	$name = $1;
 			$kind = "fld";
-			&output_name();
+			output_name();
 			$body =~ s/^[^:]*:://;
 		    }
 
@@ -490,7 +490,7 @@
 		    while ($body =~ /([a-z][_a-zA-Z0-9]*)[ \t]*::/) {
 			$name = $1;
 			$kind = "fld";
-			&output_name();
+			output_name();
 			$body =~ s/^[^:]*:://;
 		   }
 		}
@@ -517,7 +517,7 @@
 		    $name = $body;
 		    $name =~ s/[(,%].*//;
 		    $kind = "tcm";	# tcm == type class method
-		    &output_name();
+		    output_name();
 		}
 
 		last if $_ =~ /\.[ \t]*$/ || $_ =~ /\]/;
@@ -542,7 +542,7 @@
 		    $name = $body;
 		    $name =~ s/[\/)].*//;
 		    $kind = "tcim";	# tcim == type class instance method
-		    &output_name();
+		    output_name();
 		}
 
 		last if $_ =~ /\.[ \t]*$/ || $_ =~ /\]/;

-- 
Fergus Henderson <fjh at cs.mu.oz.au>  |  "I have always known that the pursuit
The University of Melbourne         |  of excellence is a lethal habit"
WWW: <http://www.cs.mu.oz.au/~fjh>  |     -- the last words of T. S. Garp.
--------------------------------------------------------------------------
mercury-reviews mailing list
post:  mercury-reviews at cs.mu.oz.au
administrative address: owner-mercury-reviews at cs.mu.oz.au
unsubscribe: Address: mercury-reviews-request at cs.mu.oz.au Message: unsubscribe
subscribe:   Address: mercury-reviews-request at cs.mu.oz.au Message: subscribe
--------------------------------------------------------------------------



More information about the reviews mailing list