develooper Front page | perl.perl6.language | Postings from October 2002

RE: "average perl users"? was: labeled if blocks

Thread Previous | Thread Next
From:
Brent Dax
Date:
October 28, 2002 19:58
Subject:
RE: "average perl users"? was: labeled if blocks
Message ID:
003901c27f01$2045b7d0$6501a8c0@deepblue
Larry Wall:
# I have historically preferred that approach.  Certainly it's 
# something that could be enforced by a policy file too.  An 
# intro to programming class is likely to have such a policy 
# file anyway:
# 
#     $ perl6
#     use CS_101;
#     if $a | $b {
#     Prof. Roberts says you are too stupid to use 
# superpositions at line 2.
# 
# But I do think that superpositions will be used heavily 
# enough in case statements that people will get used to | not 
# meaning bitor.

	use hints;
	
	if $flags & ($mask1 | $mask2) {
		...
	}
	^D
	Hint: & is for superpositions--use .& for bitwise AND at - line
3.
		(Add disable => 'superposition' to 'use hints' call to
disable this message.)
	Hint: | is for superpositions--use .| for bitwise OR at - line
3.
		(Add disable => 'superposition' to 'use hints' call to
disable this message.)
	...

Just tell newbies to always 'use hints;', and they'll be fine.

--Brent Dax <brentdax@cpan.org>
@roles=map {"Parrot $_"} qw(embedding regexen Configure)

Wire telegraph is a kind of a very, very long cat. You pull his tail in
New York and his head is meowing in Los Angeles. And radio operates
exactly the same way. The only difference is that there is no cat.
    --Albert Einstein (explaining radio)



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