Re: Scheme coding style

2015-05-29 Thread Carl Sorensen


On 5/29/15 4:00 PM, "David Kastrup"  wrote:

>I also don't quite get what "it never got officially adopted" means in
>light of commits like
>
>commit cf137655b7aee9988ef536d6fa5e38d279ee73cf
>Author: David Kastrup 
>Date:   Mon Jun 10 17:28:51 2013 +0200
>
>Run scripts/auxiliar/fixscm.sh scm/*.scm

I'm sorry.  That happened while I was not actively participating.

Some years earlier I modified a scheme source-code formatter to allow
those who didn't have Emacs to automatically indent their code.  But it
was never accepted.

I stand corrected.

Thanks for getting out the right information,

Carl


___
lilypond-devel mailing list
lilypond-devel@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-devel


Re: Scheme coding style

2015-05-29 Thread David Kastrup
Carl Sorensen  writes:

> On 5/29/15 1:25 PM, "Simon Albrecht"  wrote:
>
>>Hello,
>>
>>a while ago I found this document on what appear to be very widely
>>accepted standards for formatting scheme code:
>>. 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 
Date:   Mon Jun 10 17:28:51 2013 +0200

Run scripts/auxiliar/fixscm.sh scm/*.scm

as part of
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.
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

___
lilypond-devel mailing list
lilypond-devel@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-devel


Re: Scheme coding style

2015-05-29 Thread Simon Albrecht

I’ll come up with some text suggestions, or a patch, but not tonight.
Greetings, Simon

Am 29.05.2015 um 23:10 schrieb Carl Sorensen:

On 5/29/15 2:30 PM, "Thomas Morley"  wrote:


2015-05-29 21:25 GMT+02:00 Simon Albrecht :

Hello,

a while ago I found this document on what appear to be very widely
accepted
standards for formatting scheme code:
. 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? If yes, we
should
consider documenting them, or rather, referencing them in our docs.

It's already mentioned in:
CG 10.3.2 Desired file formatting
http://lilypond.org/doc/v2.19/Documentation/contributor/programming-withou
t-compiling

I was sure we had put that reference in the CG (I'm pretty sure I found it
and put it there).  But when I looked in the CG I couldn't find it.

A cross-reference in Usage would probably be a good idea (as would a
cross-reference from the CG to the .ly file guidelines in Usage.

Thanks,

Carl




___
lilypond-devel mailing list
lilypond-devel@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-devel


Re: Scheme coding style

2015-05-29 Thread Simon Albrecht

Am 29.05.2015 um 22:25 schrieb Carl Sorensen:


On 5/29/15 1:25 PM, "Simon Albrecht"  wrote:


Hello,

a while ago I found this document on what appear to be very widely
accepted standards for formatting scheme code:
. 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".
Which is pretty much the same as suggested in the above-linked document, 
except for the line breaks, which aren’t automatically inflected, are 
they? I don’t use Emacs.


We have a script that gets close in creating approved style, but it never
got officially adopted.



If yes, we
should consider documenting them, or rather, referencing them in our
docs. This could be
­ in the usage manual
,
where the corresponding Lilypond coding recommendations are found.

I would be happy with a reference there.


­ in the scheme tutorial
,
but where? Someone who is completely new to scheme will not make much
use of style instructions.

It seems like a reference in the Scheme tutorial would also be
appropriate. (Perhaps a reference to the usage manual, rather than a
restatement of whatever is in Usage.
  

­ 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.  Lilypond is hard
enough without the scheme layer.

Of course.

My reason to raise the topic is the amount of badly formatted, 
hard-to-read code out there. So I think we should find a prominent place 
where _every_ Lilypond user will come across style guidelines for both 
Lilypond and Scheme code. But IIRC a restructuring of the manuals 
overview page is in the making or planned anyway?
It’s a different issue with Lilypond code, since it is much more 
complicated and diverse (on the surface) than Scheme code and some 
things will always depend on the music and on individual taste. So prior 
to the GLISS there won’t be a definitive solution for documenting 
guidelines, but as a start it’s good to have references for scheme style 
in Usage and Extending.


Regards, Simon

___
lilypond-devel mailing list
lilypond-devel@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-devel


Re: Scheme coding style

2015-05-29 Thread Carl Sorensen
On 5/29/15 2:30 PM, "Thomas Morley"  wrote:

>2015-05-29 21:25 GMT+02:00 Simon Albrecht :
>> Hello,
>>
>> a while ago I found this document on what appear to be very widely
>>accepted
>> standards for formatting scheme code:
>> . 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? If yes, we
>>should
>> consider documenting them, or rather, referencing them in our docs.
>
>It's already mentioned in:
>CG 10.3.2 Desired file formatting
>http://lilypond.org/doc/v2.19/Documentation/contributor/programming-withou
>t-compiling

I was sure we had put that reference in the CG (I'm pretty sure I found it
and put it there).  But when I looked in the CG I couldn't find it.

A cross-reference in Usage would probably be a good idea (as would a
cross-reference from the CG to the .ly file guidelines in Usage.

Thanks,

Carl


___
lilypond-devel mailing list
lilypond-devel@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-devel


Re: Scheme coding style

2015-05-29 Thread Simon Albrecht

Am 29.05.2015 um 22:30 schrieb Thomas Morley:

2015-05-29 21:25 GMT+02:00 Simon Albrecht :

Hello,

a while ago I found this document on what appear to be very widely accepted
standards for formatting scheme code:
. 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? If yes, we should
consider documenting them, or rather, referencing them in our docs.

It's already mentioned in:
CG 10.3.2 Desired file formatting
http://lilypond.org/doc/v2.19/Documentation/contributor/programming-without-compiling

So that’s where I got the hint… :-)
Yours, Simon

___
lilypond-devel mailing list
lilypond-devel@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-devel


Re: Scheme coding style

2015-05-29 Thread Thomas Morley
2015-05-29 21:25 GMT+02:00 Simon Albrecht :
> Hello,
>
> a while ago I found this document on what appear to be very widely accepted
> standards for formatting scheme code:
> . 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? If yes, we should
> consider documenting them, or rather, referencing them in our docs.

It's already mentioned in:
CG 10.3.2 Desired file formatting
http://lilypond.org/doc/v2.19/Documentation/contributor/programming-without-compiling

> This
> could be
> – in the usage manual
> ,
> where the corresponding Lilypond coding recommendations are found.
> – in the scheme tutorial
> , but
> where? Someone who is completely new to scheme will not make much use of
> style instructions.
> – the Learning Manual would be best for propagating their use, but that
> doesn’t actually introduce scheme, does it? (thinking aloud…)
> What do you prefer? I could elaborate the change also.
>
> Yours, Simon

___
lilypond-devel mailing list
lilypond-devel@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-devel


Re: Scheme coding style

2015-05-29 Thread Carl Sorensen


On 5/29/15 1:25 PM, "Simon Albrecht"  wrote:

>Hello,
>
>a while ago I found this document on what appear to be very widely
>accepted standards for formatting scheme code:
>. 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".

We have a script that gets close in creating approved style, but it never
got officially adopted.


>If yes, we 
>should consider documenting them, or rather, referencing them in our
>docs. This could be
>­ in the usage manual
>,
>where the corresponding Lilypond coding recommendations are found.

I would be happy with a reference there.

>­ in the scheme tutorial
>,
>but where? Someone who is completely new to scheme will not make much
>use of style instructions.

It seems like a reference in the Scheme tutorial would also be
appropriate. (Perhaps a reference to the usage manual, rather than a
restatement of whatever is in Usage.
 
>­ 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.  Lilypond is hard
enough without the scheme layer.

Thanks,

Carl


___
lilypond-devel mailing list
lilypond-devel@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-devel


Scheme coding style

2015-05-29 Thread Simon Albrecht

Hello,

a while ago I found this document on what appear to be very widely 
accepted standards for formatting scheme code: 
. 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? If yes, we 
should consider documenting them, or rather, referencing them in our 
docs. This could be
– in the usage manual 
, 
where the corresponding Lilypond coding recommendations are found.
– in the scheme tutorial 
, 
but where? Someone who is completely new to scheme will not make much 
use of style instructions.
– the Learning Manual would be best for propagating their use, but that 
doesn’t actually introduce scheme, does it? (thinking aloud…)

What do you prefer? I could elaborate the change also.

Yours, Simon

___
lilypond-devel mailing list
lilypond-devel@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-devel