[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Scheme coding style
From: |
David Kastrup |
Subject: |
Re: Scheme coding style |
Date: |
Sat, 30 May 2015 00:00:11 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux) |
Carl Sorensen <address@hidden> writes:
> On 5/29/15 1:25 PM, "Simon Albrecht" <address@hidden> wrote:
>
>>Hello,
>>
>>a while ago I found this document on what appear to be very widely
>>accepted standards for formatting scheme code:
>><http://community.schemewiki.org/?scheme-style>. I find it very useful
>>and it seems to be altogether uncontroversial while warranting good
>>legibility.
>>Do we also accept these guidelines in our use of scheme?
>
> Yes, we accept these guidelines. But outside of .scm files, we don't
> enforce them.
>
> Last time I checked, our official standard of Scheme style was "whatever
> Emacs creates".
Emacs does not create line breaks. It will happily indent ) as the
first non-blank line character even if no Scheme style wants them.
> We have a script that gets close in creating approved style, but it
> never got officially adopted.
The script actually gets "whatever Emacs creates" rather well which is
not surprising as scripts/auxiliar/fixscm.sh is all of
#!/bin/sh
#
# Indent and untabify source files (given by their
# filenames in the command line), according to
# LilyPond source style standards.
elisp_expression='(progn
(delete-trailing-whitespace)
(indent-region (point-min) (point-max) nil)
(untabify (point-min) (point-max))
(save-buffer))'
for f in "$@"; do
emacs -batch "$f" --eval "${elisp_expression}"
done
I also don't quite get what "it never got officially adopted" means in
light of commits like
commit cf137655b7aee9988ef536d6fa5e38d279ee73cf
Author: David Kastrup <address@hidden>
Date: Mon Jun 10 17:28:51 2013 +0200
Run scripts/auxiliar/fixscm.sh scm/*.scm
as part of
<URL:https://code.google.com/p/lilypond/issues/detail?id=3404>. Is
there something more official than applying it to all Scheme files?
>> the Learning Manual would be best for propagating their use, but
>>that doesn¹t actually introduce scheme, does it? (thinking aloudŠ)
>
> I don't think we need to propagate their use in .ly files. I also
> think we should *not* introduce Scheme in the Learning Manual.
It already is there.
<URL:http://lilypond.org/doc/v2.18/Documentation/learning/advanced-tweaks-with-scheme>.
> Lilypond is hard enough without the scheme layer.
It's actually going to be pretty tricky to write a LilyPond source file
that does not once make use of # or $.
--
David Kastrup