This is the mail archive of the
guile@sourceware.cygnus.com
mailing list for the Guile project.
Use of SCM_CHARS in continuations.h
- To: Guile Mailing List <guile at sourceware dot cygnus dot com>
- Subject: Use of SCM_CHARS in continuations.h
- From: Dirk Herrmann <dirk at ida dot ing dot tu-bs dot de>
- Date: Mon, 27 Mar 2000 23:53:27 +0200 (MEST)
Hi!
In continuations.h there are the following definitions:
#define SCM_JMPBUF(x) (((scm_contregs *)SCM_CHARS(x))->jmpbuf)
#define SCM_SETJMPBUF(z, x) SCM_SETCDR (z, (SCM) x)
#define SCM_DYNENV(x) (((scm_contregs *)SCM_CHARS(x))->dynenv)
#define SCM_THROW_VALUE(x) (((scm_contregs *)SCM_CHARS(x))->throw_value)
#define SCM_BASE(x) (((scm_contregs *)SCM_CHARS(x))->base)
#define SCM_SEQ(x) (((scm_contregs *)SCM_CHARS(x))->seq)
#define SCM_DFRAME(x) (((scm_contregs *)SCM_CHARS(x))->dframe)
It looks like SCM_CHARS is used as a replacement for SCM_CDR, or in
this case better SCM_CELL_WORD_1. Also, I find it quite irritating that
the macros JMPBUF and SETJMPBUF are not symmetrical. I suggest (as a
start, the names could all need some improvement I think):
#define SCM_CONTREGS(x) ((scm_contregs *) SCM_CELL_WORD_1 (x))
#define SCM_SET_CONTREGS(x, r) (SCM_SET_CELL_WORD_1 (x, (scm_bits_t) r))
#define SCM_SETJMPBUF(x, r) (SCM_SET_CONTREGS (x, r)) /* deprecated */
#define SCM_JMPBUF(x) ((SCM_CONTREGS (x))->jmpbuf)
#define SCM_DYNENV(x) ((SCM_CONTREGS (x))->dynenv)
#define SCM_THROW_VALUE(x) ((SCM_CONTREGS (x))->throw_value)
#define SCM_BASE(x) ((SCM_CONTREGS (x))->base)
#define SCM_SEQ(x) ((SCM_CONTREGS (x))->seq)
#define SCM_DFRAME(x) ((SCM_CONTREGS (x))->dframe)
Best regards
Dirk Herrmann