[Top][All Lists]

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

[Octave-bug-tracker] [bug #37467] Errors in 'm' files

From: Michael Godfrey
Subject: [Octave-bug-tracker] [bug #37467] Errors in 'm' files
Date: Mon, 01 Oct 2012 18:22:10 +0000
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:15.0) Gecko/20100101 Firefox/15.0.1

Follow-up Comment #15, bug #37467 (project octave):

Matlab does:

First, it does a test:
>> run 'foo.m'
??? Undefined variable "foo" or class "foo.m".

Error in ==> run at 74
    evalin('caller',[script ';']);
This appears to test for .m as the suffix.
If foo.m is copied to foo, Matlab runs it
if it is a "script" (no .m) with or without
the first line: function [ ret ] = foo().
It appears to just ignore the first line.

I would say that the Matlab behaviour is about as
confusing as the current Octave behaviour.

It might be better if Octave threw an error
if foo.m is a function, but ran it if it is a script.
This would decided if it contains a function
The fact that Matlab will not run a "script" who's
name ends with suffix .m seems, to me, not very
reasonable.  But, I would not much object to this
bit of "Matlab compatibility."



Reply to this item at:


  Message sent via/by Savannah

reply via email to

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