bugGNU Octave - Bugs: bug #60141, feature request: colon method for...

 
 

bug #60141: feature request: colon method for classes of numbers

Submitter:  Ernst Reissner <ernstreissner>
Submitted:  Sun 28 Feb 2021 12:38:04 PM UTC
   
 
Category:  None Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Feature Request
Status:  Invalid / Not an Octave Bug Assigned to:  None
Originator Name:  Reissner Open/Closed:  * Closed
Release:  * 6.2.0 Operating System:  * Any
Fixed Release:  None Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Sat 20 Mar 2021 01:31:41 PM UTC, comment #2: 

No response in about 3 weeks.

Closing report.

Markus Mützel <mmuetzel>
Group administrator
Mon 01 Mar 2021 07:58:04 AM UTC, comment #1: 

That looks more like a request for help than like a bug report again.

The error message gives a hint. Do you overload the `colon` method in your class?

>> help colon
'colon' is a built-in function from the file libinterp/corefcn/data.cc

 -- R = colon (BASE, LIMIT)
 -- R = colon (BASE, INCREMENT, LIMIT)
     Return the result of the colon expression corresponding to BASE,
     LIMIT, and optionally, INCREMENT.

     This function is equivalent to the operator syntax 'BASE : LIMIT'
     or 'BASE : INCREMENT : LIMIT'.

     See also: linspace.


Markus Mützel <mmuetzel>
Group administrator
Sun 28 Feb 2021 12:38:04 PM UTC, original submission:  

I am developing an arithmetics replacing the internal one provided by octave, something like interval.
To that end i define a class `pn`.
Now i want to use the colon operator with my numbers.
Strange enough, error: `colon method not defined for pn class`.
I wonder why.
Essentially the class has all the colon operator,
or the range type returned needs to work:
a means to increment by an amount (plus function)
and a comparison le function.

I wonder whether this is possible in matlab.
If so it would not be a feature request but matlab compatibility issue.

I dont know what is best: whether you provide a more generic colon function
or you provide a way to overwrite in an appropriate way.
But nowhere i found documentation on details.
even not for matlab.

For me as a java programmer it looks pretty like an Iterator
which has functions bool hasnext(.) and pn next().

Ernst Reissner <ernstreissner>

 

(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 mmuetzel (Posted a comment)
  • -email is unavailable- added by ernstreissner (Submitted the item)
  • -email is unavailable- added by ernstreissner
  •  

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

    Date Changed by Updated Field Previous Value => Replaced by
    2021-03-20 mmuetzel StatusNeed Info Invalid / Not an Octave Bug
        Open/ClosedOpen Closed
    2021-03-01 mmuetzel StatusNone Need Info
    2021-02-28 ernstreissner Carbon-Copy- Added -email is unavailable-

    Back to the top

    Powered by Savane 3.13-4b48.
    Corresponding source code