|
Bas de page | |
---|---|
Auteur | Sujet : scheme: lambda() |
![]() Publicité | Posté le 17-01-2008 à 21:46:31 ![]() ![]() |
strayyy2 | Euuuuuh, disons que je n'étais pas énormément en cours (honte à moi, je sais, mais boulot oblige), mais il ne me semble pas qu'il en ait parlé. |
IrmatDen | C'est ballot; ca te fait 3 mots clés pour chercher donc.. |
masklinn í dag viðrar vel til loftárása |
Et accessoirement, tu devrais penser à indenter, parce qu'indenté ça donne:
(lambda (f g) ...), qui définit une fonction anonyme prenant deux paramètres "f" et "g". Donc c'est juste de la composition: en mathématique, c'est équivalent à écrire
La 2e est une HoF sans grand intérêt visible (elle permet simplement d'appliquer une fonction à deux arguments identiques en ne spécifiant qu'une seule fois l'argument). La seconde est équivalente à la première, sauf que l'intégralité de l'opération se fait en un seul appel de fonction (alors que pour la première il en faut 2 de suite, donc plus de parenthèses) Par contre pour autant que je puisse en juger l'appel à la fin du truc va pêter (et mon scheme48 semble confirmer): si on déroule l'opération on se retrouve avec
Message cité 1 fois Message édité par masklinn le 18-01-2008 à 08:48:03 --------------- I mean, true, a cancer will probably destroy its host organism. But what about the cells whose mutations allow them to think outside the box by throwing away the limits imposed by overbearing genetic regulations? Isn't that a good thing? |
IrmatDen |
|
masklinn í dag viðrar vel til loftárása |
--------------- I mean, true, a cancer will probably destroy its host organism. But what about the cells whose mutations allow them to think outside the box by throwing away the limits imposed by overbearing genetic regulations? Isn't that a good thing? |
masklinn í dag viðrar vel til loftárása |
Message cité 1 fois Message édité par masklinn le 19-01-2008 à 19:34:51 --------------- I mean, true, a cancer will probably destroy its host organism. But what about the cells whose mutations allow them to think outside the box by throwing away the limits imposed by overbearing genetic regulations? Isn't that a good thing? |
IrmatDen |
|
![]() Publicité | Posté le 20-01-2008 à 11:07:38 ![]() ![]() |
masklinn í dag viðrar vel til loftárása |
Je parlais de composer des fonctions à 2 arguments, genre de composer un truc avec map :: (a -> b) -> [a] -> [b] Imaginons que je veuille composer filter odd :: (Integral a) => [a] -> [a] avec map, dans la mesure où map prend deux arguments il faut que j'écrive:
Message édité par masklinn le 20-01-2008 à 13:19:09 --------------- I mean, true, a cancer will probably destroy its host organism. But what about the cells whose mutations allow them to think outside the box by throwing away the limits imposed by overbearing genetic regulations? Isn't that a good thing? |
IrmatDen | Ah oui, c'est pas la même souplesse. Merci beaucoup |
Sujets relatifs | |
---|---|
Procédure lambda en scheme | Aidez moi en Scheme svp |
pb en programmation scheme | [instruction lambda] variable non initialisée |
utiliser mount() dans un prog execute par lambda | [Scheme] Fonction d'affichage |
[Scheme] Questions de noob' | [Scheme for FLUENT].... partage d'informations |
[scheme] Soyez futés: utilisez scheme | |
Plus de sujets relatifs à : scheme: lambda() |