> One possibility is language enforcement: at the part of the processing of a 
> multiline string where whitespace is stripped off to the left of the 
> rectangle, it could be an error if that leading whitespace is not “spelled 
> the same” on all lines from which it is being stripped.  I lean toward 
> recommending this.

I see the logic here, but it also makes me a bit uncomfortable.  Our story is 
that indentation-stripping is done by a JDK method (String::stripIndent), and 
that the language behavior is specified in terms of the library behavior.  
(This is essential if we want to allow users to opt out, do some manipulation 
on the un-aligned form, and then perform alignment — the language and library 
behavior must be, er, aligned.). 

We could surely make String::stripIndent throw when you present it a 
mixed-whitespace string, but do we really want this?  I would prefer that 
stripIndent be a total function on strings, even if it has to produce ugly 
output when given ugly input.  


Reply via email to