<div dir="ltr">Dear list,<br><br>Consider;<br>===================================<br>//definition<br>second =&gt; dur foo;<br><br>//this is fine<br>2.0 *=&gt; foo;<br><br>//this is not fine<br>2 *=&gt; foo;<br>====================<br>
<br>The last line gives a error about not being able to resolve *=&gt; on types int and dur. I wonder if this is correct behaviour; I can imagine many cases where a integer multiple of some duration is needed to avoid &quot;trainwrecking&quot; (a DJ term for two concurent tracks running at slightly different speeds). While we can obviously express integers as floats as well there may be cases where the int data-type can make guaranteeing we are dealing with a natural number easier, for example Std.rand2( ).<br>
<br>while correct I don&#39;t think either alternative looks especially nice;<br><br>Std.rand2(1,4) * 1.0 *=&gt; foo;<br>Std.rand2(1,4) $ float *=&gt; foo;<br><br>This does work in the comparable case of;<br><br>//correct but not as ChucKian<br>
foo * 3 =&gt; foo;<br><br>or even;<br><br>1.2 =&gt; float bar;<br>//implicit casting in *=&gt; does work here<br>3 *=&gt; bar;<br><br><br>So; I&#39;d like to sugest a implicit casting of int to float or further overloading *=&gt; in these cases.<br>
<br>Yours,<br>Kas.<br></div>