Simple question ('' operator)



> basically, how do I force something on the right hand side of a
> function definition to be evaluated during definition?

The '' (double single-quote) operator evaluates something at the time
it's read into the system, so for example:

(C1) f1(x):=factor(x^4-1);
                                         4
(D1)                    f1(x) := FACTOR(x  - 1)

(C2) f1(q^2-1);
                       2   2        4      2
(D2)                  q  (q  - 2) (q  - 2 q  + 2)

------------------------------------------------------------


(C3) factor(x^4-1);
                                         2
(D3)                   (x - 1) (x + 1) (x  + 1)

(C4) f2(x):=''d3;
                                              2
(D4)               f2(x) := (x - 1) (x + 1) (x  + 1)

(C5) f2(q^2-1);
                       2   2         2     2
(D5)                  q  (q  - 2) ((q  - 1)  + 1)

------------------------------------------------------------

  Another way of doing the same thing:

(C6) f3(x):=''(factor(x^4-1));
                                              2
(D6)               f3(x) := (x - 1) (x + 1) (x  + 1)

(C7) f3(q^2-1);
                       2   2         2     2
(D7)                  q  (q  - 2) ((q  - 1)  + 1)

----------------------------------------------------------

Since '' is done at read-in time, it is completely independent of the
semantic structure of the thing you are typing in, so it can be used
anywhere, for example:

varlist: [a,b,c]$

block(''varlist, ...)

Along the same lines, since it is done at read time, it is oblivious to
any local definitions:

(C9) i:23;
(D9)                              23
(C10) block([i],i);
(D10)                              i
(C11) block([i],''i);
(D11)                             23