[Python-Dev] Python FAQ: Why doesn't Python have a "with" statement?

Phillip J. Eby pje at telecommunity.com
Thu Jun 19 19:21:23 CEST 2008


At 04:54 AM 6/19/2008 -0700, C. Titus Brown wrote:
>More generally, I've never understood why some people insist that
>certain features make Ruby better for DSLs -- are code blocks really
>that important to DSLs?  Or is it just the lack of parens??

Comparison to JavaScript suggests that it's the blocks that make the 
difference.  Even the fact that you have to spell your blocks with 
"function(){...}" doesn't stop you from making a usable DSL, it's 
just not always as pretty as you'd like.

The lack of parens and simpler syntax for blocks in Ruby just makes 
it easier to make *nice-looking* DSLs.



More information about the Python-Dev mailing list