guile-user
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: hash tables


From: Jim Blandy
Subject: Re: hash tables
Date: 09 Jul 2001 15:48:01 -0500

address@hidden (Thomas Bushnell, BSG) writes:

> Jim Blandy <address@hidden> writes:
> 
> > address@hidden (Thomas Bushnell, BSG) writes:
> > > Python does not have improper lists.  So I'm going to use pairs like
> > > ('hash . the-table-itself)
> > > to represent Python objects that don't have easy Scheme counterparts.
> > > That works as long as the cdr of these pairs is never itself a pair;
> > > then it's easy and quick to distinguish these from Python lists.
> > 
> > Under this representation, to test whether a Guile object represents a
> > Python list, you have to say:
> > 
> >   (or (null? OBJ)
> >       (and (pair? OBJ)
> >        (or (null? (cdr OBJ))
> >                (pair? OBJ))))
> > 
> > Is that right?
> 
> Hrm, pretty much.  
> 
> I'm still totally unsettled on the exact type correspondences that
> will be set up (right now, I'm debugging the parser [which does most
> of the compilation too]).  When I set in to working on the Python
> library, then I'll have to settle on exactly what the right type
> representations will be.
> 
> Do you have a suggestion?  I'm all ears!

I guess I'd use GOOPS objects.  That seems to me the cleanest way to
make type distinctions.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]