bugGNU Octave - Bugs: bug #38826, function names with hyphen not...


bug #38826: function names with hyphen not recognized

Submitted by:  Muhali <muhali>
Submitted on:  Thu Apr 25 13:13:40 2013  
Category: InterpreterSeverity: 3 - Normal
Priority: 5 - NormalItem Group: Matlab Compatibility
Status: Wont FixAssigned to: None
Originator Name: Open/Closed: Closed
Release: devOperating 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.


(Jump to the original submission Jump to the original submission)

Wed Jun 19 18:42:26 2013, comment #8:

Is the concensus that this is a feature we don't want to copy? Can we close this bug report?

Rik <rik5>
Project Administrator
Thu Apr 25 16:08:06 2013, comment #7:

Octave also allows leading underscores and $ in symbol names.

John W. Eaton <jwe>
Project Administrator
Thu Apr 25 15:54:59 2013, comment #6:

none, probably. Like Octave, Matlab only allows [A-Za-z][A-Za-z0-9_]* as function or variable names. So I don't know why ML doesn't throw an error in these cases.

Muhali <muhali>
Thu Apr 25 15:46:22 2013, comment #5:

What's the point of reading the docstring of a function that you can't call?

Jordi GutiƩrrez Hermoso <jordigh>
Project Administrator
Thu Apr 25 15:42:04 2013, comment #4:

such functions are 'recognized' in the sense that `which foo-goo' returns the corresponding path of foo-goo.m, and `type foo-goo' returns the contents of that file; `help foo-goo' returns the help text.

Muhali <muhali>
Thu Apr 25 15:27:42 2013, comment #3:

Sorry, I thought you said variable, now I see you said function.

So, you have a file called foo-goo.m? Or something else? A subfunction called foo-goo?

How do you call this foo-goo function? That looks like a subtraction operation to me.

Is the hyphen ASCII 45 (decimal) or something else?

John W. Eaton <jwe>
Project Administrator
Thu Apr 25 15:23:44 2013, comment #2:

How do you create a variable called foo-goo in Matlab?

Is the hyphen in your variable name ASCII 45 (decimal) or some other character?

John W. Eaton <jwe>
Project Administrator
Thu Apr 25 13:33:35 2013, comment #1:

Oh, sweet Jesus on a stick, they allow this? What happens if you try to name a function e-i? How is the expression e-i then parsed?

I would very much prefer to not copy this in Octave. This really looks like a Matlab bug, like braindead short-circuiting.

Jordi GutiƩrrez Hermoso <jordigh>
Project Administrator
Thu Apr 25 13:13:40 2013, original submission:

funcion names containing a hyphen, e.g. foo-goo, are recognized by ML but not by octave.

Muhali <muhali>


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

Attach File(s):

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 rik5 (Posted a comment)
  • -unavailable- added by jwe (Posted a comment)
  • -unavailable- added by jordigh (Posted a comment)
  • -unavailable- added by muhali (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 3 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Mon Jul 1 05:28:11 2013rik5StatusNeed Info=>Wont Fix
    Thu Apr 25 13:33:35 2013jordighStatusNone=>Need Info

    Back to the top

    Powered by Savane 3.1-cleanup1