Re: Design issue (and proposed change): indentation in literals

"Mark Miller" <[email protected]>
Newsgroups gmane.comp.lang.e.general
Message-ID <[email protected]>
On Thu, Jan 15, 2009 at 4:48 PM, Kevin Reid <[email protected]> wrote:
[multi-line literal indentation options]


Kevin & are talking about this, and our current favorite is #2:

> 2. inhibit automatic indent while printing literals.
>   Advantages: Does not introduce new syntax. Long multiline literals
> are presented closer to un-quoted.
>   Disadvantages: Printed source is not indentation-insensitive.

Because it's simple to understand, and the occasional ugliness it
makes us live with is easy to live with and understand.

The various #3 options, especially #3e, still look plausible as a
possible future idea.

> 3e. A refinement of the previous is to use the discard-whitespace
> marker once:
>   "abc
>  \|  def
>    ghi"
> This works particularly well with the vertically-aligned-beside-the-
> head style of indentation, which is common in Lisp and Haskell but I
> don't know a common name for:
>   def tree := term`root(branch(leaf,
>                  $|            leaf),
>                         branch(leaf))`
>
["$|" substituted for a "\|" in the original above]

If we adopt #2 now, we can still decide later to switch to #3e, since
it's upwards compatible.


-- 
Text by me above is hereby placed in the public domain

    Cheers,
    --MarkM
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.