[haXe] Array.splice behaving strangely on Neko
Michael Pliskin
pl at tepkom.ru
Thu Sep 21 12:33:31 CEST 2006
Hello Nicolas,
Thursday, September 21, 2006, 11:31:41 AM, you wrote:
>> Hello list,
>>
>> I was playing with Array.splice for a while and found a strange
>> thing. According to the spec,
>> splice(beg, end) includes [beg] but not [end].
>>
>> This, for instance, means that
>> a.splice(0, a.length) is legal and same as a
>>
>> However, if I take an array:
>> [0, 1, 2].splice(1, 3) throws an exception
>> [0, 1, 2].splice(1, 2) returns [1, 2]
>>
>> which does not look right..
NC> I think you mistake "slice" which takes [beg] and [end] with "splice"
NC> which takes [beg] and [len]. Don't ask me why this is like that, haXe is
NC> just trying to be AS/ES/JS compatible with these methods.
I think you're exactly right, I've mixed these two.. Well sorry for
the buzz, will read docs more thoroughly next time.
--
Best regards,
Michael mailto:pl at tepkom.ru
More information about the Haxe
mailing list