[bug #68101] Missed error with missing tilde in function output

Arun Giridhar <[email protected]>
Newsgroups gmane.comp.gnu.octave.bugs
Message-ID <[email protected]>
Please use the bug tracker to post updates to a bug report.  The mailing list is intended as a read-only notification stream.  Info posted to this mailing list address won't appear in the tracker database where it is most useful.

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

                 Summary: Missed error with missing tilde in function output
                   Group: GNU Octave
               Submitter: arungiridhar
               Submitted: Fri 27 Feb 2026 12:01:48 PM EST
                Category: Interpreter
                Severity: 3 - Normal
                Priority: 5 - Normal
              Item Group: Missed Error or Warning
                  Status: None
             Assigned to: None
         Originator Name:
        Originator Email:
             Open/Closed: Open
         Discussion Lock: Unlocked
                 Release: dev
        Operating System: Any
           Fixed Release: None
         Planned Release: None


    _______________________________________________________

Follow-up Comments:


-------------------------------------------------------
Date: Fri 27 Feb 2026 12:01:48 PM EST By: Arun Giridhar <arungiridhar>

# Correct statement.
>> [~, order] = sort([3 6 9 2 5 8 1 4 7 10])
order =
    7    4    1    8    5    2    9    6    3   10

# Accidentally miss the "~" character in that line.
# Should be syntax error but gives unexpected result, was very difficult to
debug this.
>> [, order] = sort([3 6 9 2 5 8 1 4 7 10])
order =
    1    2    3    4    5    6    7    8    9   10


For comparison, a doubled comma is trapped properly:

>> function [a,b,c,d,e] = fcn(), a = 1; b = 2; c = 3; d = 4; e = 5;
>> endfunction

>> [,o] = fcn
o = 1

>> [,,o] = fcn
error: syntax error

>>> [,,o] = fcn
      ^

>> [,~,o] = fcn
o = 2









    _______________________________________________________

Reply to this item at:

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

_______________________________________________
Message sent via Savannah
https://savannah.gnu.org/
signature.asc (application/pgp-signature, 228 B)
-----BEGIN PGP SIGNATURE-----

iHUEABYIAB0WIQQk97aszIMMAvLLwm6qLAuaBUf3TgUCaaHOAQAKCRCqLAuaBUf3
Tqm+AQDSbNhYGgeiwUvIZBAgSKuYA2o34CJIDNjjrYQO7F+FlgD/fTG4vvfY1H1/
iG8hsR/nQvYbtTMbJIIGdyWklGyGxgU=
=Ek7T
-----END PGP SIGNATURE-----
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.