[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: lilypond scheme-sandbox
From: |
Daniel Cartron |
Subject: |
Re: lilypond scheme-sandbox |
Date: |
Fri, 31 May 2013 11:43:12 +0200 |
User-agent: |
KMail/4.10.2 (Linux/3.8.0-22-generic; KDE/4.10.2; x86_64; ; ) |
Le vendredi 31 mai 2013 02:24:58 elmamyra a écrit :
> D'accord je comprends mieux. Je pense que cela devrait fonctionner si "ref"
> est une liste de 3 valeurs:
>
> #(define (av-btn ref)
> (filter
> (lambda (pair) (equal? (car pair) ref) )
> kdb
> )
> )
>
> Et si tu veux que la fonction retourne uniquement les listes de droite:
>
> #(define (av-btn ref)
> (map cdr
> (filter
> (lambda (pair) (equal? (car pair) ref) )
> kdb
> )
> )
> )
ok merci... Quand je pense aux haures que j'ai passé à essayer de comprendre
comment marchent tous ces trucs...
En effet la deuxième ferait exactement ce que je veux, sauf que....
guile> (av-btn '(2 6 0))
standard input:533:5: While evaluating arguments to filter in expression
(filter (lambda # #) kdb):
et pourtant :
guile> kbd
(((0 4 0) 1 1 2) ((0 6 0) 2 1 2) ((1 0 0) 1 1 3) ((1 1 0) 2 1 3) ((1 2 0) 1 1
4) ((1 3 0) 2 1 4) ((1 4 0) 1 1 5) ((1 5 0) 2 1 5) ((2 0 0) 1 1 6) ((1 6 0) 2
1 6) ((2 2 0) 1 1 7) ((2 1 0) 2 1 7) ((2 4 0) 1 1 8) ((2 3 0) 2 1 8) ((3 0 0)
1 1 9) ((2 5 0) 2 1 9) ((3 2 0) 1 1 10) ((2 6 0) 2 1 10) ((0 0 0) 1 2 3) ((0 2
0) 2 2 3) ((0 3 0) 1 2 4) ((0 4 0) 2 2 4) ((0 5 0) 1 2 5) ((0 6 -1/2) 2 2 5)
((1 0 0) 1 2 6) ((1 1 0) 2 2 6) ((1 3 0) 1 2 7) ((1 2 0) 2 2 7) ((1 5 0) 1 2
8) ((1 4 0) 2 2 8) ((1 0 0) 1 2 9) ((2 6 -1/2) 2 2 9) ((2 3 0) 1 2 10) ((2 1
0) 2 2 10) ((2 5 0) 1 2 11) ((2 2 0) 2 2 11))
C'est pas comme ça qu'il faut s'en servir ?
--
Cordialement, Daniel Cartron
« Je suis un contemplateur fervent de l'effort d'autrui. Un paresseux, c'est
tout simplement quelqu'un qui ne fait pas semblant de travailler. »
Tristan Bernard
- lilypond scheme-sandbox, Daniel Cartron, 2013/05/30
- Re: lilypond scheme-sandbox, Gilles, 2013/05/30
- Re: lilypond scheme-sandbox, Daniel Cartron, 2013/05/31
- Re: lilypond scheme-sandbox, elmamyra, 2013/05/31
- Re: lilypond scheme-sandbox, Daniel Cartron, 2013/05/31
- Re: lilypond scheme-sandbox, elmamyra, 2013/05/31
- Re: lilypond scheme-sandbox,
Daniel Cartron <=
- Re: lilypond scheme-sandbox, Daniel Cartron, 2013/05/31
- Re: lilypond scheme-sandbox, elmamyra, 2013/05/31
- Re: lilypond scheme-sandbox, Daniel Cartron, 2013/05/31
- Re: lilypond scheme-sandbox, elmamyra, 2013/05/31
- Re: lilypond scheme-sandbox, Daniel Cartron, 2013/05/31
- Re: lilypond scheme-sandbox, Daniel Cartron, 2013/05/31
- Re: lilypond scheme-sandbox, elmamyra, 2013/05/31