octave-bug-tracker
[Top][All Lists]
Advanced

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

[Octave-bug-tracker] [bug #29476] Parser incompatibility for keywords ag


From: Judd Storrs
Subject: [Octave-bug-tracker] [bug #29476] Parser incompatibility for keywords against Matlab implementation, infinite loop
Date: Fri, 09 Apr 2010 23:24:24 +0000
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.8) Gecko/20100214 Ubuntu/9.10 (karmic) Firefox/3.5.8

Follow-up Comment #14, bug #29476 (project octave):

Ok. I misunderstood slightly and I didn't realize that structure elements
already worked. So, I agree functions/methods and global variables seem to be
the problem. 

Global variables could be handled by a function as you suggest. Another
option is to use the new namespace syntax e.g. global.do since "global" is
already a keyword in both octave and matlab. [I'm not saying that global.do
works in Matlab, I don't have access to a Matlab new enough to have namespace
support]

feval() works, but it would be more elegant if handles worked.

_do = @do
_do()

It does seem to me like it would be useful to mix and match traditional and
octave code. Selectivity of features is too complex. The choice should be
"strict Matlab" or not. I would go after a path-based mechanism rather than
try to guess based on content.

What about the new Matlab keywords that we don't have ("parfor", "spmd")?

You previously asked whether Matlab allows functions with keyword names and I
don't think that was answered. It does not:

+verbose+
a.m:
function this = a()
 this.do = @do;
 function this = do(this, in)
 this = this+in;
 end
end

b.m: 
function this = b()
 this.for = @for;
 function this = for(this, in)
 this = this+in;
 end
end
-verbose-

Then in Matlab R2007a:

+verbose+
>> a                       
ans = 
    do: @a/do
>> b
??? Error: File: /tmp/test7/b.m Line: 3 Column: 14
Illegal use of reserved keyword "for".
-verbose-


    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/bugs/?29476>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/





reply via email to

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