[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: scheme function help
From: |
David Kastrup |
Subject: |
Re: scheme function help |
Date: |
Mon, 06 May 2013 19:42:46 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux) |
Madoka Machitani <address@hidden> writes:
> On Mon, May 6, 2013 at 10:59 PM, David Kastrup <address@hidden> wrote:
> [...]
>
> In general, your approach is fundamentally flawed: it is very bad
> idea
> to write code relying on user-specified music to be of a
> particular type
> (in this case, SequentialMusic) without verifying it. [...]
>
> I think he is just struggling to lern Scheme now by writing simple
> functions,
> and won't understand such technical terms you provided. Also, the one
> who initially wrote flawed sample code (knowingly, to avoid
> complexity) is me.
But you did not avoid complexity. Even when not using #{ #}, how is
insMark =
#(define-music-function (parser location mark mus)
(markup? ly:music?)
(set! (ly:music-property mus 'elements)
(cons (make-music 'MarkEvent 'label mark)
(ly:music-property mus 'elements)))
mus)
supposed to be less complex than
insMark =
#(define-music-function (parser location mark mus)
(markup? ly:music?)
(make-sequential-music
(list (make-music 'MarkEvent 'label mark) mus)))
? Actually, it might be worth mentioning that the above is _worse_ than
insMark =
#(define-music-function (parser location mark mus)
(markup? ly:music?)
#{ \mark #mark #mus #})
because it works worse with point&click. You should at least do
insMark =
#(define-music-function (parser location mark mus)
(markup? ly:music?)
(make-sequential-music
(list (make-music 'MarkEvent 'label mark 'origin location) mus)))
to get the same usability as the #{...#} version.
--
David Kastrup
- scheme function help, Stjepan Horvat, 2013/05/05
- Re: scheme function help, Madoka Machitani, 2013/05/05
- Re: scheme function help, Stjepan Horvat, 2013/05/06
- Re: scheme function help, David Kastrup, 2013/05/06
- Re: scheme function help, Stjepan Horvat, 2013/05/06
- Re: scheme function help, Stjepan Horvat, 2013/05/06
- Re: scheme function help, Stjepan Horvat, 2013/05/06
- Re: scheme function help, David Kastrup, 2013/05/06
- Re: scheme function help, Madoka Machitani, 2013/05/06
- Re: scheme function help,
David Kastrup <=
- Re: scheme function help, Stjepan Horvat, 2013/05/06
- Re: scheme function help, David Kastrup, 2013/05/06
- Re: scheme function help, Madoka Machitani, 2013/05/06
Re: scheme function help, David Kastrup, 2013/05/06
RE:scheme function help, Peter Gentry, 2013/05/08