octave-maintainers
[Top][All Lists]
Advanced

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

Re: Functions in scripts: Matlab evolves


From: Nicholas Jankowski
Subject: Re: Functions in scripts: Matlab evolves
Date: Tue, 24 Jan 2017 13:13:42 -0500

On Tue, Jan 24, 2017 at 9:56 AM, Julien Bect
<address@hidden> wrote:
> Hi all,
>
> So, the following script works in Octave but fails in Matlab:

While 2-way compatibility is desirable, by my understanding it's not
mandatory, so I don't think Octave should disallow it.


> and this one works in Matlab (>= R016b) but fails in Octave:
>

that's a direct compatibility concern. by my understanding octave
parses scripts from top to bottom as if the lines were entered by hand
at the CLI, so functions have to get defined before they're first
called. Matlab must check for function blocks at the end of every
script before executing the script.

there's a syntax check prior to execution, no? maybe a quick hack
would be to throw a 'trailing_function' flag if it's seen, and if true
Octave parses the trailing functions prior to executing script line
1...



reply via email to

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