From: "S.Volkov" Date: 2007-05-19T03:15:17+09:00 Subject: Re: Why not adopt "Python Style" indentation for Ruby? "Yukihiro Matsumoto" wrote in message news:1179498273.407463.1345.nullmailer@x31.netlab.jp... > Hi, > > In message "Re: Why not adopt "Python Style" indentation for Ruby?" > on Fri, 18 May 2007 23:15:05 +0900, "S.Volkov" > writes: > .. > > |suggestion: make 'end' optional if code block contains only one > statement; > > I'm not sure if we can define syntax for above suggestion. > > while cond > puts a > puts b # delimit by indentation or else?? You are right, not feasible - rejected :) > or maybe > > while cond: puts a # should be in same line Thus we introduce new semantic for newline! Following construct becomes invalid (and confusing): while cond: puts a puts b end =>my personal opinion - NO imho: we need special terminator anyway, now it is 'end', could be another; suggestion: introduce ';;' terminator for 'implicit blocks (not started with class/module/def/do/begin), ie: #-- while cond : puts a ; puts b ;; # but while cond do puts a ; puts b end #-- until - same as while #-- if cond : p a ;; #-- if cond : p a else p b ;; #-- unless - same as if #-- for var in expr : p var ;; # but for var in expr do p var end #-- case - sorry my lunch time ended, has to return back to my office.. BRs Sergey Volkov