Thread overview
[Issue 3830] opCmp among variant arrays
Feb 15, 2014
Peter Alexander
Feb 16, 2014
Peter Alexander
Feb 22, 2014
Peter Alexander
February 15, 2014
https://d.puremagic.com/issues/show_bug.cgi?id=3830


Peter Alexander <peter.alexander.au@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |peter.alexander.au@gmail.co
                   |                            |m


--- Comment #3 from Peter Alexander <peter.alexander.au@gmail.com> 2014-02-15 13:01:25 PST ---
What should this do?

auto a1 = variantArray("foo");
auto a2 = variantArray(10);
assert(a1 > a2);

Throw a type mismatch exception?

-- 
Configure issuemail: https://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
February 16, 2014
https://d.puremagic.com/issues/show_bug.cgi?id=3830



--- Comment #4 from Andrei Alexandrescu <andrei@erdani.com> 2014-02-16 07:14:11 PST ---
Scripting languages almost always have rich rules for comparison across unequal types, so I suppose that's an important convenience they offer. On the other hand, they're also widely criticized for the complexity and arbitraryness of these rules.

I'm not sure where that leaves us. I think we should just make Andrej's code work, because it works with regular arrays.

-- 
Configure issuemail: https://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
February 16, 2014
https://d.puremagic.com/issues/show_bug.cgi?id=3830



--- Comment #5 from bearophile_hugs@eml.cc 2014-02-16 07:43:20 PST ---
(In reply to comment #4)
> Scripting languages almost always have rich rules for comparison across unequal types, so I suppose that's an important convenience they offer.

In Python2.x you can compare and sort lists of anything, but in Python3 they have made the type system more tight, and now you have to compare only compatible types (so comparing an int and a string throws an exception).

-- 
Configure issuemail: https://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
February 16, 2014
https://d.puremagic.com/issues/show_bug.cgi?id=3830



--- Comment #6 from Peter Alexander <peter.alexander.au@gmail.com> 2014-02-16 08:50:47 PST ---
And for some reason I thought variantArray was a separate type... It's just a Variant[], and the code works for me.

http://dpaste.dzfl.pl/617841e1b8ff

I believe this can be closed as FIXED.

-- 
Configure issuemail: https://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
February 22, 2014
https://d.puremagic.com/issues/show_bug.cgi?id=3830


Peter Alexander <peter.alexander.au@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |RESOLVED
         Resolution|                            |WORKSFORME


--- Comment #7 from Peter Alexander <peter.alexander.au@gmail.com> 2014-02-22 05:13:00 PST ---
Was fixed in 2.064

-- 
Configure issuemail: https://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------