On 6/12/07, Robert Dodier <robert.dodier at gmail.com> wrote:
>
> On 6/11/07, sen1 at math.msu.edu <sen1 at math.msu.edu> wrote:
> > ...(%i6) plot2d('(f(x)),[x,0,1]);
> >
> > Why does one need the apostrophe and the parentheses in the expression
> > in (%i6), and what does it mean?
>
> In Maxima 5.11 and earlier, a Boolean expression could only
> evaluate to true or false, otherwise it would trigger an error.
That is one case where quoting is necessary. There are many other cases,
e.g. a function f which only takes numerical arguments.
The quote mark around f(x) is probably intended to prevent that error.
The single-quote mark is the "do not evaluate" operator, like Lisp's quote.
It is used here because you don't want to evaluate f(x) to determine which
function to plot, but to plot the values of f(x). A different case would
be, for example:
plot2d( %o3 , [x, 0, 1] )
which you could have used in your example. I don't know why the manual is
defining f(x) rather than using the expression directly.
I guess the documentation can be updated to cut out the quote mark.
>
I disagree. The quote mark should stay, because it is correct usage. It
only *happens to work* in some cases without the quote mark.
-s