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 25 Apr 2013 01:13:40 PM UTC  
 
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 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>
Project 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>
Project 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>
Project Administrator
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>
Project 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>
Project 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>
Project Administrator
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 File(s):
   
   
Comment:
   

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 01 Jul 2013 05:28:11 AM UTCrik5StatusNeed Info=>Wont Fix
      Open/ClosedOpen=>Closed
    Thu 25 Apr 2013 01:33:35 PM UTCjordighStatusNone=>Need Info

    Back to the top


    Powered by Savane 3.1-cleanup