[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: hash tables
From: |
Thomas Bushnell, BSG |
Subject: |
Re: hash tables |
Date: |
08 Jul 2001 15:11:37 -0700 |
User-agent: |
Gnus/5.0808 (Gnus v5.8.8) Emacs/20.7 |
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!