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

From: Ryan Culpepper (ryanc at ccs.neu.edu)
Date: Thu May 29 19:30:35 EDT 2008

Danny Yoo wrote:
>> 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.

Matthew or Robby: Could the editor for DrScheme's definition window 
change its insert method to reject such unhealthy snips (snips whose 
snipclass is not already loaded in DrScheme's space)? Or replace them 
with a "No-no" placeholder snip?

Ryan

> 
> 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!
> _________________________________________________
>  For list-related administrative tasks:
>  http://list.cs.brown.edu/mailman/listinfo/plt-scheme



Posted on the users mailing list.