On Wednesday, August 17, 2016 at 12:08:12 PM UTC-4, Kiran Pamnany wrote:
>
> On Wednesday, August 17, 2016 at 5:46:34 AM UTC-7, Steven G. Johnson wrote:
>>
>> An array of immutables is just an array of structs. Replacing an element
>> just overwrites that memory in an array, it doesn't involve any allocation.
>>
>
> So the line of code you posted:
>
> array[i] = Bar(x, y, ...)
>
> Will simply overwrite the Bar that's at array[i]?
>
Yes.
Is there a way to assert that a type is immutable?
>
You declare it as
immutable MyType
....
end