develooper Front page | perl.perl5.porters | Postings from December 2000

Re: [PATCH] Interesting syntax idea

Thread Previous | Thread Next
From:
Simon Cozens
Date:
December 29, 2000 07:04
Subject:
Re: [PATCH] Interesting syntax idea
Message ID:
20001229143404.A7762@deep-dark-truthful-mirror.perlhacker.org
On Thu, Dec 28, 2000 at 04:32:35PM -0600, Jarkko Hietaniemi wrote:
> Gimme some tests for this change and I'm prepared to be snakey.

Here you go:

--- pragma/sub_lval.t~	Fri Dec 29 14:33:00 2000
+++ pragma/sub_lval.t	Fri Dec 29 14:32:23 2000
@@ -1,4 +1,4 @@
-print "1..47\n";
+print "1..49\n";
 
 BEGIN {
     chdir 't' if -d 't';
@@ -435,3 +435,16 @@
 foobar() = 12;
 print "# '$newvar'.\nnot " unless $newvar eq "12";
 print "ok 47\n";
+
+# Testing DWIM of foo = bar;
+sub foo : lvalue {
+    $a;
+}
+$a = "not ok 48\n";
+foo = "ok 48\n";
+print $a;
+
+open bar, ">nothing" or die $!; 
+bar = *STDOUT;
+print bar "ok 49\n";
+unlink "nothing";

Looks like indirect objects are still wrong, though. Aargh.

-- 
"On a normal ascii line, the only safe condition to detect is a 'BREAK'
- everything else having been assigned functions by Gnu EMACS."
(By Tarl Neustaedter)

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About