id	summary	reporter	owner	description	type	status	priority	milestone	component	version	severity	resolution	keywords	cc	lang	patch	platform
1421	[RFC] zero length FxA behaviour	plobsing	plobsing	"FixedBooleanArray, FixedStringArray, FixedIntegerArray, and FixedFloatArray do not allow specifying a length of 0, giving a misleading error of ""Fixed${type}Array: can't resize"".

FixedPMCArray ignores being set to zero length, remaining uninitialized.

Allowing for zero lengthed arrays allows code that handles ""0 or more elements"" cases to avoid checking against the zero case. For example:

{{{

.sub 'fixed_ints_upto'
    .param int i
    .local pmc retv
    retv = new ['FixedIntegerArray']
    retv = i
    $I0 = 0
    loop:
         if $I0 >= i goto end_loop:
         retv[$I0] = $I0
         inc $I0
         goto loop
    end_loop:

    .return (retv)
.end

}}}

This will currently fail. To avoid failures, we would have to check for a zero valued argument and handle that case separately.

Zero is a valid length for an array, so I propose that we allow FxAs to be set to zero length (and not be subsequently resizable).

Alternatively, the behaviour could be to ignore setting the length to zero (as is done now in FPA). However, this can be seen as violating the set once property of FxA length."	RFC	new	normal		none	2.0.0	medium						
