[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
out of date documentation
From: |
Dirk Herrmann |
Subject: |
out of date documentation |
Date: |
Mon, 2 Apr 2001 17:08:58 +0200 (MEST) |
Hello documentation folks:
I read in the documentation (on glug):
Macro: int SCM_NIMP (SCM x)
Return non-zero iff x is a non-immediate object. This is the exact
complement of SCM_IMP, above.
You must use this macro before calling a finer-grained predicate to
determine x's type. For example, to see if x is a pair, you must
write:
SCM_NIMP (x) && SCM_CONSP (x)
This is because Guile stores typing information for non-immediate
values in their cells, rather than in the SCM value itself; thus,
you must determine whether x refers to a cell before looking inside
it.
This is somewhat of a pity, because it means that the programmer
needs to know which types Guile implements as immediates vs.
non-immediates. There are (possibly better) representations in
which SCM_CONSP can be self-sufficient. The immediate type
predicates do not suffer from this weakness.
This information is out of date, since AFAIK most (all?) macro type
predicates in guile do the !SCM_IMP test by themselves.
A more detailed discussion of the recent approach to low-level type
handling in guile can be found in the file guile-core/doc/api.txt, which I
have written at the time when we decided to switch to the new mechanism.
Thus, I will be glad to answer any questions or to clarify if necessary.
Otherwise I think the text can mostly be used as it is, despite some
improvements to my english and the texinfo markup.
Best regards,
Dirk Herrmann
- out of date documentation,
Dirk Herrmann <=