[e-lang] Design issue (and proposed change): indentation in literals

Mark Miller erights at gmail.com
Fri Jan 16 21:55:05 CST 2009


On Thu, Jan 15, 2009 at 4:48 PM, Kevin Reid <kpreid at mac.com> 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


More information about the e-lang mailing list