lilypond-devel
[Top][All Lists]
Advanced

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

Re: utility: \interpolate


From: Nicolas Sceaux
Subject: Re: utility: \interpolate
Date: Tue, 28 Feb 2006 19:35:38 +0100
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (darwin)

Erik Sandberg <address@hidden> writes:

> btw, do you know any good sources where I can learn about scheme coding style?

Usually, you learn scheme coding style by reading scheme books, or
scheme code, but I don't know if there is a coding style
document. Actually I don't know much of scheme coding style, as it's not
my language of choice. I'm just adapting things from Common Lisp.

>> The idomatic way of setting music properties is:
>>   (set! (ly:music-property m 'elements) value)
>
> thanks (so music-set-property is just a legacy thing?)

Internally, (set! (ly:music-property music 'property) value) is changed
to (ly:music-set-property! music 'property value). See the beginning of
scm/music-functions.scm and make-procedure-with-setter in guile manual.

>> >      (let
>>
>> Usually, you don't skip a line after let.
>
> It was the only way I could stop Emacs from indenting it very deeply. Many of 
> the newlines etc. were added for this reason; the indentation felt too deep. 
> Do you know any nice general tricks, either to reduce indentation, or to make 
> heavily indented code readable?

Hm, I don't know. Skip an line just after a loong function name for
instance, or use intermediate variables or auxiliary functions. But
breaking the indentation really makes the code harder to read.

>> >    (if (and (<= pitch-diff 1) (>= pitch-diff -1))
>>
>>      (if (<= -1 pitch-diff 1)
>>
>> makes the relation clearer.
>
> Ah, nice. It's funny that lisp's "unintuitive" prefix operators is what makes 
> it the first language I've seen which naturally expresses <= in a nice, 
> readable way.

I've often read that kind of comment, yes :-)

nicolas




reply via email to

[Prev in Thread] Current Thread [Next in Thread]