Does anyone know how smart the compiler is when it comes to memory 
management for things like what this package achieves? When you update a 
field, will it just (naively) reallocate memory for a new type or will it 
use the already allocated memory for the previous one? I guess the compiler 
needs to prove that it is safe to reuse the memory which might be 
difficult(?)

One of the main things I lack in julia is basically type immutable types. I 
want to be able to densely pack array of types while still being able to 
change their values. One application for this is densely packed mutable 
fixed size arrays. As far as I know, this is impossible right now?






On Monday, June 1, 2015 at 11:57:19 PM UTC+2, Simon Byrne wrote:
>
> That's some impressive metaprogramming. In v0.4, you should be able to do 
> this without the "maker" functions, using generated functions
>
> http://julia.readthedocs.org/en/latest/manual/metaprogramming/#generated-functions
>
> As far as an interface goes, I would suggest a macro, e.g. so that the 
> user could write something like
>
> @modify! a[i].field = new
>
>
> On Monday, 1 June 2015 03:09:29 UTC+1, [email protected] wrote:
>>
>> Following up on an earlier discussion that I started in this newsgroup, I 
>> have written a small package that provides a routine to modify a field of 
>> an immutable object in the case that the object is inside a container. 
>>  Please refer to:
>>
>> https://github.com/StephenVavasis/Modifyfield.jl 
>> <https://www.google.com/url?q=https%3A%2F%2Fgithub.com%2FStephenVavasis%2FModifyfield.jl&sa=D&sntz=1&usg=AFQjCNEMQeocqbzVy4CBDgPjAQNZhmq8Fg>
>>
>> Feedback is welcome.
>>
>>
>>

Reply via email to