2010/9/27 Guy Yeterian <[email protected]>:

>     J'ai  écris une fonction s(o):=lambda([m],2*m-o);
> il s'agit de la symétrie de centre o dans le plan m est une liste de 2
> réelsz et o aussi.  ça ne fonctionne pas.
>
>     de manière plus générale comment crée une fonction qui à un élément
> associe une fonction. (c'est possible en caml).

lambda does not evaluate its arguments.
To introduce the value of m into the lambda expression,
you must substitute the value into the lambda expression.

e.g. here are two ways to solve the problem:

s_1 (o) := subst ('o = o, lambda ([m], 2*m - o));

s_2 (o) := buildq ([o], lambda ([m], 2*m - o));

s_1 (17);
 => lambda([m],2*m-17)

s_2 (17);
 => lambda([m],2*m-17)

s_1 (17) (29);
 => 41

There are still other ways to approach this problem.

Hope this helps! Sorry, I can't write in French.

Robert Dodier

------------------------------------------------------------------------------
Start uncovering the many advantages of virtual appliances
and start using them to simplify application deployment and
accelerate your shift to cloud computing.
http://p.sf.net/sfu/novell-sfdev2dev
_______________________________________________
Maxima-lang-fr mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/maxima-lang-fr

Répondre à