octave-bug-tracker
[Top][All Lists]
Advanced

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

[Octave-bug-tracker] [bug #65140] incorrect value for nargin for command


From: John W. Eaton
Subject: [Octave-bug-tracker] [bug #65140] incorrect value for nargin for command line script with bytecode interpreter
Date: Mon, 8 Jan 2024 13:54:51 -0500 (EST)

URL:
  <https://savannah.gnu.org/bugs/?65140>

                 Summary: incorrect value for nargin for command line script
with bytecode interpreter
                   Group: GNU Octave
               Submitter: jwe
               Submitted: Mon 08 Jan 2024 06:54:51 PM UTC
                Category: Interpreter
                Severity: 3 - Normal
                Priority: 5 - Normal
              Item Group: Incorrect Result
                  Status: None
             Assigned to: None
         Originator Name: jwe
        Originator Email: 
             Open/Closed: Open
                 Release: dev
         Discussion Lock: Any
        Operating System: Any
           Fixed Release: None
         Planned Release: None


    _______________________________________________________

Follow-up Comments:


-------------------------------------------------------
Date: Mon 08 Jan 2024 06:54:51 PM UTC By: John W. Eaton <jwe>
Using Octave built from the bytecode-interpreter branch, I see the following
in an interactive session started with some command line arguments:


$ /path/to/octave --no-init-file --no-line-editing --no-window-system
GNU Octave, version 10.0.0
Copyright (C) 1993-2024 The Octave Project Developers.
This is free software; see the source code for copying conditions.
There is ABSOLUTELY NO WARRANTY; not even for MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE.  For details, type 'warranty'.

Octave was configured for "x86_64-pc-linux-gnu".

Home page:            https://octave.org
Support resources:    https://octave.org/support
Improve Octave:       https://octave.org/get-involved

For changes from previous versions, type 'news'.

octave:1> argv
ans =
{
  [1,1] = --no-init-file
  [2,1] = --no-line-editing
  [3,1] = --no-window-system
}

octave:2> nargin
ans = 3


That is expected behavior.  However, if I create a script file containing the
lines


argv
nargin


I see the following output when passing the name of the script on the Octave
command line with extra arguments after the name of the file:


$ /path/to/octave foo.m one two three
ans =
{
  [1,1] = one
  [2,1] = two
  [3,1] = three
}

ans = 0


The value of argv is correct but nargin should be 3 here, not 0.

This affects the way "make check" works if Octave is built in a directory
outside the source tree.  In that case, all the tests in files from the source
tree are skipped.







    _______________________________________________________

Reply to this item at:

  <https://savannah.gnu.org/bugs/?65140>

_______________________________________________
Message sent via Savannah
https://savannah.gnu.org/




reply via email to

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