[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

re-interpreting Octave output

From: Przemek Klosowski
Subject: re-interpreting Octave output
Date: Thu, 21 Apr 2011 14:32:45 -0400
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv: Gecko/20110307 Fedora/3.1.9-0.39.b3pre.fc14 Lightning/1.0b2 Thunderbird/3.1.9

On 04/21/2011 11:24 AM, Sergei Steshenko wrote:

- _no_ questions need to be asked about types of entities - because
Data::Dumper prints in _Perl_ format.

GNU Octave prints/dumps internal data in all kinds of formats which
are neither descriptive enough nor compatible with Octave itself.

Sergei has a point here---it is actually pretty useful to be able to cut and paste sections of the interpreter output to re-execute them. Octave makes it a little hard:

- interactive code is interspersed with prompts, which is annoying
  especially when trying to re-execute a multi-line segment of code,
  e.g. a loop, by cutting and pasting within a session.

- default data output is not formatted as a valid Octave input

For those reasons, I find that PS2("") is actually quite useful, to the point that I recommend it as a default. I'd even go as far as suggesting PS1(""), or at least PS1("# \\s:\\#>\n"), so that it doesn't get in the way of cutting and pasting.

Do other people agree that it is in general useful to be able to put the command and data outputs back into the interpreter, in the way Sergei's Data::Dumper example showed? The commands can be accomodated by manipulating PSx(), but data would need some assist from the interpreter, i.e. adding [] characters to printouts, like:

# octave:18> a=[1 2 3; 4 5 6]
a = [

   1   2   3
   4   5   6

and other, more complex things for cell arrays, structures, etc. Does it seem worth doing?

reply via email to

[Prev in Thread] Current Thread [Next in Thread]