? ?
Notes from a Medium-Sized Island [entries|archive|friends|userinfo]

[ website | My Website ]
[ userinfo | livejournal userinfo ]
[ archive | journal archive ]

[Jan. 21st, 2014|08:33 pm]

Nearly have pattern editing working in beepbox-js. One thing I hadn't counted on is flash actually does distinguish between int and Number at runtime, and does automatic conversion from Number to int without complaint. Not quite true, as nothings informs me below.

(Deleted comment)
[User Picture]From: jcreed
2014-01-22 04:12 pm (UTC)
Oh, I may have incorrectly guessed the mechanism by which it accomplishes it, but the symptom (I think, not having tested exactly the code below, but something analogous to it) is that in

var a : Number = 1.0;
var b : Number = 2.0;
var c : int = a / b;

one observes that c has the value zero.

Right? Yeah? The compiler silently inserts enough coercions to get things to typecheck, and then all types have no real existence at runtime, is what you're telling me happens, yes?
(Reply) (Parent) (Thread)
(Deleted comment)
[User Picture]From: jcreed
2014-01-22 04:54 pm (UTC)
oh so what you're saying is int-typed *variables* have a real existence at runtime, but int-typed values don't.
(Reply) (Parent) (Thread)