[gambit-list] Serialization of structures

James Long longster at gmail.com
Mon Nov 30 12:19:54 EST 2009


Yes, but to keep their identity, you need to add the "id" parameter to
the define-structure.  Usually the id is just a uuid.  Most people in
Gambit use "define-type" which is the same thing but supports
additional arguments.

(define-type point
   id: 0197AD5B-21C4-432C-AEC1-D26A162D6F90
   x y color)

2009/11/30 François Magnan <francois.magnan at licef.ca>:
> Hi,
>
> I found a strange behavior with serialization/deserialization:
>
> (define-structure point x y color)
> (define p (make-point 3 5 'red))
> (point? (u8vector->object (object->u8vector p)))
>
> ==>  #f
>
> Here is my version info:
> gsi -v
> v4.5.3 20091112143817 i386-apple-darwin10.2.0 "./configure --no-create --no-recursion"
>
> Are structures serializable?
>
> Thank you
> Francois Magnan
>
>
>
> _______________________________________________
> Gambit-list mailing list
> Gambit-list at iro.umontreal.ca
> https://webmail.iro.umontreal.ca/mailman/listinfo/gambit-list
>



More information about the Gambit-list mailing list