Fred> Skip Montanaro writes: >> Why not go all the way to Perl with >> >> top = list.pop() unless IndexError Fred> Trying to kill me, Skip? ;-) Nope, just a flesh wound. I'll wait for the resulting infection to really do you in. ;-) Fred> Actually, the semantics are different. If we interpret that using Fred> the Perl semantics for "unless", don't we have the same thing as: Yes, but the flavor is the same. Reading Perl code that uses the unless keyword always seemed counterintuitive to me. Something like x = y unless foo; always reads to me like, "Assign y to x. No, wait a minute. I forgot something. Only do that if foo isn't true." What was so bad about if (!foo) { x = y; } That was my initial reaction to the use of the trailing except. We argue a lot in the Python community about whether or not a proposed language feature increases the expressive power of the language or not (which is a good idea in my opinion). The Perl community has apparently never been afflicted with that disease. smiles all 'round... Skip
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4