Hans,<br><br><div class="gmail_quote"><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
So isn't this what you want?<br>
<br></blockquote><div><br>Hmmm, this is a tricky case, I see what you mean now. You are talking about callig overloaded functions using anonymous arrays, as a example of determining the type of these arrays, right? I see no real harm in your plan but mainly I think that this sounds quite dangerous as a practice and should probably be considered bad-ish form anyway. I don't have a strong opinion on this, right now.<br>
<br>I thought you were talking about assigning a anonymous array to a named one at instantiation, like this;<br><br>[1, 1.1, 1.2] @=> float foo[]; //this won't fly<br><br>That's one case where I think it's perfectly clear what is meant and that the "1"(int) can safely be cast to float, as it can here;<br>
<br>1 => float bar; //this is fine<br><br>This may be as bit of a exception because here we can determine very clearly what was meant, like we can when returning arrays from functions, but those are also the cases where I get annoyed by my own typos most. In the general case it does seem a bit odd indeed, though at least the behaviour is consistent and predictable.<br>
<br>As a side note; some time ago I complained about the lack of anonymous arrays of length zero. Like this;<br><br>[1,2] @=> int fine;<br>[1] @=> int still_fine;<br>[] @=> int fails;<br><br>It turns out that we actually can. but need to do it like this;<br>
<br>new int[0];<br><br>This can be handy when returning from functions.<br><br>Yours,<br>Kas.<br></div></div>