Rank: Administration Groups: Registered, Advanced Member Joined: 23/06/2009(UTC) Posts: 1,740 Was thanked: 318 time(s) in 268 post(s)
|
Hello, Here are some additional notes about argument functions. Functions can be defined in a preferable way (IMHO) Fun(a,b,f(2))←a+b+f(a,/2Or with dummy arguments. Dummy arguments can be even with the same names. Here are some examples: Fun_2(a,b,f(a_,a_))←a+b+f(a,/2Fun_3(a,b,f(_1,_2))←a+b+f(a,/2Fun_4(a,b,f(_,_))←a+b+f(a,/2User can choose the most convenient way of defining these functions. When calling, it is important to have in mind that (already mentioned) 1. argument functions must have variables as arguments 2. names from the argument list or previously defined variables are not allowed. 3. names should be different, contrary to the definition (SMath will not report an error here - It is allowed but pay attention on the result!) Therefore, user can have its own naming conventions for these argument names - some unusul names used only in these cases. Here is the example by using underscore: Fun_1(x,y,ff(_a,_)=15Fun_2(x,y,ff(_a,_)=15Fun_3(x,y,ff(a_,b_))=15And my favorite one at the moment: Fun_4(x,y,ff(_1,_2))=15None of the variables _a, _b, a_, b_, _1, _2 were not previously defined Regards, Radovan Edited by user 08 August 2010 22:22:48(UTC)
| Reason: Not specified |
When Sisyphus climbed to the top of a hill, they said: "Wrong boulder!" |