You honestly believe that having different meanings for parens versus brackets is inherently a "trap"? You must be using some kind of really bizarroid font, if they're not easily visually distinguishable. Where I sit, ( and [ look as different as i and |. I really think the problem you ran into has a lot more to do with expectations you brought back from Python. Comma and semicolon, or comma and period, have different meanings as well. Is *that* a problem? (No, I don't mean the scalar comma operator; that's a problem for a different reason, because people expect the other comma operator's semantics, not because anyone confuses it with the period.)
You admitted in your original post that you had been using a language that assigns one semantic to the brackets, then switched back to Perl, which assigns them a rather different semantic, and got caught expecting the semantic you would have had in Python. I posit that this is exactly the sort of scenerio where Perl's use of brackets will trip anyone up: when you expect them to have a different semantic, one that was assigned to them in another language you've been using. Do you know anyone who was tripped up by this in any *other* circumstance?
As far as "subtle but important" semantic differences, I can only say that calling the difference between an array and a reference to an array "subtle" is like calling the difference between a bibliographic entry and the corresponding book subtle. The concept of references is absolutely crucial, one of the very basic fundamentals of computer programming, right up there with flow control IMO; if it seems subtle to you, you're going to have much larger problems than confusing parens and brackets.
In reply to Re: Some Insights from a Traveler Between Languages
by jonadab
in thread Some Insights from a Traveler Between Languages
by skyknight
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |