[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: utility: \interpolate
From: |
Erik Sandberg |
Subject: |
Re: utility: \interpolate |
Date: |
Mon, 27 Feb 2006 14:24:20 +0100 |
User-agent: |
KMail/1.8.3 |
On Saturday 25 February 2006 09.42, Nicolas Sceaux wrote:
> May I nitpick about style?
Thanks! some of the mistakes were genuine while others were oversights due to
laziness (some of the code is just a quick hack/proof-of-concept; I hope to
replace it with better code sometime. E.g., primitive-eval was used because I
forgot the name of apply)
btw, do you know any good sources where I can learn about scheme coding style?
> Erik Sandberg <address@hidden> writes:
> > #(define (make-rel-music-function sig fun)
> > (let ((newfun (lambda args
> > (make-music 'SequentialMusic
>
> the indentation is broken here.
My scheme code tends to generate very deep indentation, see below.
>
> 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?)
> > (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?
> in srfi-1, first is synonym to
> car.
Ouch, I didn't know about that. Thanks.
> > (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.
--
Erik