|
From: Richard F. <fa...@be...> - 2014-09-30 03:18:25
|
If you want to use keyword parameters, the following construct will work, assuming you are not messing with using the keyword parameter names in the global context, like giving them values. instead of f(alpha,beta,gamma) := alpha+beta-3*gamma you can do g([args]):= subst(args, alpha+beta-3*gamma) and then use g(alpha=3,gamma=4) to get beta-9. Note that keyword parameter beta is not set, so it is left as just beta. It would be unfortunate if you set, globally alpha:45, say. Unless you meant to do that. RJF On 9/29/2014 7:21 PM, Robert Dodier wrote: > On 2014-09-29, Dimiter Prodanov <dim...@gm...> wrote: > >> I tried this particular syntax because I want to pass named arguments. >> In my hypothesis some of the arguments may not have been assigned. >> >> i.e. for a function f(x,y,z,w) I would like to pass only for example [x=1, >> z=2] in the code. > Here's one way. > > ev(f(x, y, z, w), [x = 1, z = 2]); > => f(1, y, 2, w) > >> I don't know if this is possible in Maxima. at and apply looked like >> good candidates for this scenario. > 'at' works too. But note that the syntax is different from what you > tried before. > > at(f(x, y, z, w), [x = 1, z = 2]); > => f(1, y, 2, w) > > Note also you can construct 'at(...) noun expressions. > > best > > Robert Dodier > > > ------------------------------------------------------------------------------ > Meet PCI DSS 3.0 Compliance Requirements with EventLog Analyzer > Achieve PCI DSS 3.0 Compliant Status with Out-of-the-box PCI DSS Reports > Are you Audit-Ready for PCI DSS 3.0 Compliance? Download White paper > Comply to PCI DSS 3.0 Requirement 10 and 11.5 with EventLog Analyzer > http://pubads.g.doubleclick.net/gampad/clk?id=154622311&iu=/4140/ostg.clktrk > _______________________________________________ > Maxima-discuss mailing list > Max...@li... > https://lists.sourceforge.net/lists/listinfo/maxima-discuss |