[plt-scheme] Can subclasses of editor-snips% be saved?

From: Danny Yoo (dyoo at cs.wpi.edu)
Date: Thu May 29 18:12:15 EDT 2008

> I've been trying to implement the serialization protocol for my 
> editor-snip% subclass, but things aren't working so well.  I can see 
> that my write method fires off, but when I try reading back, my 
> snipclass is silent.

Following up on this: if I construct instances of my-editor-snip from the 
REPL, those are snips that I can't copy-and-paste.


However, if I construct the instances from a callback in DrScheme itself, 
those seem to be copy-pasteable.  But why in the world should the source 
of the snip matter?  I'm still very confused.


I see a very subtle difference in the physical bytes being written out, 
depending on the context where I create the snip.  Depending on whether I 
initially created the snip in the REPL or in a DrScheme callback, in two 
places, I see a '-1', whereas in the other, I see a '18'.  For example, I 
created two files containing a single snip.

#####################################################################
dyoo at kfisler-ra1:~/work/function-table$ diff example.ss example2.ss
183,184c183,184
< 00000000001 18 00000000002 20 #"dyoo:function-table\0"
< 1 18 00000000012 4 9 #"mzscheme\0"
---
> 00000000001 -1 00000000002 20 #"dyoo:function-table\0"
> 1 -1 00000000012 4 9 #"mzscheme\0"
#####################################################################


example.ss is something I can load back, and example2 is corrupted.  I 
created example.ss's snip from a DrScheme callback, whereas I created 
example2.ss's snip by running a function in the REPL.

There seems to be a low level detail here that's messing up.  I don't see 
what it is yet...



Any help here would be greatly appreciated.  Thanks!


Posted on the users mailing list.