<html><body><div style="color:#000; background-color:#fff; font-family:arial, helvetica, sans-serif;font-size:12pt"><div style="font-family: arial, helvetica, sans-serif; font-size: 12pt; ">Ambiguity: yes, when the last line of a suite is a continued line, it would require double dedentations to end the line and the suite. I noticed a similar case in current Python language as well:</div><div style="font-family: arial, helvetica, sans-serif; font-size: 12pt; "><br></div><div style="font-family: arial, helvetica, sans-serif; font-size: 12pt; ">==================================</div><div style="font-family: arial, helvetica, sans-serif; font-size: 12pt; ">#BEGIN CODE 1</div><div style="font-family: arial, helvetica, sans-serif; font-size: 12pt; ">if condition:</div><div style="font-family: arial, helvetica, sans-serif; font-size: 12pt; "><span class="Apple-tab-span" style="white-space:pre">        </span>for i in range(5):</div><div><span class="Apple-tab-span"
 style="font-family: arial, helvetica, sans-serif; font-size: 12pt; white-space: pre; ">           </span>triangulate<font class="Apple-style-span" size="3">(i)</font></div><div style="font-family: arial, helvetica, sans-serif; font-size: 12pt; ">else: #double dedentations</div><div style="font-family: arial, helvetica, sans-serif; font-size: 12pt; "><span class="Apple-tab-span" style="white-space:pre"> </span>for body in space:</div><div style="font-family: arial, helvetica, sans-serif; font-size: 12pt; "><span class="Apple-tab-span" style="white-space:pre">            </span>triangulate(body)</div><div style="font-family: arial, helvetica, sans-serif; font-size: 12pt; ">#double dedentations again</div><div style="font-family: arial, helvetica, sans-serif; font-size: 12pt; ">log('triangulation done')</div><div style="font-family: arial, helvetica, sans-serif; font-size: 12pt; ">#END CODE 1</div><div style="font-family: arial, helvetica, sans-serif; font-size: 12pt;
 ">==================================<br></div><div><span class="Apple-style-span" style="font-family: arial, helvetica, sans-serif; font-size: 16px; "><div><br></div><div>If lines can be continued by indentation, similar situation would rise:</div></span><div style="font-family: arial, helvetica, sans-serif; font-size: 12pt; "><br></div><div style="font-family: arial, helvetica, sans-serif; font-size: 12pt; ">==================================</div><div style="font-family: arial, helvetica, sans-serif; font-size: 12pt; ">#BEGIN CODE 2</div><div style="font-family: arial, helvetica, sans-serif; font-size: 12pt; ">if condition:</div><div style="font-family: arial, helvetica, sans-serif; font-size: 12pt; "><span class="Apple-tab-span" style="white-space:pre"> </span>result = [sin(i) for i in range(5)]</div><div style="font-family: arial, helvetica, sans-serif; font-size: 12pt; "><span class="Apple-tab-span" style="white-space:pre">           </span>+ [cos(i) for i
 in range(5)]</div><div style="font-family: arial, helvetica, sans-serif; font-size: 12pt; ">else:<br></div><div style="font-family: arial, helvetica, sans-serif; font-size: 12pt; "><div style="font-family: arial, helvetica, sans-serif; font-size: 12pt; "><span class="Apple-tab-span" style="white-space: pre; ">    </span>result = [cos(i) for i in range(5)]</div><div style="font-family: arial, helvetica, sans-serif; font-size: 12pt; "><span class="Apple-tab-span" style="white-space: pre; ">                </span>+ [sin(i) for i in range(5)]</div><div><br></div></div><div style="font-family: arial, helvetica, sans-serif; font-size: 12pt; ">log('triangulation done')</div><div style="font-family: arial, helvetica, sans-serif; font-size: 12pt; ">#END CODE 2</div><div style="font-family: arial, helvetica, sans-serif; font-size: 12pt; ">==================================<br></div><div style="font-family: arial, helvetica, sans-serif; font-size: 12pt; "><span
 class="Apple-style-span" style="font-size: 16px; "><div><br></div></span></div><div>Generating text example: right, this is a case that can't be handled by standard indentation, unless we only consider full dedentation (dedentation to the exact level of the initial indentation) as the signal of ending the line. Whether to accommodate for such a case might be an issue of debate, but at least we can have such 'freedom' :)</div><div><br></div></div><div style="font-family: arial, helvetica, sans-serif; font-size: 12pt; "><br><blockquote style="border-left: 2px solid rgb(16, 16, 255); margin-left: 5px; padding-left: 5px;"><div style="font-size: 12pt; font-family: arial, helvetica, sans-serif; "><div style="font-size: 12pt; font-family: 'times new roman', 'new york', times, serif; "><font size="2" face="Arial"><hr size="1"><b><span style="font-weight:bold;">From:</span></b> Stephen J. Turnbull <stephen@xemacs.org><br><b><span
 style="font-weight: bold;">To:</span></b> Yingjie Lan <lanyjie@yahoo.com><br><b><span style="font-weight: bold;">Cc:</span></b> Gabriel AHTUNE <gahtune@gmail.com>; Matt Joiner <anacrolix@gmail.com>; python-ideas <python-ideas@python.org><br><b><span style="font-weight: bold;">Sent:</span></b> Saturday, September 3, 2011 5:29 PM<br><b><span style="font-weight: bold;">Subject:</span></b> Re: [Python-ideas] allow line break at operators<br></font><br>Yingjie Lan writes:<br><br> > Python uses indentation for blocks, and by the same mechanism, line<br> > breaking can be accommodated without requiring parenthesis or<br> > ending backslashes.<br><br>Possibly, but now you have a problem that a dedent has ambiguous<br>meaning.  It might mean that you're ending a suite, or it might mean<br>you're ending a continued expression.  This probably can be<br>disambiguated, but I don't know how easy that will be to do
 perfectly,<br>including in reporting ill-formed programs.<br><br> > Most people seems to like an indentation on the continuing lines,<br><br>Most of the time, yes, but sometimes not.  For example, in generating<br>text, it's often useful to dedent substantially so you can have a<br>nearly normal length line in the literal strings being concatenated.<br>Or you might have a pattern like this:<br><br>    x = long_named_variable_a<br>            - long_named_variable_a_base<br>        + long_named_variable_b<br>            - long_named_variable_b_base<br><br>which your parser would raise an error on, I presume.  That's not<br>freedom!<wink /><br><br><br><br></div></div></blockquote></div></div></body></html>