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
Afficher les réponses par date
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
On 02/25/2015 12:45 PM, Marc Feeley wrote:
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
I thought I might look into "write"ing and "pretty-print"ing Meroon objects today, but man, the code in _io.scm reminds me of the game "Adventure".^1
To serialize a Meroon object, one might need to serialize the entire class structure. It's possible, but Meroon doesn't have UUIDs attached to classes right now, so I'm not sure how useful it would be.
I'd rather have printing of Meroon objects, which would be more useful at the moment.
Brad
^1 "You're in a maze of twisty little passages, all alike."