realbasic-nug
[Top] [All Lists]

Re: Operator_Compare with variant objects?

To: REALbasic NUG <realbasic-nug@lists.realsoftware.com>
Subject: Re: Operator_Compare with variant objects?
From: Joe Strout <joe@inspiringapps.com>
Date: Sat, 30 May 2009 21:00:25 -0600
Authentication-results: mx.google.com; spf=neutral (google.com: 74.124.194.228 is neither permitted nor denied by best guess record for domain of realbasic-nug-bounces@lists.realsoftware.com) smtp.mail=realbasic-nug-bounces@lists.realsoftware.com
Delivered-to: listarchive@realsoftware.com
In-reply-to: <F2DB0971-8B47-41BC-8AA1-01185DED1E4F@xochi.com>
Organization: Inspiring Applications, Inc.
References: <AEF09038-DB63-4857-BBE1-AE5D13AA6FF3@xochi.com> <3AA0AEC2-D230-4A4C-8788-84C3FCC17A44@great-white-software.com> <9142A64B-6ACF-4072-B847-82A5C7098969@xochi.com> <4A2198A8.5010204@inspiringapps.com> <F2DB0971-8B47-41BC-8AA1-01185DED1E4F@xochi.com>
Reply-to: REALbasic NUG <realbasic-nug@lists.realsoftware.com>
Sender: realbasic-nug-bounces@lists.realsoftware.com
User-agent: Thunderbird 2.0.0.21 (Macintosh/20090302)
Michael Diehr wrote:

That's because Object doesn't have an Operator_Compare.

Keep in mind that comparisons are compiled at, er, compile time. So, for a comparison operator to be invoked, it must be something the compiler can know about at that time -- i.e., something defined on the static type of the object references involved.

Ok, but then how/why does Operator_Convert work? Wouldn't the same issue hold?

No. Comparisons and conversions are two very different things. (And Variants are weird beasts in any case; they have a lot of special cases that don't apply to objects in general.

If it's magic compiler pixie dust -- I wonder if we could get that magic applied to Operator_Compare() for Variants?

In principle, we probably could in that case, but I'm not sure I'd be in favor of it -- variants are slow enough already.

Best,
- Joe

--
Joe Strout
Inspiring Applications, Inc.
http://www.InspiringApps.com


_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives:
<http://support.realsoftware.com/listarchives/lists.html>


<Prev in Thread] Current Thread [Next in Thread>