andre maute | 17 May 17:17
Picon
Picon

stringout() problem with Maxima 5.15.0

I have the following maxima file

------ test.max -------------------
output_integer(z) := block(

        [tmp],

        tmp : file_output_append,
        file_output_append : true,

        stringout( "output.txt", "/* integer */" ),
        stringout( "output.txt", z ),

        file_output_append : tmp,

        return(z)

);

output_integer(1);
------ test.max -------------------

using my NEW Maxima installation (maxima -b test.max), I have

------------------------------------------------
Maxima 5.15.0 http://maxima.sourceforge.net
Using Lisp CLISP 2.45 (2008-05-15)
Distributed under the GNU Public License. See the file COPYING.
Dedicated to the memory of William Schelter.
The function bug_report() provides bug reporting information.
(Continue reading)

Robert Dodier | 17 May 18:31
Picon

Re: stringout() problem with Maxima 5.15.0

On 5/17/08, andre maute <andre.maute <at> gmx.de> wrote:

>  output_integer(z) := block(
>
>         [tmp],
>
>         tmp : file_output_append,
>         file_output_append : true,
>
>         stringout( "output.txt", "/* integer */" ),
>         stringout( "output.txt", z ),
>
>         file_output_append : tmp,
>
>         return(z)
>
>  );

>  (%i3)                          output_integer(1)
>  Error in `stringout' attempt

Thanks for pointing it out. I've committed a bug fix (shown below).

Be that as it may, I have some other comments.
(1) Instead of saving and restoring via a temporary variable, just
use block like this: block([variable_to_be_saved : foo], blah, blah, blah)
block restores the previous value.
(2) I find it's usually shorter and clearer to use with_stdout which just
collects all the output within in and directs it to a file; if you call
stringout you have to name the output file every time.
(Continue reading)

andre maute | 17 May 19:19
Picon
Picon

Re: stringout() problem with Maxima 5.15.0

On Saturday 17 May 2008, Robert Dodier wrote:
> On 5/17/08, andre maute <andre.maute <at> gmx.de> wrote:
> >  output_integer(z) := block(
> >
> >         [tmp],
> >
> >         tmp : file_output_append,
> >         file_output_append : true,
> >
> >         stringout( "output.txt", "/* integer */" ),
> >         stringout( "output.txt", z ),
> >
> >         file_output_append : tmp,
> >
> >         return(z)
> >
> >  );
> >
> >  (%i3)                          output_integer(1)
> >  Error in `stringout' attempt
>
> Thanks for pointing it out. I've committed a bug fix (shown below).

Thanks for the quick fix
Andre

Gmane