Even since this started to work, I still prefer some_dict.has_key("username") because then if an ordinary string accidently found its way into some_dict I'd get a runtime error instead of a silent logic bug.
Obviously I'd need to write three templates for the three pages.
This is a neat example, since it shows how terse Arc can be. I'd be interested to see how well this scales to a large site. For example, I normally like keeping my HTML and Python code separate, so that when I have thousands of lines of each, it's easier to sift through it all and find what I'm looking for. However, if my code were consistently this much shorter, then that wouldn't be as necessary.
Exactly so, thank you. I've since Googled to find how to do code formatting, so I shouldn't have this problem in the future. Thanks for posting the correct code.
Well I agree that we should only omit parens where it's 100% unambiguous where the actual parens would be. There'd need to be a very small number of simple rules/exceptions (such as "every new level of indentation denotes an extra parenthesis unless ____").
A few years ago Paul Graham seemed to think this would work. However, it may be that he tried it and found that it would be too problematic. I'm hoping that he simply has been too busy to implement it so far.
I like scheme a lot; and the parentheses never bothered me. But one device which could provide a gradual path through the thicket of parentheses, and perhaps make Arc more inviting to beginners, would be the:
hide/show invisibles
of word processors. There could even be levels:
hide/show some invisibles
hide/show more invisibles
hide/show all invisibles
Yeah, personally I don't really care whether this is even a language feature or an editor feature. The ability to hide/show more or fewer is certainly interesting.
As for parens not mattering, I agree that they don't matter all that much when the code is being written due to editors taking care of it. But I find that the code that uses whitespace to replace some parens to be much more readable.