[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

Re: Pythonic indentation (or: beating a dead horse

Yukihiro Matsumoto

5/25/2009 8:14:00 AM

Hi,

|A valid objection that was raised in the earlier thread was regarding
|a quick and easy and common debugging technique: throwing in print
|statements
|
| def do_something(a, b, c)
|print a, b, c # for debugging purposes
| a + b + c
| end
|
| def do_something(a, b, c):
|print a, b, c # error! unexpected indentation level
| a + b + c
| end

Despite some might expect, I am not fully against block-by-indentation
a la Python, as long as

* we keep end and brace blocks as well, of course.
* prohibit mixing tabs and spaces in indentation mode
* nice and compatible syntax. for compatibility and other reasons,
colons do not work for block-by-indentation-marker.

I haven't found any good syntax so far. Besides that 'end's and
braces often work nice for my eyes.

matz.