bugGNU Octave - Bugs: bug #49647, octave foo.m vs. octave...


bug #49647: octave foo.m vs. octave /other/path/to/foo.m

Submitter:  Muhali <muhali>
Submitted:  Fri 18 Nov 2016 08:05:34 PM UTC
Category:  Interpreter Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Regression
Status:  Confirmed Assigned to:  None
Originator Name:  Open/Closed:  * Open
Release:  * dev Operating System:  * GNU/Linux
Fixed Release:  None Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup

Fri 18 Nov 2016 10:13:47 PM UTC, comment #2: 

And this may be related to the fix for bug #33411. If the file does not exist in the current directory, then it has not already been seen by the parser, and it is sourced like the previous version of Octave. If it is in the current directory or otherwise in the load path, then it has already been parsed, and for some reason "source foo.m" instead invokes the function foo. That may have been an unintended consequence of the change


Mike Miller <mtmiller>
Group Member
Fri 18 Nov 2016 10:06:19 PM UTC, comment #1: 

I can confirm this difference / possible regression between 4.0.3 and 4.2.0.

I think this change can be explained by or is related to the following difference in behavior:

## Octave 4.0.3
>> ls foo.m
>> source foo.m
>> which foo
'foo' is a command-line function

## Octave 4.2.0
>> ls foo.m
>> source foo.m
error: 'x' undefined near line 2 column 3
error: called from
    foo at line 2 column 2
>> which foo
'foo' is a function from the file /home/mike/src/octave/default/+build-default/foo.m

Mike Miller <mtmiller>
Group Member
Fri 18 Nov 2016 08:05:34 PM UTC, original submission:  

with the simple

# foo.m
function y = foo(x)

I get for `octave foo.m':

error: 'x' undefined near line 3 column 8
error: execution exception in foo.m

whereas no error occurs for `octave /tmp/foo.m'

the latter pointing to a copy of foo.m.

No errors occur for octave stable.

Muhali <muhali>


(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:

No files currently attached


Depends on the following items: None found

Items that depend on this one: None found


Carbon-Copy List
  • -email is unavailable- added by amro_octave
  • -email is unavailable- added by mtmiller (Posted a comment)
  • -email is unavailable- added by muhali (Submitted the item)

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only group members can vote.


    Follow 4 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2016-12-09 amro_octave Carbon-Copy- Added amro_octave
    2016-11-18 mtmiller CategoryNone Interpreter
        Item GroupNone Regression
        StatusNone Confirmed

    Back to the top

    Powered by Savane 3.13-4b48.
    Corresponding source code