[gambit-list] Type predicates in _system.scm

Marc Feeley feeley at iro.umontreal.ca
Wed Feb 25 12:45:40 EST 2015


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 at 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

-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 4839 bytes
Desc: not available
URL: <http://mailman.iro.umontreal.ca/pipermail/gambit-list/attachments/20150225/695b10c7/attachment.bin>


More information about the Gambit-list mailing list