|
From: | Christophe Pochon |
Subject: | Re: bizarrerie scheme |
Date: | Wed, 1 Apr 2015 09:11:54 +0200 |
#(define a 0)
#(define b 1)
#(define (mafonction)
(if (= a 1)
(display "a")
(display "b")
)
(if (= b 1)
(display "b")
(display "a")
)
)
A+
Christophe
Le mardi 31 mars 2015, 11:48:19 PharoahS a écrit :
> si tu tapes en scheme:
> (define mafonc 4) il comprend mafonc donne 4
> si tu tapes (define mafonc 4 5) il ne comprend pas d'aileurs qu'y aurait il
> a comprendre?
Ce qu'il y a à comprendre c'est que je voudrais une fonction sans arguments,
qui puisse manipuler une 12aine de variables globales préexistantes en
fonction d'une 12aine de drapeaux (#t/#f) de façon à décharger ma fonction
principale.
Donc si j'écris
#(define a 1)
#(define b 0)
#(define (mafonction x)
(if (= x 1)
(display "a")
(display "b")
)
(if (= x -1)
(display "c")
(display "d")
)
)
#(display (mafonction -1))
ça marchera mais ce n'est pas ce qui m'intéresse.
--
Cordialement, Daniel Cartron
« Être con est tout à fait supportable tant qu'on l'est suffisamment pour ne pas
savoir qu'on l'est. »
François Cavanna - Le saviez-vous ?
_______________________________________________
liste de diffusion lilypond-user-fr
address@hidden
https://lists.gnu.org/mailman/listinfo/lilypond-user-fr
[Prev in Thread] | Current Thread | [Next in Thread] |