Question: Freezing or fixing a parameter at time of function definition

Hi.

I have a procedure that takes multiple parameters, in which I want to fix all but one, and then define a single variable function that maps x to this remaining unspecified parameter, so I can give it to the plot() routine. I would like to define a number of such single variable functions for different values of the parameters and plot them all on the same axes.

Ideally, I would like to find a way to make the following, instead of returning 14, return 21, by means of decoupling the value of t at the time of function definition from its name:

t := 3:
> f := x -> x*t;
> t := 2:
> f(7);

I understand why Maple is behaving as it does--it is a symbolic computation system after all--but if I could freeze the value in some way, it would make my life a lot easier. In case this is not possible, is there a way of making the following behave the way I described in my first paragraph?

MyProcedure := proc(list_of_values)
l_funcs := []:
num_values := nops(list_of_values):
    for i from 1 to num_values do
fixed_value := list_of_values[i]:
l_funcs := [l_funcs[],x->SomeFunction(x,fixed_value)]:
od;
    plot(l_funcs,0..10);
end;

Thanks very much in advance for any thoughts you might have.

Scott

Please Wait...