octave-maintainers
[Top][All Lists]
Advanced

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

Builtin variables [was Re: Bug#182000]


From: John W. Eaton
Subject: Builtin variables [was Re: Bug#182000]
Date: Sat, 22 Feb 2003 21:35:08 -0600

On 22-Feb-2003, Paul Kienzle <address@hidden> wrote:

| Built-in variables are a little bit strange in that they
| appear automatically in every scope.  Maybe they
| should be functions instead?

I think that in Matlab, they may actually be functions.  I think this
is how things like "i" are described in the documentation.  But I'm
not sure that Matlab has anything that is really like the built-in
variables that Octave allows users to give new values.  But I suppose
we could use functions to set the values instead.  It's the difference
between using something like

  page_screen_output = false;

and

  more off;

I suppose part of the reason for using variables for things like this
was that I was influenced by the way Emacs works.

| They act like functions in that a change function is called with the
| new value.

This is needed because there are C++ variables that must stay in sync
with the values that are known to Octave, and it is convenient (and a
bit more efficient) if those internal variables are not stored in the
symbol table.

| Also, when I save a value to a file, all global variables are
| also saved in the file [is there a way to control this?].

Can you give an example?  Are you trying to save just one variable and
globals are also saved?  If so, that seems like a bug.

jwe



reply via email to

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