> To plot the graph, you need to quote the conditional
> quotedf(x):= '(if x<1/2 then x else (1-x))$
Even though this will work in the very specific context of
plot2d(quotedf(x),[x,0,2]), it is not a good idea. It won't work in
plot2d(quotedf(q),[q,0,2]), for example. With that definition,
quotedf(y^2) will yield
IF x < 1/2 THEN x ELSE 1-x (!! yes, with literal 'x')
and NOT
IF y^2 < 1/2 THEN y^2 ELSE 1-y^2
which is presumably what was intended.
A much better definition of f(x) is not quoted:
f(x):= if x<1/2 then x else (1-x))$
but on the other hand, the expression to be plotted in plot2d should be
quoted:
plot2d('(f(x)),[x,0,2])
-s
PS Longer-term, it would be nice if unevaluated conditionals were better
supported in Maxima, but that is a different discussion.