When called on an immutable seq, suffix! doesn't throw the correct error
I'd expect the code
IN: scratchpad { } "a" suffix!
to throw an immutable error.
Instead, it throws a sequence out of bounds error:
T{ bounds-error { index 0 } { seq { } } }
I've tested this for arrays and strings, so it's probably all immutable sequences that are effected
Well, it's not an immutable sequence:
IN: scratchpad { } immutable? .
f
Perhaps you're thinking we need like a not-growable? mixin?
Wait, arrays are mutable? I thought the whole difference between arrays and vectors are that vectors are mutable and arrays aren't
Either way, an out of bounds error isn't very helpful in this context
Immutable means the contents can’t be changed.
Message ID: @.***>
What error seems more appropriate?
It’s saying that it can’t set a value at index 0.
Vectors are growable and arrays are not.