Not logged in
Log in now
Create an account
Subscribe to LWN
An "enum" for Python 3
An unexpected perf feature
LWN.net Weekly Edition for May 16, 2013
A look at the PyPy 2.0 release
PostgreSQL 9.3 beta: Federated databases and more
> x = 3
How would you handle that differently, keeping in mind that not stepping on Perl's rather bizarre syntax is not top priority?
And just to make a point:
> x = "0"
> y = -x
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
TypeError: bad operand type for unary -: 'str'
In perl that would have silently become a numeric 0. Oops.
On the future of Perl 5
Posted Dec 3, 2008 21:44 UTC (Wed) by dlang (✭ supporter ✭, #313)
just like many languages use * for multiplication and ** for exponents
many languages also support the concept of i++ and ++i as a command to add 1 to i. in python it's valid syntax, but produced unexpected (to many programmers) results.
Posted Dec 3, 2008 22:05 UTC (Wed) by sbergman27 (guest, #10767)
Posted Dec 3, 2008 22:41 UTC (Wed) by dlang (✭ supporter ✭, #313)
this is both a blessing and a curse.
it's great for writing programs (especially when they really are one use), but it means that if you are looking at programs that other people wrote and have not done any thinking about code style you can run into constructs from many different languages.
Posted Dec 7, 2008 2:05 UTC (Sun) by madscientist (subscriber, #16861)
I don't get the point you're trying to make. When or why would Perls' behavior be an "oops"? Or put another way, what problem would this cause in the code?
Copyright © 2013, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds