[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: No gh_set_x()?
From: |
Steven G. Johnson |
Subject: |
Re: No gh_set_x()? |
Date: |
Mon, 16 Jul 2001 22:33:40 -0400 (EDT) |
If it's useful, here is some code I wrote to do set! from C...it worked in
Guile 1.3, although I haven't tested it recently. One can probably come
up with something cleaner.
static SCM my_symbol_set_x(char *name, SCM v)
{
/* code swiped from scm_symbol_value0 and scm_symbol_set_x */
SCM symbol = scm_intern_obarray_soft(name, strlen (name),
scm_symhash, 0);
SCM vcell = scm_sym2vcell (SCM_CAR (symbol),
SCM_CDR (scm_top_level_lookup_closure_var),
SCM_BOOL_F);
if (SCM_FALSEP (vcell))
return SCM_UNDEFINED;
SCM_SETCDR (vcell, v);
return SCM_UNSPECIFIED;
}
In Guile 1.1 and Guile 1.2 I used scm_symbol_set_x(SCM_BOOL_F, var,
value), but this stopped working in Guile 1.3 because of the module system
(which will hopefully be documented someday); I couldn't figure out what
to pass for the first parameter.
Steven
- Re: Gurus? Care to re-explain the absense of gh_set_x() for me?, (continued)
- Re: Gurus? Care to re-explain the absense of gh_set_x() for me?, Thomas Bushnell, BSG, 2001/07/13
- Re: Gurus? Care to re-explain the absense of gh_set_x() for me?, Thien-Thi Nguyen, 2001/07/14
- Re: Gurus? Care to re-explain the absense of gh_set_x() for me?, Martin Grabmueller, 2001/07/14
- Guile At Work (was Re: Gurus? Care to re-explain the absense of gh_set_x() for me?), Evan Prodromou, 2001/07/14
- Re: Guile At Work (was Re: Gurus? Care to re-explain the absense of gh_set_x() for me?), Thien-Thi Nguyen, 2001/07/14
Re: No gh_set_x()?, Dirk Esser, 2001/07/13
Re: No gh_set_x()?,
Steven G. Johnson <=