2000-06-04 01:30:23 +00:00
|
|
|
|
/* Copyright (C) 1995,1996,1997,1998, 2000 Free Software Foundation, Inc.
|
1996-07-25 22:56:11 +00:00
|
|
|
|
*
|
|
|
|
|
|
* This program is free software; you can redistribute it and/or modify
|
|
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
|
|
* the Free Software Foundation; either version 2, or (at your option)
|
|
|
|
|
|
* any later version.
|
|
|
|
|
|
*
|
|
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
|
|
*
|
|
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
|
|
* along with this software; see the file COPYING. If not, write to
|
1997-05-26 22:34:48 +00:00
|
|
|
|
* the Free Software Foundation, Inc., 59 Temple Place, Suite 330,
|
|
|
|
|
|
* Boston, MA 02111-1307 USA
|
1996-07-25 22:56:11 +00:00
|
|
|
|
*
|
|
|
|
|
|
* As a special exception, the Free Software Foundation gives permission
|
|
|
|
|
|
* for additional uses of the text contained in its release of GUILE.
|
|
|
|
|
|
*
|
|
|
|
|
|
* The exception is that, if you link the GUILE library with other files
|
|
|
|
|
|
* to produce an executable, this does not by itself cause the
|
|
|
|
|
|
* resulting executable to be covered by the GNU General Public License.
|
|
|
|
|
|
* Your use of that executable is in no way restricted on account of
|
|
|
|
|
|
* linking the GUILE library code into it.
|
|
|
|
|
|
*
|
|
|
|
|
|
* This exception does not however invalidate any other reasons why
|
|
|
|
|
|
* the executable file might be covered by the GNU General Public License.
|
|
|
|
|
|
*
|
|
|
|
|
|
* This exception applies only to the code released by the
|
|
|
|
|
|
* Free Software Foundation under the name GUILE. If you copy
|
|
|
|
|
|
* code from other Free Software Foundation releases into a copy of
|
|
|
|
|
|
* GUILE, as the General Public License permits, the exception does
|
|
|
|
|
|
* not apply to the code that you add in this way. To avoid misleading
|
|
|
|
|
|
* anyone as to the status of such modified files, you must delete
|
|
|
|
|
|
* this exception notice from them.
|
|
|
|
|
|
*
|
|
|
|
|
|
* If you write modifications of your own for GUILE, it is your choice
|
|
|
|
|
|
* whether to permit this exception to apply to your modifications.
|
1997-05-26 22:34:48 +00:00
|
|
|
|
* If you do not wish that, delete this exception notice. */
|
1999-12-12 02:36:16 +00:00
|
|
|
|
|
|
|
|
|
|
/* Software engineering face-lift by Greg J. Badros, 11-Dec-1999,
|
|
|
|
|
|
gjb@cs.washington.edu, http://www.cs.washington.edu/homes/gjb */
|
|
|
|
|
|
|
1996-07-25 22:56:11 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#include <stdio.h>
|
2000-04-21 14:16:44 +00:00
|
|
|
|
#include "libguile/_scm.h"
|
|
|
|
|
|
#include "libguile/chars.h"
|
|
|
|
|
|
#include "libguile/eval.h"
|
|
|
|
|
|
#include "libguile/variable.h"
|
|
|
|
|
|
#include "libguile/alist.h"
|
2000-06-21 02:46:01 +00:00
|
|
|
|
#include "libguile/fluids.h"
|
2000-04-21 14:16:44 +00:00
|
|
|
|
#include "libguile/strings.h"
|
|
|
|
|
|
#include "libguile/vectors.h"
|
|
|
|
|
|
#include "libguile/weaks.h"
|
2000-08-11 08:44:51 +00:00
|
|
|
|
#include "libguile/modules.h"
|
2000-04-21 14:16:44 +00:00
|
|
|
|
|
|
|
|
|
|
#include "libguile/validate.h"
|
|
|
|
|
|
#include "libguile/symbols.h"
|
1996-07-25 22:56:11 +00:00
|
|
|
|
|
1996-08-07 09:46:41 +00:00
|
|
|
|
#ifdef HAVE_STRING_H
|
|
|
|
|
|
#include <string.h>
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
1996-07-25 22:56:11 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/* NUM_HASH_BUCKETS is the number of symbol scm_hash table buckets.
|
|
|
|
|
|
*/
|
|
|
|
|
|
#define NUM_HASH_BUCKETS 137
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/* {Symbols}
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
* __scm.h, alist.c, alist.h, append.c, append.h, appinit.c,
arbiters.c, arbiters.h, async.c, async.h, boolean.c, boolean.h,
chars.c, chars.h, continuations.c, continuations.h, debug.c,
debug.h, dynwind.c, dynwind.h, eq.c, eq.h, error.c, eval.c,
eval.h, extchrs.c, extchrs.h, fdsocket.c, fdsocket.h, filesys.c,
filesys.h, fports.c, fports.h, gc.c, gdb_interface.h, gdbint.c,
gdbint.h, genio.c, genio.h, gscm.c, gscm.h, gsubr.c, gsubr.h,
hash.c, hash.h, hashtab.c, hashtab.h, init.c, ioext.c, ioext.h,
kw.c, kw.h, libguile.h, mallocs.c, mallocs.h, markers.c,
markers.h, mbstrings.c, mbstrings.h, numbers.c, numbers.h,
objprop.c, objprop.h, options.c, options.h, pairs.c, pairs.h,
ports.c, ports.h, posix.c, posix.h, print.c, print.h, procprop.c,
procprop.h, procs.c, procs.h, ramap.c, ramap.h, read.c, read.h,
root.c, scmsigs.c, scmsigs.h, sequences.c, sequences.h, simpos.c,
simpos.h, smob.c, socket.c, socket.h, srcprop.c, srcprop.h,
stackchk.c, stackchk.h, stime.c, stime.h, strings.c, strings.h,
strop.c, strop.h, strorder.c, strorder.h, strports.c, strports.h,
struct.c, struct.h, symbols.c, symbols.h, tag.c, tag.h, unif.c,
unif.h, variable.c, variable.h, vectors.c, vectors.h, version.c,
version.h, vports.c, vports.h, weaks.c, weaks.h: Use SCM_P to
declare functions with prototypes. (Patch thanks to Marius
Vollmer.)
1996-10-14 01:33:50 +00:00
|
|
|
|
|
1996-07-25 22:56:11 +00:00
|
|
|
|
unsigned long
|
2000-03-21 15:49:53 +00:00
|
|
|
|
scm_strhash (const unsigned char *str, scm_sizet len, unsigned long n)
|
1996-07-25 22:56:11 +00:00
|
|
|
|
{
|
|
|
|
|
|
if (len > 5)
|
|
|
|
|
|
{
|
|
|
|
|
|
scm_sizet i = 5;
|
|
|
|
|
|
unsigned long h = 264 % n;
|
|
|
|
|
|
while (i--)
|
1996-08-30 03:36:29 +00:00
|
|
|
|
h = ((h << 8) + ((unsigned) (scm_downcase (str[h % len])))) % n;
|
1996-07-25 22:56:11 +00:00
|
|
|
|
return h;
|
|
|
|
|
|
}
|
|
|
|
|
|
else
|
|
|
|
|
|
{
|
|
|
|
|
|
scm_sizet i = len;
|
|
|
|
|
|
unsigned long h = 0;
|
|
|
|
|
|
while (i)
|
1996-08-30 03:36:29 +00:00
|
|
|
|
h = ((h << 8) + ((unsigned) (scm_downcase (str[--i])))) % n;
|
1996-07-25 22:56:11 +00:00
|
|
|
|
return h;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
int scm_symhash_dim = NUM_HASH_BUCKETS;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/* scm_sym2vcell
|
|
|
|
|
|
* looks up the symbol in the symhash table.
|
|
|
|
|
|
*/
|
* __scm.h, alist.c, alist.h, append.c, append.h, appinit.c,
arbiters.c, arbiters.h, async.c, async.h, boolean.c, boolean.h,
chars.c, chars.h, continuations.c, continuations.h, debug.c,
debug.h, dynwind.c, dynwind.h, eq.c, eq.h, error.c, eval.c,
eval.h, extchrs.c, extchrs.h, fdsocket.c, fdsocket.h, filesys.c,
filesys.h, fports.c, fports.h, gc.c, gdb_interface.h, gdbint.c,
gdbint.h, genio.c, genio.h, gscm.c, gscm.h, gsubr.c, gsubr.h,
hash.c, hash.h, hashtab.c, hashtab.h, init.c, ioext.c, ioext.h,
kw.c, kw.h, libguile.h, mallocs.c, mallocs.h, markers.c,
markers.h, mbstrings.c, mbstrings.h, numbers.c, numbers.h,
objprop.c, objprop.h, options.c, options.h, pairs.c, pairs.h,
ports.c, ports.h, posix.c, posix.h, print.c, print.h, procprop.c,
procprop.h, procs.c, procs.h, ramap.c, ramap.h, read.c, read.h,
root.c, scmsigs.c, scmsigs.h, sequences.c, sequences.h, simpos.c,
simpos.h, smob.c, socket.c, socket.h, srcprop.c, srcprop.h,
stackchk.c, stackchk.h, stime.c, stime.h, strings.c, strings.h,
strop.c, strop.h, strorder.c, strorder.h, strports.c, strports.h,
struct.c, struct.h, symbols.c, symbols.h, tag.c, tag.h, unif.c,
unif.h, variable.c, variable.h, vectors.c, vectors.h, version.c,
version.h, vports.c, vports.h, weaks.c, weaks.h: Use SCM_P to
declare functions with prototypes. (Patch thanks to Marius
Vollmer.)
1996-10-14 01:33:50 +00:00
|
|
|
|
|
1996-07-25 22:56:11 +00:00
|
|
|
|
SCM
|
2000-06-04 01:30:23 +00:00
|
|
|
|
scm_sym2vcell (SCM sym, SCM thunk, SCM definep)
|
1996-07-25 22:56:11 +00:00
|
|
|
|
{
|
2000-06-04 01:30:23 +00:00
|
|
|
|
if (SCM_NIMP (thunk))
|
1996-07-25 22:56:11 +00:00
|
|
|
|
{
|
2000-06-04 01:30:23 +00:00
|
|
|
|
SCM var;
|
|
|
|
|
|
|
|
|
|
|
|
if (SCM_TYP7 (thunk) == scm_tc7_cclo
|
|
|
|
|
|
&& SCM_TYP7 (SCM_CCLO_SUBR (thunk)) == scm_tc7_subr_3)
|
|
|
|
|
|
/* Bypass evaluator in the standard case. */
|
|
|
|
|
|
var = SCM_SUBRF (SCM_CCLO_SUBR (thunk)) (thunk, sym, definep);
|
|
|
|
|
|
else
|
|
|
|
|
|
var = scm_apply (thunk, sym, scm_cons (definep, scm_listofnull));
|
1996-07-25 22:56:11 +00:00
|
|
|
|
|
2000-04-11 13:45:01 +00:00
|
|
|
|
if (SCM_FALSEP (var))
|
1996-07-25 22:56:11 +00:00
|
|
|
|
return SCM_BOOL_F;
|
|
|
|
|
|
else
|
|
|
|
|
|
{
|
|
|
|
|
|
if (SCM_IMP(var) || !SCM_VARIABLEP (var))
|
|
|
|
|
|
scm_wta (sym, "strangely interned symbol? ", "");
|
|
|
|
|
|
return SCM_VARVCELL (var);
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
else
|
|
|
|
|
|
{
|
|
|
|
|
|
SCM lsym;
|
|
|
|
|
|
SCM * lsymp;
|
|
|
|
|
|
SCM z;
|
|
|
|
|
|
scm_sizet scm_hash = scm_strhash (SCM_UCHARS (sym), (scm_sizet) SCM_LENGTH (sym),
|
|
|
|
|
|
(unsigned long) scm_symhash_dim);
|
|
|
|
|
|
|
|
|
|
|
|
SCM_DEFER_INTS;
|
|
|
|
|
|
for (lsym = SCM_VELTS (scm_symhash)[scm_hash]; SCM_NIMP (lsym); lsym = SCM_CDR (lsym))
|
|
|
|
|
|
{
|
|
|
|
|
|
z = SCM_CAR (lsym);
|
2000-04-11 13:45:01 +00:00
|
|
|
|
if (SCM_EQ_P (SCM_CAR (z), sym))
|
1996-07-25 22:56:11 +00:00
|
|
|
|
{
|
|
|
|
|
|
SCM_ALLOW_INTS;
|
|
|
|
|
|
return z;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
for (lsym = *(lsymp = &SCM_VELTS (scm_weak_symhash)[scm_hash]);
|
|
|
|
|
|
SCM_NIMP (lsym);
|
* pairs.h, eval.c, eval.h, feature.c, gc.c, list.c, load.c,
ramap.c, symbols.c: Added new selectors SCM_CARLOC and SCM_CDRLOC
for obtaining the address of a car or cdr field. Motivation:
&SCM_CXR make assumptions about the internal structure of the
SCM_CXR selectors.
* alist.c, arbiters.c, continuations.c, debug.c, debug.h, eval.c,
eval.h, feature.c, filesys.c, fports.c, gc.c, gsubr.c, init.c,
ioext.c, kw.c, list.c, load.c, mallocs.c, numbers.c, numbers.h,
pairs.c, pairs.h, ports.c, ports.h, posix.c, procprop.c, procs.c,
procs.h, ramap.c, read.c, root.c, srcprop.c, srcprop.h,
strports.c, symbols.c, tags.h, throw.c, unif.c, variable.c,
vports.c: Cleaned up use of pairs: Don't make any special
assumptions about the internal structure of selectors and
mutators: SCM_CXR (<e1>) = <e2> --> SCM_SETCXR (<e1>, <e2>),
SCM_CXR (<e1>) &= <e2> --> SCM_SETAND_CXR (<e1>, <e2>) etc.
(Among other things, this change makes it easier to build Guile
with certain compilers which have problems with casted lvalues.)
1996-10-20 03:29:38 +00:00
|
|
|
|
lsym = *(lsymp = SCM_CDRLOC (lsym)))
|
1996-07-25 22:56:11 +00:00
|
|
|
|
{
|
|
|
|
|
|
z = SCM_CAR (lsym);
|
2000-04-11 13:45:01 +00:00
|
|
|
|
if (SCM_EQ_P (SCM_CAR (z), sym))
|
1996-07-25 22:56:11 +00:00
|
|
|
|
{
|
1997-02-10 01:01:54 +00:00
|
|
|
|
if (SCM_NFALSEP (definep))
|
1996-07-25 22:56:11 +00:00
|
|
|
|
{
|
1996-10-14 03:27:11 +00:00
|
|
|
|
/* Move handle from scm_weak_symhash to scm_symhash. */
|
1996-07-25 22:56:11 +00:00
|
|
|
|
*lsymp = SCM_CDR (lsym);
|
|
|
|
|
|
SCM_SETCDR (lsym, SCM_VELTS(scm_symhash)[scm_hash]);
|
|
|
|
|
|
SCM_VELTS(scm_symhash)[scm_hash] = lsym;
|
|
|
|
|
|
}
|
|
|
|
|
|
SCM_ALLOW_INTS;
|
|
|
|
|
|
return z;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
SCM_ALLOW_INTS;
|
|
|
|
|
|
return scm_wta (sym, "uninterned symbol? ", "");
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/* scm_sym2ovcell
|
1996-10-14 03:27:11 +00:00
|
|
|
|
* looks up the symbol in an arbitrary obarray.
|
1996-07-25 22:56:11 +00:00
|
|
|
|
*/
|
* __scm.h, alist.c, alist.h, append.c, append.h, appinit.c,
arbiters.c, arbiters.h, async.c, async.h, boolean.c, boolean.h,
chars.c, chars.h, continuations.c, continuations.h, debug.c,
debug.h, dynwind.c, dynwind.h, eq.c, eq.h, error.c, eval.c,
eval.h, extchrs.c, extchrs.h, fdsocket.c, fdsocket.h, filesys.c,
filesys.h, fports.c, fports.h, gc.c, gdb_interface.h, gdbint.c,
gdbint.h, genio.c, genio.h, gscm.c, gscm.h, gsubr.c, gsubr.h,
hash.c, hash.h, hashtab.c, hashtab.h, init.c, ioext.c, ioext.h,
kw.c, kw.h, libguile.h, mallocs.c, mallocs.h, markers.c,
markers.h, mbstrings.c, mbstrings.h, numbers.c, numbers.h,
objprop.c, objprop.h, options.c, options.h, pairs.c, pairs.h,
ports.c, ports.h, posix.c, posix.h, print.c, print.h, procprop.c,
procprop.h, procs.c, procs.h, ramap.c, ramap.h, read.c, read.h,
root.c, scmsigs.c, scmsigs.h, sequences.c, sequences.h, simpos.c,
simpos.h, smob.c, socket.c, socket.h, srcprop.c, srcprop.h,
stackchk.c, stackchk.h, stime.c, stime.h, strings.c, strings.h,
strop.c, strop.h, strorder.c, strorder.h, strports.c, strports.h,
struct.c, struct.h, symbols.c, symbols.h, tag.c, tag.h, unif.c,
unif.h, variable.c, variable.h, vectors.c, vectors.h, version.c,
version.h, vports.c, vports.h, weaks.c, weaks.h: Use SCM_P to
declare functions with prototypes. (Patch thanks to Marius
Vollmer.)
1996-10-14 01:33:50 +00:00
|
|
|
|
|
1996-07-25 22:56:11 +00:00
|
|
|
|
SCM
|
1999-12-12 02:36:16 +00:00
|
|
|
|
scm_sym2ovcell_soft (SCM sym, SCM obarray)
|
1996-07-25 22:56:11 +00:00
|
|
|
|
{
|
|
|
|
|
|
SCM lsym, z;
|
|
|
|
|
|
scm_sizet scm_hash;
|
|
|
|
|
|
|
|
|
|
|
|
scm_hash = scm_strhash (SCM_UCHARS (sym),
|
|
|
|
|
|
(scm_sizet) SCM_LENGTH (sym),
|
|
|
|
|
|
SCM_LENGTH (obarray));
|
|
|
|
|
|
SCM_REDEFER_INTS;
|
|
|
|
|
|
for (lsym = SCM_VELTS (obarray)[scm_hash];
|
|
|
|
|
|
SCM_NIMP (lsym);
|
|
|
|
|
|
lsym = SCM_CDR (lsym))
|
|
|
|
|
|
{
|
|
|
|
|
|
z = SCM_CAR (lsym);
|
2000-04-11 13:45:01 +00:00
|
|
|
|
if (SCM_EQ_P (SCM_CAR (z), sym))
|
1996-07-25 22:56:11 +00:00
|
|
|
|
{
|
|
|
|
|
|
SCM_REALLOW_INTS;
|
|
|
|
|
|
return z;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
SCM_REALLOW_INTS;
|
|
|
|
|
|
return SCM_BOOL_F;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
* __scm.h, alist.c, alist.h, append.c, append.h, appinit.c,
arbiters.c, arbiters.h, async.c, async.h, boolean.c, boolean.h,
chars.c, chars.h, continuations.c, continuations.h, debug.c,
debug.h, dynwind.c, dynwind.h, eq.c, eq.h, error.c, eval.c,
eval.h, extchrs.c, extchrs.h, fdsocket.c, fdsocket.h, filesys.c,
filesys.h, fports.c, fports.h, gc.c, gdb_interface.h, gdbint.c,
gdbint.h, genio.c, genio.h, gscm.c, gscm.h, gsubr.c, gsubr.h,
hash.c, hash.h, hashtab.c, hashtab.h, init.c, ioext.c, ioext.h,
kw.c, kw.h, libguile.h, mallocs.c, mallocs.h, markers.c,
markers.h, mbstrings.c, mbstrings.h, numbers.c, numbers.h,
objprop.c, objprop.h, options.c, options.h, pairs.c, pairs.h,
ports.c, ports.h, posix.c, posix.h, print.c, print.h, procprop.c,
procprop.h, procs.c, procs.h, ramap.c, ramap.h, read.c, read.h,
root.c, scmsigs.c, scmsigs.h, sequences.c, sequences.h, simpos.c,
simpos.h, smob.c, socket.c, socket.h, srcprop.c, srcprop.h,
stackchk.c, stackchk.h, stime.c, stime.h, strings.c, strings.h,
strop.c, strop.h, strorder.c, strorder.h, strports.c, strports.h,
struct.c, struct.h, symbols.c, symbols.h, tag.c, tag.h, unif.c,
unif.h, variable.c, variable.h, vectors.c, vectors.h, version.c,
version.h, vports.c, vports.h, weaks.c, weaks.h: Use SCM_P to
declare functions with prototypes. (Patch thanks to Marius
Vollmer.)
1996-10-14 01:33:50 +00:00
|
|
|
|
|
1996-07-25 22:56:11 +00:00
|
|
|
|
SCM
|
1999-12-12 02:36:16 +00:00
|
|
|
|
scm_sym2ovcell (SCM sym, SCM obarray)
|
1996-07-25 22:56:11 +00:00
|
|
|
|
{
|
|
|
|
|
|
SCM answer;
|
|
|
|
|
|
answer = scm_sym2ovcell_soft (sym, obarray);
|
2000-04-11 13:45:01 +00:00
|
|
|
|
if (!SCM_FALSEP (answer))
|
1996-07-25 22:56:11 +00:00
|
|
|
|
return answer;
|
|
|
|
|
|
scm_wta (sym, "uninterned symbol? ", "");
|
|
|
|
|
|
return SCM_UNSPECIFIED; /* not reached */
|
|
|
|
|
|
}
|
|
|
|
|
|
|
1996-10-11 07:57:35 +00:00
|
|
|
|
/* Intern a symbol whose name is the LEN characters at NAME in OBARRAY.
|
|
|
|
|
|
|
|
|
|
|
|
OBARRAY should be a vector of lists, indexed by the name's hash
|
|
|
|
|
|
value, modulo OBARRAY's length. Each list has the form
|
|
|
|
|
|
((SYMBOL . VALUE) ...), where SYMBOL is a symbol, and VALUE is the
|
|
|
|
|
|
value associated with that symbol (in the current module? in the
|
|
|
|
|
|
system module?)
|
|
|
|
|
|
|
|
|
|
|
|
To "intern" a symbol means: if OBARRAY already contains a symbol by
|
|
|
|
|
|
that name, return its (SYMBOL . VALUE) pair; otherwise, create a
|
|
|
|
|
|
new symbol, add the pair (SYMBOL . SCM_UNDEFINED) to the
|
|
|
|
|
|
appropriate list of the OBARRAY, and return the pair.
|
|
|
|
|
|
|
|
|
|
|
|
If softness is non-zero, don't create a symbol if it isn't already
|
|
|
|
|
|
in OBARRAY; instead, just return #f.
|
|
|
|
|
|
|
|
|
|
|
|
If OBARRAY is SCM_BOOL_F, create a symbol listed in no obarray and
|
|
|
|
|
|
return (SYMBOL . SCM_UNDEFINED).
|
|
|
|
|
|
|
|
|
|
|
|
If OBARRAY is scm_symhash, and that doesn't contain the symbol,
|
|
|
|
|
|
check scm_weak_symhash instead. */
|
|
|
|
|
|
|
* __scm.h, alist.c, alist.h, append.c, append.h, appinit.c,
arbiters.c, arbiters.h, async.c, async.h, boolean.c, boolean.h,
chars.c, chars.h, continuations.c, continuations.h, debug.c,
debug.h, dynwind.c, dynwind.h, eq.c, eq.h, error.c, eval.c,
eval.h, extchrs.c, extchrs.h, fdsocket.c, fdsocket.h, filesys.c,
filesys.h, fports.c, fports.h, gc.c, gdb_interface.h, gdbint.c,
gdbint.h, genio.c, genio.h, gscm.c, gscm.h, gsubr.c, gsubr.h,
hash.c, hash.h, hashtab.c, hashtab.h, init.c, ioext.c, ioext.h,
kw.c, kw.h, libguile.h, mallocs.c, mallocs.h, markers.c,
markers.h, mbstrings.c, mbstrings.h, numbers.c, numbers.h,
objprop.c, objprop.h, options.c, options.h, pairs.c, pairs.h,
ports.c, ports.h, posix.c, posix.h, print.c, print.h, procprop.c,
procprop.h, procs.c, procs.h, ramap.c, ramap.h, read.c, read.h,
root.c, scmsigs.c, scmsigs.h, sequences.c, sequences.h, simpos.c,
simpos.h, smob.c, socket.c, socket.h, srcprop.c, srcprop.h,
stackchk.c, stackchk.h, stime.c, stime.h, strings.c, strings.h,
strop.c, strop.h, strorder.c, strorder.h, strports.c, strports.h,
struct.c, struct.h, symbols.c, symbols.h, tag.c, tag.h, unif.c,
unif.h, variable.c, variable.h, vectors.c, vectors.h, version.c,
version.h, vports.c, vports.h, weaks.c, weaks.h: Use SCM_P to
declare functions with prototypes. (Patch thanks to Marius
Vollmer.)
1996-10-14 01:33:50 +00:00
|
|
|
|
|
1996-07-25 22:56:11 +00:00
|
|
|
|
SCM
|
1999-12-12 02:36:16 +00:00
|
|
|
|
scm_intern_obarray_soft (const char *name,scm_sizet len,SCM obarray,int softness)
|
1996-07-25 22:56:11 +00:00
|
|
|
|
{
|
|
|
|
|
|
SCM lsym;
|
|
|
|
|
|
SCM z;
|
|
|
|
|
|
register scm_sizet i;
|
|
|
|
|
|
register unsigned char *tmp;
|
|
|
|
|
|
scm_sizet scm_hash;
|
|
|
|
|
|
|
|
|
|
|
|
SCM_REDEFER_INTS;
|
|
|
|
|
|
|
2000-04-11 13:45:01 +00:00
|
|
|
|
if (SCM_FALSEP (obarray))
|
1996-07-25 22:56:11 +00:00
|
|
|
|
{
|
2000-06-12 21:27:19 +00:00
|
|
|
|
scm_hash = scm_strhash ((unsigned char *) name, len, 1019);
|
1996-07-25 22:56:11 +00:00
|
|
|
|
goto uninterned_symbol;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2000-06-12 21:27:19 +00:00
|
|
|
|
scm_hash = scm_strhash ((unsigned char *) name, len, SCM_LENGTH (obarray));
|
1996-07-25 22:56:11 +00:00
|
|
|
|
|
1996-10-11 07:57:35 +00:00
|
|
|
|
/* softness == -1 used to mean that it was known that the symbol
|
|
|
|
|
|
wasn't already in the obarray. I don't think there are any
|
|
|
|
|
|
callers that use that case any more, but just in case...
|
|
|
|
|
|
-- JimB, Oct 1996 */
|
1996-07-25 22:56:11 +00:00
|
|
|
|
if (softness == -1)
|
1996-10-11 07:57:35 +00:00
|
|
|
|
abort ();
|
1996-07-25 22:56:11 +00:00
|
|
|
|
|
|
|
|
|
|
retry_new_obarray:
|
|
|
|
|
|
for (lsym = SCM_VELTS (obarray)[scm_hash]; SCM_NIMP (lsym); lsym = SCM_CDR (lsym))
|
|
|
|
|
|
{
|
|
|
|
|
|
z = SCM_CAR (lsym);
|
|
|
|
|
|
z = SCM_CAR (z);
|
|
|
|
|
|
tmp = SCM_UCHARS (z);
|
|
|
|
|
|
if (SCM_LENGTH (z) != len)
|
|
|
|
|
|
goto trynext;
|
|
|
|
|
|
for (i = len; i--;)
|
|
|
|
|
|
if (((unsigned char *) name)[i] != tmp[i])
|
|
|
|
|
|
goto trynext;
|
|
|
|
|
|
{
|
|
|
|
|
|
SCM a;
|
|
|
|
|
|
a = SCM_CAR (lsym);
|
|
|
|
|
|
SCM_REALLOW_INTS;
|
|
|
|
|
|
return a;
|
|
|
|
|
|
}
|
|
|
|
|
|
trynext:;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2000-04-11 13:45:01 +00:00
|
|
|
|
if (SCM_EQ_P (obarray, scm_symhash))
|
1996-07-25 22:56:11 +00:00
|
|
|
|
{
|
|
|
|
|
|
obarray = scm_weak_symhash;
|
|
|
|
|
|
goto retry_new_obarray;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
uninterned_symbol:
|
|
|
|
|
|
if (softness)
|
|
|
|
|
|
{
|
|
|
|
|
|
SCM_REALLOW_INTS;
|
|
|
|
|
|
return SCM_BOOL_F;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
lsym = scm_makfromstr (name, len, SCM_SYMBOL_SLOTS);
|
|
|
|
|
|
|
|
|
|
|
|
SCM_SETLENGTH (lsym, (long) len, scm_tc7_msymbol);
|
|
|
|
|
|
SCM_SYMBOL_HASH (lsym) = scm_hash;
|
2000-04-12 12:48:11 +00:00
|
|
|
|
SCM_SET_SYMBOL_PROPS (lsym, SCM_EOL);
|
2000-04-11 13:45:01 +00:00
|
|
|
|
if (SCM_FALSEP (obarray))
|
1996-07-25 22:56:11 +00:00
|
|
|
|
{
|
|
|
|
|
|
SCM answer;
|
|
|
|
|
|
SCM_REALLOW_INTS;
|
|
|
|
|
|
SCM_NEWCELL (answer);
|
|
|
|
|
|
SCM_DEFER_INTS;
|
* pairs.h, eval.c, eval.h, feature.c, gc.c, list.c, load.c,
ramap.c, symbols.c: Added new selectors SCM_CARLOC and SCM_CDRLOC
for obtaining the address of a car or cdr field. Motivation:
&SCM_CXR make assumptions about the internal structure of the
SCM_CXR selectors.
* alist.c, arbiters.c, continuations.c, debug.c, debug.h, eval.c,
eval.h, feature.c, filesys.c, fports.c, gc.c, gsubr.c, init.c,
ioext.c, kw.c, list.c, load.c, mallocs.c, numbers.c, numbers.h,
pairs.c, pairs.h, ports.c, ports.h, posix.c, procprop.c, procs.c,
procs.h, ramap.c, read.c, root.c, srcprop.c, srcprop.h,
strports.c, symbols.c, tags.h, throw.c, unif.c, variable.c,
vports.c: Cleaned up use of pairs: Don't make any special
assumptions about the internal structure of selectors and
mutators: SCM_CXR (<e1>) = <e2> --> SCM_SETCXR (<e1>, <e2>),
SCM_CXR (<e1>) &= <e2> --> SCM_SETAND_CXR (<e1>, <e2>) etc.
(Among other things, this change makes it easier to build Guile
with certain compilers which have problems with casted lvalues.)
1996-10-20 03:29:38 +00:00
|
|
|
|
SCM_SETCAR (answer, lsym);
|
|
|
|
|
|
SCM_SETCDR (answer, SCM_UNDEFINED);
|
1996-07-25 22:56:11 +00:00
|
|
|
|
SCM_REALLOW_INTS;
|
|
|
|
|
|
return answer;
|
|
|
|
|
|
}
|
|
|
|
|
|
else
|
|
|
|
|
|
{
|
|
|
|
|
|
SCM a;
|
|
|
|
|
|
SCM b;
|
|
|
|
|
|
|
|
|
|
|
|
SCM_NEWCELL (a);
|
|
|
|
|
|
SCM_NEWCELL (b);
|
|
|
|
|
|
SCM_SETCAR (a, lsym);
|
|
|
|
|
|
SCM_SETCDR (a, SCM_UNDEFINED);
|
|
|
|
|
|
SCM_SETCAR (b, a);
|
|
|
|
|
|
SCM_SETCDR (b, SCM_VELTS(obarray)[scm_hash]);
|
|
|
|
|
|
SCM_VELTS(obarray)[scm_hash] = b;
|
|
|
|
|
|
SCM_REALLOW_INTS;
|
|
|
|
|
|
return SCM_CAR (b);
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
* __scm.h, alist.c, alist.h, append.c, append.h, appinit.c,
arbiters.c, arbiters.h, async.c, async.h, boolean.c, boolean.h,
chars.c, chars.h, continuations.c, continuations.h, debug.c,
debug.h, dynwind.c, dynwind.h, eq.c, eq.h, error.c, eval.c,
eval.h, extchrs.c, extchrs.h, fdsocket.c, fdsocket.h, filesys.c,
filesys.h, fports.c, fports.h, gc.c, gdb_interface.h, gdbint.c,
gdbint.h, genio.c, genio.h, gscm.c, gscm.h, gsubr.c, gsubr.h,
hash.c, hash.h, hashtab.c, hashtab.h, init.c, ioext.c, ioext.h,
kw.c, kw.h, libguile.h, mallocs.c, mallocs.h, markers.c,
markers.h, mbstrings.c, mbstrings.h, numbers.c, numbers.h,
objprop.c, objprop.h, options.c, options.h, pairs.c, pairs.h,
ports.c, ports.h, posix.c, posix.h, print.c, print.h, procprop.c,
procprop.h, procs.c, procs.h, ramap.c, ramap.h, read.c, read.h,
root.c, scmsigs.c, scmsigs.h, sequences.c, sequences.h, simpos.c,
simpos.h, smob.c, socket.c, socket.h, srcprop.c, srcprop.h,
stackchk.c, stackchk.h, stime.c, stime.h, strings.c, strings.h,
strop.c, strop.h, strorder.c, strorder.h, strports.c, strports.h,
struct.c, struct.h, symbols.c, symbols.h, tag.c, tag.h, unif.c,
unif.h, variable.c, variable.h, vectors.c, vectors.h, version.c,
version.h, vports.c, vports.h, weaks.c, weaks.h: Use SCM_P to
declare functions with prototypes. (Patch thanks to Marius
Vollmer.)
1996-10-14 01:33:50 +00:00
|
|
|
|
|
1996-07-25 22:56:11 +00:00
|
|
|
|
SCM
|
1999-12-12 02:36:16 +00:00
|
|
|
|
scm_intern_obarray (const char *name,scm_sizet len,SCM obarray)
|
1996-07-25 22:56:11 +00:00
|
|
|
|
{
|
|
|
|
|
|
return scm_intern_obarray_soft (name, len, obarray, 0);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
SCM
|
1999-12-12 02:36:16 +00:00
|
|
|
|
scm_intern (const char *name,scm_sizet len)
|
1996-07-25 22:56:11 +00:00
|
|
|
|
{
|
|
|
|
|
|
return scm_intern_obarray (name, len, scm_symhash);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
* __scm.h, alist.c, alist.h, append.c, append.h, appinit.c,
arbiters.c, arbiters.h, async.c, async.h, boolean.c, boolean.h,
chars.c, chars.h, continuations.c, continuations.h, debug.c,
debug.h, dynwind.c, dynwind.h, eq.c, eq.h, error.c, eval.c,
eval.h, extchrs.c, extchrs.h, fdsocket.c, fdsocket.h, filesys.c,
filesys.h, fports.c, fports.h, gc.c, gdb_interface.h, gdbint.c,
gdbint.h, genio.c, genio.h, gscm.c, gscm.h, gsubr.c, gsubr.h,
hash.c, hash.h, hashtab.c, hashtab.h, init.c, ioext.c, ioext.h,
kw.c, kw.h, libguile.h, mallocs.c, mallocs.h, markers.c,
markers.h, mbstrings.c, mbstrings.h, numbers.c, numbers.h,
objprop.c, objprop.h, options.c, options.h, pairs.c, pairs.h,
ports.c, ports.h, posix.c, posix.h, print.c, print.h, procprop.c,
procprop.h, procs.c, procs.h, ramap.c, ramap.h, read.c, read.h,
root.c, scmsigs.c, scmsigs.h, sequences.c, sequences.h, simpos.c,
simpos.h, smob.c, socket.c, socket.h, srcprop.c, srcprop.h,
stackchk.c, stackchk.h, stime.c, stime.h, strings.c, strings.h,
strop.c, strop.h, strorder.c, strorder.h, strports.c, strports.h,
struct.c, struct.h, symbols.c, symbols.h, tag.c, tag.h, unif.c,
unif.h, variable.c, variable.h, vectors.c, vectors.h, version.c,
version.h, vports.c, vports.h, weaks.c, weaks.h: Use SCM_P to
declare functions with prototypes. (Patch thanks to Marius
Vollmer.)
1996-10-14 01:33:50 +00:00
|
|
|
|
|
1996-07-25 22:56:11 +00:00
|
|
|
|
SCM
|
1999-12-12 02:36:16 +00:00
|
|
|
|
scm_intern0 (const char * name)
|
1996-07-25 22:56:11 +00:00
|
|
|
|
{
|
|
|
|
|
|
return scm_intern (name, strlen (name));
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
1997-02-10 01:01:54 +00:00
|
|
|
|
/* Intern the symbol named NAME in scm_symhash, NAME is null-terminated. */
|
1996-07-25 22:56:11 +00:00
|
|
|
|
SCM
|
1999-12-12 02:36:16 +00:00
|
|
|
|
scm_sysintern0_no_module_lookup (const char *name)
|
1996-07-25 22:56:11 +00:00
|
|
|
|
{
|
|
|
|
|
|
SCM easy_answer;
|
|
|
|
|
|
SCM_DEFER_INTS;
|
|
|
|
|
|
easy_answer = scm_intern_obarray_soft (name, strlen (name), scm_symhash, 1);
|
|
|
|
|
|
if (SCM_NIMP (easy_answer))
|
|
|
|
|
|
{
|
|
|
|
|
|
SCM_ALLOW_INTS;
|
|
|
|
|
|
return easy_answer;
|
|
|
|
|
|
}
|
|
|
|
|
|
else
|
|
|
|
|
|
{
|
|
|
|
|
|
SCM lsym;
|
|
|
|
|
|
scm_sizet len = strlen (name);
|
2000-06-12 21:27:19 +00:00
|
|
|
|
scm_sizet scm_hash = scm_strhash ((unsigned char *) name,
|
|
|
|
|
|
len,
|
|
|
|
|
|
(unsigned long) scm_symhash_dim);
|
1996-07-25 22:56:11 +00:00
|
|
|
|
SCM_NEWCELL (lsym);
|
|
|
|
|
|
SCM_SETLENGTH (lsym, (long) len, scm_tc7_ssymbol);
|
|
|
|
|
|
SCM_SETCHARS (lsym, name);
|
1997-02-10 01:01:54 +00:00
|
|
|
|
lsym = scm_cons (lsym, SCM_UNDEFINED);
|
1996-07-25 22:56:11 +00:00
|
|
|
|
SCM_VELTS (scm_symhash)[scm_hash] = scm_cons (lsym, SCM_VELTS (scm_symhash)[scm_hash]);
|
|
|
|
|
|
SCM_ALLOW_INTS;
|
|
|
|
|
|
return lsym;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
1997-01-18 11:49:35 +00:00
|
|
|
|
/* Intern the symbol named NAME in scm_symhash, and give it the value
|
|
|
|
|
|
VAL. NAME is null-terminated. Use the current top_level lookup
|
|
|
|
|
|
closure to give NAME its value.
|
|
|
|
|
|
*/
|
|
|
|
|
|
SCM
|
1999-12-12 02:36:16 +00:00
|
|
|
|
scm_sysintern (const char *name, SCM val)
|
1997-02-10 01:01:54 +00:00
|
|
|
|
{
|
|
|
|
|
|
SCM vcell = scm_sysintern0 (name);
|
|
|
|
|
|
SCM_SETCDR (vcell, val);
|
|
|
|
|
|
return vcell;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
SCM
|
1999-12-12 02:36:16 +00:00
|
|
|
|
scm_sysintern0 (const char *name)
|
1997-01-18 11:49:35 +00:00
|
|
|
|
{
|
|
|
|
|
|
SCM lookup_proc;
|
2000-08-11 08:44:51 +00:00
|
|
|
|
if (scm_module_system_booted_p
|
|
|
|
|
|
&& SCM_NIMP (lookup_proc = SCM_TOP_LEVEL_LOOKUP_CLOSURE))
|
1997-01-18 11:49:35 +00:00
|
|
|
|
{
|
|
|
|
|
|
SCM sym = SCM_CAR (scm_intern0 (name));
|
|
|
|
|
|
SCM vcell = scm_sym2vcell (sym, lookup_proc, SCM_BOOL_T);
|
2000-04-11 13:45:01 +00:00
|
|
|
|
if (SCM_FALSEP (vcell))
|
* dynl.c, feature.c, filesys.c, fports.c, list.c, load.c,
net_db.c, sort.c, stacks.c, unif.c: Use SCM_WTA, SCM_MISC_ERROR
where possible.
* symbols.c (scm_sysintern0): Fixed the function name in a
scm_misc_error invocation.
* print.c (scm_simple_format): Do not need SCM_COERCE_SUBSTR, and
use scm_return_first to ward off latent GC bug that Mikael caught.
* async.c: Use SCM_VALIDATE_ASYNC_COPY one place where it wasn't
used before but should've been.
2000-01-11 23:56:47 +00:00
|
|
|
|
scm_misc_error ("sysintern0", "can't define variable", sym);
|
1997-01-18 11:49:35 +00:00
|
|
|
|
return vcell;
|
|
|
|
|
|
}
|
|
|
|
|
|
else
|
1997-02-10 01:01:54 +00:00
|
|
|
|
return scm_sysintern0_no_module_lookup (name);
|
1997-01-18 11:49:35 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
1997-02-26 12:08:26 +00:00
|
|
|
|
/* Lookup the value of the symbol named by the nul-terminated string
|
|
|
|
|
|
NAME in the current module. */
|
|
|
|
|
|
SCM
|
1999-12-12 02:36:16 +00:00
|
|
|
|
scm_symbol_value0 (const char *name)
|
1997-02-26 12:08:26 +00:00
|
|
|
|
{
|
|
|
|
|
|
/* This looks silly - we look up the symbol twice. But it is in
|
|
|
|
|
|
fact necessary given the current module system because the module
|
|
|
|
|
|
lookup closures are written in scheme which needs real symbols. */
|
|
|
|
|
|
SCM symbol = scm_intern_obarray_soft (name, strlen (name), scm_symhash, 0);
|
|
|
|
|
|
SCM vcell = scm_sym2vcell (SCM_CAR (symbol),
|
2000-06-21 02:46:01 +00:00
|
|
|
|
SCM_TOP_LEVEL_LOOKUP_CLOSURE,
|
1997-02-26 12:08:26 +00:00
|
|
|
|
SCM_BOOL_F);
|
|
|
|
|
|
if (SCM_FALSEP (vcell))
|
|
|
|
|
|
return SCM_UNDEFINED;
|
|
|
|
|
|
return SCM_CDR (vcell);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2000-01-05 19:25:37 +00:00
|
|
|
|
SCM_DEFINE (scm_symbol_p, "symbol?", 1, 0, 0,
|
2000-01-27 18:15:56 +00:00
|
|
|
|
(SCM obj),
|
|
|
|
|
|
"Returns @t{#t} if @var{obj} is a symbol, otherwise returns @t{#f}. (r5rs)")
|
1999-12-12 02:36:16 +00:00
|
|
|
|
#define FUNC_NAME s_scm_symbol_p
|
1996-07-25 22:56:11 +00:00
|
|
|
|
{
|
2000-01-27 18:15:56 +00:00
|
|
|
|
if SCM_IMP(obj) return SCM_BOOL_F;
|
|
|
|
|
|
return SCM_BOOL(SCM_SYMBOLP(obj));
|
1996-07-25 22:56:11 +00:00
|
|
|
|
}
|
1999-12-12 02:36:16 +00:00
|
|
|
|
#undef FUNC_NAME
|
1996-07-25 22:56:11 +00:00
|
|
|
|
|
2000-01-05 19:25:37 +00:00
|
|
|
|
SCM_DEFINE (scm_symbol_to_string, "symbol->string", 1, 0, 0,
|
1999-12-12 02:36:16 +00:00
|
|
|
|
(SCM s),
|
2000-01-27 18:15:56 +00:00
|
|
|
|
"Returns the name of @var{symbol} as a string. If the symbol was part of\n"
|
2000-09-02 23:16:00 +00:00
|
|
|
|
"an object returned as the value of a literal expression (section\n"
|
|
|
|
|
|
"@pxref{Literal expressions,,,r4rs, The Revised^4 Report on Scheme}) or\n"
|
|
|
|
|
|
"by a call to the @samp{read} procedure, and its name contains alphabetic\n"
|
|
|
|
|
|
"characters, then the string returned will contain characters in the\n"
|
|
|
|
|
|
"implementation's preferred standard case---some implementations will\n"
|
|
|
|
|
|
"prefer upper case, others lower case. If the symbol was returned by\n"
|
|
|
|
|
|
"@samp{string->symbol}, the case of characters in the string returned\n"
|
|
|
|
|
|
"will be the same as the case in the string that was passed to\n"
|
|
|
|
|
|
"@samp{string->symbol}. It is an error to apply mutation procedures like\n"
|
|
|
|
|
|
"@code{string-set!} to strings returned by this procedure. (r5rs)\n\n"
|
2000-01-27 18:15:56 +00:00
|
|
|
|
"The following examples assume that the implementation's standard case is\n"
|
|
|
|
|
|
"lower case:\n\n"
|
|
|
|
|
|
"@format\n"
|
|
|
|
|
|
"@t{(symbol->string 'flying-fish) \n"
|
|
|
|
|
|
" ==> \"flying-fish\"\n"
|
|
|
|
|
|
"(symbol->string 'Martin) ==> \"martin\"\n"
|
|
|
|
|
|
"(symbol->string\n"
|
2000-09-02 23:16:00 +00:00
|
|
|
|
" (string->symbol \"Malvina\")) \n"
|
|
|
|
|
|
" ==> \"Malvina\"\n"
|
2000-01-27 18:15:56 +00:00
|
|
|
|
"}\n"
|
|
|
|
|
|
"@end format")
|
1999-12-12 02:36:16 +00:00
|
|
|
|
#define FUNC_NAME s_scm_symbol_to_string
|
1996-07-25 22:56:11 +00:00
|
|
|
|
{
|
2000-01-05 19:25:37 +00:00
|
|
|
|
SCM_VALIDATE_SYMBOL (1,s);
|
1996-10-14 03:27:11 +00:00
|
|
|
|
return scm_makfromstr(SCM_CHARS(s), (scm_sizet)SCM_LENGTH(s), 0);
|
1996-07-25 22:56:11 +00:00
|
|
|
|
}
|
1999-12-12 02:36:16 +00:00
|
|
|
|
#undef FUNC_NAME
|
1996-07-25 22:56:11 +00:00
|
|
|
|
|
|
|
|
|
|
|
2000-01-05 19:25:37 +00:00
|
|
|
|
SCM_DEFINE (scm_string_to_symbol, "string->symbol", 1, 0, 0,
|
1999-12-12 02:36:16 +00:00
|
|
|
|
(SCM s),
|
2000-01-27 18:15:56 +00:00
|
|
|
|
"Returns the symbol whose name is @var{string}. This procedure can\n"
|
|
|
|
|
|
"create symbols with names containing special characters or letters in\n"
|
|
|
|
|
|
"the non-standard case, but it is usually a bad idea to create such\n"
|
|
|
|
|
|
"symbols because in some implementations of Scheme they cannot be read as\n"
|
|
|
|
|
|
"themselves. See @samp{symbol->string}.\n\n"
|
|
|
|
|
|
"The following examples assume that the implementation's standard case is\n"
|
|
|
|
|
|
"lower case:\n\n"
|
|
|
|
|
|
"@format\n"
|
|
|
|
|
|
"@t{(eq? 'mISSISSIppi 'mississippi) \n"
|
|
|
|
|
|
" ==> #t\n"
|
|
|
|
|
|
"(string->symbol \"mISSISSIppi\") \n"
|
|
|
|
|
|
" ==>\n"
|
|
|
|
|
|
" @r{}the symbol with name \"mISSISSIppi\"\n"
|
|
|
|
|
|
"(eq? 'bitBlt (string->symbol \"bitBlt\")) \n"
|
|
|
|
|
|
" ==> #f\n"
|
|
|
|
|
|
"(eq? 'JollyWog\n"
|
|
|
|
|
|
" (string->symbol\n"
|
|
|
|
|
|
" (symbol->string 'JollyWog))) \n"
|
|
|
|
|
|
" ==> #t\n"
|
|
|
|
|
|
"(string=? \"K. Harper, M.D.\"\n"
|
|
|
|
|
|
" (symbol->string\n"
|
|
|
|
|
|
" (string->symbol \"K. Harper, M.D.\"))) \n"
|
|
|
|
|
|
" ==> #t\n"
|
|
|
|
|
|
"}\n"
|
|
|
|
|
|
"@end format")
|
1999-12-12 02:36:16 +00:00
|
|
|
|
#define FUNC_NAME s_scm_string_to_symbol
|
1996-07-25 22:56:11 +00:00
|
|
|
|
{
|
|
|
|
|
|
SCM vcell;
|
|
|
|
|
|
SCM answer;
|
|
|
|
|
|
|
2000-01-05 19:25:37 +00:00
|
|
|
|
SCM_VALIDATE_ROSTRING (1,s);
|
1996-07-25 22:56:11 +00:00
|
|
|
|
vcell = scm_intern(SCM_ROCHARS(s), (scm_sizet)SCM_LENGTH(s));
|
|
|
|
|
|
answer = SCM_CAR (vcell);
|
|
|
|
|
|
return answer;
|
|
|
|
|
|
}
|
1999-12-12 02:36:16 +00:00
|
|
|
|
#undef FUNC_NAME
|
1996-07-25 22:56:11 +00:00
|
|
|
|
|
|
|
|
|
|
|
2000-01-05 19:25:37 +00:00
|
|
|
|
SCM_DEFINE (scm_string_to_obarray_symbol, "string->obarray-symbol", 2, 1, 0,
|
1999-12-12 02:36:16 +00:00
|
|
|
|
(SCM o, SCM s, SCM softp),
|
2000-01-18 14:13:31 +00:00
|
|
|
|
"Intern a new symbol in @var{obarray}, a symbol table, with name\n"
|
|
|
|
|
|
"@var{string}.\n\n"
|
|
|
|
|
|
"If @var{obarray} is @code{#f}, use the default system symbol table. If\n"
|
|
|
|
|
|
"@var{obarray} is @code{#t}, the symbol should not be interned in any\n"
|
|
|
|
|
|
"symbol table; merely return the pair (@var{symbol}\n"
|
|
|
|
|
|
". @var{#<undefined>}).\n\n"
|
|
|
|
|
|
"The @var{soft?} argument determines whether new symbol table entries\n"
|
|
|
|
|
|
"should be created when the specified symbol is not already present in\n"
|
|
|
|
|
|
"@var{obarray}. If @var{soft?} is specified and is a true value, then\n"
|
|
|
|
|
|
"new entries should not be added for symbols not already present in the\n"
|
|
|
|
|
|
"table; instead, simply return @code{#f}.")
|
1999-12-12 02:36:16 +00:00
|
|
|
|
#define FUNC_NAME s_scm_string_to_obarray_symbol
|
1996-07-25 22:56:11 +00:00
|
|
|
|
{
|
|
|
|
|
|
SCM vcell;
|
|
|
|
|
|
SCM answer;
|
|
|
|
|
|
int softness;
|
|
|
|
|
|
|
2000-01-05 19:25:37 +00:00
|
|
|
|
SCM_VALIDATE_ROSTRING (2,s);
|
2000-04-11 13:45:01 +00:00
|
|
|
|
SCM_ASSERT (SCM_BOOLP (o) || SCM_VECTORP (o), o, SCM_ARG1, FUNC_NAME);
|
1996-07-25 22:56:11 +00:00
|
|
|
|
|
2000-04-11 13:45:01 +00:00
|
|
|
|
softness = (!SCM_UNBNDP (softp) && !SCM_FALSEP(softp));
|
1996-07-25 22:56:11 +00:00
|
|
|
|
/* iron out some screwy calling conventions */
|
2000-04-11 13:45:01 +00:00
|
|
|
|
if (SCM_FALSEP (o))
|
1996-07-25 22:56:11 +00:00
|
|
|
|
o = scm_symhash;
|
2000-06-05 11:39:46 +00:00
|
|
|
|
else if (SCM_EQ_P (o, SCM_BOOL_T))
|
1996-07-25 22:56:11 +00:00
|
|
|
|
o = SCM_BOOL_F;
|
|
|
|
|
|
|
1996-10-14 03:27:11 +00:00
|
|
|
|
vcell = scm_intern_obarray_soft (SCM_ROCHARS(s),
|
|
|
|
|
|
(scm_sizet)SCM_ROLENGTH(s),
|
|
|
|
|
|
o,
|
|
|
|
|
|
softness);
|
2000-04-11 13:45:01 +00:00
|
|
|
|
if (SCM_FALSEP (vcell))
|
1996-07-25 22:56:11 +00:00
|
|
|
|
return vcell;
|
|
|
|
|
|
answer = SCM_CAR (vcell);
|
|
|
|
|
|
return answer;
|
|
|
|
|
|
}
|
1999-12-12 02:36:16 +00:00
|
|
|
|
#undef FUNC_NAME
|
1996-07-25 22:56:11 +00:00
|
|
|
|
|
2000-01-05 19:25:37 +00:00
|
|
|
|
SCM_DEFINE (scm_intern_symbol, "intern-symbol", 2, 0, 0,
|
1999-12-12 02:36:16 +00:00
|
|
|
|
(SCM o, SCM s),
|
* alist.c, chars.c, debug.c, dynl.c, dynwind.c, error.c, eval.c,
evalext.c, filesys.c, gc.c, hash.c, hashtab.c, ioext.c,
keywords.c, list.c, load.c, macros.c, net_db.c, numbers.c,
objprop.c, ports.c, posix.c, print.c, procprop.c, procs.c,
ramap.c, regex-posix.c, root.c, scmsigs.c, simpos.c, socket.c,
stacks.c, stime.c, strings.c, strop.c, strports.c, struct.c,
symbols.c, throw.c, unif.c, vectors.c, version.c, vports.c,
weaks.c: Converted docstrings to ANSI C format.
2000-01-18 11:24:03 +00:00
|
|
|
|
"Add a new symbol to @var{obarray} with name @var{string}, bound to an\n"
|
|
|
|
|
|
"unspecified initial value. The symbol table is not modified if a symbol\n"
|
|
|
|
|
|
"with this name is already present.")
|
1999-12-12 02:36:16 +00:00
|
|
|
|
#define FUNC_NAME s_scm_intern_symbol
|
1996-07-25 22:56:11 +00:00
|
|
|
|
{
|
1996-10-14 03:27:11 +00:00
|
|
|
|
scm_sizet hval;
|
2000-01-05 19:25:37 +00:00
|
|
|
|
SCM_VALIDATE_SYMBOL (2,s);
|
2000-04-11 13:45:01 +00:00
|
|
|
|
if (SCM_FALSEP (o))
|
1996-10-14 03:27:11 +00:00
|
|
|
|
o = scm_symhash;
|
2000-01-05 19:25:37 +00:00
|
|
|
|
SCM_VALIDATE_VECTOR (1,o);
|
1996-10-14 03:27:11 +00:00
|
|
|
|
hval = scm_strhash (SCM_UCHARS (s), SCM_LENGTH (s), SCM_LENGTH(o));
|
|
|
|
|
|
/* If the symbol is already interned, simply return. */
|
|
|
|
|
|
SCM_REDEFER_INTS;
|
|
|
|
|
|
{
|
|
|
|
|
|
SCM lsym;
|
|
|
|
|
|
SCM sym;
|
|
|
|
|
|
for (lsym = SCM_VELTS (o)[hval];
|
|
|
|
|
|
SCM_NIMP (lsym);
|
|
|
|
|
|
lsym = SCM_CDR (lsym))
|
|
|
|
|
|
{
|
|
|
|
|
|
sym = SCM_CAR (lsym);
|
2000-04-11 13:45:01 +00:00
|
|
|
|
if (SCM_EQ_P (SCM_CAR (sym), s))
|
1996-10-14 03:27:11 +00:00
|
|
|
|
{
|
|
|
|
|
|
SCM_REALLOW_INTS;
|
|
|
|
|
|
return SCM_UNSPECIFIED;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
SCM_VELTS (o)[hval] =
|
|
|
|
|
|
scm_acons (s, SCM_UNDEFINED, SCM_VELTS (o)[hval]);
|
|
|
|
|
|
}
|
|
|
|
|
|
SCM_REALLOW_INTS;
|
|
|
|
|
|
return SCM_UNSPECIFIED;
|
1996-07-25 22:56:11 +00:00
|
|
|
|
}
|
1999-12-12 02:36:16 +00:00
|
|
|
|
#undef FUNC_NAME
|
1996-07-25 22:56:11 +00:00
|
|
|
|
|
2000-01-05 19:25:37 +00:00
|
|
|
|
SCM_DEFINE (scm_unintern_symbol, "unintern-symbol", 2, 0, 0,
|
1999-12-12 02:36:16 +00:00
|
|
|
|
(SCM o, SCM s),
|
* alist.c, chars.c, debug.c, dynl.c, dynwind.c, error.c, eval.c,
evalext.c, filesys.c, gc.c, hash.c, hashtab.c, ioext.c,
keywords.c, list.c, load.c, macros.c, net_db.c, numbers.c,
objprop.c, ports.c, posix.c, print.c, procprop.c, procs.c,
ramap.c, regex-posix.c, root.c, scmsigs.c, simpos.c, socket.c,
stacks.c, stime.c, strings.c, strop.c, strports.c, struct.c,
symbols.c, throw.c, unif.c, vectors.c, version.c, vports.c,
weaks.c: Converted docstrings to ANSI C format.
2000-01-18 11:24:03 +00:00
|
|
|
|
"Remove the symbol with name @var{string} from @var{obarray}. This\n"
|
|
|
|
|
|
"function returns @code{#t} if the symbol was present and @code{#f}\n"
|
|
|
|
|
|
"otherwise.")
|
1999-12-12 02:36:16 +00:00
|
|
|
|
#define FUNC_NAME s_scm_unintern_symbol
|
1996-07-25 22:56:11 +00:00
|
|
|
|
{
|
1996-10-14 03:27:11 +00:00
|
|
|
|
scm_sizet hval;
|
2000-01-05 19:25:37 +00:00
|
|
|
|
SCM_VALIDATE_SYMBOL (2,s);
|
2000-04-11 13:45:01 +00:00
|
|
|
|
if (SCM_FALSEP (o))
|
1996-10-14 03:27:11 +00:00
|
|
|
|
o = scm_symhash;
|
2000-01-05 19:25:37 +00:00
|
|
|
|
SCM_VALIDATE_VECTOR (1,o);
|
1996-10-14 03:27:11 +00:00
|
|
|
|
hval = scm_strhash (SCM_UCHARS (s), SCM_LENGTH (s), SCM_LENGTH(o));
|
|
|
|
|
|
SCM_DEFER_INTS;
|
|
|
|
|
|
{
|
|
|
|
|
|
SCM lsym_follow;
|
|
|
|
|
|
SCM lsym;
|
|
|
|
|
|
SCM sym;
|
|
|
|
|
|
for (lsym = SCM_VELTS (o)[hval], lsym_follow = SCM_BOOL_F;
|
|
|
|
|
|
SCM_NIMP (lsym);
|
|
|
|
|
|
lsym_follow = lsym, lsym = SCM_CDR (lsym))
|
|
|
|
|
|
{
|
|
|
|
|
|
sym = SCM_CAR (lsym);
|
2000-04-11 13:45:01 +00:00
|
|
|
|
if (SCM_EQ_P (SCM_CAR (sym), s))
|
1996-10-14 03:27:11 +00:00
|
|
|
|
{
|
|
|
|
|
|
/* Found the symbol to unintern. */
|
2000-04-11 13:45:01 +00:00
|
|
|
|
if (SCM_FALSEP (lsym_follow))
|
1996-10-14 03:27:11 +00:00
|
|
|
|
SCM_VELTS(o)[hval] = lsym;
|
|
|
|
|
|
else
|
* pairs.h, eval.c, eval.h, feature.c, gc.c, list.c, load.c,
ramap.c, symbols.c: Added new selectors SCM_CARLOC and SCM_CDRLOC
for obtaining the address of a car or cdr field. Motivation:
&SCM_CXR make assumptions about the internal structure of the
SCM_CXR selectors.
* alist.c, arbiters.c, continuations.c, debug.c, debug.h, eval.c,
eval.h, feature.c, filesys.c, fports.c, gc.c, gsubr.c, init.c,
ioext.c, kw.c, list.c, load.c, mallocs.c, numbers.c, numbers.h,
pairs.c, pairs.h, ports.c, ports.h, posix.c, procprop.c, procs.c,
procs.h, ramap.c, read.c, root.c, srcprop.c, srcprop.h,
strports.c, symbols.c, tags.h, throw.c, unif.c, variable.c,
vports.c: Cleaned up use of pairs: Don't make any special
assumptions about the internal structure of selectors and
mutators: SCM_CXR (<e1>) = <e2> --> SCM_SETCXR (<e1>, <e2>),
SCM_CXR (<e1>) &= <e2> --> SCM_SETAND_CXR (<e1>, <e2>) etc.
(Among other things, this change makes it easier to build Guile
with certain compilers which have problems with casted lvalues.)
1996-10-20 03:29:38 +00:00
|
|
|
|
SCM_SETCDR (lsym_follow, SCM_CDR(lsym));
|
1996-10-14 03:27:11 +00:00
|
|
|
|
SCM_ALLOW_INTS;
|
|
|
|
|
|
return SCM_BOOL_T;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
SCM_ALLOW_INTS;
|
|
|
|
|
|
return SCM_BOOL_F;
|
1996-07-25 22:56:11 +00:00
|
|
|
|
}
|
1999-12-12 02:36:16 +00:00
|
|
|
|
#undef FUNC_NAME
|
1996-07-25 22:56:11 +00:00
|
|
|
|
|
2000-01-05 19:25:37 +00:00
|
|
|
|
SCM_DEFINE (scm_symbol_binding, "symbol-binding", 2, 0, 0,
|
1999-12-12 02:36:16 +00:00
|
|
|
|
(SCM o, SCM s),
|
* alist.c, chars.c, debug.c, dynl.c, dynwind.c, error.c, eval.c,
evalext.c, filesys.c, gc.c, hash.c, hashtab.c, ioext.c,
keywords.c, list.c, load.c, macros.c, net_db.c, numbers.c,
objprop.c, ports.c, posix.c, print.c, procprop.c, procs.c,
ramap.c, regex-posix.c, root.c, scmsigs.c, simpos.c, socket.c,
stacks.c, stime.c, strings.c, strop.c, strports.c, struct.c,
symbols.c, throw.c, unif.c, vectors.c, version.c, vports.c,
weaks.c: Converted docstrings to ANSI C format.
2000-01-18 11:24:03 +00:00
|
|
|
|
"Look up in @var{obarray} the symbol whose name is @var{string}, and\n"
|
|
|
|
|
|
"return the value to which it is bound. If @var{obarray} is @code{#f},\n"
|
|
|
|
|
|
"use the global symbol table. If @var{string} is not interned in\n"
|
|
|
|
|
|
"@var{obarray}, an error is signalled.")
|
1999-12-12 02:36:16 +00:00
|
|
|
|
#define FUNC_NAME s_scm_symbol_binding
|
1996-07-25 22:56:11 +00:00
|
|
|
|
{
|
|
|
|
|
|
SCM vcell;
|
2000-01-05 19:25:37 +00:00
|
|
|
|
SCM_VALIDATE_SYMBOL (2,s);
|
2000-04-11 13:45:01 +00:00
|
|
|
|
if (SCM_FALSEP (o))
|
1996-07-25 22:56:11 +00:00
|
|
|
|
o = scm_symhash;
|
2000-01-05 19:25:37 +00:00
|
|
|
|
SCM_VALIDATE_VECTOR (1,o);
|
1996-07-25 22:56:11 +00:00
|
|
|
|
vcell = scm_sym2ovcell (s, o);
|
|
|
|
|
|
return SCM_CDR(vcell);
|
|
|
|
|
|
}
|
1999-12-12 02:36:16 +00:00
|
|
|
|
#undef FUNC_NAME
|
1996-07-25 22:56:11 +00:00
|
|
|
|
|
|
|
|
|
|
|
2000-01-05 19:25:37 +00:00
|
|
|
|
SCM_DEFINE (scm_symbol_interned_p, "symbol-interned?", 2, 0, 0,
|
1999-12-12 02:36:16 +00:00
|
|
|
|
(SCM o, SCM s),
|
* alist.c, chars.c, debug.c, dynl.c, dynwind.c, error.c, eval.c,
evalext.c, filesys.c, gc.c, hash.c, hashtab.c, ioext.c,
keywords.c, list.c, load.c, macros.c, net_db.c, numbers.c,
objprop.c, ports.c, posix.c, print.c, procprop.c, procs.c,
ramap.c, regex-posix.c, root.c, scmsigs.c, simpos.c, socket.c,
stacks.c, stime.c, strings.c, strop.c, strports.c, struct.c,
symbols.c, throw.c, unif.c, vectors.c, version.c, vports.c,
weaks.c: Converted docstrings to ANSI C format.
2000-01-18 11:24:03 +00:00
|
|
|
|
"Return @var{#t} if @var{obarray} contains a symbol with name\n"
|
|
|
|
|
|
"@var{string}, and @var{#f} otherwise.")
|
1999-12-12 02:36:16 +00:00
|
|
|
|
#define FUNC_NAME s_scm_symbol_interned_p
|
1996-07-25 22:56:11 +00:00
|
|
|
|
{
|
|
|
|
|
|
SCM vcell;
|
2000-01-05 19:25:37 +00:00
|
|
|
|
SCM_VALIDATE_SYMBOL (2,s);
|
2000-04-11 13:45:01 +00:00
|
|
|
|
if (SCM_FALSEP (o))
|
1996-07-25 22:56:11 +00:00
|
|
|
|
o = scm_symhash;
|
2000-01-05 19:25:37 +00:00
|
|
|
|
SCM_VALIDATE_VECTOR (1,o);
|
1996-07-25 22:56:11 +00:00
|
|
|
|
vcell = scm_sym2ovcell_soft (s, o);
|
2000-04-11 13:45:01 +00:00
|
|
|
|
if (SCM_IMP (vcell) && SCM_EQ_P (o, scm_symhash))
|
1996-07-25 22:56:11 +00:00
|
|
|
|
vcell = scm_sym2ovcell_soft (s, scm_weak_symhash);
|
|
|
|
|
|
return (SCM_NIMP(vcell)
|
|
|
|
|
|
? SCM_BOOL_T
|
|
|
|
|
|
: SCM_BOOL_F);
|
|
|
|
|
|
}
|
1999-12-12 02:36:16 +00:00
|
|
|
|
#undef FUNC_NAME
|
1996-07-25 22:56:11 +00:00
|
|
|
|
|
|
|
|
|
|
|
2000-01-05 19:25:37 +00:00
|
|
|
|
SCM_DEFINE (scm_symbol_bound_p, "symbol-bound?", 2, 0, 0,
|
1999-12-12 02:36:16 +00:00
|
|
|
|
(SCM o, SCM s),
|
* alist.c, chars.c, debug.c, dynl.c, dynwind.c, error.c, eval.c,
evalext.c, filesys.c, gc.c, hash.c, hashtab.c, ioext.c,
keywords.c, list.c, load.c, macros.c, net_db.c, numbers.c,
objprop.c, ports.c, posix.c, print.c, procprop.c, procs.c,
ramap.c, regex-posix.c, root.c, scmsigs.c, simpos.c, socket.c,
stacks.c, stime.c, strings.c, strop.c, strports.c, struct.c,
symbols.c, throw.c, unif.c, vectors.c, version.c, vports.c,
weaks.c: Converted docstrings to ANSI C format.
2000-01-18 11:24:03 +00:00
|
|
|
|
"Return @var{#t} if @var{obarray} contains a symbol with name\n"
|
|
|
|
|
|
"@var{string} bound to a defined value. This differs from\n"
|
|
|
|
|
|
"@var{symbol-bound?} in that the mere mention of a symbol usually causes\n"
|
|
|
|
|
|
"it to be interned; @code{symbol-bound?} determines whether a symbol has\n"
|
|
|
|
|
|
"been given any meaningful value.")
|
1999-12-12 02:36:16 +00:00
|
|
|
|
#define FUNC_NAME s_scm_symbol_bound_p
|
1996-07-25 22:56:11 +00:00
|
|
|
|
{
|
|
|
|
|
|
SCM vcell;
|
2000-01-05 19:25:37 +00:00
|
|
|
|
SCM_VALIDATE_SYMBOL (2,s);
|
2000-04-11 13:45:01 +00:00
|
|
|
|
if (SCM_FALSEP (o))
|
1996-07-25 22:56:11 +00:00
|
|
|
|
o = scm_symhash;
|
2000-01-05 19:25:37 +00:00
|
|
|
|
SCM_VALIDATE_VECTOR (1,o);
|
1996-07-25 22:56:11 +00:00
|
|
|
|
vcell = scm_sym2ovcell_soft (s, o);
|
2000-04-11 13:45:01 +00:00
|
|
|
|
return SCM_BOOL (SCM_NIMP (vcell) && !SCM_UNBNDP (SCM_CDR (vcell)));
|
1996-07-25 22:56:11 +00:00
|
|
|
|
}
|
1999-12-12 02:36:16 +00:00
|
|
|
|
#undef FUNC_NAME
|
1996-07-25 22:56:11 +00:00
|
|
|
|
|
|
|
|
|
|
|
2000-01-05 19:25:37 +00:00
|
|
|
|
SCM_DEFINE (scm_symbol_set_x, "symbol-set!", 3, 0, 0,
|
1999-12-12 02:36:16 +00:00
|
|
|
|
(SCM o, SCM s, SCM v),
|
* alist.c, chars.c, debug.c, dynl.c, dynwind.c, error.c, eval.c,
evalext.c, filesys.c, gc.c, hash.c, hashtab.c, ioext.c,
keywords.c, list.c, load.c, macros.c, net_db.c, numbers.c,
objprop.c, ports.c, posix.c, print.c, procprop.c, procs.c,
ramap.c, regex-posix.c, root.c, scmsigs.c, simpos.c, socket.c,
stacks.c, stime.c, strings.c, strop.c, strports.c, struct.c,
symbols.c, throw.c, unif.c, vectors.c, version.c, vports.c,
weaks.c: Converted docstrings to ANSI C format.
2000-01-18 11:24:03 +00:00
|
|
|
|
"Find the symbol in @var{obarray} whose name is @var{string}, and rebind\n"
|
|
|
|
|
|
"it to @var{value}. An error is signalled if @var{string} is not present\n"
|
|
|
|
|
|
"in @var{obarray}.")
|
1999-12-12 02:36:16 +00:00
|
|
|
|
#define FUNC_NAME s_scm_symbol_set_x
|
1996-07-25 22:56:11 +00:00
|
|
|
|
{
|
|
|
|
|
|
SCM vcell;
|
2000-01-05 19:25:37 +00:00
|
|
|
|
SCM_VALIDATE_SYMBOL (2,s);
|
2000-04-11 13:45:01 +00:00
|
|
|
|
if (SCM_FALSEP (o))
|
1996-07-25 22:56:11 +00:00
|
|
|
|
o = scm_symhash;
|
2000-01-05 19:25:37 +00:00
|
|
|
|
SCM_VALIDATE_VECTOR (1,o);
|
1996-07-25 22:56:11 +00:00
|
|
|
|
vcell = scm_sym2ovcell (s, o);
|
* pairs.h, eval.c, eval.h, feature.c, gc.c, list.c, load.c,
ramap.c, symbols.c: Added new selectors SCM_CARLOC and SCM_CDRLOC
for obtaining the address of a car or cdr field. Motivation:
&SCM_CXR make assumptions about the internal structure of the
SCM_CXR selectors.
* alist.c, arbiters.c, continuations.c, debug.c, debug.h, eval.c,
eval.h, feature.c, filesys.c, fports.c, gc.c, gsubr.c, init.c,
ioext.c, kw.c, list.c, load.c, mallocs.c, numbers.c, numbers.h,
pairs.c, pairs.h, ports.c, ports.h, posix.c, procprop.c, procs.c,
procs.h, ramap.c, read.c, root.c, srcprop.c, srcprop.h,
strports.c, symbols.c, tags.h, throw.c, unif.c, variable.c,
vports.c: Cleaned up use of pairs: Don't make any special
assumptions about the internal structure of selectors and
mutators: SCM_CXR (<e1>) = <e2> --> SCM_SETCXR (<e1>, <e2>),
SCM_CXR (<e1>) &= <e2> --> SCM_SETAND_CXR (<e1>, <e2>) etc.
(Among other things, this change makes it easier to build Guile
with certain compilers which have problems with casted lvalues.)
1996-10-20 03:29:38 +00:00
|
|
|
|
SCM_SETCDR (vcell, v);
|
1996-07-25 22:56:11 +00:00
|
|
|
|
return SCM_UNSPECIFIED;
|
|
|
|
|
|
}
|
1999-12-12 02:36:16 +00:00
|
|
|
|
#undef FUNC_NAME
|
1996-07-25 22:56:11 +00:00
|
|
|
|
|
|
|
|
|
|
static void
|
1999-12-12 02:36:16 +00:00
|
|
|
|
msymbolize (SCM s)
|
1996-07-25 22:56:11 +00:00
|
|
|
|
{
|
|
|
|
|
|
SCM string;
|
|
|
|
|
|
string = scm_makfromstr (SCM_CHARS (s), SCM_LENGTH (s), SCM_SYMBOL_SLOTS);
|
|
|
|
|
|
SCM_SETCHARS (s, SCM_CHARS (string));
|
|
|
|
|
|
SCM_SETLENGTH (s, SCM_LENGTH (s), scm_tc7_msymbol);
|
* pairs.h, eval.c, eval.h, feature.c, gc.c, list.c, load.c,
ramap.c, symbols.c: Added new selectors SCM_CARLOC and SCM_CDRLOC
for obtaining the address of a car or cdr field. Motivation:
&SCM_CXR make assumptions about the internal structure of the
SCM_CXR selectors.
* alist.c, arbiters.c, continuations.c, debug.c, debug.h, eval.c,
eval.h, feature.c, filesys.c, fports.c, gc.c, gsubr.c, init.c,
ioext.c, kw.c, list.c, load.c, mallocs.c, numbers.c, numbers.h,
pairs.c, pairs.h, ports.c, ports.h, posix.c, procprop.c, procs.c,
procs.h, ramap.c, read.c, root.c, srcprop.c, srcprop.h,
strports.c, symbols.c, tags.h, throw.c, unif.c, variable.c,
vports.c: Cleaned up use of pairs: Don't make any special
assumptions about the internal structure of selectors and
mutators: SCM_CXR (<e1>) = <e2> --> SCM_SETCXR (<e1>, <e2>),
SCM_CXR (<e1>) &= <e2> --> SCM_SETAND_CXR (<e1>, <e2>) etc.
(Among other things, this change makes it easier to build Guile
with certain compilers which have problems with casted lvalues.)
1996-10-20 03:29:38 +00:00
|
|
|
|
SCM_SETCDR (string, SCM_EOL);
|
|
|
|
|
|
SCM_SETCAR (string, SCM_EOL);
|
2000-04-12 12:48:11 +00:00
|
|
|
|
SCM_SET_SYMBOL_PROPS (s, SCM_EOL);
|
1997-03-05 22:49:12 +00:00
|
|
|
|
/* If it's a tc7_ssymbol, it comes from scm_symhash */
|
|
|
|
|
|
SCM_SYMBOL_HASH (s) = scm_strhash (SCM_UCHARS (s),
|
|
|
|
|
|
(scm_sizet) SCM_LENGTH (s),
|
|
|
|
|
|
SCM_LENGTH (scm_symhash));
|
1996-07-25 22:56:11 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
2000-01-05 19:25:37 +00:00
|
|
|
|
SCM_DEFINE (scm_symbol_fref, "symbol-fref", 1, 0, 0,
|
1999-12-12 02:36:16 +00:00
|
|
|
|
(SCM s),
|
* alist.c, chars.c, debug.c, dynl.c, dynwind.c, error.c, eval.c,
evalext.c, filesys.c, gc.c, hash.c, hashtab.c, ioext.c,
keywords.c, list.c, load.c, macros.c, net_db.c, numbers.c,
objprop.c, ports.c, posix.c, print.c, procprop.c, procs.c,
ramap.c, regex-posix.c, root.c, scmsigs.c, simpos.c, socket.c,
stacks.c, stime.c, strings.c, strop.c, strports.c, struct.c,
symbols.c, throw.c, unif.c, vectors.c, version.c, vports.c,
weaks.c: Converted docstrings to ANSI C format.
2000-01-18 11:24:03 +00:00
|
|
|
|
"Return the contents of @var{symbol}'s @dfn{function slot}.")
|
1999-12-12 02:36:16 +00:00
|
|
|
|
#define FUNC_NAME s_scm_symbol_fref
|
1996-07-25 22:56:11 +00:00
|
|
|
|
{
|
2000-01-05 19:25:37 +00:00
|
|
|
|
SCM_VALIDATE_SYMBOL (1,s);
|
1996-07-25 22:56:11 +00:00
|
|
|
|
SCM_DEFER_INTS;
|
|
|
|
|
|
if (SCM_TYP7(s) == scm_tc7_ssymbol)
|
|
|
|
|
|
msymbolize (s);
|
|
|
|
|
|
SCM_ALLOW_INTS;
|
|
|
|
|
|
return SCM_SYMBOL_FUNC (s);
|
|
|
|
|
|
}
|
1999-12-12 02:36:16 +00:00
|
|
|
|
#undef FUNC_NAME
|
1996-07-25 22:56:11 +00:00
|
|
|
|
|
|
|
|
|
|
|
2000-01-05 19:25:37 +00:00
|
|
|
|
SCM_DEFINE (scm_symbol_pref, "symbol-pref", 1, 0, 0,
|
1999-12-12 02:36:16 +00:00
|
|
|
|
(SCM s),
|
* alist.c, chars.c, debug.c, dynl.c, dynwind.c, error.c, eval.c,
evalext.c, filesys.c, gc.c, hash.c, hashtab.c, ioext.c,
keywords.c, list.c, load.c, macros.c, net_db.c, numbers.c,
objprop.c, ports.c, posix.c, print.c, procprop.c, procs.c,
ramap.c, regex-posix.c, root.c, scmsigs.c, simpos.c, socket.c,
stacks.c, stime.c, strings.c, strop.c, strports.c, struct.c,
symbols.c, throw.c, unif.c, vectors.c, version.c, vports.c,
weaks.c: Converted docstrings to ANSI C format.
2000-01-18 11:24:03 +00:00
|
|
|
|
"Return the @dfn{property list} currently associated with @var{symbol}.")
|
1999-12-12 02:36:16 +00:00
|
|
|
|
#define FUNC_NAME s_scm_symbol_pref
|
1996-07-25 22:56:11 +00:00
|
|
|
|
{
|
2000-01-05 19:25:37 +00:00
|
|
|
|
SCM_VALIDATE_SYMBOL (1,s);
|
1996-07-25 22:56:11 +00:00
|
|
|
|
SCM_DEFER_INTS;
|
|
|
|
|
|
if (SCM_TYP7(s) == scm_tc7_ssymbol)
|
|
|
|
|
|
msymbolize (s);
|
|
|
|
|
|
SCM_ALLOW_INTS;
|
|
|
|
|
|
return SCM_SYMBOL_PROPS (s);
|
|
|
|
|
|
}
|
1999-12-12 02:36:16 +00:00
|
|
|
|
#undef FUNC_NAME
|
1996-07-25 22:56:11 +00:00
|
|
|
|
|
|
|
|
|
|
|
2000-01-05 19:25:37 +00:00
|
|
|
|
SCM_DEFINE (scm_symbol_fset_x, "symbol-fset!", 2, 0, 0,
|
1999-12-12 02:36:16 +00:00
|
|
|
|
(SCM s, SCM val),
|
* alist.c, chars.c, debug.c, dynl.c, dynwind.c, error.c, eval.c,
evalext.c, filesys.c, gc.c, hash.c, hashtab.c, ioext.c,
keywords.c, list.c, load.c, macros.c, net_db.c, numbers.c,
objprop.c, ports.c, posix.c, print.c, procprop.c, procs.c,
ramap.c, regex-posix.c, root.c, scmsigs.c, simpos.c, socket.c,
stacks.c, stime.c, strings.c, strop.c, strports.c, struct.c,
symbols.c, throw.c, unif.c, vectors.c, version.c, vports.c,
weaks.c: Converted docstrings to ANSI C format.
2000-01-18 11:24:03 +00:00
|
|
|
|
"Change the binding of @var{symbol}'s function slot.")
|
1999-12-12 02:36:16 +00:00
|
|
|
|
#define FUNC_NAME s_scm_symbol_fset_x
|
1996-07-25 22:56:11 +00:00
|
|
|
|
{
|
2000-01-05 19:25:37 +00:00
|
|
|
|
SCM_VALIDATE_SYMBOL (1,s);
|
1996-07-25 22:56:11 +00:00
|
|
|
|
SCM_DEFER_INTS;
|
|
|
|
|
|
if (SCM_TYP7(s) == scm_tc7_ssymbol)
|
|
|
|
|
|
msymbolize (s);
|
|
|
|
|
|
SCM_ALLOW_INTS;
|
2000-04-12 12:48:11 +00:00
|
|
|
|
SCM_SET_SYMBOL_FUNC (s, val);
|
1996-07-25 22:56:11 +00:00
|
|
|
|
return SCM_UNSPECIFIED;
|
|
|
|
|
|
}
|
1999-12-12 02:36:16 +00:00
|
|
|
|
#undef FUNC_NAME
|
1996-07-25 22:56:11 +00:00
|
|
|
|
|
|
|
|
|
|
|
2000-01-05 19:25:37 +00:00
|
|
|
|
SCM_DEFINE (scm_symbol_pset_x, "symbol-pset!", 2, 0, 0,
|
1999-12-12 02:36:16 +00:00
|
|
|
|
(SCM s, SCM val),
|
* alist.c, chars.c, debug.c, dynl.c, dynwind.c, error.c, eval.c,
evalext.c, filesys.c, gc.c, hash.c, hashtab.c, ioext.c,
keywords.c, list.c, load.c, macros.c, net_db.c, numbers.c,
objprop.c, ports.c, posix.c, print.c, procprop.c, procs.c,
ramap.c, regex-posix.c, root.c, scmsigs.c, simpos.c, socket.c,
stacks.c, stime.c, strings.c, strop.c, strports.c, struct.c,
symbols.c, throw.c, unif.c, vectors.c, version.c, vports.c,
weaks.c: Converted docstrings to ANSI C format.
2000-01-18 11:24:03 +00:00
|
|
|
|
"Change the binding of @var{symbol}'s property slot.")
|
1999-12-12 02:36:16 +00:00
|
|
|
|
#define FUNC_NAME s_scm_symbol_pset_x
|
1996-07-25 22:56:11 +00:00
|
|
|
|
{
|
2000-01-05 19:25:37 +00:00
|
|
|
|
SCM_VALIDATE_SYMBOL (1,s);
|
1996-07-25 22:56:11 +00:00
|
|
|
|
SCM_DEFER_INTS;
|
|
|
|
|
|
if (SCM_TYP7(s) == scm_tc7_ssymbol)
|
|
|
|
|
|
msymbolize (s);
|
2000-04-12 12:48:11 +00:00
|
|
|
|
SCM_SET_SYMBOL_PROPS (s, val);
|
1996-07-25 22:56:11 +00:00
|
|
|
|
SCM_ALLOW_INTS;
|
|
|
|
|
|
return SCM_UNSPECIFIED;
|
|
|
|
|
|
}
|
1999-12-12 02:36:16 +00:00
|
|
|
|
#undef FUNC_NAME
|
1996-07-25 22:56:11 +00:00
|
|
|
|
|
|
|
|
|
|
|
2000-01-05 19:25:37 +00:00
|
|
|
|
SCM_DEFINE (scm_symbol_hash, "symbol-hash", 1, 0, 0,
|
1999-12-12 02:36:16 +00:00
|
|
|
|
(SCM s),
|
* alist.c, chars.c, debug.c, dynl.c, dynwind.c, error.c, eval.c,
evalext.c, filesys.c, gc.c, hash.c, hashtab.c, ioext.c,
keywords.c, list.c, load.c, macros.c, net_db.c, numbers.c,
objprop.c, ports.c, posix.c, print.c, procprop.c, procs.c,
ramap.c, regex-posix.c, root.c, scmsigs.c, simpos.c, socket.c,
stacks.c, stime.c, strings.c, strop.c, strports.c, struct.c,
symbols.c, throw.c, unif.c, vectors.c, version.c, vports.c,
weaks.c: Converted docstrings to ANSI C format.
2000-01-18 11:24:03 +00:00
|
|
|
|
"Return the hash value derived from @var{symbol}'s name, i.e. the integer\n"
|
|
|
|
|
|
"index into @var{symbol}'s obarray at which it is stored.")
|
1999-12-12 02:36:16 +00:00
|
|
|
|
#define FUNC_NAME s_scm_symbol_hash
|
1996-07-25 22:56:11 +00:00
|
|
|
|
{
|
2000-01-05 19:25:37 +00:00
|
|
|
|
SCM_VALIDATE_SYMBOL (1,s);
|
1997-03-05 22:49:12 +00:00
|
|
|
|
if (SCM_TYP7(s) == scm_tc7_ssymbol)
|
|
|
|
|
|
msymbolize (s);
|
2000-04-12 12:48:11 +00:00
|
|
|
|
return SCM_MAKINUM (SCM_UNPACK (s) ^ SCM_SYMBOL_HASH (s));
|
1996-07-25 22:56:11 +00:00
|
|
|
|
}
|
1999-12-12 02:36:16 +00:00
|
|
|
|
#undef FUNC_NAME
|
1996-07-25 22:56:11 +00:00
|
|
|
|
|
|
|
|
|
|
|
1997-03-05 22:49:12 +00:00
|
|
|
|
static void
|
1999-12-12 02:36:16 +00:00
|
|
|
|
copy_and_prune_obarray (SCM from, SCM to)
|
1997-03-05 22:49:12 +00:00
|
|
|
|
{
|
|
|
|
|
|
int i;
|
|
|
|
|
|
int length = SCM_LENGTH (from);
|
|
|
|
|
|
for (i = 0; i < length; ++i)
|
|
|
|
|
|
{
|
|
|
|
|
|
SCM head = SCM_VELTS (from)[i]; /* GC protection */
|
|
|
|
|
|
SCM ls = head;
|
|
|
|
|
|
SCM res = SCM_EOL;
|
|
|
|
|
|
SCM *lloc = &res;
|
|
|
|
|
|
while (SCM_NIMP (ls))
|
|
|
|
|
|
{
|
|
|
|
|
|
if (!SCM_UNBNDP (SCM_CDAR (ls)))
|
|
|
|
|
|
{
|
|
|
|
|
|
*lloc = scm_cons (SCM_CAR (ls), SCM_EOL);
|
|
|
|
|
|
lloc = SCM_CDRLOC (*lloc);
|
|
|
|
|
|
}
|
|
|
|
|
|
ls = SCM_CDR (ls);
|
|
|
|
|
|
}
|
|
|
|
|
|
SCM_VELTS (to)[i] = res;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
2000-01-05 19:25:37 +00:00
|
|
|
|
SCM_DEFINE (scm_builtin_bindings, "builtin-bindings", 0, 0, 0,
|
2000-01-27 18:15:56 +00:00
|
|
|
|
(),
|
* alist.c, chars.c, debug.c, dynl.c, dynwind.c, error.c, eval.c,
evalext.c, filesys.c, gc.c, hash.c, hashtab.c, ioext.c,
keywords.c, list.c, load.c, macros.c, net_db.c, numbers.c,
objprop.c, ports.c, posix.c, print.c, procprop.c, procs.c,
ramap.c, regex-posix.c, root.c, scmsigs.c, simpos.c, socket.c,
stacks.c, stime.c, strings.c, strop.c, strports.c, struct.c,
symbols.c, throw.c, unif.c, vectors.c, version.c, vports.c,
weaks.c: Converted docstrings to ANSI C format.
2000-01-18 11:24:03 +00:00
|
|
|
|
"Create and return a copy of the global symbol table, removing all\n"
|
|
|
|
|
|
"unbound symbols.")
|
1999-12-12 02:36:16 +00:00
|
|
|
|
#define FUNC_NAME s_scm_builtin_bindings
|
1997-03-05 22:49:12 +00:00
|
|
|
|
{
|
|
|
|
|
|
int length = SCM_LENGTH (scm_symhash);
|
* eval.c, filesys.c, fluids.c, gc.c, gh_data.c, init.c, kw.c,
net_db.c, posix.c, print.c, regex-posix.c, scmsigs.c, socket.c,
stime.c, symbols.c, unif.c, vectors.c, weaks.c: Removed third
argument in call to scm_make_vector.
1998-07-12 00:10:02 +00:00
|
|
|
|
SCM obarray = scm_make_vector (SCM_MAKINUM (length), SCM_EOL);
|
1997-03-05 22:49:12 +00:00
|
|
|
|
copy_and_prune_obarray (scm_symhash, obarray);
|
|
|
|
|
|
return obarray;
|
|
|
|
|
|
}
|
1999-12-12 02:36:16 +00:00
|
|
|
|
#undef FUNC_NAME
|
1997-03-05 22:49:12 +00:00
|
|
|
|
|
|
|
|
|
|
|
2000-01-05 19:25:37 +00:00
|
|
|
|
SCM_DEFINE (scm_builtin_weak_bindings, "builtin-weak-bindings", 0, 0, 0,
|
2000-01-27 18:15:56 +00:00
|
|
|
|
(),
|
* alist.c, chars.c, debug.c, dynl.c, dynwind.c, error.c, eval.c,
evalext.c, filesys.c, gc.c, hash.c, hashtab.c, ioext.c,
keywords.c, list.c, load.c, macros.c, net_db.c, numbers.c,
objprop.c, ports.c, posix.c, print.c, procprop.c, procs.c,
ramap.c, regex-posix.c, root.c, scmsigs.c, simpos.c, socket.c,
stacks.c, stime.c, strings.c, strop.c, strports.c, struct.c,
symbols.c, throw.c, unif.c, vectors.c, version.c, vports.c,
weaks.c: Converted docstrings to ANSI C format.
2000-01-18 11:24:03 +00:00
|
|
|
|
"")
|
1999-12-12 02:36:16 +00:00
|
|
|
|
#define FUNC_NAME s_scm_builtin_weak_bindings
|
1997-03-05 22:49:12 +00:00
|
|
|
|
{
|
|
|
|
|
|
int length = SCM_LENGTH (scm_weak_symhash);
|
|
|
|
|
|
SCM obarray = scm_make_doubly_weak_hash_table (SCM_MAKINUM (length));
|
|
|
|
|
|
copy_and_prune_obarray (scm_weak_symhash, obarray);
|
|
|
|
|
|
return obarray;
|
|
|
|
|
|
}
|
1999-12-12 02:36:16 +00:00
|
|
|
|
#undef FUNC_NAME
|
1997-03-05 22:49:12 +00:00
|
|
|
|
|
1997-09-01 22:28:49 +00:00
|
|
|
|
static int gensym_counter;
|
|
|
|
|
|
static SCM gensym_prefix;
|
1997-03-05 22:49:12 +00:00
|
|
|
|
|
1999-12-12 02:36:16 +00:00
|
|
|
|
/* :FIXME:OPTIMIZE */
|
2000-01-05 19:05:23 +00:00
|
|
|
|
SCM_DEFINE (scm_gensym, "gensym", 0, 2, 0,
|
1999-12-12 02:36:16 +00:00
|
|
|
|
(SCM name, SCM obarray),
|
* alist.c, chars.c, debug.c, dynl.c, dynwind.c, error.c, eval.c,
evalext.c, filesys.c, gc.c, hash.c, hashtab.c, ioext.c,
keywords.c, list.c, load.c, macros.c, net_db.c, numbers.c,
objprop.c, ports.c, posix.c, print.c, procprop.c, procs.c,
ramap.c, regex-posix.c, root.c, scmsigs.c, simpos.c, socket.c,
stacks.c, stime.c, strings.c, strop.c, strports.c, struct.c,
symbols.c, throw.c, unif.c, vectors.c, version.c, vports.c,
weaks.c: Converted docstrings to ANSI C format.
2000-01-18 11:24:03 +00:00
|
|
|
|
"Create a new, unique symbol in @var{obarray}, using the global symbol\n"
|
|
|
|
|
|
"table by default. If @var{name} is specified, it should be used as a\n"
|
|
|
|
|
|
"prefix for the new symbol's name. The default prefix is @code{%%gensym}.")
|
1999-12-12 02:36:16 +00:00
|
|
|
|
#define FUNC_NAME s_scm_gensym
|
1997-09-01 22:28:49 +00:00
|
|
|
|
{
|
|
|
|
|
|
SCM new;
|
|
|
|
|
|
if (SCM_UNBNDP (name))
|
2000-09-10 20:22:09 +00:00
|
|
|
|
name = gensym_prefix;
|
1997-09-01 22:28:49 +00:00
|
|
|
|
else
|
2000-09-10 19:10:10 +00:00
|
|
|
|
{
|
|
|
|
|
|
SCM_VALIDATE_SYMBOL (1, name);
|
2000-09-10 20:22:09 +00:00
|
|
|
|
name = scm_symbol_to_string (name);
|
2000-09-10 19:10:10 +00:00
|
|
|
|
}
|
1999-12-12 02:36:16 +00:00
|
|
|
|
|
2000-09-10 20:22:09 +00:00
|
|
|
|
new = name;
|
1997-09-01 22:28:49 +00:00
|
|
|
|
if (SCM_UNBNDP (obarray))
|
|
|
|
|
|
{
|
|
|
|
|
|
obarray = SCM_BOOL_F;
|
|
|
|
|
|
goto skip_test;
|
|
|
|
|
|
}
|
|
|
|
|
|
else
|
2000-01-05 16:16:57 +00:00
|
|
|
|
SCM_ASSERT ((SCM_VECTORP (obarray) || SCM_WVECTP (obarray)),
|
1997-09-01 22:28:49 +00:00
|
|
|
|
obarray,
|
|
|
|
|
|
SCM_ARG2,
|
1999-12-12 02:36:16 +00:00
|
|
|
|
FUNC_NAME);
|
2000-04-11 13:45:01 +00:00
|
|
|
|
while (!SCM_FALSEP (scm_string_to_obarray_symbol (obarray, new, SCM_BOOL_T)))
|
1997-09-01 22:28:49 +00:00
|
|
|
|
skip_test:
|
|
|
|
|
|
new = scm_string_append
|
|
|
|
|
|
(scm_cons2 (name,
|
|
|
|
|
|
scm_number_to_string (SCM_MAKINUM (gensym_counter++),
|
|
|
|
|
|
SCM_UNDEFINED),
|
|
|
|
|
|
SCM_EOL));
|
|
|
|
|
|
return scm_string_to_obarray_symbol (obarray, new, SCM_BOOL_F);
|
|
|
|
|
|
}
|
1999-12-12 02:36:16 +00:00
|
|
|
|
#undef FUNC_NAME
|
* __scm.h, alist.c, alist.h, append.c, append.h, appinit.c,
arbiters.c, arbiters.h, async.c, async.h, boolean.c, boolean.h,
chars.c, chars.h, continuations.c, continuations.h, debug.c,
debug.h, dynwind.c, dynwind.h, eq.c, eq.h, error.c, eval.c,
eval.h, extchrs.c, extchrs.h, fdsocket.c, fdsocket.h, filesys.c,
filesys.h, fports.c, fports.h, gc.c, gdb_interface.h, gdbint.c,
gdbint.h, genio.c, genio.h, gscm.c, gscm.h, gsubr.c, gsubr.h,
hash.c, hash.h, hashtab.c, hashtab.h, init.c, ioext.c, ioext.h,
kw.c, kw.h, libguile.h, mallocs.c, mallocs.h, markers.c,
markers.h, mbstrings.c, mbstrings.h, numbers.c, numbers.h,
objprop.c, objprop.h, options.c, options.h, pairs.c, pairs.h,
ports.c, ports.h, posix.c, posix.h, print.c, print.h, procprop.c,
procprop.h, procs.c, procs.h, ramap.c, ramap.h, read.c, read.h,
root.c, scmsigs.c, scmsigs.h, sequences.c, sequences.h, simpos.c,
simpos.h, smob.c, socket.c, socket.h, srcprop.c, srcprop.h,
stackchk.c, stackchk.h, stime.c, stime.h, strings.c, strings.h,
strop.c, strop.h, strorder.c, strorder.h, strports.c, strports.h,
struct.c, struct.h, symbols.c, symbols.h, tag.c, tag.h, unif.c,
unif.h, variable.c, variable.h, vectors.c, vectors.h, version.c,
version.h, vports.c, vports.h, weaks.c, weaks.h: Use SCM_P to
declare functions with prototypes. (Patch thanks to Marius
Vollmer.)
1996-10-14 01:33:50 +00:00
|
|
|
|
|
1996-07-25 22:56:11 +00:00
|
|
|
|
void
|
|
|
|
|
|
scm_init_symbols ()
|
|
|
|
|
|
{
|
1997-09-01 22:28:49 +00:00
|
|
|
|
gensym_counter = 0;
|
|
|
|
|
|
gensym_prefix = scm_permanent_object (scm_makfrom0str ("%%gensym"));
|
2000-04-21 14:16:44 +00:00
|
|
|
|
#include "libguile/symbols.x"
|
1996-07-25 22:56:11 +00:00
|
|
|
|
}
|
2000-03-19 19:01:16 +00:00
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
|
Local Variables:
|
|
|
|
|
|
c-file-style: "gnu"
|
|
|
|
|
|
End:
|
|
|
|
|
|
*/
|