Yes that’s a good point. Note however that due to the “define-prim” on all the current backends the definition is really
(define (##ratnum? obj) (##ratnum? obj))
So the body of the define-prim isn’t even used. I think for sanity it should be removed because it exposes a low-level representation that is not shared by all backends. So it should be
(define-prim (##ratnum? obj))
and similarly for other type predicates. All uses of ##subtype and ##subtype-set! are suspect because they access the low-level representation and reduce portability of the Gambit runtime library.
As for serializing meroon objects, it shouldn’t be hard. Add an issue on github and I’ll look at it when I have more time.
Marc
On Feb 25, 2015, at 12:32 PM, Bradley Lucier lucier@math.purdue.edu wrote:
Marc:
A typical type predicate in _system.scm is
(define-prim (##ratnum? obj) (and (##subtyped? obj) (##eq? (##subtype obj) (macro-subtype-ratnum))))
Should all these uses of ##eq? be changed to ##eqv?
Also, it seems that you're set up to deserialize meroon objects, but not to serialize them. Is that easily fixed?
Brad