Created
September 14, 2018 18:21
-
-
Save LeifAndersen/51aab9801caa5cf76542e32b7b958566 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(module serialize-structs '#%kernel | |
(#%declare #:cross-phase-persistent) | |
;; Exports just the structre info, which is needed in | |
;; "class.rkt" (which is, in turn, ultimately required by | |
;; "serialize.rkt") | |
(#%provide (protect (all-defined))) | |
(define-values (struct:serialize-info | |
make-serialize-info | |
serialize-info? | |
serialize-info-vectorizer | |
serialize-info-deserialize-id | |
serialize-info-can-cycle? | |
serialize-info-dir) | |
(let-values ([(struct: make- ? -ref -set!) | |
(make-struct-type 'serialize-info #f 4 0 #f '() (current-inspector) #f '(0 1 2 3) #f 'serialize-info)]) | |
(values struct: | |
make- | |
? | |
(make-struct-field-accessor -ref 0 'vectorizer) | |
(make-struct-field-accessor -ref 1 'deserialize-id) | |
(make-struct-field-accessor -ref 2 'can-cycle?) | |
(make-struct-field-accessor -ref 3 'dir)))) | |
(define-values (struct:deserialize-info | |
make-deserialize-info | |
deserialize-info? | |
deserialize-info-maker | |
deserialize-info-cycle-maker) | |
(let-values ([(struct: make- ? -ref -set!) | |
(make-struct-type 'deserialize-info #f 2 0 #f '() (current-inspector) #f '(0 1) #f 'deserialize-info)]) | |
(values struct: make- ? (make-struct-field-accessor -ref 0 'maker) (make-struct-field-accessor -ref '1 'cycle-maker)))) | |
(define-values (prop:serializable serializable-struct? serializable-info) | |
(make-struct-type-property 'serializable #f))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment