[Swift-devel] Re: Few easy questions

Mihael Hategan hategan at mcs.anl.gov
Sat Jun 7 10:56:35 CDT 2008


On Sat, 2008-06-07 at 14:09 +0000, Ben Clifford wrote:
> Milena asked me the below questions privately:
> 
> On Mon, 2 Jun 2008, Milena Nikolic wrote:
> 
> > 1. For COND_EXPR, what can be compared? This covers ==, !=, <, >, <=, >=
> > for numeric types I guess. Can other types be compared with == and != ?
> 
> Numeric types should have the equality (== and !=) and ordering (< > <=
> >=) operators - this should be working now in the codebase.
> 
> Strings and booleans should probably also work with the equality (== and 
> !=) operators.

And if we stretch it a bit, there's lexicographic order.

> 
> > 2. In RANGE_EXPR can we have anything else but int? For instance [1.5, 2.5,
> > 0.1]?
> 
> Any numeric type should work there.
> 
> There is a bug related to this, bug 126: 
> http://bugzilla.mcs.anl.gov/swift/show_bug.cgi?id=126
> 
> That is a problem in the runtime, that can be fixed separately from 
> typechecking.
> 




More information about the Swift-devel mailing list