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

Re: [ID 20000403.009] uninitialised concatenation???

From:
Mike Stok
Date:
April 4, 2000 07:09
Subject:
Re: [ID 20000403.009] uninitialised concatenation???
Message ID:
Pine.LNX.4.21.0004040858380.11591-100000@ratdog.stok.co.uk
On Tue, 4 Apr 2000, Tom Christiansen wrote:

> The opcodes that Perl compiles your program into ARE NOT THE ONES
> THAT YOU SAW.
> 
> There are a million cases of this.   Here are two:
> 
>     % perl -MO=Deparse -e 'for($i=0; $i<10; $i++){}'
>     $i = 0;
>     while ($i < 10) {
> 	();
>     }
>     continue {
> 	++$i
>     }

This is an accurate description of what's going on on the perl side of
things, but isn't the average writer or reader of the code likely to be
thinking in terms of 'for'?

Would a satisfactory approach be for the error message to be couched in
terms of the source, and perldiag/splain have the detail about the
internal representation?

Mike

-- 
mike@stok.co.uk                    |           The "`Stok' disclaimers" apply.
http://www.stok.co.uk/~mike/       |
                                   |
stok@colltech.com                  |            Collective Technologies (work)




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