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

 
 

bug #38826: function names with hyphen not recognized

Submitter:  Muhali <muhali>
Submitted:  Thu 25 Apr 2013 01:13:40 PM UTC
   
 
Category:  Interpreter Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Matlab Compatibility
Status:  Wont Fix Assigned to:  None
Originator Name:  Open/Closed:  * Closed
Release:  * dev Operating System:  * GNU/Linux
Fixed Release:  None Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Jump to the original submission

Wed 19 Jun 2013 06:42:26 PM UTC, comment #8: 

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

Rik <rik5>
Group administrator
Thu 25 Apr 2013 04:08:06 PM UTC, comment #7: 

Octave also allows leading underscores and $ in symbol names.

John W. Eaton <jwe>
Group administrator
Thu 25 Apr 2013 03:54:59 PM UTC, 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 25 Apr 2013 03:46:22 PM UTC, comment #5: 

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

Jordi GutiƩrrez Hermoso <jordigh>
Group Member
Thu 25 Apr 2013 03:42:04 PM UTC, 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 25 Apr 2013 03:27:42 PM UTC, 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>
Group administrator
Thu 25 Apr 2013 03:23:44 PM UTC, 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>
Group administrator
Thu 25 Apr 2013 01:33:35 PM UTC, 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>
Group Member
Thu 25 Apr 2013 01:13:40 PM UTC, 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 Files:
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by rik5 (Posted a comment)
  • -email is unavailable- added by jwe (Posted a comment)
  • -email is unavailable- added by jordigh (Posted a comment)
  • -email is unavailable- added by muhali (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only group members can vote.

     

    Follow 3 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2013-07-01 rik5 StatusNeed Info Wont Fix
        Open/ClosedOpen Closed
    2013-04-25 jordigh StatusNone Need Info

    Back to the top

    Powered by Savane 3.13-f8d8.
    Corresponding source code