Lolirofle / lolpranz

Platform
0 stars 0 forks source link

The purging of dynamically sized types #2

Open Pranz opened 10 years ago

Pranz commented 10 years ago

The problem: We need to have a lot of references to a lot of data. Nearly all objects need will be designed in mind for mutability. We can't have a mutable reference and simultaneously have immutable (active) references. Rust has support for this, but nearly everything that is good requires sized types. The solution:

Pranz commented 10 years ago

So, what I'm thinking is that you have lists containing values of individual components of an object, updater, renderer, event handler. These are of definite size, and in them you can have a boxed Rc of it's parent object. I think this works?

Game<'a>:
  updatables : Vec<Updater<Any,'a>>

Updater<T,'a>:
  myval        : Box<Rc<T>>
  update       : |&mut 'a T|:'a