plotting piecewise functions



> (C1) sss:'(if x<0 then 0 else 1)$
> (C2) plot2d(sss,[x,-1,1]);
> (C3) sss(x):=sin(x);
> (C4) plot2d(sss,[x,-1,1]);
> 
> So, what would (D4) be? (Correct answer: stepwise function plot!)

Of course.  The first argument to plot2d is evaluated.  The only reason
plot2d(ff,...) rather than plot2d('ff,...) works is that Maxima
evaluates an unbound symbol to itself.  If you follow the rule of always
using quotes, you don't run into this sort of problem: plot2d('sss,...)
plots the function.  Still, in general I don't like "convenience"
features like this -- often they make it harder to write code that
invokes the convenient function.

> The example above shows that the treatment of named expressions needs 
> more attantion. I would suggest 'quote 1st argument and expand named 
> expressions internally' strategy for plot2d. It combines the 
> best from all notations present. If my opinion counts, of course...

I don't understand your suggestion.  Could you please clarify it?  What
does "expand named expressions internally" mean?  Does your proposal
allow, e.g.

     plot2d(d23/d45,...)

      -s