[racket] serializable class definition inside unit body

From: Matthias Felleisen (matthias at ccs.neu.edu)
Date: Mon Jun 9 06:35:38 EDT 2014

Can you lift the class to the #lang module level? If not, why not? 


On Jun 9, 2014, at 5:37 AM, seryojka wrote:

> Hello, I'll repost here my question from SO:
> 
>  #lang racket
> 
> (define-signature asdf^
>   (some-class%))
> 
> (define-unit asdf@
>   (import)
>   (export asdf^)
> 
> 
>   (define-serializable-class some-class%
>     (class object%
>       (inspect #f)
>       (super-new))))
> returns error
> 
> define-serializable-class: allowed only at the top level or within a module top level
> which is indeed expectable according to documentation. 
> I use units for resolving mutually dependent definitions (inside procedures bodies). What alternatives do I have to perform my task? I could run with merging those units or implementing my own serialization protocol, but it is not good enough for me.
> 
> 
> 
> ____________________
>  Racket Users list:
>  http://lists.racket-lang.org/users

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.racket-lang.org/users/archive/attachments/20140609/e37706d4/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 4463 bytes
Desc: not available
URL: <http://lists.racket-lang.org/users/archive/attachments/20140609/e37706d4/attachment.p7s>

Posted on the users mailing list.