bugGNU Octave - Bugs: bug #30588, error on empty files

 
 

bug #30588: error on empty files

Submitter:  Jens Tusche <jensenmann>
Submitted:  Thu 29 Jul 2010 10:22:57 AM UTC
   
 
Category:  Interpreter Severity:  2 - Minor
Priority:  5 - Normal Item Group:  Incorrect Result
Status:  Fixed Assigned to:  None
Originator Name:  Open/Closed:  * Closed
Release:  * 3.2.3 Operating System:  * GNU/Linux
Fixed Release:  None Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Mon 09 Aug 2010 08:50:54 AM UTC, comment #5: 

I checked in the following changeset:

  http://hg.savannah.gnu.org/hgweb/octave/rev/988d16d5ae34

It should be possible to execute empty script files with

  foo;

but

  foo ();

should give an error about calling a script as if it were a function.

John W. Eaton <jwe>
Group administrator
Mon 09 Aug 2010 07:37:45 AM UTC, comment #4: 

OK that's an easy solution. I have changed my code. The issue can be closed from my point of view. Thank you

Jens Tusche <jensenmann>
Sun 08 Aug 2010 07:54:06 PM UTC, comment #3: 

Thanks for presenting a use case which makes sense.

I don't think we will change this.  However, for your personal situation, I might consider switching your code to

source my_personal_init.m

rather than

my_personal_init()

This will not error if the initialization file is empty.

Rik <rik5>
Group administrator
Fri 06 Aug 2010 07:01:33 AM UTC, comment #2: 

I would not call it a bug.

In our group we've used octave and matlab for years. For our environment we use an initialization script which is the same for each user. For individual purposes, there is a second "personal" init script invoked, which does not necessarily contain any lines.

So, now with the new octave version I get this error, which is neither the case with 3.0.5 nor matlab.

Of course this is not a blocking issue, easily to work around at my side. I rather meant it as a hint regarding slightly loosing matlab compatibility.

Cheers
Jens

Jens Tusche <jensenmann>
Thu 05 Aug 2010 03:43:16 PM UTC, comment #1: 

I can confirm this on a recent tip (10856:dea165ff6d74). 

Other than consistency with Octave 3.0, how does this manifest itself as a problem?  It would seem that Octave is correct in warning that the function named 'test' is undefined in this instance.

Rik <rik5>
Group administrator
Thu 29 Jul 2010 10:22:57 AM UTC, original submission:  

Dear all,

if there is an empty file test.m and type "test" in octave, then you'll get:

>> test

error: `test' undefined near line 4 column 1

Same with commented lines. If the file contains at least one valid line then everything goes well.

I came from version 3.0.5 where this issue was not seen, but on 3.2.3 and 3.2.4 it present.

Best regards
Jens Tusche

Jens Tusche <jensenmann>

 

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

Attach Files:
   
   
Comment:
   

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 jwe (Posted a comment)
  • -email is unavailable- added by rik5 (Posted a comment)
  • -email is unavailable- added by jensenmann (Submitted the item)
  • -email is unavailable- added by jensenmann
  •  

    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 6 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2010-08-09 jwe StatusWont Fix Fixed
    2010-08-08 rik5 StatusNeed Info Wont Fix
        Open/ClosedOpen Closed
    2010-08-05 rik5 Severity3 - Normal 2 - Minor
        StatusNone Need Info
    2010-07-29 jensenmann Carbon-Copy- Added jensenmann

    Back to the top

    Powered by Savane 3.13-d3ae.
    Corresponding source code