[Swift-devel] numeric type(s) in swift.
Ben Clifford
benc at hawaga.org.uk
Fri Jul 20 11:09:00 CDT 2007
some of the way that numbers are implemented at the moment, they don't
even keep their declared types. the following puts the string 3.5 into a
file, despite the fact that there's an integer type involved which should
be doing something else (causing an error or rounding, most likely).
that's behaviour that's consistent with having a single 'number' type
rather than multiple strong number types.
type messagefile {}
(messagefile t) greeting(float m) {
app {
echo m stdout=@filename(t);
}
}
float f = 7/2;
int i = f;
messagefile outfile <"j-echo.out">;
outfile = greeting(i);
More information about the Swift-devel
mailing list