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

 
 

bug #30588: error on empty files

Submitted by:  Jens Tusche <jensenmann>
Submitted on:  Thu 29 Jul 2010 10:22:57 AM UTC  
 
Category: InterpreterSeverity: 2 - Minor
Priority: 5 - NormalItem Group: Incorrect Result
Status: FixedAssigned to: None
Originator Name: Open/Closed: Closed
Release: 3.2.3Operating System: GNU/Linux

Add a New Comment(Rich Markup)
   

You are not logged in

Please log in, so followups can be emailed to you.

 

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>
Project 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>
Project 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>
Project 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 File(s):
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by jwe (Posted a comment)
  • -unavailable- added by rik5 (Posted a comment)
  • -unavailable- added by jensenmann (Submitted the item)
  • -unavailable- added by jensenmann
  •  

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only project members can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 6 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Mon 09 Aug 2010 08:50:54 AM UTCjweStatusWont Fix=>Fixed
    Sun 08 Aug 2010 07:54:06 PM UTCrik5StatusNeed Info=>Wont Fix
      Open/ClosedOpen=>Closed
    Thu 05 Aug 2010 03:43:16 PM UTCrik5Severity3 - Normal=>2 - Minor
      StatusNone=>Need Info
    Thu 29 Jul 2010 10:22:57 AM UTCjensenmannCarbon-Copy-=>Added jensenmann

    Back to the top


    Powered by Savane 3.1-cleanup1