Subject: outputing tex into a file given by a variable
From: Stavros Macrakis
Date: Fri, 25 May 2007 13:34:14 -0400
On 5/25/07, Fabrizio Caruso <caruso at dm.unipi.it> wrote:
>
> I am trying to output some tex into a file whose
> name is a variable.
>
> I have tried
>
> tex(<maxima_expression>,file_name)
>
> which, instead, outputs into a file whose name
> is name of the variable file_name
> and not the name given by the string contained in file_name.
>
Argh. The workaround is apply(tex,[expr,filename]).
As I've said before (but I guess I'm not tired of saying again)... it is
almost always a mistake for routines to auto-quote their arguments. In this
particular case, it is particularly strange, since filenames are generally
quoted as strings. What's more, many other routines operating on filenames
(writefile, compile_file) don't quote their arguments (though some do).
The documentation for this and other argument-quoting routines suggests
using quote-quote to "force evaluation of the argument", but this only works
interactively, not in programs, where it is more likely that an evaluated
argument is needed. We need to revise this misleading phrasing. Even
better if we could get rid of the quoting routines entirely; I wonder how
big the compatibility problem is....
-s