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"
|
2000-12-12 13:57:26 +00:00
|
|
|
|
#include "libguile/hash.h"
|
2000-09-10 22:22:36 +00:00
|
|
|
|
#include "libguile/smob.h"
|
2000-04-21 14:16:44 +00:00
|
|
|
|
#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"
|
2001-02-02 04:56:25 +00:00
|
|
|
|
#include "libguile/hashtab.h"
|
2000-04-21 14:16:44 +00:00
|
|
|
|
#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
|
|
|
|
|
|
|
|
|
|
|
2000-12-13 11:38:30 +00:00
|
|
|
|
static SCM symbols;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2000-09-12 12:30:36 +00:00
|
|
|
|
static char *
|
|
|
|
|
|
duplicate_string (const char * src, unsigned long length)
|
|
|
|
|
|
{
|
|
|
|
|
|
char * dst = scm_must_malloc (length + 1, "duplicate_string");
|
2000-09-12 17:00:57 +00:00
|
|
|
|
memcpy (dst, src, length);
|
|
|
|
|
|
dst[length] = 0;
|
2000-09-12 12:30:36 +00:00
|
|
|
|
return dst;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
1996-07-25 22:56:11 +00:00
|
|
|
|
|
|
|
|
|
|
/* {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
|
|
|
|
|
2000-12-12 18:36:35 +00:00
|
|
|
|
SCM
|
|
|
|
|
|
scm_mem2symbol (const char *name, scm_sizet len)
|
|
|
|
|
|
{
|
|
|
|
|
|
scm_sizet raw_hash = scm_string_hash ((const unsigned char *) name, len);
|
2000-12-13 11:38:30 +00:00
|
|
|
|
scm_sizet hash = raw_hash % SCM_VECTOR_LENGTH (symbols);
|
2000-12-12 18:36:35 +00:00
|
|
|
|
|
|
|
|
|
|
{
|
2000-12-13 11:38:30 +00:00
|
|
|
|
/* Try to find the symbol in the symbols table */
|
2000-12-12 18:36:35 +00:00
|
|
|
|
|
|
|
|
|
|
SCM l;
|
|
|
|
|
|
|
2000-12-13 11:38:30 +00:00
|
|
|
|
for (l = SCM_VELTS (symbols) [hash]; !SCM_NULLP (l); l = SCM_CDR (l))
|
2000-12-12 18:36:35 +00:00
|
|
|
|
{
|
|
|
|
|
|
SCM sym = SCM_CAAR (l);
|
|
|
|
|
|
if (SCM_SYMBOL_HASH (sym) == raw_hash && SCM_SYMBOL_LENGTH (sym) == len)
|
|
|
|
|
|
{
|
|
|
|
|
|
char *chrs = SCM_SYMBOL_CHARS (sym);
|
|
|
|
|
|
scm_sizet i = len;
|
|
|
|
|
|
|
|
|
|
|
|
while (i != 0)
|
|
|
|
|
|
{
|
|
|
|
|
|
--i;
|
|
|
|
|
|
if (name[i] != chrs[i])
|
|
|
|
|
|
goto next_symbol;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
return sym;
|
|
|
|
|
|
}
|
|
|
|
|
|
next_symbol:
|
2001-02-15 15:39:49 +00:00
|
|
|
|
;
|
2000-12-12 18:36:35 +00:00
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
/* The symbol was not found - create it. */
|
|
|
|
|
|
|
|
|
|
|
|
SCM symbol;
|
|
|
|
|
|
SCM cell;
|
|
|
|
|
|
SCM slot;
|
|
|
|
|
|
|
|
|
|
|
|
SCM_NEWCELL2 (symbol);
|
|
|
|
|
|
SCM_SET_SYMBOL_CHARS (symbol, duplicate_string (name, len));
|
|
|
|
|
|
SCM_SET_SYMBOL_HASH (symbol, raw_hash);
|
|
|
|
|
|
SCM_SET_PROP_SLOTS (symbol, scm_cons (SCM_BOOL_F, SCM_EOL));
|
|
|
|
|
|
SCM_SET_SYMBOL_LENGTH (symbol, (long) len);
|
|
|
|
|
|
|
|
|
|
|
|
cell = scm_cons (symbol, SCM_UNDEFINED);
|
2000-12-13 11:38:30 +00:00
|
|
|
|
slot = SCM_VELTS (symbols) [hash];
|
|
|
|
|
|
SCM_VELTS (symbols) [hash] = scm_cons (cell, slot);
|
2000-12-12 18:36:35 +00:00
|
|
|
|
|
|
|
|
|
|
return symbol;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
SCM
|
|
|
|
|
|
scm_str2symbol (const char *str)
|
|
|
|
|
|
{
|
|
|
|
|
|
return scm_mem2symbol (str, strlen (str));
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
1996-07-25 22:56:11 +00:00
|
|
|
|
/* 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)
|
2001-03-04 22:48:13 +00:00
|
|
|
|
#define FUNC_NAME "scm_sym2vcell"
|
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;
|
|
|
|
|
|
|
2000-09-10 22:22:36 +00:00
|
|
|
|
if (SCM_EVAL_CLOSURE_P (thunk))
|
2000-06-04 01:30:23 +00:00
|
|
|
|
/* Bypass evaluator in the standard case. */
|
2000-09-10 22:22:36 +00:00
|
|
|
|
var = scm_eval_closure_lookup (thunk, sym, definep);
|
2000-06-04 01:30:23 +00:00
|
|
|
|
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;
|
2000-12-08 13:41:56 +00:00
|
|
|
|
else if (SCM_VARIABLEP (var))
|
|
|
|
|
|
return SCM_VARVCELL (var);
|
1996-07-25 22:56:11 +00:00
|
|
|
|
else
|
2001-03-04 22:48:13 +00:00
|
|
|
|
SCM_MISC_ERROR ("strangely interned symbol: ~S", SCM_LIST1 (sym));
|
1996-07-25 22:56:11 +00:00
|
|
|
|
}
|
|
|
|
|
|
else
|
|
|
|
|
|
{
|
|
|
|
|
|
SCM lsym;
|
2000-12-12 18:36:35 +00:00
|
|
|
|
scm_sizet hash;
|
1996-07-25 22:56:11 +00:00
|
|
|
|
|
|
|
|
|
|
SCM_DEFER_INTS;
|
2000-12-12 18:36:35 +00:00
|
|
|
|
hash = SCM_SYMBOL_HASH (sym) % SCM_VECTOR_LENGTH (scm_symhash);
|
|
|
|
|
|
for (lsym = SCM_VELTS (scm_symhash)[hash]; SCM_NIMP (lsym); lsym = SCM_CDR (lsym))
|
1996-07-25 22:56:11 +00:00
|
|
|
|
{
|
2000-12-08 13:41:56 +00:00
|
|
|
|
SCM 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;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2000-12-12 18:36:35 +00:00
|
|
|
|
if (!SCM_FALSEP (definep))
|
1996-07-25 22:56:11 +00:00
|
|
|
|
{
|
2000-12-12 18:36:35 +00:00
|
|
|
|
SCM cell = scm_cons (sym, SCM_UNDEFINED);
|
|
|
|
|
|
SCM slot = SCM_VELTS (scm_symhash) [hash];
|
|
|
|
|
|
|
|
|
|
|
|
SCM_VELTS (scm_symhash) [hash] = scm_cons (cell, slot);
|
|
|
|
|
|
|
|
|
|
|
|
SCM_ALLOW_INTS;
|
|
|
|
|
|
return cell;
|
|
|
|
|
|
}
|
|
|
|
|
|
else
|
|
|
|
|
|
{
|
|
|
|
|
|
SCM_ALLOW_INTS;
|
|
|
|
|
|
return SCM_BOOL_F;
|
1996-07-25 22:56:11 +00:00
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
2001-03-04 22:48:13 +00:00
|
|
|
|
#undef FUNC_NAME
|
|
|
|
|
|
|
1996-07-25 22:56:11 +00:00
|
|
|
|
|
|
|
|
|
|
/* 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;
|
2000-11-01 16:59:45 +00:00
|
|
|
|
scm_sizet hash = SCM_SYMBOL_HASH (sym) % SCM_VECTOR_LENGTH (obarray);
|
1996-07-25 22:56:11 +00:00
|
|
|
|
SCM_REDEFER_INTS;
|
2000-09-12 12:30:36 +00:00
|
|
|
|
for (lsym = SCM_VELTS (obarray)[hash];
|
1996-07-25 22:56:11 +00:00
|
|
|
|
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)
|
2001-03-04 22:48:13 +00:00
|
|
|
|
#define FUNC_NAME "scm_sym2ovcell"
|
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;
|
2001-03-04 22:48:13 +00:00
|
|
|
|
SCM_MISC_ERROR ("uninterned symbol: ~S", SCM_LIST1 (sym));
|
1996-07-25 22:56:11 +00:00
|
|
|
|
return SCM_UNSPECIFIED; /* not reached */
|
|
|
|
|
|
}
|
2001-03-04 22:48:13 +00:00
|
|
|
|
#undef FUNC_NAME
|
|
|
|
|
|
|
1996-07-25 22:56:11 +00:00
|
|
|
|
|
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
|
2000-12-12 18:36:35 +00:00
|
|
|
|
return (SYMBOL . SCM_UNDEFINED). */
|
1996-10-11 07:57:35 +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
|
2000-09-12 12:30:36 +00:00
|
|
|
|
scm_intern_obarray_soft (const char *name,scm_sizet len,SCM obarray,unsigned int softness)
|
1996-07-25 22:56:11 +00:00
|
|
|
|
{
|
2000-12-12 18:36:35 +00:00
|
|
|
|
SCM symbol = scm_mem2symbol (name, len);
|
|
|
|
|
|
scm_sizet raw_hash = SCM_SYMBOL_HASH (symbol);
|
2000-09-12 12:30:36 +00:00
|
|
|
|
scm_sizet hash;
|
1996-07-25 22:56:11 +00:00
|
|
|
|
SCM lsym;
|
|
|
|
|
|
|
2000-04-11 13:45:01 +00:00
|
|
|
|
if (SCM_FALSEP (obarray))
|
1996-07-25 22:56:11 +00:00
|
|
|
|
{
|
2000-12-12 18:36:35 +00:00
|
|
|
|
if (softness)
|
|
|
|
|
|
return SCM_BOOL_F;
|
|
|
|
|
|
else
|
|
|
|
|
|
return scm_cons (symbol, SCM_UNDEFINED);
|
1996-07-25 22:56:11 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
2000-10-09 16:27:24 +00:00
|
|
|
|
hash = raw_hash % SCM_VECTOR_LENGTH (obarray);
|
1996-07-25 22:56:11 +00:00
|
|
|
|
|
2000-09-12 12:30:36 +00:00
|
|
|
|
for (lsym = SCM_VELTS (obarray)[hash]; SCM_NIMP (lsym); lsym = SCM_CDR (lsym))
|
1996-07-25 22:56:11 +00:00
|
|
|
|
{
|
2000-09-12 12:30:36 +00:00
|
|
|
|
SCM a = SCM_CAR (lsym);
|
|
|
|
|
|
SCM z = SCM_CAR (a);
|
2000-12-12 18:36:35 +00:00
|
|
|
|
if (SCM_EQ_P (z, symbol))
|
1996-07-25 22:56:11 +00:00
|
|
|
|
return a;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if (softness)
|
|
|
|
|
|
{
|
|
|
|
|
|
return SCM_BOOL_F;
|
|
|
|
|
|
}
|
|
|
|
|
|
else
|
|
|
|
|
|
{
|
2000-12-12 18:36:35 +00:00
|
|
|
|
SCM cell = scm_cons (symbol, SCM_UNDEFINED);
|
|
|
|
|
|
SCM slot = SCM_VELTS (obarray) [hash];
|
2000-12-08 16:32:36 +00:00
|
|
|
|
|
2000-12-12 18:36:35 +00:00
|
|
|
|
SCM_VELTS (obarray) [hash] = scm_cons (cell, slot);
|
2000-12-08 16:32:36 +00:00
|
|
|
|
|
2000-12-12 18:36:35 +00:00
|
|
|
|
return cell;
|
|
|
|
|
|
}
|
2000-12-08 16:32:36 +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
|
|
|
|
{
|
2000-12-12 18:36:35 +00:00
|
|
|
|
scm_sizet len = strlen (name);
|
1996-07-25 22:56:11 +00:00
|
|
|
|
SCM easy_answer;
|
|
|
|
|
|
SCM_DEFER_INTS;
|
2000-12-12 18:36:35 +00:00
|
|
|
|
easy_answer = scm_intern_obarray_soft (name, len, scm_symhash, 1);
|
1996-07-25 22:56:11 +00:00
|
|
|
|
if (SCM_NIMP (easy_answer))
|
|
|
|
|
|
{
|
|
|
|
|
|
SCM_ALLOW_INTS;
|
|
|
|
|
|
return easy_answer;
|
|
|
|
|
|
}
|
|
|
|
|
|
else
|
|
|
|
|
|
{
|
2000-12-12 18:36:35 +00:00
|
|
|
|
SCM symbol = scm_mem2symbol (name, len);
|
|
|
|
|
|
scm_sizet raw_hash = SCM_SYMBOL_HASH (symbol);
|
2000-12-08 13:41:56 +00:00
|
|
|
|
scm_sizet hash = raw_hash % SCM_VECTOR_LENGTH (scm_symhash);
|
2000-12-12 18:36:35 +00:00
|
|
|
|
SCM cell = scm_cons (symbol, SCM_UNDEFINED);
|
|
|
|
|
|
SCM slot = SCM_VELTS (scm_symhash) [hash];
|
2000-09-12 12:30:36 +00:00
|
|
|
|
|
2000-12-12 18:36:35 +00:00
|
|
|
|
SCM_VELTS (scm_symhash) [hash] = scm_cons (cell, slot);
|
1996-07-25 22:56:11 +00:00
|
|
|
|
SCM_ALLOW_INTS;
|
2000-12-12 18:36:35 +00:00
|
|
|
|
return cell;
|
1996-07-25 22:56:11 +00:00
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
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
|
|
|
|
{
|
2000-12-08 17:08:34 +00:00
|
|
|
|
SCM sym = scm_str2symbol (name);
|
1997-01-18 11:49:35 +00:00
|
|
|
|
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. */
|
2000-12-12 18:36:35 +00:00
|
|
|
|
SCM symbol = scm_str2symbol (name);
|
|
|
|
|
|
SCM vcell = scm_sym2vcell (symbol, SCM_TOP_LEVEL_LOOKUP_CLOSURE, SCM_BOOL_F);
|
1997-02-26 12:08:26 +00:00
|
|
|
|
if (SCM_FALSEP (vcell))
|
|
|
|
|
|
return SCM_UNDEFINED;
|
|
|
|
|
|
return SCM_CDR (vcell);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2000-12-13 11:38:30 +00:00
|
|
|
|
|
2000-01-05 19:25:37 +00:00
|
|
|
|
SCM_DEFINE (scm_symbol_p, "symbol?", 1, 0, 0,
|
2000-09-12 12:50:13 +00:00
|
|
|
|
(SCM obj),
|
* vectors.c (s_scm_vector_p, list->vector, scm_vector)
(scm_vector_ref, scm_vector_set_x, scm_vector_to_list)
(scm_vector_fill_x), strorder.c (scm_string_equal_p)
(scm_string_ci_equal_p, scm_string_less_p, scm_string_leq_p)
(scm_string_gr_p, scm_string_geq_p, scm_string_ci_less_p)
(scm_string_ci_geq_p), symbols.c (scm_symbol_p)
(scm_symbol_to_string, scm_string_to_symbol): Changed use of @t{}
to @code{} as the texinfo manual recommends, converted the
examples to use a @lisp{}-environment.
* strports.c (scm_eval_string): Cleaned up the docstring.
* struct.c (scm_struct_p, scm_struct_vtable_p): Added texinfo
markup.
* numbers.c (scm_exact_p, scm_odd_p, scm_even_p)
(scm_number_to_string, scm_string_to_number, scm_number_p)
(scm_real_p, scm_integer_p, scm_inexact_p, scm_make_rectangular)
(scm_make_polar, scm_inexact_to_exact): Added texinfo markup.
(scm_ash): Added texinfo markup and removed obsolete @refill.
(scm_gr_p): Corrected comment.
(scm_gr_p, scm_leq_p, scm_geq_p): Added texinfo markup to (future
docstring) comments.
(scm_positive_p, scm_less_p, scm_num_eq_p, scm_real_p)
(scm_number_p, scm_negative_p, scm_max, scm_min, scm_sum)
(scm_difference, scm_product, scm_divide, scm_asinh, scm_acosh)
(scm_atanh, scm_truncate, scm_round, scm_exact_to_inexact)
(floor, ceiling, $sqrt, $abs, $exp, $log, $sin, $cos, $tan, $asin)
($acos, $atan, $sinh, $cosh, $tanh, scm_real_part, scm_imag_part)
(scm_magnitude, scm_angle, scm_abs, scm_quotient, scm_remainder)
(scm_modulo, scm_gcd, scm_lcm): Added (future docstring) comments.
2001-03-02 09:07:22 +00:00
|
|
|
|
"Returns @code{#t} if @var{obj} is a symbol, otherwise returns\n"
|
|
|
|
|
|
"@code{#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-09-12 12:50:13 +00:00
|
|
|
|
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),
|
* vectors.c (s_scm_vector_p, list->vector, scm_vector)
(scm_vector_ref, scm_vector_set_x, scm_vector_to_list)
(scm_vector_fill_x), strorder.c (scm_string_equal_p)
(scm_string_ci_equal_p, scm_string_less_p, scm_string_leq_p)
(scm_string_gr_p, scm_string_geq_p, scm_string_ci_less_p)
(scm_string_ci_geq_p), symbols.c (scm_symbol_p)
(scm_symbol_to_string, scm_string_to_symbol): Changed use of @t{}
to @code{} as the texinfo manual recommends, converted the
examples to use a @lisp{}-environment.
* strports.c (scm_eval_string): Cleaned up the docstring.
* struct.c (scm_struct_p, scm_struct_vtable_p): Added texinfo
markup.
* numbers.c (scm_exact_p, scm_odd_p, scm_even_p)
(scm_number_to_string, scm_string_to_number, scm_number_p)
(scm_real_p, scm_integer_p, scm_inexact_p, scm_make_rectangular)
(scm_make_polar, scm_inexact_to_exact): Added texinfo markup.
(scm_ash): Added texinfo markup and removed obsolete @refill.
(scm_gr_p): Corrected comment.
(scm_gr_p, scm_leq_p, scm_geq_p): Added texinfo markup to (future
docstring) comments.
(scm_positive_p, scm_less_p, scm_num_eq_p, scm_real_p)
(scm_number_p, scm_negative_p, scm_max, scm_min, scm_sum)
(scm_difference, scm_product, scm_divide, scm_asinh, scm_acosh)
(scm_atanh, scm_truncate, scm_round, scm_exact_to_inexact)
(floor, ceiling, $sqrt, $abs, $exp, $log, $sin, $cos, $tan, $asin)
($acos, $atan, $sinh, $cosh, $tanh, scm_real_part, scm_imag_part)
(scm_magnitude, scm_angle, scm_abs, scm_quotient, scm_remainder)
(scm_modulo, scm_gcd, scm_lcm): Added (future docstring) comments.
2001-03-02 09:07:22 +00:00
|
|
|
|
"Returns the name of @var{symbol} as a string. If the symbol\n"
|
|
|
|
|
|
"was part of an object returned as the value of a literal\n"
|
|
|
|
|
|
"expression (section @pxref{Literal expressions,,,r4rs, The\n"
|
|
|
|
|
|
"Revised^4 Report on Scheme}) or by a call to the @code{read}\n"
|
|
|
|
|
|
"procedure, and its name contains alphabetic characters, then\n"
|
|
|
|
|
|
"the string returned will contain characters in the\n"
|
|
|
|
|
|
"implementation's preferred standard case---some implementations\n"
|
|
|
|
|
|
"will prefer upper case, others lower case. If the symbol was\n"
|
|
|
|
|
|
"returned by @code{string->symbol}, the case of characters in\n"
|
|
|
|
|
|
"the string returned will be the same as the case in the string\n"
|
|
|
|
|
|
"that was passed to @code{string->symbol}. It is an error to\n"
|
|
|
|
|
|
"apply mutation procedures like @code{string-set!} to strings\n"
|
|
|
|
|
|
"returned by this procedure. (r5rs)\n\n"
|
|
|
|
|
|
"The following examples assume that the implementation's\n"
|
|
|
|
|
|
"standard case is lower case:\n\n"
|
|
|
|
|
|
"@lisp\n"
|
|
|
|
|
|
"(symbol->string 'flying-fish) @result{} \"flying-fish\"\n"
|
|
|
|
|
|
"(symbol->string 'Martin) @result{} \"martin\"\n"
|
2000-01-27 18:15:56 +00:00
|
|
|
|
"(symbol->string\n"
|
* vectors.c (s_scm_vector_p, list->vector, scm_vector)
(scm_vector_ref, scm_vector_set_x, scm_vector_to_list)
(scm_vector_fill_x), strorder.c (scm_string_equal_p)
(scm_string_ci_equal_p, scm_string_less_p, scm_string_leq_p)
(scm_string_gr_p, scm_string_geq_p, scm_string_ci_less_p)
(scm_string_ci_geq_p), symbols.c (scm_symbol_p)
(scm_symbol_to_string, scm_string_to_symbol): Changed use of @t{}
to @code{} as the texinfo manual recommends, converted the
examples to use a @lisp{}-environment.
* strports.c (scm_eval_string): Cleaned up the docstring.
* struct.c (scm_struct_p, scm_struct_vtable_p): Added texinfo
markup.
* numbers.c (scm_exact_p, scm_odd_p, scm_even_p)
(scm_number_to_string, scm_string_to_number, scm_number_p)
(scm_real_p, scm_integer_p, scm_inexact_p, scm_make_rectangular)
(scm_make_polar, scm_inexact_to_exact): Added texinfo markup.
(scm_ash): Added texinfo markup and removed obsolete @refill.
(scm_gr_p): Corrected comment.
(scm_gr_p, scm_leq_p, scm_geq_p): Added texinfo markup to (future
docstring) comments.
(scm_positive_p, scm_less_p, scm_num_eq_p, scm_real_p)
(scm_number_p, scm_negative_p, scm_max, scm_min, scm_sum)
(scm_difference, scm_product, scm_divide, scm_asinh, scm_acosh)
(scm_atanh, scm_truncate, scm_round, scm_exact_to_inexact)
(floor, ceiling, $sqrt, $abs, $exp, $log, $sin, $cos, $tan, $asin)
($acos, $atan, $sinh, $cosh, $tanh, scm_real_part, scm_imag_part)
(scm_magnitude, scm_angle, scm_abs, scm_quotient, scm_remainder)
(scm_modulo, scm_gcd, scm_lcm): Added (future docstring) comments.
2001-03-02 09:07:22 +00:00
|
|
|
|
" (string->symbol \"Malvina\")) @result{} \"Malvina\"\n"
|
|
|
|
|
|
"@end lisp")
|
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-09-12 12:30:36 +00:00
|
|
|
|
SCM_VALIDATE_SYMBOL (1, s);
|
2000-10-09 16:27:24 +00:00
|
|
|
|
return scm_makfromstr (SCM_SYMBOL_CHARS (s), SCM_SYMBOL_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),
|
* vectors.c (s_scm_vector_p, list->vector, scm_vector)
(scm_vector_ref, scm_vector_set_x, scm_vector_to_list)
(scm_vector_fill_x), strorder.c (scm_string_equal_p)
(scm_string_ci_equal_p, scm_string_less_p, scm_string_leq_p)
(scm_string_gr_p, scm_string_geq_p, scm_string_ci_less_p)
(scm_string_ci_geq_p), symbols.c (scm_symbol_p)
(scm_symbol_to_string, scm_string_to_symbol): Changed use of @t{}
to @code{} as the texinfo manual recommends, converted the
examples to use a @lisp{}-environment.
* strports.c (scm_eval_string): Cleaned up the docstring.
* struct.c (scm_struct_p, scm_struct_vtable_p): Added texinfo
markup.
* numbers.c (scm_exact_p, scm_odd_p, scm_even_p)
(scm_number_to_string, scm_string_to_number, scm_number_p)
(scm_real_p, scm_integer_p, scm_inexact_p, scm_make_rectangular)
(scm_make_polar, scm_inexact_to_exact): Added texinfo markup.
(scm_ash): Added texinfo markup and removed obsolete @refill.
(scm_gr_p): Corrected comment.
(scm_gr_p, scm_leq_p, scm_geq_p): Added texinfo markup to (future
docstring) comments.
(scm_positive_p, scm_less_p, scm_num_eq_p, scm_real_p)
(scm_number_p, scm_negative_p, scm_max, scm_min, scm_sum)
(scm_difference, scm_product, scm_divide, scm_asinh, scm_acosh)
(scm_atanh, scm_truncate, scm_round, scm_exact_to_inexact)
(floor, ceiling, $sqrt, $abs, $exp, $log, $sin, $cos, $tan, $asin)
($acos, $atan, $sinh, $cosh, $tanh, scm_real_part, scm_imag_part)
(scm_magnitude, scm_angle, scm_abs, scm_quotient, scm_remainder)
(scm_modulo, scm_gcd, scm_lcm): Added (future docstring) comments.
2001-03-02 09:07:22 +00:00
|
|
|
|
"Returns the symbol whose name is @var{string}. This procedure\n"
|
|
|
|
|
|
"can create symbols with names containing special characters or\n"
|
|
|
|
|
|
"letters in the non-standard case, but it is usually a bad idea\n"
|
|
|
|
|
|
"to create such because in some implementations of Scheme they\n"
|
|
|
|
|
|
"cannot be read as themselves. See @code{symbol->string}.\n\n"
|
|
|
|
|
|
"The following examples assume that the implementation's\n"
|
|
|
|
|
|
"standard case is lower case:\n\n"
|
|
|
|
|
|
"@lisp\n"
|
|
|
|
|
|
"(eq? 'mISSISSIppi 'mississippi) @result{} #t\n"
|
|
|
|
|
|
"(string->symbol \"mISSISSIppi\") @result{} @r{the symbol with name \"mISSISSIppi\"}\n"
|
|
|
|
|
|
"(eq? 'bitBlt (string->symbol \"bitBlt\")) @result{} #f\n"
|
|
|
|
|
|
"(eq? 'JollyWog\n"
|
|
|
|
|
|
" (string->symbol (symbol->string 'JollyWog))) @result{} #t\n"
|
|
|
|
|
|
"(string=? \"K. Harper, M.D.\"\n"
|
|
|
|
|
|
" (symbol->string\n"
|
|
|
|
|
|
" (string->symbol \"K. Harper, M.D.\"))) @result{}#t\n"
|
|
|
|
|
|
"@end lisp")
|
1999-12-12 02:36:16 +00:00
|
|
|
|
#define FUNC_NAME s_scm_string_to_symbol
|
1996-07-25 22:56:11 +00:00
|
|
|
|
{
|
2000-12-08 17:08:34 +00:00
|
|
|
|
SCM_VALIDATE_STRING (1, s);
|
|
|
|
|
|
return scm_mem2symbol (SCM_STRING_CHARS (s), SCM_STRING_LENGTH (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
|
|
|
|
|
|
|
|
|
|
|
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-10-30 11:42:26 +00:00
|
|
|
|
SCM_VALIDATE_STRING (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;
|
|
|
|
|
|
|
2000-11-22 11:20:03 +00:00
|
|
|
|
vcell = scm_intern_obarray_soft (SCM_STRING_CHARS(s),
|
2000-10-30 11:42:26 +00:00
|
|
|
|
SCM_STRING_LENGTH (s),
|
1996-10-14 03:27:11 +00:00
|
|
|
|
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);
|
2000-11-01 16:59:45 +00:00
|
|
|
|
hval = SCM_SYMBOL_HASH (s) % SCM_VECTOR_LENGTH (o);
|
1996-10-14 03:27:11 +00:00
|
|
|
|
/* 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);
|
2000-11-01 16:59:45 +00:00
|
|
|
|
hval = SCM_SYMBOL_HASH (s) % SCM_VECTOR_LENGTH (o);
|
1996-10-14 03:27:11 +00:00
|
|
|
|
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);
|
|
|
|
|
|
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"
|
2001-01-16 11:19:36 +00:00
|
|
|
|
"@var{symbol-interned?} in that the mere mention of a symbol usually causes\n"
|
* 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
|
|
|
|
"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
|
|
|
|
|
|
|
|
|
|
|
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
|
|
|
|
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
|
|
|
|
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);
|
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;
|
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,
|
2000-09-12 12:30:36 +00:00
|
|
|
|
(SCM symbol),
|
|
|
|
|
|
"Return a hash value for @var{symbol}.")
|
1999-12-12 02:36:16 +00:00
|
|
|
|
#define FUNC_NAME s_scm_symbol_hash
|
1996-07-25 22:56:11 +00:00
|
|
|
|
{
|
2000-09-12 12:30:36 +00:00
|
|
|
|
SCM_VALIDATE_SYMBOL (1, symbol);
|
|
|
|
|
|
return SCM_MAKINUM (SCM_SYMBOL_HASH (symbol));
|
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;
|
2000-10-09 16:27:24 +00:00
|
|
|
|
int length = SCM_VECTOR_LENGTH (from);
|
1997-03-05 22:49:12 +00:00
|
|
|
|
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
|
|
|
|
{
|
2000-10-09 16:27:24 +00:00
|
|
|
|
int length = SCM_VECTOR_LENGTH (scm_symhash);
|
2001-02-02 04:56:25 +00:00
|
|
|
|
SCM obarray = scm_c_make_hash_table (length);
|
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-09-12 05:44:00 +00:00
|
|
|
|
#define MAX_PREFIX_LENGTH 30
|
|
|
|
|
|
|
1997-09-01 22:28:49 +00:00
|
|
|
|
static int gensym_counter;
|
2000-09-12 05:44:00 +00:00
|
|
|
|
|
|
|
|
|
|
SCM_DEFINE (scm_gensym, "gensym", 0, 1, 0,
|
|
|
|
|
|
(SCM prefix),
|
2001-02-17 11:26:26 +00:00
|
|
|
|
"Create a new symbol with a name constructed from a prefix and\n"
|
|
|
|
|
|
"a counter value. The string @var{prefix} can be specified as\n"
|
|
|
|
|
|
"an optional argument. Default prefix is @code{g}. The counter\n"
|
|
|
|
|
|
"is increased by 1 at each call. There is no provision for\n"
|
|
|
|
|
|
"resetting the counter.")
|
1999-12-12 02:36:16 +00:00
|
|
|
|
#define FUNC_NAME s_scm_gensym
|
1997-09-01 22:28:49 +00:00
|
|
|
|
{
|
2000-09-12 05:44:00 +00:00
|
|
|
|
char buf[MAX_PREFIX_LENGTH + SCM_INTBUFLEN];
|
|
|
|
|
|
char *name = buf;
|
|
|
|
|
|
int len;
|
|
|
|
|
|
if (SCM_UNBNDP (prefix))
|
|
|
|
|
|
{
|
|
|
|
|
|
name[0] = 'g';
|
|
|
|
|
|
len = 1;
|
|
|
|
|
|
}
|
1997-09-01 22:28:49 +00:00
|
|
|
|
else
|
2000-09-10 19:10:10 +00:00
|
|
|
|
{
|
2000-10-25 11:01:03 +00:00
|
|
|
|
SCM_VALIDATE_STRING (1, prefix);
|
|
|
|
|
|
len = SCM_STRING_LENGTH (prefix);
|
2000-09-12 05:44:00 +00:00
|
|
|
|
if (len > MAX_PREFIX_LENGTH)
|
|
|
|
|
|
name = SCM_MUST_MALLOC (MAX_PREFIX_LENGTH + SCM_INTBUFLEN);
|
2000-11-22 11:20:03 +00:00
|
|
|
|
strncpy (name, SCM_STRING_CHARS (prefix), len);
|
2000-09-10 19:10:10 +00:00
|
|
|
|
}
|
2000-09-12 05:44:00 +00:00
|
|
|
|
{
|
|
|
|
|
|
int n_digits = scm_iint2str (gensym_counter++, 10, &name[len]);
|
2000-12-08 17:08:34 +00:00
|
|
|
|
SCM res = scm_mem2symbol (name, len + n_digits);
|
2000-09-12 05:44:00 +00:00
|
|
|
|
if (name != buf)
|
|
|
|
|
|
scm_must_free (name);
|
|
|
|
|
|
return res;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
#undef FUNC_NAME
|
1999-12-12 02:36:16 +00:00
|
|
|
|
|
2000-09-12 05:44:00 +00:00
|
|
|
|
static int gentemp_counter;
|
|
|
|
|
|
|
|
|
|
|
|
SCM_DEFINE (scm_gentemp, "gentemp", 0, 2, 0,
|
|
|
|
|
|
(SCM prefix, SCM obarray),
|
|
|
|
|
|
"Create a new symbol with a name unique in an obarray.\n"
|
2001-02-17 11:26:26 +00:00
|
|
|
|
"The name is constructed from an optional string @var{prefix}\n"
|
|
|
|
|
|
"and a counter value. The default prefix is @code{t}. The\n"
|
|
|
|
|
|
"@var{obarray} is specified as a second optional argument.\n"
|
|
|
|
|
|
"Default is the system obarray where all normal symbols are\n"
|
|
|
|
|
|
"interned. The counter is increased by 1 at each\n"
|
2000-09-12 05:44:00 +00:00
|
|
|
|
"call. There is no provision for resetting the counter.")
|
|
|
|
|
|
#define FUNC_NAME s_scm_gentemp
|
|
|
|
|
|
{
|
|
|
|
|
|
char buf[MAX_PREFIX_LENGTH + SCM_INTBUFLEN];
|
|
|
|
|
|
char *name = buf;
|
|
|
|
|
|
int len, n_digits;
|
|
|
|
|
|
if (SCM_UNBNDP (prefix))
|
|
|
|
|
|
{
|
|
|
|
|
|
name[0] = 't';
|
|
|
|
|
|
len = 1;
|
|
|
|
|
|
}
|
|
|
|
|
|
else
|
1997-09-01 22:28:49 +00:00
|
|
|
|
{
|
2000-10-25 11:01:03 +00:00
|
|
|
|
SCM_VALIDATE_STRING (1, prefix);
|
|
|
|
|
|
len = SCM_STRING_LENGTH (prefix);
|
2000-09-12 05:44:00 +00:00
|
|
|
|
if (len > MAX_PREFIX_LENGTH)
|
|
|
|
|
|
name = SCM_MUST_MALLOC (MAX_PREFIX_LENGTH + SCM_INTBUFLEN);
|
2000-11-22 11:20:03 +00:00
|
|
|
|
strncpy (name, SCM_STRING_CHARS (prefix), len);
|
1997-09-01 22:28:49 +00:00
|
|
|
|
}
|
2000-09-12 05:44:00 +00:00
|
|
|
|
|
|
|
|
|
|
if (SCM_UNBNDP (obarray))
|
|
|
|
|
|
obarray = scm_symhash;
|
1997-09-01 22:28:49 +00:00
|
|
|
|
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-09-12 05:44:00 +00:00
|
|
|
|
do
|
|
|
|
|
|
n_digits = scm_iint2str (gentemp_counter++, 10, &name[len]);
|
|
|
|
|
|
while (!SCM_FALSEP (scm_intern_obarray_soft (name,
|
|
|
|
|
|
len + n_digits,
|
|
|
|
|
|
obarray,
|
|
|
|
|
|
1)));
|
|
|
|
|
|
{
|
|
|
|
|
|
SCM vcell = scm_intern_obarray_soft (name,
|
|
|
|
|
|
len + n_digits,
|
|
|
|
|
|
obarray,
|
|
|
|
|
|
0);
|
|
|
|
|
|
if (name != buf)
|
|
|
|
|
|
scm_must_free (name);
|
|
|
|
|
|
return SCM_CAR (vcell);
|
|
|
|
|
|
}
|
1997-09-01 22:28:49 +00:00
|
|
|
|
}
|
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
|
|
|
|
|
2000-12-13 11:38:30 +00:00
|
|
|
|
|
|
|
|
|
|
void
|
|
|
|
|
|
scm_symbols_prehistory ()
|
|
|
|
|
|
{
|
|
|
|
|
|
symbols = scm_make_weak_key_hash_table (SCM_MAKINUM (277));
|
|
|
|
|
|
scm_permanent_object (symbols);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
1996-07-25 22:56:11 +00:00
|
|
|
|
void
|
|
|
|
|
|
scm_init_symbols ()
|
|
|
|
|
|
{
|
1997-09-01 22:28:49 +00:00
|
|
|
|
gensym_counter = 0;
|
2000-09-12 05:44:00 +00:00
|
|
|
|
gentemp_counter = 0;
|
* alist.c, arbiters.c, async.c, backtrace.c, boolean.c, chars.c,
continuations.c, debug-malloc.c, debug.c, dynl.c, dynwind.c,
environments.c, eq.c, error.c, eval.c, evalext.c, feature.c,
filesys.c, fluids.c, fports.c, gc.c, goops.c, guardians.c, hash.c,
hashtab.c, hooks.c, ioext.c, iselect.c, keywords.c, lang.c,
list.c, load.c, macros.c, modules.c, net_db.c, numbers.c,
objects.c, objprop.c, options.c, pairs.c, ports.c, posix.c,
print.c, procprop.c, procs.c, properties.c, ramap.c, random.c,
read.c, regex-posix.c, root.c, scmsigs.c, script.c, simpos.c,
socket.c, sort.c, srcprop.c, stackchk.c, stacks.c, stime.c,
strings.c, strop.c, strorder.c, strports.c, struct.c, symbols.c,
tag.c, threads.c, throw.c, unif.c, variable.c, vectors.c,
version.c, vports.c, weaks.c: Makes sure the snarfer output
inclusion is disabled when the snarfer is run on the file. Thanks
to Lars J. Aas!
* Makefile.am: Install guile-procedures.txt in version-specific
directory to enable multiple installed guile versions. Suggested
by Karl M. Hegbloom <karlheg@debian.org, patch by Matthias Koeppe.
2000-11-17 16:25:05 +00:00
|
|
|
|
#ifndef SCM_MAGIC_SNARFER
|
2000-04-21 14:16:44 +00:00
|
|
|
|
#include "libguile/symbols.x"
|
* alist.c, arbiters.c, async.c, backtrace.c, boolean.c, chars.c,
continuations.c, debug-malloc.c, debug.c, dynl.c, dynwind.c,
environments.c, eq.c, error.c, eval.c, evalext.c, feature.c,
filesys.c, fluids.c, fports.c, gc.c, goops.c, guardians.c, hash.c,
hashtab.c, hooks.c, ioext.c, iselect.c, keywords.c, lang.c,
list.c, load.c, macros.c, modules.c, net_db.c, numbers.c,
objects.c, objprop.c, options.c, pairs.c, ports.c, posix.c,
print.c, procprop.c, procs.c, properties.c, ramap.c, random.c,
read.c, regex-posix.c, root.c, scmsigs.c, script.c, simpos.c,
socket.c, sort.c, srcprop.c, stackchk.c, stacks.c, stime.c,
strings.c, strop.c, strorder.c, strports.c, struct.c, symbols.c,
tag.c, threads.c, throw.c, unif.c, variable.c, vectors.c,
version.c, vports.c, weaks.c: Makes sure the snarfer output
inclusion is disabled when the snarfer is run on the file. Thanks
to Lars J. Aas!
* Makefile.am: Install guile-procedures.txt in version-specific
directory to enable multiple installed guile versions. Suggested
by Karl M. Hegbloom <karlheg@debian.org, patch by Matthias Koeppe.
2000-11-17 16:25:05 +00:00
|
|
|
|
#endif
|
1996-07-25 22:56:11 +00:00
|
|
|
|
}
|
2000-03-19 19:01:16 +00:00
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
|
Local Variables:
|
|
|
|
|
|
c-file-style: "gnu"
|
|
|
|
|
|
End:
|
|
|
|
|
|
*/
|