Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

error in octave, _compactformat_ undefined #713

Closed
latot opened this issue Dec 26, 2016 · 6 comments
Closed

error in octave, _compactformat_ undefined #713

latot opened this issue Dec 26, 2016 · 6 comments

Comments

@latot
Copy link
Contributor

latot commented Dec 26, 2016

Hi all, seems the option __compactformat__ was removed from octave:

octave:2> a=sym(1)
error: '__compactformat__' undefined near line 1 column 3

the problem is in the display file:

grep -r compactformat
inst/@sym/display.m:    loose = eval('! __compactformat__ ()');

at least seems only happen in this case.

Thx. Cya.

@cbm755
Copy link
Collaborator

cbm755 commented Dec 26, 2016

what octave version is this? attach a bit of ver output. There were problems about this but I thought we'd worked it out...

@mtmiller
Copy link
Collaborator

In Octave's 4.3 development branch, both get(0, 'FormatSpacing') and __compactformat__ have been dropped, there is currently no way to query whether the output format is in compact mode or not.

@mtmiller
Copy link
Collaborator

Open upstream issue: https://savannah.gnu.org/bugs/?46603

@latot
Copy link
Contributor Author

latot commented Dec 26, 2016

Hi, Thx, for the doc!

@mtmiller
Copy link
Collaborator

This is fixed upstream,

http://hg.savannah.gnu.org/hgweb/octave/rev/f84aa17075d4

The new (pre-4.4) way to query the output format is with

[fmt, spacing] = format ()
fmt =

short

spacing =

loose

Is this good enough to use here or should something better be done upstream?

There are a couple of shortcomings I see with this approach:

  • nargout('format') doesn't work because it is a compiled function
  • calling [a,b] = format in Octave 4.0, for example, will reset the format to defaults, and then error that the number of output arguments doesn't match

@cbm755
Copy link
Collaborator

cbm755 commented Dec 31, 2016

Thanks everyone. @mtmiller: I think that API will be fine for us.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants