theseion / Fuel

Fuel, the Smalltalk object serializer
https://theseion.github.io/Fuel
MIT License
26 stars 12 forks source link

Header, Writing To #260

Closed seandenigris closed 2 years ago

seandenigris commented 2 years ago

Following the docs, I did:

serializer := FLSerializer new.
    serializer header 
        at: #spFormatVersion
        putAdditionalObject: SpFileDatabase formatVersion.

but, FLSerializer DNU #header. I noticed that FLSerializer implements #at:putAdditionalObject:, so I tried that, but my image hung.

theseion commented 2 years ago

Those docs are outdated for version 4. You should use #at:putAdditionalObject:. See FLFullHeaderSerializationTest>>testJustMaterializeHeader and #testAdditionalObjects for reference. From the top of my head I don't see why the image should hang but maybe there's a recursion issue there.

stale[bot] commented 2 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will remain open but will probably not come into focus. If you still think this should receive some attention, leave a comment. Thank you for your contributions.

theseion commented 2 years ago

Not stale.

seandenigris commented 2 years ago

I’ll try again in 5.0.1

stale[bot] commented 2 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will remain open but will probably not come into focus. If you still think this should receive some attention, leave a comment. Thank you for your contributions.

seandenigris commented 2 years ago

The following works in P9 and GT 0.8.1395 with Fuel 5.0.1:

filePath := (FileLocator imageDirectory / 'obj.fuel') fullName.
FLSerializer new
    at: #spFormatVersion
        putAdditionalObject: '1.0.3';
    object: 3;
    filePath: filePath;
    serialize.

materialization := FLMaterializer new
    filePath: filePath;
    materialize.
theseion commented 2 years ago

Thanks @seandenigris.