bugGNU Octave - Bugs: bug #34478, argn is undefined inside subsref


bug #34478: argn is undefined inside subsref

Submitted by:  Carnë Draug <carandraug>
Submitted on:  Tue 04 Oct 2011 06:49:30 PM UTC  
Category: InterpreterSeverity: 3 - Normal
Priority: 5 - NormalItem Group: None
Status: NoneAssigned to: None
Originator Name: Open/Closed: Open
Release: 3.4.2Operating System: GNU/Linux

Add a New Comment (Rich MarkupRich Markup):

You are not logged in

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


Tue 14 Jan 2014 01:13:59 AM UTC, comment #3:

attached source code of example

(file #30267)

Felipe G. Nievinski <fgnievinski>
Tue 14 Jan 2014 01:06:55 AM UTC, comment #2:

likely related: nargout silently fails.

with @aclass/subsref.m as follows:

I find, correctly:


but, incorrectly:

and also:

Felipe G. Nievinski <fgnievinski>
Thu 06 Oct 2011 10:57:52 AM UTC, comment #1:


just for the record, replacing argn with

b = _varval_ (".argn.");

on subsref.m still causes an error about not being defined. Here's the exact error:

Carnë Draug <carandraug>
Project Member
Tue 04 Oct 2011 06:49:30 PM UTC, original submission:


I was trying to implement a new class and found that when calling argn inside subsref, it is not defined (note that this also causes inputname to fail inside subsref).

I uploaded a file with the most minimal case to replicate this behaviour. There's only the class constructor and the subsref function which only checks argn.

The following code will fail now with:

> a = testClass;
> a.method

error: `argn' undefined near line 2 column 3
error: called from:
error: /home/carandraug/development/inputParser/@testClass/subsref.m at line 2, column 3

And I'm using octave 3.4.2 in Debian Squeeze (not the one in the repos, compiled by me).

Carnë Draug <carandraug>
Project Member


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

Attach File(s):

Attached Files
file #30267:  @aclass.zip added by fgnievinski (478B - application/x-zip-compressed)
file #24098:  @testClass.tar added by carandraug (10kB - application/x-tar)


Depends on the following items: None found

Items that depend on this one: None found


Carbon-Copy List
  • -unavailable- added by fgnievinski (Posted a comment)
  • -unavailable- added by carandraug (Submitted the item)

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

    Date Changed By Updated Field Previous Value => Replaced By
    Tue 14 Jan 2014 01:13:59 AM UTCfgnievinskiAttached File-=>Added @aclass.zip, #30267
    Tue 04 Oct 2011 06:49:30 PM UTCcarandraugAttached File-=>Added @testClass.tar, #24098

    Back to the top

    Powered by Savane 3.1-cleanup