Best way to format nested lists

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Best way to format nested lists

Cameron Horsburgh
Hi folks,

I'm trying to document the recently added feature whereby System Staff
Delimiters may be nested to an arbitrary depth. I've figured out how the
feature works, but I'm trying to work out the best way to format the code.

For example the example given puts the relevant line in one long line:

\set StaffGroup.systemStartDelimiterHierarchy
        = #'(SystemStartSquare (SystemStartBracket a (SystemStartSquare b)) d)

Even small examples will wrap, making the whole thing messy and
difficult to understand. I presume this is a Scheme like construction --
how do deeply nested lists get formatted there?

Cameron



_______________________________________________
lilypond-devel mailing list
[hidden email]
http://lists.gnu.org/mailman/listinfo/lilypond-devel
Reply | Threaded
Open this post in threaded view
|

Re: Best way to format nested lists

David Feuer-2
On 4/17/06, Cameron Horsburgh <[hidden email]> wrote:

> For example the example given puts the relevant line in one long line:
>
> \set StaffGroup.systemStartDelimiterHierarchy
>         = #'(SystemStartSquare (SystemStartBracket a (SystemStartSquare b)) d)
>
> Even small examples will wrap, making the whole thing messy and
> difficult to understand. I presume this is a Scheme like construction --
> how do deeply nested lists get formatted there?

Different people do different things, but generally something like this:

\set StaffGroup.systemStartDelimiterHierarchy
   = #'(SystemStartSquare
             (SystemStartBracket a (SystemStartSquare b))
             d)

You might want to use an editor, such as Vim, that can do automatic
indentation of LilyPond files.


_______________________________________________
lilypond-devel mailing list
[hidden email]
http://lists.gnu.org/mailman/listinfo/lilypond-devel
Reply | Threaded
Open this post in threaded view
|

Re: Best way to format nested lists

Pedro Kröger
In reply to this post by Cameron Horsburgh
Cameron Horsburgh <[hidden email]> writes:

> difficult to understand. I presume this is a Scheme like construction --
> how do deeply nested lists get formatted there?

if you think in scheme/lisp, there is a concensus about how to indent
the code. this link may help:

http://dept-info.labri.fr/~strandh/Teaching/MTP/Common/Strandh-Tutorial/indentation.html

although it's written for common lisp, it applies to any lisp-like
language.

pedro



_______________________________________________
lilypond-devel mailing list
[hidden email]
http://lists.gnu.org/mailman/listinfo/lilypond-devel