[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

making indentation marker &| implicit

This page is part of the web mail archives of SRFI 108 from before July 7th, 2015. The new archives for SRFI 108 contain all messages, not just those from before July 7th, 2015.



I hate to delay this even more, but ...

SRFI-10[789] uses &| as an indentation marker, which causes
any preceding whitespace to be skipped.  Scribble avoids this
in a way that seems nicer: Any indentation that is common to
each line (following a newline) is stripped.  Thus using SRFI-109
syntax:
(define str1 &{
  abc
    def
  ghi}
becomes: "abc\n  def\nhgi".

http://docs.racket-lang.org/scribbl/reader.html
(last section: 2.4.4 Spaces, Newlines, and Indentation.)

"Initial indentation" means indentation in the source port,
not the string returned by the reader.

Some tweaking of the Scribble rules might be appropriate.
For example, line-continuations markers @- seem worth keeping.
And the rules for initial and final lines needs some thought.

Tabs would have to be consistent: If a line starts with
T1 tabs followed by S1 spaces, and another line starts with
T2 tabs followed by S2 spaces, then it is an error if
(and (not (= T1 T2)) (> S1 0) (> S2 0)).
--
	--Per Bothner
per@xxxxxxxxxxx   http://per.bothner.com/