Dan Sugalski wrote:
[ freeze/thaw writer/reader ]

... For this I think we're better off with
specific API functions since the set is small and bounded. If we really
want we can put them in some sort of vtable structure, which might not be
a bad thing.

Sort of vtable could be a real vtable too. I.e. we could have: - a PackFile PMC - on creation it gets the info structure attached to struct_val - outputting items goes into push_<item> vtables - inputting items is done by shift_<item> vtables - uncoverd items (e.g. key/value pair) could go into _keyed variants

Currently writing packfiles includes two passes: 1) calculate needed space (and after allocating that) 2) actually pack into this space. This doesn't really play together with e.g. freezing a constant class definition PMC, which would need these 2 passes too.

So to unify this more, writing packfiles could use the same PackFile PMC by generating (and reallocating) the (opcode_t) image in one pass.

And, as mentioned several times, the image format should be overridable: This is then just providing the required methods for the PackFile PMC.

Comments welcome,
leo



Reply via email to