Question: How to make this inline assignment work

I want to make from a procedure call a single argument function that can be used in function composition.

To illustrate this with a simple example, below the function pow[3] performs a cube operation

pow[3]:=x-> `^`(x,3):
(evalf[4]@pow[3]@sin)(Pi/6)
                             0.1250

To make the use of pow a bit more generic, I though about doing definitions for other powers in a loop with an inline assignement

for i from -1/2 to 5 by 1/2 do (power[i]:=x-> `^`(x,i)) end do;

This does not work because the i in the rigthhand side of power[i]:=x-> `^`(x,i) does not evaluate to the acutal value of the loop counter. I tried eval and evaln without success. How do I get full evaluation of the inline assignement?

Please Wait...