I'm looking into whether Racket's class/object system might be useful for
one of my projects, and I am stumped by an error when deserializing
objects. I've managed to produce the error a few different ways, but here
is a fairly minimal example:
> (define-serializable-class ok% object%
      (inspect #f)
      (init-field [my-field null])
      (super-new))
> (define-serializable-class broken% object%
      (inspect #f)
      (super-new)
      (init-field [my-field null]))
> (deserialize (serialize (new ok%)))
(object:ok% '())
> (deserialize (serialize (new broken%)))
my-field: assignment disallowed;
  cannot assign field before initialization
I am guessing there is some subtlety of the way new instances are
initialized that I don't properly understand. Can anyone explain what is
going wrong? (and, ideally, how to avoid the problem in other situations?)
Many thanks,
Philip

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to