I said: >> I think there's an easy workaround that makes this useable; if you want >> vertical space, just use a ";" character and nothing else. Egil replied: >But this adds a rather big disadvantage - that you have to care about the indentation of comments!
I'm not sure that's a big disadvantage. You'd probably want to have their indentation match anyway, or inserts after the comment will start at the "wrong" indentation level. Tools would LIKE languages where lines are indented consistently. I do grant, though, that this means that long comments would be a tight fit in a deep indentation. If it's that hairy, maybe it should be another function :-). What do others think? But let's explore alternatives... >> Another option I didn't mention was to "ignore whitespace-only lines". >> That would work well in files, but it would HIDEOUS for interactive use. >> It'd mean that you would have to enter your NEXT command before reading (and >> execution) of the previous command, making it CERTAIN that your output will >> be out-of-sync. And I think it'd be a VERY bad idea for the syntax to vary >> between interactive and non-interactive use... it's confusing, and makes >> debugging rough. Egil: >It varies in exactly that way in Python. And I haven't had too much problems with that, except that it makes copy-pasting code into the interpreter hard. Which is why I don't like it. When things don't seem to go truly awry, sometimes I copy-paste some lines and do some interactive experimentation. >Another solution would be to add another key-combindation interactively to mean "execute this, I'm done", but that would have the disadvantage of confusing people :( Yes - I think that has the same problem. Another alternative would be to treat "whitespace only" lines as DIFFERENT than "comment-only" lines. E.G., comment-only lines would be ignored, but whitespace-only lines would be treated differently. (I'd propose that whitespace-only lines be treated as no-horizontal-space lines). While odd, it DOES have the following advantages: * Comments don't need to match indentation (e.g., ;FIXME) * User interaction is still relatively simple (Enter Enter) * Whitespace-only lines can't have mysterious non-visible effects * Reading is the same, whether it's interactive or file (so cut-and-paste is easy, as is the interface) The obvious disadvantage is that you can't use truly blank lines for vertical spacing. But you CAN use ";" to do that... and now you don't HAVE to follow the indentation rules for them. I think you'd STILL want to follow the indentation with your comments - I think it's cleaner, and it means that editors are more likely to indent correctly. But let's discuss alternatives, it's the only way I know to find good solutions. --- David A. Wheeler