|
From: | Richard |
Subject: | [Octave-bug-tracker] [bug #53911] Comparing handle classes using == fails |
Date: | Tue, 15 May 2018 10:13:20 -0400 (EDT) |
User-agent: | Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Ubuntu Chromium/65.0.3325.181 Chrome/65.0.3325.181 Safari/537.36 |
URL: <http://savannah.gnu.org/bugs/?53911> Summary: Comparing handle classes using == fails Project: GNU Octave Submitted by: crobar Submitted on: Tue 15 May 2018 02:13:18 PM UTC Category: None Severity: 3 - Normal Priority: 5 - Normal Item Group: Matlab Compatibility Status: None Assigned to: None Originator Name: Richard Crozier Originator Email: Open/Closed: Open Discussion Lock: Any Release: 4.4.0 Operating System: Any _______________________________________________________ Details: In matlab you can compare two handle class object to determine if the are actually the same instance, e.g. in Matlab: >> addpath ('/home/rcrozier/src/mfiles/mcode-hg/octave_test/test_comparing_handle_classes_using_eq') >> x = compare1 () x = compare1 with properties: foo: 1.0000e+000 >> y = x y = compare1 with properties: foo: 1.0000e+000 >> z = compare1 z = compare1 with properties: foo: 1.0000e+000 >> x == y ans = logical 1 >> x == z ans = logical 0 In Octave this is not possible: >> x = compare1 () x = <object compare1> >> y = x y = <object compare1> >> z = compare1 z = <object compare1> >> x == y error: eq method not defined for compare1 class >> Is there any workaround to determine if two handle objects are actually the same? _______________________________________________________ File Attachments: ------------------------------------------------------- Date: Tue 15 May 2018 02:13:18 PM UTC Name: compare1.m Size: 98B By: crobar <http://savannah.gnu.org/bugs/download.php?file_id=44161> _______________________________________________________ Reply to this item at: <http://savannah.gnu.org/bugs/?53911> _______________________________________________ Message sent via Savannah https://savannah.gnu.org/
[Prev in Thread] | Current Thread | [Next in Thread] |