[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Octave-bug-tracker] [bug #32651] Function precedence for derived classe

From: anonymous
Subject: [Octave-bug-tracker] [bug #32651] Function precedence for derived classes different to Matlab
Date: Wed, 02 Mar 2011 15:32:32 +0000
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-GB; rv: Gecko/20101206 Ubuntu/10.04 (lucid) Firefox/3.6.13


                 Summary: Function precedence for derived classes different to
                 Project: GNU Octave
            Submitted by: None
            Submitted on: Wed 02 Mar 2011 15:32:31 UTC
                Category: Interpreter
                Severity: 3 - Normal
                Priority: 5 - Normal
              Item Group: Incorrect Result
                  Status: None
             Assigned to: None
         Originator Name: Steve Marple
        Originator Email: address@hidden
             Open/Closed: Open
         Discussion Lock: Any
                 Release: 3.4.0
        Operating System: GNU/Linux



In Matlab a class can contain a function having the same name as another
class; the purpose of such a function being to convert one object to an object
of a different type. In Octave the converter function is never called, the
class constructor is always called.

It appears that Octave follows Mathwork's published function precedence
whereas Matlab does not. Octave's behaviour does not allow the creation of
converter functions as such functions can never be called.

Is this a bug in Octave?

Test results:
>> p2=pcls2
pcls2 constructor
>> pcls(p2)
convert pcls2 to pcls
pcls constructor
>> d=dcls
dcls constructor
pcls constructor
>> pcls(d)
convert dcls to pcls
>> version

ans = (R13) Service Pack 1

octave:1> p2=pcls2
pcls2 constructor
octave:2> pcls(p2)
pcls constructor
octave:3> d=dcls
dcls constructor
pcls constructor
octave:4> pcls(d)
pcls constructor
ans = 3.2.3


File Attachments:

Date: Wed 02 Mar 2011 15:32:31 UTC  Name: test_files.tar  Size: 20kB   By:



Reply to this item at:


  Message sent via/by Savannah

reply via email to

[Prev in Thread] Current Thread [Next in Thread]