Obsolete parser tokens?

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

Obsolete parser tokens?

Rik-4
1/28/12

John,

It seems like the keywords 'static', 'get', and 'set' could possibly be
removed from the parser.  According to Mercurial, it appears 'static' was
obsoleted by 'persistent' on 11/12/2002.  9 years would appear to be enough
time to get rid of any references in outstanding code.    'get' and 'set'
seem not to be used as keywords.  Rather, the set() and get() functions in
src/graphics.cc are what Octave uses when it encounters these words.

Cheers,
Rik
Reply | Threaded
Open this post in threaded view
|

Obsolete parser tokens?

John W. Eaton
Administrator
On 28-Jan-2012, Rik wrote:

| It seems like the keywords 'static', 'get', and 'set' could possibly be
| removed from the parser.  According to Mercurial, it appears 'static' was
| obsoleted by 'persistent' on 11/12/2002.  9 years would appear to be enough
| time to get rid of any references in outstanding code.    'get' and 'set'
| seem not to be used as keywords.  Rather, the set() and get() functions in
| src/graphics.cc are what Octave uses when it encounters these words.

I would not object to removing it "static" as a reserved keyword, but
I checked, and there are some .m files in Octave Forge that are still
using it.  So before removing it completely, we should probably warn
that it is deprecated for a few releases first.

Although set and get are normally function names, they are also
recognized specially for some kind of classdef syntax.  They are not
keywords in Matlab though, so we could probably also fix Octave to
handle this syntax without requiring actual reserved keywords.

jwe
Reply | Threaded
Open this post in threaded view
|

Re: Obsolete parser tokens?

Rik-4
On 01/30/2012 01:57 PM, John W. Eaton wrote:

> On 28-Jan-2012, Rik wrote:
>
> | It seems like the keywords 'static', 'get', and 'set' could possibly be
> | removed from the parser.  According to Mercurial, it appears 'static' was
> | obsoleted by 'persistent' on 11/12/2002.  9 years would appear to be enough
> | time to get rid of any references in outstanding code.    'get' and 'set'
> | seem not to be used as keywords.  Rather, the set() and get() functions in
> | src/graphics.cc are what Octave uses when it encounters these words.
>
> I would not object to removing it "static" as a reserved keyword, but
> I checked, and there are some .m files in Octave Forge that are still
> using it.  So before removing it completely, we should probably warn
> that it is deprecated for a few releases first.
Could you do this?  I know how to deprecate a function, but deprecating a
keyword is different and I have no experience with that part of the code.
> Although set and get are normally function names, they are also
> recognized specially for some kind of classdef syntax.  They are not
> keywords in Matlab though, so we could probably also fix Octave to
> handle this syntax without requiring actual reserved keywords.
>
That is what I was thinking.  I checked Matlab's keywords and they don't
have 'get' or 'set' so I think we could do without.

--Rik
Reply | Threaded
Open this post in threaded view
|

Re: Obsolete parser tokens?

John W. Eaton
Administrator
On 30-Jan-2012, Rik wrote:

| On 01/30/2012 01:57 PM, John W. Eaton wrote:
|
| > Although set and get are normally function names, they are also
| > recognized specially for some kind of classdef syntax.  They are not
| > keywords in Matlab though, so we could probably also fix Octave to
| > handle this syntax without requiring actual reserved keywords.
| >
| That is what I was thinking.  I checked Matlab's keywords and they don't
| have 'get' or 'set' so I think we could do without.

I checked in the following change so the special get and set tokens
that are needed for the funky classdef get.PROPERTY and set.PROPERTY
functions are not treated as keywords

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

jwe
Reply | Threaded
Open this post in threaded view
|

Re: Obsolete parser tokens?

John W. Eaton
Administrator
In reply to this post by Rik-4
On 30-Jan-2012, Rik wrote:

| On 01/30/2012 01:57 PM, John W. Eaton wrote:
| > On 28-Jan-2012, Rik wrote:
| >
| > I would not object to removing it "static" as a reserved keyword, but
| > I checked, and there are some .m files in Octave Forge that are still
| > using it.  So before removing it completely, we should probably warn
| > that it is deprecated for a few releases first.
|
| Could you do this?  I know how to deprecate a function, but deprecating a
| keyword is different and I have no experience with that part of the code.

I checked in the following change:

  http://hg.savannah.gnu.org/hgweb/octave/rev/9e3983c8963c

jwe