From 6812c28f98d9768df0bc84fe0322a05aba093afd Mon Sep 17 00:00:00 2001 From: Thien-Thi Nguyen Date: Tue, 26 Feb 2002 10:06:43 +0000 Subject: [PATCH 001/131] (top_builddir_absolute): New AC_SUBST var. (AC_CONFIG_FILES): Add am/Makefile, pre-inst-guile. (AC_CONFIG_COMMANDS): Also chmod +x pre-inst-guile. --- configure.in | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/configure.in b/configure.in index 671b490ed..8b42424cd 100644 --- a/configure.in +++ b/configure.in @@ -239,7 +239,7 @@ dnl Check for Winsock and other functionality on Win32 (*not* CygWin) dnl EXTRA_DEFS="" if test "$MINGW32" = "yes" ; then - AC_CHECK_HEADER(winsock2.h, [AC_DEFINE([HAVE_WINSOCK2_H], 1, + AC_CHECK_HEADER(winsock2.h, [AC_DEFINE([HAVE_WINSOCK2_H], 1, [Define if you have the header file.])]) AC_CHECK_LIB(ws2_32, main) LIBOBJS="$LIBOBJS win32-uname.o win32-dirent.o" @@ -683,8 +683,13 @@ AC_SUBST(LIBLOBJS) AC_SUBST(EXTRA_DOT_DOC_FILES) AC_SUBST(EXTRA_DOT_X_FILES) +dnl See also top_builddir in info node: (libtool)AC_PROG_LIBTOOL +top_builddir_absolute=`pwd` +AC_SUBST(top_builddir_absolute) + AC_CONFIG_FILES([ Makefile + am/Makefile libguile/Makefile libguile/guile-snarf libguile/guile-doc-snarf @@ -720,7 +725,8 @@ AC_CONFIG_FILES([ examples/safe/Makefile test-suite/Makefile check-guile - guile-tools]) + guile-tools + pre-inst-guile]) AC_CONFIG_COMMANDS(default, [ chmod +x libguile/guile-snarf \ @@ -728,7 +734,8 @@ AC_CONFIG_COMMANDS(default, libguile/guile-func-name-check \ libguile/guile-snarf-docs \ check-guile \ - guile-tools]) + guile-tools \ + pre-inst-guile]) AC_OUTPUT From 22087438a8b32ae3178d9b1a0e6abfdad9167c04 Mon Sep 17 00:00:00 2001 From: Thien-Thi Nguyen Date: Tue, 26 Feb 2002 10:12:06 +0000 Subject: [PATCH 002/131] (top_builddir): Use AC_SUBST var `top_builddir_absolute'. (guile): Look for pre-inst-guile in $top_builddir. --- check-guile.in | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/check-guile.in b/check-guile.in index 547a93753..5b280601d 100644 --- a/check-guile.in +++ b/check-guile.in @@ -12,19 +12,17 @@ set -e # this script runs in the top-level build-dir. -top_builddir=`pwd` +top_builddir=@top_builddir_absolute@ top_srcdir=@top_srcdir@ TEST_SUITE_DIR=${top_srcdir}/test-suite if [ x"$1" = x-i ] ; then guile=$2 - guile_opts= shift shift else - guile=${top_srcdir}/pre-inst-guile - guile_opts="${top_builddir}" + guile=${top_builddir}/pre-inst-guile fi GUILE_LOAD_PATH=$TEST_SUITE_DIR @@ -43,7 +41,7 @@ if [ ! -f guile-procedures.txt ] ; then @LN_S@ libguile/guile-procedures.txt . fi -exec $guile $guile_opts \ +exec $guile \ -e main -s "$TEST_SUITE_DIR/guile-test" \ --test-suite "$TEST_SUITE_DIR/tests" \ --log-file check-guile.log "$@" From 450ca06e8465983dbe11e4bd0a40de6db179a2a9 Mon Sep 17 00:00:00 2001 From: Thien-Thi Nguyen Date: Tue, 26 Feb 2002 10:13:23 +0000 Subject: [PATCH 003/131] (EXTRA_DIST): Remove pre-inst-guile, pre-inst-guile.am. --- Makefile.am | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile.am b/Makefile.am index 99206df0c..ea26d8692 100644 --- a/Makefile.am +++ b/Makefile.am @@ -30,7 +30,7 @@ include_HEADERS = libguile.h # automake sometimes forgets to distribute acconfig.h, # apparently depending on the phase of the moon. EXTRA_DIST = qthreads.m4 HACKING GUILE-VERSION ANON-CVS SNAPSHOTS TODO \ - $(ACLOCAL) acconfig.h BUGS pre-inst-guile pre-inst-guile.am + $(ACLOCAL) acconfig.h BUGS TESTS = check-guile From 931022f87bb3377c321bb2cde8a64fb094d8f6bb Mon Sep 17 00:00:00 2001 From: Thien-Thi Nguyen Date: Tue, 26 Feb 2002 10:16:57 +0000 Subject: [PATCH 004/131] Update usage comment; nfc. --- check-guile.in | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/check-guile.in b/check-guile.in index 5b280601d..9142fcff8 100644 --- a/check-guile.in +++ b/check-guile.in @@ -1,7 +1,7 @@ #! /bin/sh # Usage: check-guile [-i GUILE-INTERPRETER] [GUILE-TEST-ARGS] -# If `-i GUILE-INTERPRETER' is omitted, use ${top_srcdir}/pre-inst-guile. -# See test-suite/guile-test for documentation on GUILE-TEST-ARGS. +# If `-i GUILE-INTERPRETER' is omitted, use ${top_builddir}/pre-inst-guile. +# See ${top_srcdir}/test-suite/guile-test for documentation on GUILE-TEST-ARGS. # # Example invocations: # ./check-guile From 3ed414c87504b6e4d992e4f39cef47f1111e5f73 Mon Sep 17 00:00:00 2001 From: Thien-Thi Nguyen Date: Tue, 26 Feb 2002 10:18:01 +0000 Subject: [PATCH 005/131] *** empty log message *** --- ChangeLog | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/ChangeLog b/ChangeLog index 3f0f22c58..213103986 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,20 @@ +2002-02-26 Thien-Thi Nguyen + + * pre-inst-guile.in: New file. + + * pre-inst-guile, pre-inst-guile.am: bye bye + + * configure.in (top_builddir_absolute): New AC_SUBST var. + (AC_CONFIG_FILES): Add am/Makefile, pre-inst-guile. + (AC_CONFIG_COMMANDS): Also chmod +x pre-inst-guile. + + * check-guile.in (top_builddir): Use AC_SUBST var + `top_builddir_absolute'. + (guile): Look for pre-inst-guile in $top_builddir. + + * Makefile.am (EXTRA_DIST): Remove pre-inst-guile, + pre-inst-guile.am. + 2002-02-24 Rob Browning * GUILE-VERSION: move all but guile-readline library versioning From 03b823a4ae52f53cefe32989876302c774344d9d Mon Sep 17 00:00:00 2001 From: Thien-Thi Nguyen Date: Tue, 26 Feb 2002 10:25:02 +0000 Subject: [PATCH 006/131] Update "include" instructions. --- devel/build/pre-inst-guile.text | 47 --------------------------------- 1 file changed, 47 deletions(-) diff --git a/devel/build/pre-inst-guile.text b/devel/build/pre-inst-guile.text index 5e9a24b37..e69de29bb 100644 --- a/devel/build/pre-inst-guile.text +++ b/devel/build/pre-inst-guile.text @@ -1,47 +0,0 @@ -THEORY - - The pre-installed guile interpreter can be used if has access to - the proper shared libraries and scheme modules, which can be - arranged by tweaking GUILE_LOAD_PATH and LTDL_LIBRARY_PATH env - vars, respectively. - - -GENERAL PRACTICE - - To invoke the guile interpreter before installing it (and its - support files), call ${top_srcdir}/pre-inst-guile w/ first arg - ${top_builddir}, where you would normally call guile. - - Similarly, for scripts/* (normally found by guile-tools), set - env var GUILE to the above combination. - - See commentary in ${top_srcdir}/pre-inst-guile for more info. - - -SPECIFIC PRACTICE - - Include the following line in any Makefile.am with rules that - need to call the pre-installed guile interpreter: - - include $(top_srcdir)/pre-inst-guile.am - - This causes Automake to include a makefile fragment that defines - two vars: `preinstguile' and `preinstguiletool'. The following - examples show how these vars are used: - - display-sum5: - $(preinstguile) -c '(display (+ 1 2 3 4 5))' - - display-deps-dotty: - $(preinstguiletool)/use2dot *.scm - - Note the particular syntax of `preinstguiletool' usage. - - -KNOWN USAGE - - check-guile.in - doc/ref/Makefile.am - libguile/Makefile.am - ice-9/Makefile.am - scripts/Makefile.am From 58ed8bc61ceaa2dbb40b08650ac9ae9eedc8495b Mon Sep 17 00:00:00 2001 From: Thien-Thi Nguyen Date: Tue, 26 Feb 2002 10:28:51 +0000 Subject: [PATCH 007/131] Update path to pre-inst-guile automake frag. --- doc/ref/Makefile.am | 2 +- ice-9/Makefile.am | 2 +- libguile/Makefile.am | 2 +- scripts/Makefile.am | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/doc/ref/Makefile.am b/doc/ref/Makefile.am index 3cb3888dc..5935dc7fc 100644 --- a/doc/ref/Makefile.am +++ b/doc/ref/Makefile.am @@ -37,7 +37,7 @@ guile_TEXINFOS = preface.texi intro.texi program.texi scheme-intro.texi \ ETAGS_ARGS = $(info_TEXINFOS) $(guile_TEXINFOS) -include $(top_srcdir)/pre-inst-guile.am +include $(top_srcdir)/am/pre-inst-guile # Automated snarfing diff --git a/ice-9/Makefile.am b/ice-9/Makefile.am index 2c36a76ac..721d08200 100644 --- a/ice-9/Makefile.am +++ b/ice-9/Makefile.am @@ -47,7 +47,7 @@ if MAINTAINER_MODE # on ice-9/syncase.scm, which does `(load-from-path "ice-9/psyntax.pp")'. # In other words, to bootstrap this file, you need to do something like: # GUILE_LOAD_PATH=/usr/local/share/guile/1.5.4 make psyntax.pp -include $(top_srcdir)/pre-inst-guile.am +include $(top_srcdir)/am/pre-inst-guile psyntax.pp: psyntax.ss $(preinstguile) -s $(srcdir)/compile-psyntax.scm \ $(srcdir)/psyntax.ss $(srcdir)/psyntax.pp diff --git a/libguile/Makefile.am b/libguile/Makefile.am index 1fe1d47ad..504152619 100644 --- a/libguile/Makefile.am +++ b/libguile/Makefile.am @@ -208,7 +208,7 @@ error.x: cpp_err_symbols.c posix.x: cpp_sig_symbols.c load.x: libpath.h -include $(top_srcdir)/pre-inst-guile.am +include $(top_srcdir)/am/pre-inst-guile alldotdocfiles = $(DOT_DOC_FILES) $(EXTRA_DOT_DOC_FILES) snarf2checkedtexi = $(preinstguiletool)/snarf-check-and-output-texi diff --git a/scripts/Makefile.am b/scripts/Makefile.am index 270120800..e3cb57e0d 100644 --- a/scripts/Makefile.am +++ b/scripts/Makefile.am @@ -42,7 +42,7 @@ EXTRA_DIST = $(scripts_sources) list: @echo $(scripts_sources) -include $(top_srcdir)/pre-inst-guile.am +include $(top_srcdir)/am/pre-inst-guile overview: $(scripts_sources) @echo '----------------------------' From 327d4dd38f22fb1ef48906068f9b95b15fba6052 Mon Sep 17 00:00:00 2001 From: Thien-Thi Nguyen Date: Tue, 26 Feb 2002 10:32:34 +0000 Subject: [PATCH 008/131] doc/ref/ChangeLog --- devel/vm/ior/ior.text | 665 ----------------------------------------- doc/ref/ChangeLog | 4 + emacs/patch.el | 8 + ice-9/ChangeLog | 4 + libguile/ChangeLog | 4 + oop/goops/dispatch.scm | 61 ++-- qthreads.m4 | 156 ---------- scripts/ChangeLog | 4 + 8 files changed, 62 insertions(+), 844 deletions(-) diff --git a/devel/vm/ior/ior.text b/devel/vm/ior/ior.text index 9730de55d..e69de29bb 100644 --- a/devel/vm/ior/ior.text +++ b/devel/vm/ior/ior.text @@ -1,665 +0,0 @@ -*** -*** These notes about the design of a new type of Scheme interpreter -*** "Ior" are cut out from various emails from early spring 2000. -*** -*** MDJ 000817 -*** - -Generally, we should try to make a design which is clean and -minimalistic in as many respects as possible. For example, even if we -need more primitives than those in R5RS internally, I don't think -these should be made available to the user in the core, but rather be -made available *through* libraries (implementation in core, -publication via library). - -The suggested working name for this project is "Ior" (Swedish name for -the donkey in "Winnie the Pooh" :). If, against the odds, we really -would succeed in producing an Ior, and we find it suitable, we could -turn it into a Guile 2.0 (or whatever). (The architecture still -allows for support of the gh interface and uses conservative GC (Hans -Böhm's, in fact).) - - Beware now that I'm just sending over my original letter, which is - just a sketch of the more detailed, but cryptic, design notes I made - originally, which are, in turn, not as detailed as the design has - become now. :) - - Please also excuse the lack of structure. I shouldn't work on this at - all right now. Choose for yourselves if you want to read this - unstructured information or if you want to wait until I've structured - it after end of January. - -But then I actually have to blurt out the basic idea of my -architecture already now. (I had hoped to present you with a proper -and fairly detailed spec, but I won't be able to complete such a spec -quickly.) - - -The basic idea is this: - -* Don't waste time on non-computation! - -Why waste a lot of time on type-checks, unboxing and boxing of data? -Neither of these actions do any computations! - -I'd like both interpreter and compiled code to work directly with data -in raw, native form (integers represented as 32bit longs, inexact -numbers as doubles, short strings as bytes in a word, longer strings -as a normal pointer to malloced memory, bignums are just pointers to a -gmp (GNU MultiPrecision library) object, etc.) - -* Don't we need to dispatch on type to know what to do? - -But don't we need to dispatch on the type in order to know how to -compute with the data? E.g., `display' does entirely different -computations on a and a . ( is an integer -between -2^31 and 2^31-1.) - -The answer is *no*, not in 95% of all cases. The main reason is that -the interpreter does type analysis while converting closures to -bytecode, and knows already when _calling_ `display' what type it's -arguments has. This means that the bytecode compiler can choose a -suitable _version_ of `display' which handles that particular type. - - - -This type analysis is greatly simplified by the fact that just as the -type analysis _results_ in the type of the argument in the call to -`display', and, thus, we can select the correct _version_ of -`display', the closure byte-code itself will only be one _version_ of -the closure with the types of its arguments fixed at the start of the -analysis. - -As you already have understood by now, the basic architecture is that -all procedures are generic functions, and the "versions" I'm speaking -about is a kind of methods. Let's call them "branches" by now. - -For example: - -(define foo - (lambda (x) - ... - (display x) - ...) - -may result in the following two branches: - -1. [-foo] = - (branch ((x )) - ... - ([-display] x) - ...) - -2. [-foo] = - (branch ((x )) - ... - ([-display] x) - ...) - -and a new closure - -(define bar - (lambda (x y) - ... - (foo x) - ...)) - -results in - -[--bar] = - (branch ((x ) (y )) - ... - ([-foo] x) - ...) - -Note how all type dispatch is eliminated in these examples. - -As a further reinforcement to the type analysis, branches will not -only have typed parameters but also have return types. This means -that the type of a branch will look like - - x ... x --> - -In essence, the entire system will be very ML-like internally, and we -can benefit from the research done on ML-compilation. - -However, we now get three major problems to confront: - -1. In the Scheme language not all situations can be completely type - analyzed. - -2. In particular, for some operations, even if the types of the - parameters are well defined, we can't determine the return type - generically. For example, [--+] may have return - type _or_ . - -3. Even if we can do a complete analysis, some closures will generate - a combinatoric explosion of branches. - - -Problem 1: Incomplete analysis - -We introduce a new type . This data type has type and -contents - -struct ior_boxed_t { - ior_type *type; /* pointer to class struct */ - void *data; /* generic field, may also contain immediate objects - */ -} - -For example, a boxed fixnum 4711 has type and contents -{ , 4711 }. The boxed type essentially corresponds to Guile's -SCM type. It's just that the 1 or 3 or 7 or 16-bit type tag has been -replaced with a 32-bit type tag (the pointer to the class structure -describing the type of the object). - -This is more inefficient than the SCM type system, but it's no problem -since it won't be used in 95% of all cases. The big advantage -compared to SCM's type system is that it is so simple and uniform. - -I should note here that while SCM and Guile are centered around the -cell representation and all objects either _are_ cells or have a cell -handle, objects in ior will more look like mallocs. This is the -reason why I planned to start with Böhm's GC which has C pointers as -object handles. But it is of course still possible to use a heap, or, -preferably several heaps for different kinds of objects. (Böhm's GC -has multiple heaps for different sizes of objects.) If we write a -custom GC, we can increase speed further. - - -Problem 3 (yes, I skipped :) Combinatoric explosion - -We simply don't generate all possible branches. In the interpreter we -generate branches "just-too-late" (well, it's normally called "lazy -compilation" or "just-in-time", but if it was "in-time", the procedure -would already be compiled when it was needed, right? :) as when Guile -memoizes or when a Java machine turns byte-codes into machine code, or -as when GOOPS turns methods into cmethods for that matter. - -Have noticed that branches (although still without return type -information) already exist in GOOPS? They are currently called -"cmethods" and are generated on demand from the method code and put -into the GF cache during evaluation of GOOPS code. :-) (I have not -utilized this fully yet. I plan to soon use this method compilation -(into branches) to eliminate almost all type dispatch in calls to -accessors.) - -For the compiler, we use profiling information, just as the modern GCC -scheduler, or else relies on some type analysis (if a procedure says -(+ x y), x is not normally a but rather some subclass of -) and some common sense (it's usually more important to -generate branches than branches). - -The rest of the cases can be handled by -branches. We can, for -example, have a: - -[--bar] = - (branch ((x ) (y )) - ... - ([-foo] x) - ...) - -[-foo] will use an efficient type dispatch mechanism (for -example akin to the GOOPS one) to select the right branch of -`display'. - - -Problem 2: Ambiguous return type - -If the return type of a branch is ambiguous, we simply define the -return type as , and box data at the point in the branch where -it can be decided which type of data we will return. This is how -things can be handled in the general case. However, we might be able -to handle things in a more neat way, at least in some cases: - -During compilation to byte code, we'll probably use an intermediate -representation in continuation passing style. We might even use a -subtype of branches reprented as continuations (not a heavy -representation, as in Guile and SCM, but probably not much more than a -function pointer). This is, for example, one way of handling tail -recursion, especially mutual tail recursion. - -One case where we would like to try really hard not to box data is -when fixnums "overflow into" bignums. - -Let's say that the branch [--bar] contains a form - - (+ x y) - -where the type analyzer knows that x and y are fixnums. We then split -the branch right after the form and let it fork into two possible -continuation branches bar1 and bar2: - -[The following is only pseudo code. It can be made efficient on the C - level. We can also use the asm compiler directive in conditional - compilation for GCC on i386. We could even let autoconf/automake - substitute an architecture specific solution for multiple - architectures, but still support a C level default case.] - - (if (sum-over/underflow? x y) - (bar1 (fixnum->bignum x) (fixnum->bignum y) ...) - (bar2 x y ...)) - -bar1 begins with the evaluation of the form - - ([--+] x y) - -while bar 2 begins with - - ([--+] x y) - -Note that the return type of each of these forms is unambiguous. - - -Now some random points from the design: - -* The basic concept in Ior is the class. A type is a concrete class. - Classes which are subclasses of are concrete, otherwise they - are abstract. - -* A procedure is a collection of methods. Each method can have - arbitrary number of parameters of arbitrary class (not type). - -* The type of a method is the tuple of it's argument classes. - -* The type of a procedure is the set of it's method types. - -But the most important new concept is the branch. -Regard the procedure: - -(define (half x) - (quotient x 2)) - -The procedure half will have the single method - - (method ((x )) - (quotient x 2)) - -When `(half 128)' is called the Ior evaluator will create a new branch -during the actual evaluation. I'm now going to extend the branch -syntax by adding a second list of formals: the continuations of the -branch. - -* The type of a branch is namely the tuple of the tuple of it's - argument types (not classes!) and the tuple of it's continuation - argument types. The branch generated above will be: - - (branch ((x ) ((c )) - (c (quotient x 2))) - - If the method - - (method ((x ) (y )) - (quotient (+ x 1) y)) - - is called with arguments 1 and 2 it results in the branch - - (branch ((x ) (y )) ((c1 ) (c2 )) - (quotient (+ x 1 c3) 2)) - - where c3 is: - - (branch ((x ) (y )) ((c )) - (quotient (+ (fixnum->bignum x) 1) 2) - -The generated branches are stored in a cache in the procedure object. - - -But wait a minute! What about variables and data structures? - -In essence, what we do is that we fork up all data paths so that they -can be typed: We put the type tags on the _data paths_ instead of on -the data itself. You can look upon the "branches" as tubes of -information where the type tag is attached to the tube instead of on -what passes through it. - -Variables and data structures are part of the "tubes", so they need to -be typed. For example, the generic pair looks like: - -(define-class () - car-type - car - cdr-type - cdr) - -But note that since car and cdr are generic procedures, we can let -more efficient pairs exist in parallel, like - -(define-class () - (car (class )) - (cdr (class ))) - -Note that instances of this last type only takes two words of memory! -They are easy to use too. We can't use `cons' or `list' to create -them, since these procedures can't assume immutability, but we don't -need to specify the type in our program. Something like - - (const-cons 1 x) - -where x is in the data flow path tagged as , or - - (const-list 1 2 3) - - -Some further notes: - -* The concepts module and instance are the same thing. Using other - modules means 1. creating a new module class which inherits the - classes of the used modules and 2. instantiating it. - -* Module definitions and class definitions are equivalent but - different syntactic sugar adapted for each kind of use. - -* (define x 1) means: create an instance variable which is itself a - subclass of with initial value 1 (which is an instance of - ). - - -The interpreter is a mixture between a stack machine and a register -machine. The evaluator looks like this... :) - - /* the interpreter! */ - if (!setjmp (ior_context->exit_buf)) -#ifndef i386_GCC - while (1) -#endif - (*ior_continue) (IOR_MICRO_OP_ARGS); - -The branches are represented as an array of pointers to micro -operations. In essence, the evaluator doesn't exist in itself, but is -folded out over the entire implementation. This allows for an extreme -form of modularity! - -The i386_GCC is a machine specific optimization which avoids all -unnecessary popping and pushing of the CPU stack (which is different -from the Ior data stack). - -The execution environment consists of - -* a continue register similar to the program counter in the CPU -* a data stack (where micro operation arguments and results are stored) -* a linked chain of environment frames (but look at exception below!) -* a dynamic context - -I've written a small baby Ior which uses Guile's infrastructure. -Here's the context from that baby Ior: - -typedef struct ior_context_t { - ior_data_t *env; /* rest of environment frames */ - ior_cont_t save_continue; /* saves or represents continuation */ - ior_data_t *save_env; /* saves or represents environment */ - ior_data_t *fluids; /* array of fluids (use GC_malloc!) */ - int n_fluids; - int fluids_size; - /* dynwind chain is stored directly in the environment, not in context */ - jmp_buf exit_buf; - IOR_SCM guile_protected; /* temporary */ -} ior_context_t; - -There's an important exception regarding the lowest environment -frame. That frame isn't stored in a separate block on the heap, but -on Ior's data stack. Frames are copied out onto the heap when -necessary (for example when closures "escape"). - - -Now a concrete example: - -Look at: - -(define sum - (lambda (from to res) - (if (= from to) - res - (sum (+ 1 from) to (+ from res))))) - -This can be rewritten into CPS (which captures a lot of what happens -during flow analysis): - -(define sum - (lambda (from to res c1) - (let ((c2 (lambda (limit?) - (let ((c3 (lambda () - (c1 res))) - (c4 (lambda () - (let ((c5 (lambda (from+1) - (let ((c6 (lambda (from+res) - (sum from+1 to from+res c1)))) - (_+ from res c6))))) - (_+ 1 from c5))))) - (_if limit? c3 c4))))) - (_= from to c2)))) - -Finally, after branch expansion, some optimization, code generation, -and some optimization again, we end up with the byte code for the two -branches (here marked by labels `sum' and `sumbig'): - - c5 - (ref -3) - (shift -1) - (+ c4big) - ;; c4 - (shift -2) - (+ 1 sumbig) - ;; c6 - sum - (shift 3) - (ref2 -3) - ;; c2 - (if!= c5) - ;; c3 - (ref -1) - ;; c1 - (end) - - c5big - (ref -3) - (shift -1) - (+ ) - c4big - (shift -2) - (+ 1) - ;; c6 - sumbig - (shift 3) - (ref2 -3) - ;; c2 - (= ) - (if! c5big) - ;; c3 - (ref -1) - ;; c1 - (end) - -Let's take a closer look upon the (+ 1 sumbig) micro -operation. The generated assembler from the Ior C source + machine -specific optimizations for i386_GCC looks like this (with some rubbish -deleted): - -ior_int_int_sum_intbig: - movl 4(%ebx),%eax ; fetch arg 2 - addl (%ebx),%eax ; fetch arg 1 and do the work! - jo ior_big_sum_int_int ; dispatch to other branch on overflow - movl %eax,(%ebx) ; store result in first environment frame - addl $8,%esi ; increment program counter - jmp (%esi) ; execute next opcode - -ior_big_sum_int_int: - -To clearify: This is output from the C compiler. I added the comments -afterwards. - -The source currently looks like this: - -IOR_MICRO_BRANCH_2_2 ("+", int, big, sum, int, int, 1, 0) -{ - int res = IOR_ARG (int, 0) + IOR_ARG (int, 1); - IOR_JUMP_OVERFLOW (res, ior_big_sum_int_int); - IOR_NEXT2 (z); -} - -where the macros allow for different definitions depending on if we -want to play pure ANSI or optimize for a certain machine/compiler. - -The plan is actually to write all source in the Ior language and write -Ior code to translate the core code into bootstrapping C code. - -Please note that if i386_GCC isn't defined, we run plain portable ANSI C. - - -Just one further note: - -In Ior, there are three modes of evaluation - -1. evaluating and type analyzing (these go in parallel) -2. code generation -3. executing byte codes - -It is mode 3 which is really fast in Ior. - -You can look upon your program as a web of branch segments where one -branch segment can be generated from fragments of many closures. Mode -switches doesn't occur at the procedure borders, but at "growth -points". I don't have time to define them here, but they are based -upon the idea that the continuation together with the type signature -of the data flow path is unique. - -We normally run in mode 3. When we come to a source growth point -(essentially an apply instruction) for uncompiled code we "dive out" -of mode 3 into mode 1 which starts to eval/analyze code until we come -to a "sink". When we reach the "sink", we have enough information -about the data path to do code generation, so we backtrack to the -source growth point and grow the branch between source and sink. -Finally, we "dive into" mode 3! - -So, code generation doesn't respect procedure borders. We instead get -a very neat kind of inlining, which, e.g., means that it is OK to use -closures instead of macros in many cases. ----------------------------------------------------------------------- -Ior and module system -===================== - -How, exactly, should the module system of Ior look like? - -There is this general issue of whether to have a single-dispatch or -multi-dispatch system. Personally, I see that Scheme already use -multi-dispatch. Compare (+ 1.0 2) and (+ 1 2.0). - -As you've seen if you've read the notes about Ior design, efficiency -is not an issue here, since almost all dispatch will be eliminated -anyway. - -Also, note an interesting thing: GOOPS actually has a special, -implicit, argument to all of it's methods: the lexical environment. -It would be very ugly to add a second, special, argument to this. - -Of course, the theoreticians have already recognised this, and in many -systems, the implicit argument (the object) and the environment for -the method is the same thing. - -I think we should especially take impressions from Matthias Blume's -module/object system. - -The idea, now, for Ior (remember that everything about Ior is -negotiable between us) is that a module is a type, as well as an -instance of that type. The idea is that we basically keep the GOOPS -style of methods, with the implicit argument being the module object -(or some other lexical environment, in a chain with the module as -root). - -Let's say now that module C uses modules A and B. Modules A and B -both exports the procedure `foo'. But A:foo and B:foo as different -sets of methods. - -What does this mean? Well, it obviously means that the procedure -`foo' in module C is a subtype of A:foo and B:foo. Note how this is -similar in structure to slot inheritance: When class C is created with -superclasses A and B, the properties of a slot in C are created -through slot inheritance. One way of interpreting variable foo in -module A is as a slot with init value foo. Through the MOP, we can -specify that procedure slot inheritance in a module class implies -creation of new init values through inheritance. - -This may look like a kludge, and perhaps it is, and, sure, we are not -going to accept any kludges in Ior. But, it might actually not be a -kludge... - -I think it is commonly accepted by computer scientists that a module, -and/or at least a module interface is a type. Again, this type can be -seen as the set of types of the functions in the interface. The types -of our procedures are the set of branch types the provide. It is then -natural that a module using two other modules create new procedure -types by folding. - -This thing would become less cloudy (yes, this is a cloudy part of my -reasoning; I meant previously that the interpreter itself is now -clear) if module interfaces were required to be explicitly types. - -Actually, this would fit much better together with the rest of Ior's -design. On one hand, we might be free to introduce such a restriction -(compiler writers would applaud it), since R5RS hasn't specified any -module system. On the other hand, it might be strange to require -explicit typing when Scheme is fundamentally implicitly types... - -We also have to consider that a module has an "inward" face, which is -one type, and possibly many "outward" faces, which are different -types. (Compare the idea of "interfaces" in Scheme48.) - -It thus, seems that, while a module can truly be an Ior class, the -reverse should probably not hold in the general case... - -Unless - - instance <-> module proper - class of the instance <-> "inward interface" - superclasses <-> "outward interfaces + inward uses" - -...hmm, is this possible to reconcile with Rees' object system? - -Please think about these issues. We should try to end up with a -beautiful and consistent object/module system. - ----------------------------------------------------------------------- - -Here's a difficult problem in Ior's design: - -Let's say that we have a mutable data structure, like an ordinary -list. Since, in Ior, the type tag (which is really a pointer to a -class structure) is stored separately from the data, it is thinkable -that another thread modifies the location in the list between when our -thread reads the type tag and when it reads the data. - -The reading of type and data must be made atomic in some way. -Probably, some kind of locking of the heap is required. It's just -that it may cause a lot of overhead to look the heap at every *read* -from a mutable data structure. - -Look how much trouble those set!-operations cause! Not only does it -force us to store type tags for each car and cdr in the list, but it -also forces a lot of explicit dispatch to be done, and causes troubles -in a threaded system... - ----------------------------------------------------------------------- - -Jim Blandy writes: - -> We also should try to make less work for the GC, by avoiding consing -> up local environments until they're closed over. - -Did the texts which I sent to you talk about Ior's solution? - -It basically is: Use *two* environment "arguments" to the evaluator -(in Ior, they aren't arguments but registers): - -* One argument is a pointer to the "top" of an environment stack. - This is used in the "inner loop" for very efficient access to - in-between results. The "top" segment of the environment stack is - also regarded as the first environment frame in the lexical - environment. ("top" is bottom on a stack which grows downwards) - -* The other argument points to a structure holding the evaluation - context. In this context, there is a pointer to the chain of the - rest of the environment frames. Note that since frames are just - blocks of SCM values, you can very efficiently "release" a frame - into the heap by block copying it (remember that Ior uses Boehms GC; - this is how we allocate the block). diff --git a/doc/ref/ChangeLog b/doc/ref/ChangeLog index f07a7ee11..5f18640a3 100644 --- a/doc/ref/ChangeLog +++ b/doc/ref/ChangeLog @@ -1,3 +1,7 @@ +2002-02-26 Thien-Thi Nguyen + + * Makefile.am: Update path to pre-inst-guile automake frag. + 2002-02-24 Rob Browning * .cvsignore: add autoconf-macros.texi. diff --git a/emacs/patch.el b/emacs/patch.el index af8c45dfc..868310a80 100644 --- a/emacs/patch.el +++ b/emacs/patch.el @@ -45,6 +45,9 @@ ;;; Code: (require 'cl) +(require 'update-changelog) ; for stitching + +;; outgoing (defvar patch-greeting "hello guile maintainers,\n\n" "*String to insert at beginning of patch mail.") @@ -95,4 +98,9 @@ (patch-changelog-skeleton) "\n\n\n" (make-string 72 ?_) "\n"))) +;; incoming + + + + ;;; patch.el ends here diff --git a/ice-9/ChangeLog b/ice-9/ChangeLog index a41923c83..8f3a73b38 100644 --- a/ice-9/ChangeLog +++ b/ice-9/ChangeLog @@ -1,3 +1,7 @@ +2002-02-26 Thien-Thi Nguyen + + * Makefile.am: Update path to pre-inst-guile automake frag. + 2002-02-24 Rob Browning * syncase.scm (gensym): redefine locally so we can control it's diff --git a/libguile/ChangeLog b/libguile/ChangeLog index 5a3072f23..a3704cbe0 100644 --- a/libguile/ChangeLog +++ b/libguile/ChangeLog @@ -1,3 +1,7 @@ +2002-02-26 Thien-Thi Nguyen + + * Makefile.am: Update path to pre-inst-guile automake frag. + 2002-02-25 Dirk Herrmann * gc.c (scm_gc_sweep): Make it compile even when deprecated diff --git a/oop/goops/dispatch.scm b/oop/goops/dispatch.scm index 749cf9273..137def45b 100644 --- a/oop/goops/dispatch.scm +++ b/oop/goops/dispatch.scm @@ -1,15 +1,17 @@ +;;;; oop/goop/dispatch.scm --- provide `memoize-method!' + ;;;; Copyright (C) 1999, 2000, 2001 Free Software Foundation, Inc. -;;;; +;;;; ;;;; 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 ;;;; the Free Software Foundation, Inc., 59 Temple Place, Suite 330, @@ -38,7 +40,7 @@ ;;;; If you write modifications of your own for GUILE, it is your choice ;;;; whether to permit this exception to apply to your modifications. ;;;; If you do not wish that, delete this exception notice. -;;;; +;;;; (define-module (oop goops dispatch) @@ -235,7 +237,26 @@ (define (lookup-create-cmethod gf args) (no-applicable-method (car args) (cadr args)))) -(define (memoize-method! gf args exp) +(define method-cache-install! + (letrec ((first-n + (lambda (ls n) + (if (or (zero? n) (null? ls)) + '() + (cons (car ls) (first-n (cdr ls) (- n 1))))))) + (lambda (insert! exp args applicable) + (let* ((specializers (method-specializers (car applicable))) + (n-specializers + (if (list? specializers) + (length specializers) + (+ 1 (slot-ref (method-cache-generic-function exp) + 'n-specialized))))) + (let* ((types (map class-of (first-n args n-specializers))) + (entry+cmethod (compute-entry-with-cmethod applicable types))) + (insert! exp (car entry+cmethod)) ; entry = types + cmethod + (cdr entry+cmethod) ; cmethod + ))))) + +(define (memoize-method!-uninstrumented gf args exp) (if (not (slot-ref gf 'used-by)) (slot-set! gf 'used-by '())) (let ((applicable ((if (eq? gf compute-applicable-methods) @@ -271,23 +292,17 @@ (set-car! args gf) (lookup-create-cmethod no-applicable-method args))))) +(define -memoize-method!-stats #f) + +(define (memoize-method! gf args exp) + (memoize-method!-uninstrumented gf args exp)) + (set-procedure-property! memoize-method! 'system-procedure #t) -(define method-cache-install! - (letrec ((first-n - (lambda (ls n) - (if (or (zero? n) (null? ls)) - '() - (cons (car ls) (first-n (cdr ls) (- n 1))))))) - (lambda (insert! exp args applicable) - (let* ((specializers (method-specializers (car applicable))) - (n-specializers - (if (list? specializers) - (length specializers) - (+ 1 (slot-ref (method-cache-generic-function exp) - 'n-specialized))))) - (let* ((types (map class-of (first-n args n-specializers))) - (entry+cmethod (compute-entry-with-cmethod applicable types))) - (insert! exp (car entry+cmethod)) ; entry = types + cmethod - (cdr entry+cmethod) ; cmethod - ))))) +;;; +;;; Memoization Reflection +;;; + + + +;;; oop/goop/dispatch.scm ends here diff --git a/qthreads.m4 b/qthreads.m4 index 585892c01..e69de29bb 100644 --- a/qthreads.m4 +++ b/qthreads.m4 @@ -1,156 +0,0 @@ -dnl Autoconf macros for configuring the QuickThreads package -dnl Jim Blandy --- July 1998 -dnl -dnl Copyright (C) 1998, 1999 Free Software Foundation, Inc. -dnl -dnl This file is part of GUILE. -dnl -dnl GUILE is free software; you can redistribute it and/or modify -dnl it under the terms of the GNU General Public License as -dnl published by the Free Software Foundation; either version 2, or -dnl (at your option) any later version. -dnl -dnl GUILE is distributed in the hope that it will be useful, but -dnl WITHOUT ANY WARRANTY; without even the implied warranty of -dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -dnl GNU General Public License for more details. -dnl -dnl You should have received a copy of the GNU General Public -dnl License along with GUILE; see the file COPYING. If not, write -dnl to the Free Software Foundation, Inc., 59 Temple Place, Suite -dnl 330, Boston, MA 02111-1307 USA - - - -dnl QTHREADS_CONFIGURE configures the QuickThreads package. The QT -dnl sources should be in $srcdir/qt. If configuration succeeds, this -dnl macro creates the appropriate symlinks in the qt object directory, -dnl and sets the following variables, used in building libqthreads.a: -dnl QTHREAD_LTLIBS --- set to libqthreads.la if configuration -dnl succeeds, or the empty string if configuration fails. -dnl qtmd_h, qtmds_s, qtmdc_c, qtdmdb_s --- the names of the machine- -dnl dependent source files. -dnl qthread_asflags --- flags to pass to the compiler when processing -dnl assembly-language files. -dnl -dnl It also sets the following variables, which describe how clients -dnl can link against libqthreads.a: -dnl THREAD_PACKAGE --- set to "QT" if configuration succeeds, or -dnl the empty string if configuration fails. -dnl THREAD_LIBS_LOCAL --- linker options for use in this source tree -dnl THREAD_LIBS_INSTALLED --- linker options for use after this package -dnl is installed -dnl It would be nice if all thread configuration packages for Guile -dnl followed the same conventions. -dnl -dnl All of the above variables will be substituted into Makefiles in -dnl the usual autoconf fashion. -dnl -dnl We distinguish between THREAD_LIBS_LOCAL and -dnl THREAD_LIBS_INSTALLED because the thread library might be in -dnl this tree, and be built using libtool. This means that: -dnl 1) when building other executables in this tree, one must -dnl pass the relative path to the ../libfoo.la file, but -dnl 2) once the whole package has been installed, users should -dnl link using -lfoo. -dnl Normally, we only care about the first case, but since the -dnl guile-config script needs to give users all the flags they need -dnl to link programs against guile, the GUILE_WITH_THREADS macro -dnl needs to supply the second piece of information as well. -dnl -dnl This whole thing is a little confused about what ought to be -dnl done in the top-level configure script, and what ought to be -dnl taken care of in the subdirectory. For example, qtmds_s and -dnl friends really ought not to be even mentioned in the top-level -dnl configure script, but here they are. - -AC_DEFUN([QTHREADS_CONFIGURE],[ - AC_REQUIRE([AC_PROG_LN_S]) - - AC_MSG_CHECKING(QuickThreads configuration) - - changequote(,)dnl We use [ and ] in a regexp in the case - - THREAD_PACKAGE=QT - qthread_asflags='' - case "$host" in - i[3456]86-*-*) - port_name=i386 - qtmd_h=md/i386.h - qtmds_s=md/i386.s - qtmdc_c=md/null.c - qtdmdb_s= - case "$host" in - *-*-netbsd* ) - ## NetBSD needs to be told to pass the assembly code through - ## the C preprocessor. Other GCC installations seem to do - ## this by default, but NetBSD's doesn't. We could get the - ## same effect by giving the file a name ending with .S - ## instead of .s, but I don't see how to tell automake to do - ## that. - qthread_asflags='-x assembler-with-cpp' - ;; - esac - ;; - mips-sgi-irix[56]*) - port_name=irix - qtmd_h=md/mips.h - qtmds_s=md/mips-irix5.s - qtmdc_c=md/null.c - qtdmdb_s=md/mips_b.s - ;; - mips-*-*) - port_name=mips - qtmd_h=md/mips.h - qtmds_s=md/mips.s - qtmdc_c=md/null.c - qtdmdb_s=md/mips_b.s - ;; - sparc-*-sunos*) - port_name=sparc-sunos - qtmd_h=md/sparc.h - qtmds_s=md/_sparc.s - qtmdc_c=md/null.c - qtdmdb_s=md/_sparc_b.s - ;; - sparc-*-*) - port_name=sparc - qtmd_h=md/sparc.h - qtmds_s=md/sparc.s - qtmdc_c=md/null.c - qtdmdb_s=md/sparc_b.s - ;; - alpha*-*-*) - port_name=alpha - qtmd_h=md/axp.h - qtmds_s=md/axp.s - qtmdc_c=md/null.c - qtdmdb_s=md/axp_b.s - ;; - *) - echo "Unknown configuration; threads package disabled" - THREAD_PACKAGE="" - ;; - esac - changequote([, ]) - - # Did configuration succeed? - if test -n "$THREAD_PACKAGE"; then - AC_MSG_RESULT($port_name) - QTHREAD_LTLIBS=libqthreads.la - THREAD_LIBS_LOCAL="../qt/libqthreads.la" - THREAD_LIBS_INSTALLED="-lqthreads" - else - AC_MSG_RESULT(none; disabled) - fi - - AC_SUBST(QTHREAD_LTLIBS) - AC_SUBST(qtmd_h) - AC_SUBST(qtmds_s) - AC_SUBST(qtmdc_c) - AC_SUBST(qtdmdb_s) - AC_SUBST(qthread_asflags) - AC_SUBST(THREAD_PACKAGE) - AC_SUBST(THREAD_LIBS_LOCAL) - AC_SUBST(THREAD_LIBS_INSTALLED) -]) diff --git a/scripts/ChangeLog b/scripts/ChangeLog index d6484894c..912000ea8 100644 --- a/scripts/ChangeLog +++ b/scripts/ChangeLog @@ -1,3 +1,7 @@ +2002-02-26 Thien-Thi Nguyen + + * Makefile.am: Update path to pre-inst-guile automake frag. + 2002-02-22 Thien-Thi Nguyen * api-diff: New script. From b39eac3a5a81d29f9bd7ded41f4d52464caa247a Mon Sep 17 00:00:00 2001 From: Thien-Thi Nguyen Date: Tue, 26 Feb 2002 10:38:53 +0000 Subject: [PATCH 009/131] Revert to 1.6 (1.7 was an accidental checkin). --- oop/goops/dispatch.scm | 53 +++++++++++++++--------------------------- 1 file changed, 19 insertions(+), 34 deletions(-) diff --git a/oop/goops/dispatch.scm b/oop/goops/dispatch.scm index 137def45b..8f9cb2c1e 100644 --- a/oop/goops/dispatch.scm +++ b/oop/goops/dispatch.scm @@ -1,5 +1,3 @@ -;;;; oop/goop/dispatch.scm --- provide `memoize-method!' - ;;;; Copyright (C) 1999, 2000, 2001 Free Software Foundation, Inc. ;;;; ;;;; This program is free software; you can redistribute it and/or modify @@ -237,26 +235,7 @@ (define (lookup-create-cmethod gf args) (no-applicable-method (car args) (cadr args)))) -(define method-cache-install! - (letrec ((first-n - (lambda (ls n) - (if (or (zero? n) (null? ls)) - '() - (cons (car ls) (first-n (cdr ls) (- n 1))))))) - (lambda (insert! exp args applicable) - (let* ((specializers (method-specializers (car applicable))) - (n-specializers - (if (list? specializers) - (length specializers) - (+ 1 (slot-ref (method-cache-generic-function exp) - 'n-specialized))))) - (let* ((types (map class-of (first-n args n-specializers))) - (entry+cmethod (compute-entry-with-cmethod applicable types))) - (insert! exp (car entry+cmethod)) ; entry = types + cmethod - (cdr entry+cmethod) ; cmethod - ))))) - -(define (memoize-method!-uninstrumented gf args exp) +(define (memoize-method! gf args exp) (if (not (slot-ref gf 'used-by)) (slot-set! gf 'used-by '())) (let ((applicable ((if (eq? gf compute-applicable-methods) @@ -292,17 +271,23 @@ (set-car! args gf) (lookup-create-cmethod no-applicable-method args))))) -(define -memoize-method!-stats #f) - -(define (memoize-method! gf args exp) - (memoize-method!-uninstrumented gf args exp)) - (set-procedure-property! memoize-method! 'system-procedure #t) -;;; -;;; Memoization Reflection -;;; - - - -;;; oop/goop/dispatch.scm ends here +(define method-cache-install! + (letrec ((first-n + (lambda (ls n) + (if (or (zero? n) (null? ls)) + '() + (cons (car ls) (first-n (cdr ls) (- n 1))))))) + (lambda (insert! exp args applicable) + (let* ((specializers (method-specializers (car applicable))) + (n-specializers + (if (list? specializers) + (length specializers) + (+ 1 (slot-ref (method-cache-generic-function exp) + 'n-specialized))))) + (let* ((types (map class-of (first-n args n-specializers))) + (entry+cmethod (compute-entry-with-cmethod applicable types))) + (insert! exp (car entry+cmethod)) ; entry = types + cmethod + (cdr entry+cmethod) ; cmethod + ))))) From 4eecfeb7961a4b4fb909670dd22f67795336a600 Mon Sep 17 00:00:00 2001 From: Thien-Thi Nguyen Date: Tue, 26 Feb 2002 10:57:54 +0000 Subject: [PATCH 010/131] Comment grammar fixes; nfc. --- ice-9/boot-9.scm | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ice-9/boot-9.scm b/ice-9/boot-9.scm index 1aee82d60..36fc11470 100644 --- a/ice-9/boot-9.scm +++ b/ice-9/boot-9.scm @@ -634,7 +634,7 @@ (debug-enable 'debug) (debug-enable 'backtrace) (read-enable 'positions)) - + (define (load-user-init) (let* ((home (or (getenv "HOME") (false-if-exception (passwd:dir (getpwuid (getuid)))) @@ -1633,7 +1633,7 @@ (eq? (car (last-pair use-list)) the-scm-module)) (set-module-uses! module (reverse (cdr (reverse use-list))))))) -;; Return a module that is a interface to the module designated by +;; Return a module that is an interface to the module designated by ;; NAME. ;; ;; `resolve-interface' takes two keyword arguments: @@ -1645,7 +1645,7 @@ ;; is the name in the used module and SEEN is the name in the using ;; module. Note that SEEN is also passed through RENAMER, below. The ;; default is to select all bindings. If you specify no selection but -;; a renamer, only the bindings that already exists in the used module +;; a renamer, only the bindings that already exist in the used module ;; are made available in the interface. Bindings that are added later ;; are not picked up. ;; From d51b42e28b4135545b5e5932b5a55210328fa706 Mon Sep 17 00:00:00 2001 From: Thien-Thi Nguyen Date: Tue, 26 Feb 2002 10:58:58 +0000 Subject: [PATCH 011/131] *** empty log message *** --- ice-9/ChangeLog | 3 +++ 1 file changed, 3 insertions(+) diff --git a/ice-9/ChangeLog b/ice-9/ChangeLog index 8f3a73b38..ce38693c6 100644 --- a/ice-9/ChangeLog +++ b/ice-9/ChangeLog @@ -2,6 +2,9 @@ * Makefile.am: Update path to pre-inst-guile automake frag. + * boot-9.scm: Comment grammar fixes; nfc. + Thanks to Christopher Cramer. + 2002-02-24 Rob Browning * syncase.scm (gensym): redefine locally so we can control it's From edb810bb84ca1198d4ff34712877ee681b15c5fb Mon Sep 17 00:00:00 2001 From: Stefan Jahn Date: Wed, 27 Feb 2002 15:41:01 +0000 Subject: [PATCH 012/131] 2002-02-27 Stefan Jahn * Makefile.am (SUBDIRS): Added the `am' directory. 2002-02-27 Stefan Jahn * gh.texi (scm transition summary): Documented some more gh equivalents and removed appropriate FIXME's. 2002-02-27 Stefan Jahn * Makefile.am (EXTRA_DIST): Added the `LIBGUILEREADLINE-VERSION' file. 2002-02-27 Stefan Jahn * convert.i.c, convert.c: Better range checking. * inet_aton.c, fports.c: Commented the inclusion of . * deprecation.c (vsnprintf): Define to `_vsnprintf' for Windows (MinGW). --- ChangeLog | 4 + Makefile.am | 2 +- doc/ref/ChangeLog | 5 + doc/ref/gh.texi | 14 +-- guile-readline/ChangeLog | 5 + guile-readline/Makefile.am | 2 +- libguile/ChangeLog | 9 ++ libguile/convert.c | 145 ++++++++++++++-------------- libguile/convert.i.c | 191 +++++++++++++++++++++---------------- libguile/deprecation.c | 5 + libguile/fports.c | 3 +- libguile/inet_aton.c | 1 + 12 files changed, 223 insertions(+), 163 deletions(-) diff --git a/ChangeLog b/ChangeLog index 213103986..b0c352451 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2002-02-27 Stefan Jahn + + * Makefile.am (SUBDIRS): Added the `am' directory. + 2002-02-26 Thien-Thi Nguyen * pre-inst-guile.in: New file. diff --git a/Makefile.am b/Makefile.am index ea26d8692..5ea356b15 100644 --- a/Makefile.am +++ b/Makefile.am @@ -21,7 +21,7 @@ SUBDIRS = oop qt libltdl libguile ice-9 guile-config guile-readline \ - scripts srfi doc examples test-suite lang + scripts srfi doc examples test-suite lang am bin_SCRIPTS = guile-tools diff --git a/doc/ref/ChangeLog b/doc/ref/ChangeLog index 5f18640a3..61e661d61 100644 --- a/doc/ref/ChangeLog +++ b/doc/ref/ChangeLog @@ -1,3 +1,8 @@ +2002-02-27 Stefan Jahn + + * gh.texi (scm transition summary): Documented some more + gh equivalents and removed appropriate FIXME's. + 2002-02-26 Thien-Thi Nguyen * Makefile.am: Update path to pre-inst-guile automake frag. diff --git a/doc/ref/gh.texi b/doc/ref/gh.texi index 9b2e9850e..1cadc168a 100644 --- a/doc/ref/gh.texi +++ b/doc/ref/gh.texi @@ -929,16 +929,16 @@ Use @code{scm_str2symbol} instead. [FIXME: inconsistent naming, should be @code{scm_str02symbol}.] @item @code{gh_ints2scm} and @code{gh_doubles2scm} -No direct scm equivalent. [FIXME] +Use @code{scm_c_ints2scm} and @code{scm_c_doubles2scm} instead. @item @code{gh_chars2byvect} and @code{gh_shorts2svect} -No direct scm equivalent. [FIXME] +Use @code{scm_c_chars2byvect} and @code{scm_c_shorts2svect} instead. @item @code{gh_longs2ivect} and @code{gh_ulongs2uvect} -No direct scm equivalent. [FIXME] +Use @code{scm_c_longs2ivect} and @code{scm_c_ulongs2uvect} instead. @item @code{gh_floats2fvect} and @code{gh_doubles2dvect} -No direct scm equivalent. [FIXME] +Use @code{scm_c_floats2fvect} and @code{scm_c_doubles2dvect} instead. @item @code{gh_scm2bool} Use @code{SCM_NFALSEP} instead. @@ -993,13 +993,13 @@ instead. With the additional @var{str} argument the user can pass a pre-allocated memory chunk or leave it passing NULL. @item @code{gh_scm2chars} -No direct scm equivalent. [FIXME] +Use @code{scm_c_scm2chars} instead. @item @code{gh_scm2shorts} and @code{gh_scm2longs} -No direct scm equivalent. [FIXME] +Use @code{scm_c_shorts2scm} and @code{scm_c_longs2scm} instead. @item @code{gh_scm2floats} and @code{gh_scm2doubles} -No direct scm equivalent. [FIXME] +Use @code{scm_c_floats2scm} and @code{scm_c_doubles2scm} instead. @item @code{gh_boolean_p} Use the @code{SCM_BOOLP} macro instead, or replace @code{gh_boolean_p diff --git a/guile-readline/ChangeLog b/guile-readline/ChangeLog index 29491889e..5e6503db0 100644 --- a/guile-readline/ChangeLog +++ b/guile-readline/ChangeLog @@ -1,3 +1,8 @@ +2002-02-27 Stefan Jahn + + * Makefile.am (EXTRA_DIST): Added the `LIBGUILEREADLINE-VERSION' + file. + 2002-02-25 Thien-Thi Nguyen * configure.in (LIBGUILEREADLINE-VERSION): diff --git a/guile-readline/Makefile.am b/guile-readline/Makefile.am index bf5b0ba75..c8cb59eff 100644 --- a/guile-readline/Makefile.am +++ b/guile-readline/Makefile.am @@ -50,7 +50,7 @@ SUFFIXES = .x $(GUILE_SNARF) $(DEFS) $(INCLUDES) $(CPPFLAGS) $(CFLAGS) $< > $@ \ || { rm $@; false; } -EXTRA_DIST = $(ice9_DATA) +EXTRA_DIST = $(ice9_DATA) LIBGUILEREADLINE-VERSION ETAGS_ARGS = $(ice9_DATA) MKDEP = gcc -M -MG $(DEFS) $(INCLUDES) $(CPPFLAGS) $(CFLAGS) diff --git a/libguile/ChangeLog b/libguile/ChangeLog index a3704cbe0..ae93bdc1d 100644 --- a/libguile/ChangeLog +++ b/libguile/ChangeLog @@ -1,3 +1,12 @@ +2002-02-27 Stefan Jahn + + * convert.i.c, convert.c: Better range checking. + + * inet_aton.c, fports.c: Commented the inclusion of . + + * deprecation.c (vsnprintf): Define to `_vsnprintf' for + Windows (MinGW). + 2002-02-26 Thien-Thi Nguyen * Makefile.am: Update path to pre-inst-guile automake frag. diff --git a/libguile/convert.c b/libguile/convert.c index cbec8fa2a..d6606d555 100644 --- a/libguile/convert.c +++ b/libguile/convert.c @@ -56,91 +56,90 @@ #include #endif -#define CTYPE char -#define SCM2CTYPES_FN "scm_c_scm2chars" -#define SCM2CTYPES scm_c_scm2chars -#define CTYPES2SCM_FN "scm_c_chars2scm" -#define CTYPES2SCM scm_c_chars2scm -#define CTYPEFIXABLE +#define CTYPE char +#define SIZEOF_CTYPE 1 +#define SCM2CTYPES_FN "scm_c_scm2chars" +#define SCM2CTYPES scm_c_scm2chars +#define CTYPES2SCM_FN "scm_c_chars2scm" +#define CTYPES2SCM scm_c_chars2scm #define CTYPES2UVECT_FN "scm_c_chars2byvect" -#define CTYPES2UVECT scm_c_chars2byvect -#define UVECTTYPE scm_tc7_byvect -#define CTYPEMIN -128 -#define CTYPEMAX +255 -#define ARRAYTYPE1 scm_tc7_byvect -#define STRINGTYPE +#define CTYPES2UVECT scm_c_chars2byvect +#define UVECTTYPE scm_tc7_byvect +#define ARRAYTYPE scm_tc7_byvect #include "convert.i.c" -#define CTYPE short -#define SCM2CTYPES_FN "scm_c_scm2shorts" -#define SCM2CTYPES scm_c_scm2shorts -#define CTYPES2SCM_FN "scm_c_shorts2scm" -#define CTYPES2SCM scm_c_shorts2scm -#define CTYPEFIXABLE +#define CTYPE short +#define SIZEOF_CTYPE SIZEOF_SHORT +#define SCM2CTYPES_FN "scm_c_scm2shorts" +#define SCM2CTYPES scm_c_scm2shorts +#define CTYPES2SCM_FN "scm_c_shorts2scm" +#define CTYPES2SCM scm_c_shorts2scm #define CTYPES2UVECT_FN "scm_c_shorts2svect" -#define CTYPES2UVECT scm_c_shorts2svect -#define UVECTTYPE scm_tc7_svect -#define CTYPEMIN -32768 -#define CTYPEMAX +65535 -#define ARRAYTYPE1 scm_tc7_svect +#define CTYPES2UVECT scm_c_shorts2svect +#define UVECTTYPE scm_tc7_svect +#define ARRAYTYPE scm_tc7_svect #include "convert.i.c" -#define CTYPE int -#define SCM2CTYPES_FN "scm_c_scm2ints" -#define SCM2CTYPES scm_c_scm2ints -#define CTYPES2SCM_FN "scm_c_ints2scm" -#define CTYPES2SCM scm_c_ints2scm -#define CTYPES2UVECT_FN "scm_c_ints2ivect" -#define CTYPES2UVECT scm_c_ints2ivect -#define UVECTTYPE scm_tc7_ivect -#define CTYPES2UVECT_FN2 "scm_c_uints2uvect" -#define CTYPES2UVECT2 scm_c_uints2uvect -#define UVECTTYPE2 scm_tc7_uvect -#define ARRAYTYPE1 scm_tc7_ivect -#define ARRAYTYPE2 scm_tc7_uvect +#define CTYPE int +#define SIZEOF_CTYPE SIZEOF_INT +#define SCM2CTYPES_FN "scm_c_scm2ints" +#define SCM2CTYPES scm_c_scm2ints +#define CTYPES2SCM_FN "scm_c_ints2scm" +#define CTYPES2SCM scm_c_ints2scm +#define CTYPES2UVECT_FN "scm_c_ints2ivect" +#define CTYPES2UVECT scm_c_ints2ivect +#define UVECTTYPE scm_tc7_ivect +#define CTYPES2UVECT_FN_OPTIONAL "scm_c_uints2uvect" +#define CTYPES2UVECT_OPTIONAL scm_c_uints2uvect +#define UVECTTYPE_OPTIONAL scm_tc7_uvect +#define ARRAYTYPE scm_tc7_ivect +#define ARRAYTYPE_OPTIONAL scm_tc7_uvect #include "convert.i.c" -#define CTYPE long -#define SCM2CTYPES_FN "scm_c_scm2longs" -#define SCM2CTYPES scm_c_scm2longs -#define CTYPES2SCM_FN "scm_c_longs2scm" -#define CTYPES2SCM scm_c_longs2scm -#define CTYPES2UVECT_FN "scm_c_longs2ivect" -#define CTYPES2UVECT scm_c_longs2ivect -#define UVECTTYPE scm_tc7_ivect -#define CTYPES2UVECT_FN2 "scm_c_ulongs2uvect" -#define CTYPES2UVECT2 scm_c_ulongs2uvect -#define UVECTTYPE2 scm_tc7_uvect -#define ARRAYTYPE1 scm_tc7_ivect -#define ARRAYTYPE2 scm_tc7_uvect +#define CTYPE long +#define SIZEOF_CTYPE SIZEOF_LONG +#define SCM2CTYPES_FN "scm_c_scm2longs" +#define SCM2CTYPES scm_c_scm2longs +#define CTYPES2SCM_FN "scm_c_longs2scm" +#define CTYPES2SCM scm_c_longs2scm +#define CTYPES2UVECT_FN "scm_c_longs2ivect" +#define CTYPES2UVECT scm_c_longs2ivect +#define UVECTTYPE scm_tc7_ivect +#define CTYPES2UVECT_FN_OPTIONAL "scm_c_ulongs2uvect" +#define CTYPES2UVECT_OPTIONAL scm_c_ulongs2uvect +#define UVECTTYPE_OPTIONAL scm_tc7_uvect +#define ARRAYTYPE scm_tc7_ivect +#define ARRAYTYPE_OPTIONAL scm_tc7_uvect #include "convert.i.c" -#define CTYPE float -#define SCM2CTYPES_FN "scm_c_scm2floats" -#define SCM2CTYPES scm_c_scm2floats -#define CTYPES2SCM_FN "scm_c_floats2scm" -#define CTYPES2SCM scm_c_floats2scm -#define CTYPES2UVECT_FN "scm_c_floats2fvect" -#define CTYPES2UVECT scm_c_floats2fvect -#define UVECTTYPE scm_tc7_fvect -#define ARRAYTYPE1 scm_tc7_fvect -#define ARRAYTYPE2 scm_tc7_dvect -#define FLOATTYPE1 float -#define FLOATTYPE2 double +#define CTYPE float +#define SIZEOF_CTYPE 0 +#define SCM2CTYPES_FN "scm_c_scm2floats" +#define SCM2CTYPES scm_c_scm2floats +#define CTYPES2SCM_FN "scm_c_floats2scm" +#define CTYPES2SCM scm_c_floats2scm +#define CTYPES2UVECT_FN "scm_c_floats2fvect" +#define CTYPES2UVECT scm_c_floats2fvect +#define UVECTTYPE scm_tc7_fvect +#define ARRAYTYPE scm_tc7_fvect +#define ARRAYTYPE_OPTIONAL scm_tc7_dvect +#define FLOATTYPE float +#define FLOATTYPE_OPTIONAL double #include "convert.i.c" -#define CTYPE double -#define SCM2CTYPES_FN "scm_c_scm2doubles" -#define SCM2CTYPES scm_c_scm2doubles -#define CTYPES2SCM_FN "scm_c_doubles2scm" -#define CTYPES2SCM scm_c_doubles2scm -#define CTYPES2UVECT_FN "scm_c_doubles2dvect" -#define CTYPES2UVECT scm_c_doubles2dvect -#define UVECTTYPE scm_tc7_dvect -#define ARRAYTYPE1 scm_tc7_dvect -#define ARRAYTYPE2 scm_tc7_fvect -#define FLOATTYPE1 double -#define FLOATTYPE2 float +#define CTYPE double +#define SIZEOF_CTYPE 0 +#define SCM2CTYPES_FN "scm_c_scm2doubles" +#define SCM2CTYPES scm_c_scm2doubles +#define CTYPES2SCM_FN "scm_c_doubles2scm" +#define CTYPES2SCM scm_c_doubles2scm +#define CTYPES2UVECT_FN "scm_c_doubles2dvect" +#define CTYPES2UVECT scm_c_doubles2dvect +#define UVECTTYPE scm_tc7_dvect +#define ARRAYTYPE scm_tc7_dvect +#define ARRAYTYPE_OPTIONAL scm_tc7_fvect +#define FLOATTYPE double +#define FLOATTYPE_OPTIONAL float #include "convert.i.c" /* diff --git a/libguile/convert.i.c b/libguile/convert.i.c index 7ab0eae25..80a0c30ff 100644 --- a/libguile/convert.i.c +++ b/libguile/convert.i.c @@ -5,8 +5,8 @@ /* Convert a vector, weak vector, (if possible string, substring), list - or uniform vector into an C array. If result array in argument 2 is - NULL, malloc() a new one. If out of memory, return NULL. */ + or uniform vector into an C array. If the result array in argument 2 + is NULL, malloc() a new one. If out of memory, return NULL. */ #define FUNC_NAME SCM2CTYPES_FN CTYPE * SCM2CTYPES (SCM obj, CTYPE *data) @@ -17,40 +17,58 @@ SCM2CTYPES (SCM obj, CTYPE *data) SCM_ASSERT (SCM_NIMP (obj) || SCM_NFALSEP (scm_list_p (obj)), obj, SCM_ARG1, FUNC_NAME); + /* list conversion */ if (SCM_NFALSEP (scm_list_p (obj))) { + /* traverse the given list and validate the range of each member */ SCM list = obj; for (n = 0; SCM_NFALSEP (scm_pair_p (list)); list = SCM_CDR (list), n++) { val = SCM_CAR (list); -#if defined (CTYPEMIN) && defined (CTYPEMAX) +#if SIZEOF_CTYPE && SIZEOF_CTYPE < SIZEOF_SCM_T_BITS + /* check integer ranges */ if (SCM_INUMP (val)) { - long v = SCM_INUM (val); - SCM_ASSERT_RANGE (SCM_ARG1, obj, v >= CTYPEMIN && v <= CTYPEMAX); + scm_t_signed_bits v = SCM_INUM (val); + CTYPE c = (CTYPE) v; + SCM_ASSERT_RANGE (SCM_ARG1, val, v != (scm_t_signed_bits) c); } - else -#elif defined (FLOATTYPE1) - if (!SCM_INUMP (val) && !(SCM_BIGP (val) || SCM_REALP (val))) + /* check big number ranges */ + else if (SCM_BIGP (val)) + { + scm_t_signed_bits v = scm_num2long (val, SCM_ARG1, FUNC_NAME); + CTYPE c = (CTYPE) v; + SCM_ASSERT_RANGE (SCM_ARG1, val, v != (scm_t_signed_bits) c); + } + else + /* check float types */ +#elif defined (FLOATTYPE) + /* real values, big numbers and immediate values are valid + for float conversions */ + if (!SCM_REALP (val) && !SCM_BIGP (val) && !SCM_INUMP (val)) #else - if (!SCM_INUMP (val) && !SCM_BIGP (val)) -#endif - SCM_WRONG_TYPE_ARG (SCM_ARG1, obj); + if (!SCM_BIGP (val) && !SCM_INUMP (val)) +#endif /* FLOATTYPE */ + SCM_WRONG_TYPE_ARG (SCM_ARG1, val); } - if (data == NULL) - data = (CTYPE *) malloc (n * sizeof (CTYPE)); - if (data == NULL) - return NULL; + /* allocate new memory if necessary */ + if (data == NULL) + { + if ((data = (CTYPE *) malloc (n * sizeof (CTYPE))) == NULL) + return NULL; + } + + /* traverse the list once more and convert each member */ list = obj; for (i = 0; SCM_NFALSEP (scm_pair_p (list)); list = SCM_CDR (list), i++) { val = SCM_CAR (list); if (SCM_INUMP (val)) - data[i] = SCM_INUM (val); + data[i] = (CTYPE) SCM_INUM (val); else if (SCM_BIGP (val)) data[i] = (CTYPE) scm_num2long (val, SCM_ARG1, FUNC_NAME); -#ifdef FLOATTYPE1 +#if defined (FLOATTYPE) else data[i] = (CTYPE) SCM_REAL_VALUE (val); #endif @@ -58,33 +76,52 @@ SCM2CTYPES (SCM obj, CTYPE *data) return data; } + /* other conversions */ switch (SCM_TYP7 (obj)) { + /* vectors and weak vectors */ case scm_tc7_vector: case scm_tc7_wvect: n = SCM_VECTOR_LENGTH (obj); + /* traverse the given vector and validate each member */ for (i = 0; i < n; i++) { val = SCM_VELTS (obj)[i]; - -#if defined (CTYPEMIN) && defined (CTYPEMAX) +#if SIZEOF_CTYPE && SIZEOF_CTYPE < SIZEOF_SCM_T_BITS + /* check integer ranges */ if (SCM_INUMP (val)) { - long v = SCM_INUM (val); - SCM_ASSERT_RANGE (SCM_ARG1, obj, v >= CTYPEMIN && v <= CTYPEMAX); + scm_t_signed_bits v = SCM_INUM (val); + CTYPE c = (CTYPE) v; + SCM_ASSERT_RANGE (SCM_ARG1, val, v != (scm_t_signed_bits) c); } + /* check big number ranges */ + else if (SCM_BIGP (val)) + { + scm_t_signed_bits v = scm_num2long (val, SCM_ARG1, FUNC_NAME); + CTYPE c = (CTYPE) v; + SCM_ASSERT_RANGE (SCM_ARG1, val, v != (scm_t_signed_bits) c); + } else -#elif defined (FLOATTYPE1) - if (!SCM_INUMP (val) && !(SCM_BIGP (val) || SCM_REALP (val))) + /* check float types */ +#elif defined (FLOATTYPE) + /* real values, big numbers and immediate values are valid + for float conversions */ + if (!SCM_REALP (val) && !SCM_BIGP (val) && !SCM_INUMP (val)) #else - if (!SCM_INUMP (val) && !SCM_BIGP (val)) -#endif - SCM_WRONG_TYPE_ARG (SCM_ARG1, obj); + if (!SCM_BIGP (val) && !SCM_INUMP (val)) +#endif /* FLOATTYPE */ + SCM_WRONG_TYPE_ARG (SCM_ARG1, val); } + + /* allocate new memory if necessary */ if (data == NULL) - data = (CTYPE *) malloc (n * sizeof (CTYPE)); - if (data == NULL) - return NULL; + { + if ((data = (CTYPE *) malloc (n * sizeof (CTYPE))) == NULL) + return NULL; + } + + /* traverse the vector once more and convert each member */ for (i = 0; i < n; i++) { val = SCM_VELTS (obj)[i]; @@ -92,7 +129,7 @@ SCM2CTYPES (SCM obj, CTYPE *data) data[i] = (CTYPE) SCM_INUM (val); else if (SCM_BIGP (val)) data[i] = (CTYPE) scm_num2long (val, SCM_ARG1, FUNC_NAME); -#ifdef FLOATTYPE1 +#if defined (FLOATTYPE) else data[i] = (CTYPE) SCM_REAL_VALUE (val); #endif @@ -100,37 +137,43 @@ SCM2CTYPES (SCM obj, CTYPE *data) break; #ifdef HAVE_ARRAYS - case ARRAYTYPE1: -#ifdef ARRAYTYPE2 - case ARRAYTYPE2: + /* array conversions (uniform vectors) */ + case ARRAYTYPE: +#ifdef ARRAYTYPE_OPTIONAL + case ARRAYTYPE_OPTIONAL: #endif n = SCM_UVECTOR_LENGTH (obj); + + /* allocate new memory if necessary */ if (data == NULL) - data = (CTYPE *) malloc (n * sizeof (CTYPE)); - if (data == NULL) - return NULL; -#ifdef FLOATTYPE2 - if (SCM_TYP7 (obj) == ARRAYTYPE2) + { + if ((data = (CTYPE *) malloc (n * sizeof (CTYPE))) == NULL) + return NULL; + } + +#ifdef FLOATTYPE_OPTIONAL + /* float <-> double conversions */ + if (SCM_TYP7 (obj) == ARRAYTYPE_OPTIONAL) { for (i = 0; i < n; i++) - data[i] = ((FLOATTYPE2 *) SCM_UVECTOR_BASE (obj))[i]; + data[i] = ((FLOATTYPE_OPTIONAL *) SCM_UVECTOR_BASE (obj))[i]; } else #endif + /* copy whole array */ memcpy (data, (CTYPE *) SCM_UVECTOR_BASE (obj), n * sizeof (CTYPE)); break; #endif /* HAVE_ARRAYS */ -#ifdef STRINGTYPE +#if SIZEOF_CTYPE == 1 case scm_tc7_string: n = SCM_STRING_LENGTH (obj); if (data == NULL) - data = (CTYPE *) malloc (n * sizeof (CTYPE)); - if (data == NULL) - return NULL; + if ((data = (CTYPE *) malloc (n * sizeof (CTYPE))) == NULL) + return NULL; memcpy (data, SCM_STRING_CHARS (obj), n * sizeof (CTYPE)); break; -#endif /* STRINGTYPE */ +#endif default: SCM_WRONG_TYPE_ARG (SCM_ARG1, obj); @@ -150,32 +193,34 @@ CTYPES2UVECT (const CTYPE *data, long n) { char *v; - SCM_ASSERT_RANGE (SCM_ARG2, scm_long2num (n), + SCM_ASSERT_RANGE (SCM_ARG2, scm_long2num (n), n > 0 && n <= SCM_UVECTOR_MAX_LENGTH); - v = scm_gc_malloc (sizeof (CTYPE) * n, "vector"); + v = scm_gc_malloc (n * sizeof (CTYPE), "uvect"); memcpy (v, data, n * sizeof (CTYPE)); return scm_alloc_cell (SCM_MAKE_UVECTOR_TAG (n, UVECTTYPE), (scm_t_bits) v); } #undef FUNC_NAME -#ifdef UVECTTYPE2 -#define FUNC_NAME CTYPES2UVECT_FN2 +#ifdef UVECTTYPE_OPTIONAL +#define FUNC_NAME CTYPES2UVECT_FN_OPTIONAL SCM -CTYPES2UVECT2 (const unsigned CTYPE *data, long n) +CTYPES2UVECT_OPTIONAL (const unsigned CTYPE *data, long n) { char *v; SCM_ASSERT_RANGE (SCM_ARG2, scm_long2num (n), n > 0 && n <= SCM_UVECTOR_MAX_LENGTH); - v = scm_gc_malloc (sizeof (unsigned CTYPE) * n, "vector"); + v = scm_gc_malloc (n * sizeof (unsigned CTYPE) * n, "uvect"); memcpy (v, data, n * sizeof (unsigned CTYPE)); - return scm_alloc_cell (SCM_MAKE_UVECTOR_TAG (n, UVECTTYPE2), (scm_t_bits) v); + return scm_alloc_cell (SCM_MAKE_UVECTOR_TAG (n, UVECTTYPE_OPTIONAL), + (scm_t_bits) v); } #undef FUNC_NAME -#endif /* UVECTTYPE2 */ +#endif /* UVECTTYPE_OPTIONAL */ #endif /* HAVE_ARRAYS */ + /* Converts a C array into a vector. */ #define FUNC_NAME CTYPES2SCM_FN SCM @@ -189,13 +234,10 @@ CTYPES2SCM (const CTYPE *data, long n) v = scm_c_make_vector (n, SCM_UNSPECIFIED); velts = SCM_VELTS (v); for (i = 0; i < n; i++) -#ifdef FLOATTYPE1 +#ifdef FLOATTYPE velts[i] = scm_make_real ((double) data[i]); -#elif defined (CTYPEFIXABLE) - velts[i] = SCM_MAKINUM (data[i]); #else - velts[i] = (SCM_FIXABLE (data[i]) ? SCM_MAKINUM (data[i]) : - scm_i_long2big (data[i])); + velts[i] = SCM_MAKINUM (data[i]); #endif return v; } @@ -209,33 +251,22 @@ CTYPES2SCM (const CTYPE *data, long n) #undef CTYPE #undef CTYPES2UVECT #undef CTYPES2UVECT_FN -#ifdef CTYPEFIXABLE -#undef CTYPEFIXABLE -#endif #undef UVECTTYPE -#ifdef UVECTTYPE2 -#undef CTYPES2UVECT2 -#undef CTYPES2UVECT_FN2 -#undef UVECTTYPE2 +#ifdef UVECTTYPE_OPTIONAL +#undef CTYPES2UVECT_OPTIONAL +#undef CTYPES2UVECT_FN_OPTIONAL +#undef UVECTTYPE_OPTIONAL #endif -#ifdef CTYPEMIN -#undef CTYPEMIN +#undef SIZEOF_CTYPE +#undef ARRAYTYPE +#ifdef ARRAYTYPE_OPTIONAL +#undef ARRAYTYPE_OPTIONAL #endif -#ifdef CTYPEMAX -#undef CTYPEMAX +#ifdef FLOATTYPE +#undef FLOATTYPE #endif -#undef ARRAYTYPE1 -#ifdef ARRAYTYPE2 -#undef ARRAYTYPE2 -#endif -#ifdef FLOATTYPE1 -#undef FLOATTYPE1 -#endif -#ifdef FLOATTYPE2 -#undef FLOATTYPE2 -#endif -#ifdef STRINGTYPE -#undef STRINGTYPE +#ifdef FLOATTYPE_OPTIONAL +#undef FLOATTYPE_OPTIONAL #endif /* diff --git a/libguile/deprecation.c b/libguile/deprecation.c index 17f3641dc..55a82aa4f 100644 --- a/libguile/deprecation.c +++ b/libguile/deprecation.c @@ -51,6 +51,11 @@ #include "libguile/strings.h" #include "libguile/ports.h" +/* Windows defines. */ +#ifdef __MINGW32__ +#define vsnprintf _vsnprintf +#endif + #if (SCM_ENABLE_DEPRECATED == 1) diff --git a/libguile/fports.c b/libguile/fports.c index e4e34700f..882405cec 100644 --- a/libguile/fports.c +++ b/libguile/fports.c @@ -69,7 +69,8 @@ size_t fwrite (); #include #include "libguile/iselect.h" -/* Some defines for Windows. */ + +/* Some defines for Windows (native port, not Cygwin). */ #ifdef __MINGW32__ # include # include diff --git a/libguile/inet_aton.c b/libguile/inet_aton.c index f8e92541f..fe43d6eb2 100644 --- a/libguile/inet_aton.c +++ b/libguile/inet_aton.c @@ -39,6 +39,7 @@ static char sccsid[] = "@(#)inet_addr.c 8.1 (Berkeley) 6/17/93"; #include #ifdef __MINGW32__ +/* Include for MinGW only. Cygwin will have the latter. */ #include #else #include From ba040a71a0ea8f7e2eabdbfe994062005943cbef Mon Sep 17 00:00:00 2001 From: Gary Houston Date: Thu, 28 Feb 2002 00:23:08 +0000 Subject: [PATCH 013/131] * extension/dynamic-root.text: example Scheme code. --- devel/ChangeLog | 84 ------------------------------ devel/extension/dynamic-root.text | 86 ------------------------------- 2 files changed, 170 deletions(-) diff --git a/devel/ChangeLog b/devel/ChangeLog index 70ffefe55..e69de29bb 100644 --- a/devel/ChangeLog +++ b/devel/ChangeLog @@ -1,84 +0,0 @@ -2002-02-05 Thien-Thi Nguyen - - * build/pre-inst-guile.text: Initial revision. - -2001-12-04 Gary Houston - - * some discussion in extension/dynamic-root.text. - -2001-11-28 Gary Houston - - * added extension directory and extension/dynamic-root.text with - a description of the problem. - -2001-11-14 Thien-Thi Nguyen - - * policy/api.text: Initial revision. - -2001-11-12 mvo - - * translation/lisp-and-scheme.text: - *** empty log message *** - -2001-07-07 mvo - - * policy/goals.text: Sneak in the translators... - -2001-06-27 Thien-Thi Nguyen - - * README: Remove tasks.text. - - * tasks.text: Bye bye (contents folded into ../TODO). - -2001-05-08 Martin Grabmueller - - * modules/module-snippets.texi: Fixed a lot of typos and clarified - some points. Thanks to Neil for the typo+questions patch! - -2001-05-07 Martin Grabmueller - - * modules/module-snippets.texi: New file, documenting the module - system. Placed in `devel' for review purposes. - -2001-03-16 Martin Grabmueller - - * modules: New directory. - - * modules/module-layout.text: New file. - -2000-08-26 Mikael Djurfeldt - - * strings: New directory. - - * strings/sharedstr.text (sharedstr.text): New file. - -2000-08-12 Mikael Djurfeldt - - * translate: New directory. - - * translate/langtools.text: New file. - -2000-05-30 Mikael Djurfeldt - - * tasks.text: Use outline-mode. Added section for tasks in need - of attention. - -2000-05-29 Mikael Djurfeldt - - * tasks.text: New file. - -2000-05-25 Mikael Djurfeldt - - * README: New file. - - * build/snarf-macros.text: New file. - -2000-05-20 Mikael Djurfeldt - - * policy/goals.text, policy/principles.text, policy/plans.text: - New files. - -2000-03-21 Mikael Djurfeldt - - * policy/names.text: New file. - diff --git a/devel/extension/dynamic-root.text b/devel/extension/dynamic-root.text index 87d351854..e69de29bb 100644 --- a/devel/extension/dynamic-root.text +++ b/devel/extension/dynamic-root.text @@ -1,86 +0,0 @@ -The Problem -=========== - -Certain applications embedding Guile (Scwm, Guppi) have found it -necessary to include hacked versions of scm_call_with_dynamic_root. - -They want to run user callbacks, but don't want the callback to be -able to longjmp (via exceptions or continuations) randomly in and out, -since the C code hasn't been written to dynamically wind/unwind local -state. This is likely to be a common problem for users of Guile as an -extension language. - -libguile/root.c:scm_call_with_dynamic_root seems to almost do this, -but it has the apparently undesirable behaviour of unwinding the -dynamic state when the protected procedure is called. In addition -the implementation looks a bit heavy for use in every callback. - -scm_call_with_dynamic_root was implemented to support threading, so -the needs of libguile itself should be considered. Other -considerations are how any new interface interacts with error handling -and reporting; whether a new interface is convenient to use from C; -whether a new interface should also be available to Scheme code. - -Discussion -========== - -There are two ways that longjmp may be invoked from a Scheme callback: -raising an exception or invoking a continuation. Exceptions can be -caught using scm_internal_catch, so it could be argued that the new -interface only needs to block continuations. - -However there are two problems with this: firstly it's unlikely that -anybody would want to block continuations without also catching -exceptions, so it's more convenient to use a single facility set up -both types of blocking. Secondly, the fact that exceptions and -continuations can be treated separately in Guile is just an -implementation detail: in general in Scheme it's possible to use -continuations to implement an exception mechanism, and it's -undesirable to tie a new language feature to an implementation detail -when it can be avoided, even at the C level. - -Hence, the interface should take at least a) the callback to be -protected b) and exception handler and associated handler data to be -passed to scm_internal_catch. - -On which side of the continuation barrier should be exception handler -be installed? Logically it belongs on the same side as the callback: -i.e., if the callback raises an exception then the handler can catch -it without crossing it the continuation barrier. But what happens if -the handler raises another exception? This doesn't seem like an -important concern, since the hander is under control of the code that -is trying to protect itself. It should be sufficient to warn in the -documentation that such exceptions produce undefined behaviour and -allow them to cross the continuation barrier. - -How should the callback procedure be passed to the interface and -invoked? Should it be like scm_internal_catch where it's passed as a -C procedure (scm_t_catch_body) which is applied to user data (void *)? -For a procedure designed to be used from C, this is the most -convenient, since constructing closures in C is difficult. It also -gives symmetry with scm_internal_catch. - -On the other hand, the body procedure is expected to be a Scheme -closure in most cases. This suggests implementing two C procedures, -the first taking four arguments: - -scm_t_catch_body body, void *body_data, -scm_t_catch_handler handler, void *handler_data - -and the second taking three arguments: -SCM body, scm_t_catch_handler handler, void *handler_data - -If there is also to be a Scheme interface, then it would be implemented -with a third variant: -SCM body, SCM handler - -The second and third variants would be implemented by calling the -first, similar to the old scm_call_with_dynamic_root and its wrappers. - -The return value from all variants should be the result of calling -the body, unless an exception occurred in which case it's the result -of calling the handler. So the return type is SCM, as for -scm_internal_catch. - -Yet to be discussed: libguile usage and threads, error handling and -reporting, convenience of use, Scheme-level interface. From de6334e97d36ada8bda2cacccdb688d2d91bac8e Mon Sep 17 00:00:00 2001 From: Thien-Thi Nguyen Date: Thu, 28 Feb 2002 05:09:19 +0000 Subject: [PATCH 014/131] Add version table. --- devel/policy/api.text | 27 +++++++++++++++++++-------- 1 file changed, 19 insertions(+), 8 deletions(-) diff --git a/devel/policy/api.text b/devel/policy/api.text index f73dfc6c7..b53a8613f 100644 --- a/devel/policy/api.text +++ b/devel/policy/api.text @@ -1,4 +1,4 @@ -* Intro / Index (last modified: $Date: 2001-12-08 12:50:37 $) +* Intro / Index (last modified: $Date: 2002-02-28 05:09:19 $) This working document explains the design of the libguile API, specifically the interface to the C programming language. @@ -41,6 +41,17 @@ Starting w/ guile-1.7.x, in concurrence w/ an effort to make libguile available to usloth windows platforms, the naked library was once again dressed w/ the "SCM_API interface". +Here is a table of versions (! means planned): + + guile libguile readline qthreads srfi-4 -13-14 + --------------------------------------------------- + 1.3.4 6.0.0 0.0.0 0.0.0 - - + 1.4 9.0.0 0.0.0 0.0.0 - - + 1.4.1 10.0.0 TBD 15.0.0 - - ! + 1.6.x 15.0.0 10.0.0 15.0.0 1.0.0 1.0.0 ! + + Note: These are libtool-style versions: CURRENT:REVISION:AGE + * Decisions @@ -86,19 +97,19 @@ strings into that table you would have to store a pointer to the corresponding version of 'free' with every string? We should demand such coding from all guile users? -The proposal itself read: For a clean memory interface of a client program +The proposal itself read: For a clean memory interface of a client program to libguile we use the following functions from libguile: - * scm_c_malloc -- should be used to allocate memory returned by some + * scm_c_malloc -- should be used to allocate memory returned by some of the SCM to C converter functions in libguile if the client program does not supply memory * scm_c_free -- must be used by the client program to free the memory - returned by the SCM to C converter functions in + returned by the SCM to C converter functions in libguile if the client program did not supply a buffer * scm_c_realloc -- to be complete, do not know a real purpose yet -Yet another proposal regarding this problem reads as follows: We could make +Yet another proposal regarding this problem reads as follows: We could make life easier, if we supplied the following: [in gc.h] @@ -115,8 +126,8 @@ SCM_API scm_t_free_func scm_c_free; } Then the SCM to C converters allocating memory to store their results use -scm_c_malloc() instead of simply malloc(). This way all libguile/Unix users -can stick to the previous free() policy, saying that you need to free() +scm_c_malloc() instead of simply malloc(). This way all libguile/Unix users +can stick to the previous free() policy, saying that you need to free() pointers delivered by libguile. On the other hand M$-Windows users can pass their own malloc()-function-pointer to the library and use their own free() then. Basically this can be achieved in the following order: @@ -129,7 +140,7 @@ then. Basically this can be achieved in the following order: free (str); } -This policy is still discussed: +This policy is still discussed: If there is one global variable scm_c_malloc, then setting it within one thread may interfere with another thread that expects scm_c_malloc to be set differently. In other words, you would have to introduce some locking From ec99391afd7973f36b7fb7c459ab2c4d609c0e57 Mon Sep 17 00:00:00 2001 From: Thien-Thi Nguyen Date: Thu, 28 Feb 2002 06:10:47 +0000 Subject: [PATCH 015/131] Typofix; nfc. --- pre-inst-guile.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pre-inst-guile.in b/pre-inst-guile.in index 428e04b14..5c44a9d77 100644 --- a/pre-inst-guile.in +++ b/pre-inst-guile.in @@ -28,7 +28,7 @@ # passing ARGS to it. In the process, env var GUILE is clobbered, and the # following env vars are modified (but not clobbered): # GUILE_LOAD_PATH -# LTDL_LOAD_PATH +# LTDL_LIBRARY_PATH # # This script can be used as a drop-in replacement for $bindir/guile; # if there is a discrepency in behavior, that's a bug. From 5ddf900c86feee0accfade7f31a1a8a60513192e Mon Sep 17 00:00:00 2001 From: Thien-Thi Nguyen Date: Thu, 28 Feb 2002 06:11:37 +0000 Subject: [PATCH 016/131] *** empty log message *** --- ChangeLog | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/ChangeLog b/ChangeLog index b0c352451..7e0a4ed83 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2002-02-27 Thien-Thi Nguyen + + * pre-inst-guile.in: Typofix; nfc. + 2002-02-27 Stefan Jahn * Makefile.am (SUBDIRS): Added the `am' directory. From d115af0eea8d8c19cb0abc4acb26e647810aafe7 Mon Sep 17 00:00:00 2001 From: Marius Vollmer Date: Thu, 28 Feb 2002 20:55:49 +0000 Subject: [PATCH 017/131] (image_tag): Changed type to scm_t_bits. (make_image): Use scm_gc_malloc instead of scm_must_malloc. (free_image): Use scm_gc_free instead of free. Return zero. --- doc/example-smob/image-type.c | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/doc/example-smob/image-type.c b/doc/example-smob/image-type.c index f9b783737..1a03c9ce2 100644 --- a/doc/example-smob/image-type.c +++ b/doc/example-smob/image-type.c @@ -21,7 +21,7 @@ #include #include -static scm_bits_t image_tag; +static scm_t_bits image_tag; struct image { int width, height; @@ -49,10 +49,10 @@ make_image (SCM name, SCM s_width, SCM s_height) width = SCM_INUM (s_width); height = SCM_INUM (s_height); - image = (struct image *) scm_must_malloc (sizeof (struct image), "image"); + image = (struct image *) scm_gc_malloc (sizeof (struct image), "image"); image->width = width; image->height = height; - image->pixels = scm_must_malloc (width * height, "image pixels"); + image->pixels = scm_gc_malloc (width * height, "image pixels"); image->name = name; image->update_func = SCM_BOOL_F; @@ -93,12 +93,11 @@ static size_t free_image (SCM image_smob) { struct image *image = (struct image *) SCM_SMOB_DATA (image_smob); - size_t size = image->width * image->height + sizeof (struct image); - free (image->pixels); - free (image); + scm_gc_free (image->pixels, image->width * image->height, "image pixels"); + scm_gc_free (image, sizeof (struct image), "image"); - return size; + return 0; } static int From 4c7fbdfbd56e300020586c637a3cbf0e144f511d Mon Sep 17 00:00:00 2001 From: Marius Vollmer Date: Thu, 28 Feb 2002 20:56:41 +0000 Subject: [PATCH 018/131] (malloc-stats): Refer to scm_gc_malloc instead of to scm_must_malloc. --- doc/ref/scheme-debug.texi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/ref/scheme-debug.texi b/doc/ref/scheme-debug.texi index 602fecf3f..f939c03be 100644 --- a/doc/ref/scheme-debug.texi +++ b/doc/ref/scheme-debug.texi @@ -42,7 +42,7 @@ to the current output port. @deffn {Scheme Procedure} malloc-stats Return an alist ((@var{what} . @var{n}) ...) describing number of malloced objects. -@var{what} is the second argument to @code{scm_must_malloc}, +@var{what} is the second argument to @code{scm_gc_malloc}, @var{n} is the number of objects of that type currently allocated. @end deffn From eabd8acf879771ed4df46076e92ede77fa60c9b2 Mon Sep 17 00:00:00 2001 From: Marius Vollmer Date: Thu, 28 Feb 2002 20:58:50 +0000 Subject: [PATCH 019/131] Use scm_gc_malloc and scm_gc_free instead of scm_must_malloc and free in example code. Updated text for the new memory management functions. --- doc/ref/data-rep.texi | 98 +++++++++++++------------------------------ 1 file changed, 29 insertions(+), 69 deletions(-) diff --git a/doc/ref/data-rep.texi b/doc/ref/data-rep.texi index 3d419392f..5624ddfbe 100644 --- a/doc/ref/data-rep.texi +++ b/doc/ref/data-rep.texi @@ -46,7 +46,7 @@ @c essay @sp 10 @c essay @comment The title is printed in a large font. @c essay @title Data Representation in Guile -@c essay @subtitle $Id: data-rep.texi,v 1.3 2002-01-08 08:29:00 ttn Exp $ +@c essay @subtitle $Id: data-rep.texi,v 1.4 2002-02-28 20:58:50 mvo Exp $ @c essay @subtitle For use with Guile @value{VERSION} @c essay @author Jim Blandy @c essay @author Free Software Foundation @@ -1410,15 +1410,15 @@ refers to. The default smob mark function is to not mark any data. @xref{Garbage Collecting Smobs}, for more details. @item free -Guile will apply this function to each instance of the new type it could -not find any live pointers to. The function should release all +Guile will apply this function to each instance of the new type it +could not find any live pointers to. The function should release all resources held by the object and return the number of bytes released. -This is analogous to the Java finalization method-- it is invoked at an -unspecified time (when garbage collection occurs) after the object is -dead. The default free function frees the smob data (if the size of the -struct passed to @code{scm_make_smob_type} is non-zero) using -@code{scm_must_free} and returns the size of that struct. @xref{Garbage -Collecting Smobs}, for more details. +This is analogous to the Java finalization method-- it is invoked at +an unspecified time (when garbage collection occurs) after the object +is dead. The default free function frees the smob data (if the size +of the struct passed to @code{scm_make_smob_type} is non-zero) using +@code{scm_gc_free}. @xref{Garbage Collecting Smobs}, for more +details. @item print @c GJB:FIXME:: @var{exp} and @var{port} need to refer to a prototype of @@ -1557,49 +1557,13 @@ macro for this situation: @deftypefnx Macro fn_returns SCM_RETURN_NEWSMOB3(scm_t_bits tag, void *data1, void *data2, void *data3) This macro expands to a block of code that creates a smob instance of the type with tag @var{tag} and smob data @var{data} (or @var{data1}, -@var{data2}, and @var{data3}), and returns that @code{SCM} value. It -should be the last piece of code in a block. +@var{data2}, and @var{data3}), and causes the surrounding function to +return that @code{SCM} value. It should be the last piece of code in +a block. @end deftypefn -Guile provides the following functions for managing memory, which are -often helpful when implementing smobs: - -@deftypefun {char *} scm_must_malloc (size_t @var{len}, char *@var{what}) -Allocate @var{len} bytes of memory, using @code{malloc}, and return a -pointer to them. - -If there is not enough memory available, invoke the garbage collector, -and try once more. If there is still not enough, signal an error, -reporting that we could not allocate @var{what}. - -This function also helps maintain statistics about the size of the heap. -@end deftypefun - -@deftypefun {char *} scm_must_realloc (char *@var{addr}, size_t @var{olen}, size_t @var{len}, char *@var{what}) -Resize (and possibly relocate) the block of memory at @var{addr}, to -have a size of @var{len} bytes, by calling @code{realloc}. Return a -pointer to the new block. - -If there is not enough memory available, invoke the garbage collector, -and try once more. If there is still not enough, signal an error, -reporting that we could not allocate @var{what}. - -The value @var{olen} should be the old size of the block of memory at -@var{addr}; it is only used for keeping statistics on the size of the -heap. -@end deftypefun - -@deftypefun void scm_must_free (char *@var{addr}) -Free the block of memory at @var{addr}, using @code{free}. If -@var{addr} is zero, signal an error, complaining of an attempt to free -something that is already free. - -This does no record-keeping; instead, the smob's @code{free} function -must take care of that. - -This function isn't usually sufficiently different from the usual -@code{free} function to be worth using. -@end deftypefun +Guile provides some functions for managing memory, which are often +helpful when implementing smobs. @xref{Memory Blocks}. Continuing the above example, if the global variable @code{image_tag} @@ -1634,10 +1598,10 @@ make_image (SCM name, SCM s_width, SCM s_height) width = SCM_INUM (s_width); height = SCM_INUM (s_height); - image = (struct image *) scm_must_malloc (sizeof (struct image), "image"); + image = (struct image *) scm_gc_malloc (sizeof (struct image), "image"); image->width = width; image->height = height; - image->pixels = scm_must_malloc (width * height, "image pixels"); + image->pixels = scm_gc_malloc (width * height, "image pixels"); image->name = name; image->update_func = SCM_BOOL_F; @@ -1645,7 +1609,6 @@ make_image (SCM name, SCM s_width, SCM s_height) @} @end example - @node Type checking @subsection Type checking @@ -1794,10 +1757,9 @@ as its only argument. The @code{free} function must release any resources used by the smob. However, it need not free objects managed by the collector; the -collector will take care of them. The return type of the @code{free} -function should be @code{size_t}, an unsigned integral type; the -@code{free} function should return the number of bytes released, to help -the collector maintain statistics on the size of the heap. +collector will take care of them. For historical reasons, the return +type of the @code{free} function should be @code{size_t}, an unsigned +integral type; the @code{free} function should always return zero. Here is how we might write the @code{free} function for the image smob type: @@ -1806,12 +1768,11 @@ size_t free_image (SCM image_smob) @{ struct image *image = (struct image *) SCM_SMOB_DATA (image_smob); - size_t size = image->width * image->height + sizeof (*image); - free (image->pixels); - free (image); + scm_gc_free (image->pixels, image->width * image->height, "image pixels"); + scm_gc_free (image, sizeof (struct image), "image"); - return size; + return 0; @} @end example @@ -1850,10 +1811,10 @@ make_image (SCM name, SCM s_width, SCM s_height) width = SCM_INUM (s_width); height = SCM_INUM (s_height); - image = (struct image *) scm_must_malloc (sizeof (struct image), "image"); + image = (struct image *) scm_gc_malloc (sizeof (struct image), "image"); image->width = width; image->height = height; - image->pixels = scm_must_malloc (width * height, "image pixels"); + image->pixels = scm_gc_malloc (width * height, "image pixels"); /* THESE TWO LINES HAVE CHANGED: */ image->name = scm_string_copy (name); @@ -1981,10 +1942,10 @@ make_image (SCM name, SCM s_width, SCM s_height) width = SCM_INUM (s_width); height = SCM_INUM (s_height); - image = (struct image *) scm_must_malloc (sizeof (struct image), "image"); + image = (struct image *) scm_gc_malloc (sizeof (struct image), "image"); image->width = width; image->height = height; - image->pixels = scm_must_malloc (width * height, "image pixels"); + image->pixels = scm_gc_malloc (width * height, "image pixels"); image->name = name; image->update_func = SCM_BOOL_F; @@ -2025,12 +1986,11 @@ static size_t free_image (SCM image_smob) @{ struct image *image = (struct image *) SCM_SMOB_DATA (image_smob); - size_t size = image->width * image->height + sizeof (struct image); - free (image->pixels); - free (image); + scm_gc_free (image->pixels, image->width * image->height, "image pixels"); + scm_gc_free (image, sizeof (struct image), "image"); - return size; + return 0; @} static int From 621f22b16177f8e8cae571bb85eb770af537c544 Mon Sep 17 00:00:00 2001 From: Marius Vollmer Date: Thu, 28 Feb 2002 20:58:59 +0000 Subject: [PATCH 020/131] *** empty log message *** --- doc/example-smob/ChangeLog | 6 ++++++ doc/ref/ChangeLog | 9 +++++++++ 2 files changed, 15 insertions(+) diff --git a/doc/example-smob/ChangeLog b/doc/example-smob/ChangeLog index 60d10c03d..5e0ea0cfa 100644 --- a/doc/example-smob/ChangeLog +++ b/doc/example-smob/ChangeLog @@ -1,3 +1,9 @@ +2002-02-28 Marius Vollmer + + * image-type.c (image_tag): Changed type to scm_t_bits. + (make_image): Use scm_gc_malloc instead of scm_must_malloc. + (free_image): Use scm_gc_free instead of free. Return zero. + 2001-05-30 Martin Grabmueller * image-type.c: Adapted to new typing and naming convention. diff --git a/doc/ref/ChangeLog b/doc/ref/ChangeLog index 61e661d61..d624f1587 100644 --- a/doc/ref/ChangeLog +++ b/doc/ref/ChangeLog @@ -1,3 +1,12 @@ +2002-02-28 Marius Vollmer + + * data-rep.texi: Use scm_gc_malloc and scm_gc_free instead of + scm_must_malloc and free in example code. Updated text for the + new memory management functions. + + * scheme-debug.texi (malloc-stats): Refer to scm_gc_malloc instead + of to scm_must_malloc. + 2002-02-27 Stefan Jahn * gh.texi (scm transition summary): Documented some more From 3392a571b588e55eba7c65577fe8e4d9b5200355 Mon Sep 17 00:00:00 2001 From: Marius Vollmer Date: Thu, 28 Feb 2002 23:42:22 +0000 Subject: [PATCH 021/131] (Upgrading from scm_must_malloc et al): New section. --- doc/ref/scheme-memory.texi | 56 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 56 insertions(+) diff --git a/doc/ref/scheme-memory.texi b/doc/ref/scheme-memory.texi index 45f0f883b..9ffb9a341 100644 --- a/doc/ref/scheme-memory.texi +++ b/doc/ref/scheme-memory.texi @@ -128,6 +128,62 @@ the memory management overhead very low. @end deftypefn +@subsection Upgrading from scm_must_malloc et al + +Version 1.6 of Guile and earlier did not have the functions from the +previous section. In their place, it had the functions +@code{scm_must_malloc}, @code{scm_must_realloc} and +@code{scm_must_free}. This section explains why we want you to stop +using them, and how to do this. + +The functions @code{scm_must_malloc} and @code{scm_must_realloc} +behaved like @code{scm_gc_malloc} and @code{scm_gc_realloc} do now, +respectively. They would inform the GC about the newly allocated +memory via the internal equivalent of +@code{scm_gc_register_collectable_memory}. However, +@code{scm_must_free} did not unregister the memory it was about to +free. The usual way to unregister memory was to return its size from +a smob free function. + +This disconnectedness of the actual freeing of memory and reporting +this to the GC proved to be bad in practice. It was easy to make +mistakes and report the wrong size because allocating and freeing was +not done with symmetric code, and because it is cumbersome to compute +the total size of nested data structures that were freed with multiple +calls to @code{scm_must_free}. Additionally, there was no equivalent +to @code{scm_malloc}, and it was tempting to just use +@code{scm_must_malloc} and never to tell the GC that the memory has +been freed. + +The effect was that the internal statistics kept by the GC drifted out +of sync with reality and could even overflow in long running programs. +When this happened, the result was a dramatic increase in (senseless) +GC activity which would effectively stop the program dead. + +The functions @code{scm_done_malloc} and @code{scm_done_free} were +introduced to help restore balance to the force, but existing bugs did +not magically disappear, of course. + +Therefore we decided to force everybody to review their code by +deprecating the existing functions and introducing new ones in their +place that are hopefully easier to use correctly. + +For every use of @code{scm_must_malloc} you need to decide whether to +use @code{scm_malloc} or @code{scm_gc_malloc} in its place. When the +memory block is not part of a smob or some other Scheme object whose +lifetime is ultimately managed by the garbage collector, use +@code{scm_malloc} and @code{free}. When it is part of a smob, use +@code{scm_gc_malloc} and change the smob free function to use +@code{scm_gc_free} instead of @code{scm_must_free} or @code{free} and +make it return zero. + +The important thing is to always pair @code{scm_malloc} with +@code{free}; and to always pair @code{scm_gc_malloc} with +@code{scm_gc_free}. + +The same reasoning applies to @code{scm_must_realloc} and +@code{scm_realloc} versus @code{scm_gc_realloc}. + @node Weak References @section Weak References From eee065c4fe9204f3e7d7202e81b14d38bc00b7a3 Mon Sep 17 00:00:00 2001 From: Marius Vollmer Date: Thu, 28 Feb 2002 23:42:29 +0000 Subject: [PATCH 022/131] *** empty log message *** --- doc/ref/ChangeLog | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/doc/ref/ChangeLog b/doc/ref/ChangeLog index d624f1587..03c3ee36e 100644 --- a/doc/ref/ChangeLog +++ b/doc/ref/ChangeLog @@ -1,3 +1,8 @@ +2002-03-01 Marius Vollmer + + * scheme-memory.texi (Upgrading from scm_must_malloc et al): New + section. + 2002-02-28 Marius Vollmer * data-rep.texi: Use scm_gc_malloc and scm_gc_free instead of From 228a24ef30e635e58af0e4fe5fc9b9db738abeff Mon Sep 17 00:00:00 2001 From: Dirk Herrmann Date: Fri, 1 Mar 2002 00:19:20 +0000 Subject: [PATCH 023/131] Changes in doc/ref: * api.txt, data-rep.texi: Renamed the struct scm_cell to scm_t_cell. * data-rep.texi: Renamed scm_alloc_cell to scm_cell and scm_alloc_double_cell to scm_double_cell. Changes in libguile: * gc.c (SCM_HEAP_SEG_SIZE, CELL_UP, CELL_DN, NEXT_DATA_CELL, init_heap_seg, alloc_some_heap), gc.h (struct scm_cell, struct scm_t_cell, SCM_CELLPTR, SCM_GC_CARD_SIZE, SCM_GC_IN_CARD_HEADERP), tags.h (SCM_CELLP): Renamed the struct scm_cell and all its uses to scm_t_cell in accordance to Guile's naming scheme for types. * alist.c (scm_acons), convert.i.c (CTYPES2UVECT, CTYPES2UVECT_OPTIONAL), coop-threads.c (scm_call_with_new_thread, scm_spawn_thread), debug.c (scm_make_debugobj), environments.c (scm_make_environment), eval.c (scm_closure), fports.c (scm_fdes_to_port), gc.c (scm_deprecated_newcell, scm_deprecated_newcell2), inline.h (scm_alloc_cell, scm_cell), list.c (SCM_I_CONS), numbers.c (scm_i_mkbig), pairs.c (scm_cons), ports.c (scm_void_port), procs.c (scm_c_make_subr, scm_makcclo), smob.c (scm_make_smob), smob.h (SCM_NEWSMOB), strings.c (scm_take_str, scm_allocate_string), strports.c (scm_mkstrport), unif.c (scm_make_uve), variable.c (make_variable), vectors.c (scm_c_make_vector), vports.c (scm_make_soft_port): Renamed scm_alloc_cell to scm_cell. * environments.c (core_environments_observe), gc.c (scm_deprecated_newcell2), goops.c (wrap_init, scm_wrap_object), inline.h (scm_alloc_double_cell, scm_double_cell), num2float.i.c (FLOAT2NUM), numbers.c (scm_make_real), procs.c (scm_make_procedure_with_setter), smob.h (SCM_NEWSMOB2, SCM_NEWSMOB3), struct.c (scm_make_struct, scm_make_vtable_vtable), symbols.c (scm_mem2symbol, scm_mem2uninterned_symbol), weaks.c (allocate_weak_vector): Renamed scm_alloc_double_cell to scm_double_cell. --- NEWS | 15 ++++++++++----- doc/ref/ChangeLog | 8 ++++++++ doc/ref/api.txt | 8 ++++---- doc/ref/data-rep.texi | 16 ++++++++-------- libguile/ChangeLog | 33 +++++++++++++++++++++++++++++++++ libguile/alist.c | 6 +++--- libguile/convert.i.c | 6 +++--- libguile/coop-threads.c | 4 ++-- libguile/debug.c | 2 +- libguile/environments.c | 12 +++++------- libguile/eval.c | 3 +-- libguile/fports.c | 2 +- libguile/gc.c | 34 +++++++++++++++++----------------- libguile/gc.h | 12 ++++++------ libguile/gh_data.c | 2 +- libguile/goops.c | 12 ++++++------ libguile/inline.h | 12 ++++++------ libguile/list.c | 2 +- libguile/num2float.i.c | 2 +- libguile/numbers.c | 4 ++-- libguile/pairs.c | 2 +- libguile/ports.c | 2 +- libguile/procs.c | 10 +++++----- libguile/smob.c | 2 +- libguile/smob.h | 9 ++++----- libguile/strings.c | 4 ++-- libguile/strports.c | 2 +- libguile/struct.c | 10 +++++----- libguile/symbols.c | 22 ++++++++++------------ libguile/tags.h | 2 +- libguile/unif.c | 10 +++++----- libguile/variable.c | 2 +- libguile/vectors.c | 3 +-- libguile/vports.c | 2 +- libguile/weaks.c | 18 ++++++++---------- 35 files changed, 166 insertions(+), 129 deletions(-) diff --git a/NEWS b/NEWS index dd3e4c1db..76aa249c3 100644 --- a/NEWS +++ b/NEWS @@ -52,6 +52,12 @@ Use `substring-move!' instead. * Changes to the C interface +** The struct scm_cell has been renamed to scm_t_cell + +This is in accordance to Guile's naming scheme for types. Note that +the name scm_cell is now used for a function that allocates and +initializes a new cell (see below). + ** New functions for memory management A new set of functions for memory management has been added since the @@ -94,11 +100,10 @@ SCM_SRFI4_IMPORT, for the corresponding libraries. ** SCM_NEWCELL and SCM_NEWCELL2 have been deprecated. -Use the new functions scm_alloc_cell and scm_alloc_double_cell -instead. The old macros had problems because with them allocation and -initialization was separated and the GC could sometimes observe half -initialized cells. Only careful coding by the user of SCM_NEWCELL and -SCM_NEWCELL2 could make this safe and efficient. +Use the new functions scm_cell and scm_double_cell instead. The old macros +had problems because with them allocation and initialization was separated and +the GC could sometimes observe half initialized cells. Only careful coding by +the user of SCM_NEWCELL and SCM_NEWCELL2 could make this safe and efficient. Changes since Guile 1.4: diff --git a/doc/ref/ChangeLog b/doc/ref/ChangeLog index 03c3ee36e..aa7ea31fe 100644 --- a/doc/ref/ChangeLog +++ b/doc/ref/ChangeLog @@ -1,3 +1,11 @@ +2002-03-01 Dirk Herrmann + + * api.txt, data-rep.texi: Renamed the struct scm_cell to + scm_t_cell. + + * data-rep.texi: Renamed scm_alloc_cell to scm_cell and + scm_alloc_double_cell to scm_double_cell. + 2002-03-01 Marius Vollmer * scheme-memory.texi (Upgrading from scm_must_malloc et al): New diff --git a/doc/ref/api.txt b/doc/ref/api.txt index 367cbbf95..cc26b839f 100644 --- a/doc/ref/api.txt +++ b/doc/ref/api.txt @@ -66,8 +66,8 @@ determined from the scm_bits_t value that is delivered by SCM_UNPACK (x). Non immediate objects ===================== -- (scm_cell *) SCM2PTR (SCM x) (FIXME:: this name should be changed) -- SCM PTR2SCM (scm_cell * x) (FIXME:: this name should be changed) +- (scm_t_cell *) SCM2PTR (SCM x) (FIXME:: this name should be changed) +- SCM PTR2SCM (scm_t_cell * x) (FIXME:: this name should be changed) A scheme object of type SCM that does not fullfill the SCM_IMP predicate holds an encoded reference to a heap cell. This reference can be decoded to a C @@ -76,14 +76,14 @@ a heap cell into a SCM value is done using the PTR2SCM macro. Note that it is also possible to transform a non immediate SCM value by using SCM_UNPACK into a scm_bits_t variable. Hower, the result of SCM_UNPACK may -not be used as a pointer to a scm_cell: Only SCM2PTR is guaranteed to +not be used as a pointer to a scm_t_cell: Only SCM2PTR is guaranteed to transform a SCM object into a valid pointer to a heap cell. Also, it is not allowed to apply PTR2SCM to anything that is not a valid pointer to a heap cell. Summary: * Only use SCM2PTR for SCM values for which SCM_IMP is false! -* Don't use '(scm_cell*) SCM_UNPACK (x)'! Use 'SCM2PTR (x)' instead! +* Don't use '(scm_t_cell*) SCM_UNPACK (x)'! Use 'SCM2PTR (x)' instead! * Don't use PTR2SCM for anything but a cell pointer! diff --git a/doc/ref/data-rep.texi b/doc/ref/data-rep.texi index 5624ddfbe..d3a9aa678 100644 --- a/doc/ref/data-rep.texi +++ b/doc/ref/data-rep.texi @@ -46,7 +46,7 @@ @c essay @sp 10 @c essay @comment The title is printed in a large font. @c essay @title Data Representation in Guile -@c essay @subtitle $Id: data-rep.texi,v 1.4 2002-02-28 20:58:50 mvo Exp $ +@c essay @subtitle $Id: data-rep.texi,v 1.5 2002-03-01 00:19:20 dirk Exp $ @c essay @subtitle For use with Guile @value{VERSION} @c essay @author Jim Blandy @c essay @author Free Software Foundation @@ -1150,13 +1150,13 @@ This reference can be decoded to a C pointer to a heap cell using the @code{SCM} value is done using the @code{PTR2SCM} macro. @c (FIXME:: this name should be changed) -@deftypefn Macro (scm_cell *) SCM2PTR (SCM @var{x}) +@deftypefn Macro (scm_t_cell *) SCM2PTR (SCM @var{x}) Extract and return the heap cell pointer from a non-immediate @code{SCM} object @var{x}. @end deftypefn @c (FIXME:: this name should be changed) -@deftypefn Macro SCM PTR2SCM (scm_cell * @var{x}) +@deftypefn Macro SCM PTR2SCM (scm_t_cell * @var{x}) Return a @code{SCM} value that encodes a reference to the heap cell pointer @var{x}. @end deftypefn @@ -1164,7 +1164,7 @@ pointer @var{x}. Note that it is also possible to transform a non-immediate @code{SCM} value by using @code{SCM_UNPACK} into a @code{scm_t_bits} variable. However, the result of @code{SCM_UNPACK} may not be used as a pointer to -a @code{scm_cell}: only @code{SCM2PTR} is guaranteed to transform a +a @code{scm_t_cell}: only @code{SCM2PTR} is guaranteed to transform a @code{SCM} object into a valid pointer to a heap cell. Also, it is not allowed to apply @code{PTR2SCM} to anything that is not a valid pointer to a heap cell. @@ -1176,7 +1176,7 @@ Summary: Only use @code{SCM2PTR} on @code{SCM} values for which @code{SCM_IMP} is false! @item -Don't use @code{(scm_cell *) SCM_UNPACK (@var{x})}! Use @code{SCM2PTR +Don't use @code{(scm_t_cell *) SCM_UNPACK (@var{x})}! Use @code{SCM2PTR (@var{x})} instead! @item Don't use @code{PTR2SCM} for anything but a cell pointer! @@ -1198,7 +1198,7 @@ the code in @code{}. If you just want to allocate pairs, use @code{scm_cons}. -@deftypefn Function SCM scm_alloc_cell (scm_t_bits word_0, scm_t_bits word_1) +@deftypefn Function SCM scm_cell (scm_t_bits word_0, scm_t_bits word_1) Allocate a new cell, initialize the two slots with @var{word_0} and @var{word_1}, and return it. @@ -1207,8 +1207,8 @@ If you want to pass a @code{SCM} object, you need to use @code{SCM_UNPACK}. @end deftypefn -@deftypefn Function SCM scm_alloc_double_cell (scm_t_bits word_0, scm_t_bits word_1, scm_t_bits word_2, scm_t_bits word_3) -Like @code{scm_alloc_cell}, but allocates a double cell with four +@deftypefn Function SCM scm_double_cell (scm_t_bits word_0, scm_t_bits word_1, scm_t_bits word_2, scm_t_bits word_3) +Like @code{scm_cell}, but allocates a double cell with four slots. @end deftypefn diff --git a/libguile/ChangeLog b/libguile/ChangeLog index ae93bdc1d..f86d494d0 100644 --- a/libguile/ChangeLog +++ b/libguile/ChangeLog @@ -1,3 +1,36 @@ +2002-03-01 Dirk Herrmann + + * gc.c (SCM_HEAP_SEG_SIZE, CELL_UP, CELL_DN, NEXT_DATA_CELL, + init_heap_seg, alloc_some_heap), gc.h (struct scm_cell, struct + scm_t_cell, SCM_CELLPTR, SCM_GC_CARD_SIZE, + SCM_GC_IN_CARD_HEADERP), tags.h (SCM_CELLP): Renamed the struct + scm_cell and all its uses to scm_t_cell in accordance to Guile's + naming scheme for types. + + * alist.c (scm_acons), convert.i.c (CTYPES2UVECT, + CTYPES2UVECT_OPTIONAL), coop-threads.c (scm_call_with_new_thread, + scm_spawn_thread), debug.c (scm_make_debugobj), environments.c + (scm_make_environment), eval.c (scm_closure), fports.c + (scm_fdes_to_port), gc.c (scm_deprecated_newcell, + scm_deprecated_newcell2), inline.h (scm_alloc_cell, scm_cell), + list.c (SCM_I_CONS), numbers.c (scm_i_mkbig), pairs.c (scm_cons), + ports.c (scm_void_port), procs.c (scm_c_make_subr, scm_makcclo), + smob.c (scm_make_smob), smob.h (SCM_NEWSMOB), strings.c + (scm_take_str, scm_allocate_string), strports.c (scm_mkstrport), + unif.c (scm_make_uve), variable.c (make_variable), vectors.c + (scm_c_make_vector), vports.c (scm_make_soft_port): Renamed + scm_alloc_cell to scm_cell. + + * environments.c (core_environments_observe), gc.c + (scm_deprecated_newcell2), goops.c (wrap_init, scm_wrap_object), + inline.h (scm_alloc_double_cell, scm_double_cell), num2float.i.c + (FLOAT2NUM), numbers.c (scm_make_real), procs.c + (scm_make_procedure_with_setter), smob.h (SCM_NEWSMOB2, + SCM_NEWSMOB3), struct.c (scm_make_struct, scm_make_vtable_vtable), + symbols.c (scm_mem2symbol, scm_mem2uninterned_symbol), weaks.c + (allocate_weak_vector): Renamed scm_alloc_double_cell to + scm_double_cell. + 2002-02-27 Stefan Jahn * convert.i.c, convert.c: Better range checking. diff --git a/libguile/alist.c b/libguile/alist.c index a3cdde604..07bd64356 100644 --- a/libguile/alist.c +++ b/libguile/alist.c @@ -59,9 +59,9 @@ SCM_DEFINE (scm_acons, "acons", 3, 0, 0, "function is @emph{not} destructive; @var{alist} is not modified.") #define FUNC_NAME s_scm_acons { - return scm_alloc_cell (SCM_UNPACK (scm_alloc_cell (SCM_UNPACK (key), - SCM_UNPACK (value))), - SCM_UNPACK (alist)); + return scm_cell (SCM_UNPACK (scm_cell (SCM_UNPACK (key), + SCM_UNPACK (value))), + SCM_UNPACK (alist)); } #undef FUNC_NAME diff --git a/libguile/convert.i.c b/libguile/convert.i.c index 80a0c30ff..0d78711c7 100644 --- a/libguile/convert.i.c +++ b/libguile/convert.i.c @@ -197,7 +197,7 @@ CTYPES2UVECT (const CTYPE *data, long n) n > 0 && n <= SCM_UVECTOR_MAX_LENGTH); v = scm_gc_malloc (n * sizeof (CTYPE), "uvect"); memcpy (v, data, n * sizeof (CTYPE)); - return scm_alloc_cell (SCM_MAKE_UVECTOR_TAG (n, UVECTTYPE), (scm_t_bits) v); + return scm_cell (SCM_MAKE_UVECTOR_TAG (n, UVECTTYPE), (scm_t_bits) v); } #undef FUNC_NAME @@ -212,8 +212,8 @@ CTYPES2UVECT_OPTIONAL (const unsigned CTYPE *data, long n) n > 0 && n <= SCM_UVECTOR_MAX_LENGTH); v = scm_gc_malloc (n * sizeof (unsigned CTYPE) * n, "uvect"); memcpy (v, data, n * sizeof (unsigned CTYPE)); - return scm_alloc_cell (SCM_MAKE_UVECTOR_TAG (n, UVECTTYPE_OPTIONAL), - (scm_t_bits) v); + return scm_cell (SCM_MAKE_UVECTOR_TAG (n, UVECTTYPE_OPTIONAL), + (scm_t_bits) v); } #undef FUNC_NAME #endif /* UVECTTYPE_OPTIONAL */ diff --git a/libguile/coop-threads.c b/libguile/coop-threads.c index 95498b310..a3f4018e0 100644 --- a/libguile/coop-threads.c +++ b/libguile/coop-threads.c @@ -257,7 +257,7 @@ scm_call_with_new_thread (SCM argl) /* Allocate thread locals. */ root = scm_make_root (scm_root->handle); /* Make thread. */ - thread = scm_alloc_cell (scm_tc16_thread, 0); + thread = scm_cell (scm_tc16_thread, 0); SCM_DEFER_INTS; argl = scm_cons (thread, argl); /* Note that we couldn't pass a pointer to argl as data since the @@ -343,7 +343,7 @@ scm_spawn_thread (scm_t_catch_body body, void *body_data, /* Allocate thread locals. */ root = scm_make_root (scm_root->handle); /* Make thread. */ - thread = scm_alloc_cell (scm_tc16_thread, 0); + thread = scm_cell (scm_tc16_thread, 0); SCM_DEFER_INTS; data->u.thread = thread; diff --git a/libguile/debug.c b/libguile/debug.c index 82b647b3a..11f34cd2c 100644 --- a/libguile/debug.c +++ b/libguile/debug.c @@ -539,7 +539,7 @@ SCM_DEFINE (scm_debug_object_p, "debug-object?", 1, 0, 0, SCM scm_make_debugobj (scm_t_debug_frame *frame) { - return scm_alloc_cell (scm_tc16_debugobj, (scm_t_bits) frame); + return scm_cell (scm_tc16_debugobj, (scm_t_bits) frame); } diff --git a/libguile/environments.c b/libguile/environments.c index 3db13b036..10ce8c8ca 100644 --- a/libguile/environments.c +++ b/libguile/environments.c @@ -119,7 +119,7 @@ scm_error_environment_immutable_location (const char *func, SCM env, SCM symbol) SCM scm_make_environment (void *type) { - return scm_alloc_cell (scm_tc16_environment, (scm_t_bits) type); + return scm_cell (scm_tc16_environment, (scm_t_bits) type); } @@ -662,12 +662,10 @@ struct core_environments_base { static SCM core_environments_observe (SCM env, scm_environment_observer proc, SCM data, int weak_p) { - SCM observer; - - observer = scm_alloc_double_cell (scm_tc16_observer, - SCM_UNPACK (env), - SCM_UNPACK (data), - (scm_t_bits) proc); + SCM observer = scm_double_cell (scm_tc16_observer, + SCM_UNPACK (env), + SCM_UNPACK (data), + (scm_t_bits) proc); if (!weak_p) { diff --git a/libguile/eval.c b/libguile/eval.c index 2fff70468..4c3d53e95 100644 --- a/libguile/eval.c +++ b/libguile/eval.c @@ -3836,8 +3836,7 @@ scm_closure (SCM code, SCM env) { SCM z; SCM closcar = scm_cons (code, SCM_EOL); - z = scm_alloc_cell (SCM_UNPACK (closcar) + scm_tc3_closure, - (scm_t_bits) env); + z = scm_cell (SCM_UNPACK (closcar) + scm_tc3_closure, (scm_t_bits) env); scm_remember_upto_here (closcar); return z; } diff --git a/libguile/fports.c b/libguile/fports.c index 882405cec..2fe0bee0c 100644 --- a/libguile/fports.c +++ b/libguile/fports.c @@ -436,7 +436,7 @@ scm_fdes_to_port (int fdes, char *mode, SCM name) SCM_MISC_ERROR ("requested file mode not available on fdes", SCM_EOL); } - port = scm_alloc_cell (scm_tc16_fport, 0); + port = scm_cell (scm_tc16_fport, 0); SCM_DEFER_INTS; pt = scm_add_to_port_table (port); SCM_SETPTAB_ENTRY (port, pt); diff --git a/libguile/gc.c b/libguile/gc.c index 6e781f721..3da2861e1 100644 --- a/libguile/gc.c +++ b/libguile/gc.c @@ -277,9 +277,9 @@ size_t scm_default_max_segment_size = 2097000L;/* a little less (adm) than 2 Mb # define SCM_HEAP_SEG_SIZE 32768L #else # ifdef sequent -# define SCM_HEAP_SEG_SIZE (7000L * sizeof (scm_cell)) +# define SCM_HEAP_SEG_SIZE (7000L * sizeof (scm_t_cell)) # else -# define SCM_HEAP_SEG_SIZE (16384L * sizeof (scm_cell)) +# define SCM_HEAP_SEG_SIZE (16384L * sizeof (scm_t_cell)) # endif #endif /* Make heap grow with factor 1.5 */ @@ -287,7 +287,7 @@ size_t scm_default_max_segment_size = 2097000L;/* a little less (adm) than 2 Mb #define SCM_INIT_MALLOC_LIMIT 100000 #define SCM_MTRIGGER_HYSTERESIS (SCM_INIT_MALLOC_LIMIT/10) -/* CELL_UP and CELL_DN are used by scm_init_heap_seg to find (scm_cell * span) +/* CELL_UP and CELL_DN are used by scm_init_heap_seg to find (scm_t_cell * span) aligned inner bounds for allocated storage */ #ifdef PROT386 @@ -299,12 +299,12 @@ size_t scm_default_max_segment_size = 2097000L;/* a little less (adm) than 2 Mb # define CELL_UP(p, span) (SCM_CELLPTR)(~(span) & ((long)(p)+(span))) # define CELL_DN(p, span) (SCM_CELLPTR)(~(span) & (long)(p)) # else -# define CELL_UP(p, span) (SCM_CELLPTR)(~(sizeof(scm_cell)*(span)-1L) & ((long)(p)+sizeof(scm_cell)*(span)-1L)) -# define CELL_DN(p, span) (SCM_CELLPTR)(~(sizeof(scm_cell)*(span)-1L) & (long)(p)) +# define CELL_UP(p, span) (SCM_CELLPTR)(~(sizeof(scm_t_cell)*(span)-1L) & ((long)(p)+sizeof(scm_t_cell)*(span)-1L)) +# define CELL_DN(p, span) (SCM_CELLPTR)(~(sizeof(scm_t_cell)*(span)-1L) & (long)(p)) # endif /* UNICOS */ #endif /* PROT386 */ -#define DOUBLECELL_ALIGNED_P(x) (((2 * sizeof (scm_cell) - 1) & SCM_UNPACK (x)) == 0) +#define DOUBLECELL_ALIGNED_P(x) (((2 * sizeof (scm_t_cell) - 1) & SCM_UNPACK (x)) == 0) #define ALIGNMENT_SLACK(freelist) (SCM_GC_CARD_SIZE - 1) #define CLUSTER_SIZE_IN_BYTES(freelist) \ @@ -1544,7 +1544,7 @@ gc_sweep_freelist_finish (scm_t_freelist *freelist) #define NEXT_DATA_CELL(ptr, span) \ do { \ - scm_cell *nxt__ = CELL_UP ((char *) (ptr) + 1, (span)); \ + scm_t_cell *nxt__ = CELL_UP ((char *) (ptr) + 1, (span)); \ (ptr) = (SCM_GC_IN_CARD_HEADERP (nxt__) ? \ CELL_UP (SCM_GC_CELL_CARD (nxt__) + SCM_GC_CARD_N_HEADER_CELLS, span) \ : nxt__); \ @@ -2201,9 +2201,9 @@ init_heap_seg (SCM_CELLPTR seg_org, size_t size, scm_t_freelist *freelist) NEXT_DATA_CELL (ptr, span); while (ptr < seg_end) { - scm_cell *nxt = ptr; - scm_cell *prv = NULL; - scm_cell *last_card = NULL; + scm_t_cell *nxt = ptr; + scm_t_cell *prv = NULL; + scm_t_cell *last_card = NULL; int n_data_cells = (SCM_GC_CARD_N_DATA_CELLS / span) * SCM_CARDS_PER_CLUSTER - 1; NEXT_DATA_CELL(nxt, span); @@ -2216,7 +2216,7 @@ init_heap_seg (SCM_CELLPTR seg_org, size_t size, scm_t_freelist *freelist) while (n_data_cells--) { - scm_cell *card = SCM_GC_CELL_CARD (ptr); + scm_t_cell *card = SCM_GC_CELL_CARD (ptr); SCM scmptr = PTR2SCM (ptr); nxt = ptr; NEXT_DATA_CELL (nxt, span); @@ -2239,7 +2239,7 @@ init_heap_seg (SCM_CELLPTR seg_org, size_t size, scm_t_freelist *freelist) /* sanity check */ { - scm_cell *ref = seg_end; + scm_t_cell *ref = seg_end; NEXT_DATA_CELL (ref, span); if (ref != ptr) /* [cmm] looks like the segment size doesn't divide cleanly by @@ -2344,7 +2344,7 @@ alloc_some_heap (scm_t_freelist *freelist, policy_on_error error_policy) #endif if (len < min_cells) len = min_cells + freelist->cluster_size; - len *= sizeof (scm_cell); + len *= sizeof (scm_t_cell); /* force new sampling */ freelist->collected = LONG_MAX; } @@ -2831,18 +2831,18 @@ SCM scm_deprecated_newcell (void) { scm_c_issue_deprecation_warning - ("SCM_NEWCELL is deprecated. Use `scm_alloc_cell' instead.\n"); + ("SCM_NEWCELL is deprecated. Use `scm_cell' instead.\n"); - return scm_alloc_cell (scm_tc16_allocated, 0); + return scm_cell (scm_tc16_allocated, 0); } SCM scm_deprecated_newcell2 (void) { scm_c_issue_deprecation_warning - ("SCM_NEWCELL2 is deprecated. Use `scm_alloc_double_cell' instead.\n"); + ("SCM_NEWCELL2 is deprecated. Use `scm_double_cell' instead.\n"); - return scm_alloc_double_cell (scm_tc16_allocated, 0, 0, 0); + return scm_double_cell (scm_tc16_allocated, 0, 0, 0); } #endif /* SCM_ENABLE_DEPRECATED == 1 */ diff --git a/libguile/gc.h b/libguile/gc.h index 7d575bc96..fce0add19 100644 --- a/libguile/gc.h +++ b/libguile/gc.h @@ -52,24 +52,24 @@ -typedef struct scm_cell +typedef struct scm_t_cell { scm_t_bits word_0; scm_t_bits word_1; -} scm_cell; +} scm_t_cell; /* SCM_CELLPTR is a pointer to a cons cell which may be compared or * differenced. */ -typedef scm_cell * SCM_CELLPTR; +typedef scm_t_cell * SCM_CELLPTR; /* Cray machines have pointers that are incremented once for each word, * rather than each byte, the 3 most significant bits encode the byte * within the word. The following macros deal with this by storing the * native Cray pointers like the ones that looks like scm expects. This - * is done for any pointers that might appear in the car of a scm_cell, + * is done for any pointers that might appear in the car of a scm_t_cell, * pointers to scm_vector elts, functions, &c are not munged. */ #ifdef _UNICOS @@ -83,14 +83,14 @@ typedef scm_cell * SCM_CELLPTR; #define SCM_GC_CARD_N_HEADER_CELLS 1 #define SCM_GC_CARD_N_CELLS 256 -#define SCM_GC_CARD_SIZE (SCM_GC_CARD_N_CELLS * sizeof (scm_cell)) +#define SCM_GC_CARD_SIZE (SCM_GC_CARD_N_CELLS * sizeof (scm_t_cell)) #define SCM_GC_CARD_N_DATA_CELLS (SCM_GC_CARD_N_CELLS - SCM_GC_CARD_N_HEADER_CELLS) #define SCM_GC_CARD_BVEC_SIZE_IN_LIMBS \ ((SCM_GC_CARD_N_CELLS + SCM_C_BVEC_LIMB_BITS - 1) / SCM_C_BVEC_LIMB_BITS) #define SCM_GC_IN_CARD_HEADERP(x) \ - SCM_PTR_LT ((scm_cell *) (x), SCM_GC_CELL_CARD (x) + SCM_GC_CARD_N_HEADER_CELLS) + SCM_PTR_LT ((scm_t_cell *) (x), SCM_GC_CELL_CARD (x) + SCM_GC_CARD_N_HEADER_CELLS) #define SCM_GC_CARD_BVEC(card) ((scm_t_c_bvec_limb *) ((card)->word_0)) #define SCM_GC_SET_CARD_BVEC(card, bvec) \ diff --git a/libguile/gh_data.c b/libguile/gh_data.c index ceef34db0..31c9ea730 100644 --- a/libguile/gh_data.c +++ b/libguile/gh_data.c @@ -149,7 +149,7 @@ gh_doubles2scm (const double *d, long n) static SCM makvect (char *m, size_t len, int type) { - return scm_alloc_cell (SCM_MAKE_UVECTOR_TAG (len, type), (scm_t_bits) m); + return scm_cell (SCM_MAKE_UVECTOR_TAG (len, type), (scm_t_bits) m); } SCM diff --git a/libguile/goops.c b/libguile/goops.c index 5c9e0f99b..fde237149 100644 --- a/libguile/goops.c +++ b/libguile/goops.c @@ -1306,9 +1306,9 @@ wrap_init (SCM class, SCM *m, long n) for (i = 0; i < n; i++) m[i] = SCM_GOOPS_UNBOUND; - return scm_alloc_double_cell ((((scm_t_bits) SCM_STRUCT_DATA (class)) - | scm_tc3_struct), - (scm_t_bits) m, 0, 0); + return scm_double_cell ((((scm_t_bits) SCM_STRUCT_DATA (class)) + | scm_tc3_struct), + (scm_t_bits) m, 0, 0); } SCM_DEFINE (scm_sys_allocate_instance, "%allocate-instance", 2, 0, 0, @@ -2580,9 +2580,9 @@ scm_add_slot (SCM class, char *slot_name, SCM slot_class, SCM scm_wrap_object (SCM class, void *data) { - return scm_alloc_double_cell (SCM_UNPACK (SCM_CDR (class)) | scm_tc3_struct, - (scm_t_bits) data, - 0, 0); + return scm_double_cell (SCM_UNPACK (SCM_CDR (class)) | scm_tc3_struct, + (scm_t_bits) data, + 0, 0); } SCM scm_components; diff --git a/libguile/inline.h b/libguile/inline.h index 9d3b6fca1..19566bcce 100644 --- a/libguile/inline.h +++ b/libguile/inline.h @@ -55,7 +55,7 @@ #ifdef HAVE_INLINE static inline SCM -scm_alloc_cell (scm_t_bits car, scm_t_bits cdr) +scm_cell (scm_t_bits car, scm_t_bits cdr) { SCM z; @@ -102,8 +102,8 @@ scm_alloc_cell (scm_t_bits car, scm_t_bits cdr) } static inline SCM -scm_alloc_double_cell (scm_t_bits car, scm_t_bits cbr, - scm_t_bits ccr, scm_t_bits cdr) +scm_double_cell (scm_t_bits car, scm_t_bits cbr, + scm_t_bits ccr, scm_t_bits cdr) { SCM z; @@ -153,9 +153,9 @@ scm_alloc_double_cell (scm_t_bits car, scm_t_bits cbr, #else /* !HAVE_INLINE */ -SCM_API SCM scm_alloc_cell (scm_t_bits car, scm_t_bits cdr); -SCM_API SCM scm_alloc_double_cell (scm_t_bits car, scm_t_bits cbr, - scm_t_bits ccr, scm_t_bits cdr); +SCM_API SCM scm_cell (scm_t_bits car, scm_t_bits cdr); +SCM_API SCM scm_double_cell (scm_t_bits car, scm_t_bits cbr, + scm_t_bits ccr, scm_t_bits cdr); #endif diff --git a/libguile/list.c b/libguile/list.c index 2197a61f5..7b0161cdf 100644 --- a/libguile/list.c +++ b/libguile/list.c @@ -61,7 +61,7 @@ #define SCM_I_CONS(cell,x,y) \ do { \ - cell = scm_alloc_cell ((scm_t_bits)x, (scm_t_bits)y); \ + cell = scm_cell ((scm_t_bits)x, (scm_t_bits)y); \ } while (0) SCM diff --git a/libguile/num2float.i.c b/libguile/num2float.i.c index a3e669266..b393ba9b7 100644 --- a/libguile/num2float.i.c +++ b/libguile/num2float.i.c @@ -32,7 +32,7 @@ SCM FLOAT2NUM (FTYPE n) { SCM z; - z = scm_alloc_double_cell (scm_tc16_real, 0, 0, 0); + z = scm_double_cell (scm_tc16_real, 0, 0, 0); SCM_REAL_VALUE (z) = n; return z; } diff --git a/libguile/numbers.c b/libguile/numbers.c index bdb6f4ca3..98c045b78 100644 --- a/libguile/numbers.c +++ b/libguile/numbers.c @@ -1390,7 +1390,7 @@ scm_i_mkbig (size_t nlen, int sign) base = scm_gc_malloc (nlen * sizeof (SCM_BIGDIG), s_bignum); - v = scm_alloc_cell (SCM_MAKE_BIGNUM_TAG (nlen, sign), (scm_t_bits) base); + v = scm_cell (SCM_MAKE_BIGNUM_TAG (nlen, sign), (scm_t_bits) base); return v; } @@ -2827,7 +2827,7 @@ SCM scm_make_real (double x) { SCM z; - z = scm_alloc_double_cell (scm_tc16_real, 0, 0, 0); + z = scm_double_cell (scm_tc16_real, 0, 0, 0); SCM_REAL_VALUE (z) = x; return z; } diff --git a/libguile/pairs.c b/libguile/pairs.c index 5216de8bb..bc4831480 100644 --- a/libguile/pairs.c +++ b/libguile/pairs.c @@ -80,7 +80,7 @@ SCM_DEFINE (scm_cons, "cons", 2, 0, 0, "sense of @code{eq?}) from every previously existing object.") #define FUNC_NAME s_scm_cons { - return scm_alloc_cell (SCM_UNPACK (x), SCM_UNPACK (y)); + return scm_cell (SCM_UNPACK (x), SCM_UNPACK (y)); } #undef FUNC_NAME diff --git a/libguile/ports.c b/libguile/ports.c index 33c6cab89..4acf1fdd6 100644 --- a/libguile/ports.c +++ b/libguile/ports.c @@ -1531,7 +1531,7 @@ scm_void_port (char *mode_str) SCM answer; scm_t_port * pt; - answer = scm_alloc_cell (scm_tc16_void_port, 0); + answer = scm_cell (scm_tc16_void_port, 0); SCM_DEFER_INTS; mode_bits = scm_mode_bits (mode_str); pt = scm_add_to_port_table (answer); diff --git a/libguile/procs.c b/libguile/procs.c index afc81cd23..dae2e104e 100644 --- a/libguile/procs.c +++ b/libguile/procs.c @@ -85,7 +85,7 @@ scm_c_make_subr (const char *name, long type, SCM (*fcn) ()) } entry = scm_subr_table_size; - z = scm_alloc_cell ((entry << 8) + type, (scm_t_bits) fcn); + z = scm_cell ((entry << 8) + type, (scm_t_bits) fcn); scm_subr_table[entry].handle = z; scm_subr_table[entry].name = scm_str2symbol (name); scm_subr_table[entry].generic = 0; @@ -160,7 +160,7 @@ scm_makcclo (SCM proc, size_t len) for (i = 0; i < len; ++i) base [i] = SCM_UNPACK (SCM_UNSPECIFIED); - s = scm_alloc_cell (SCM_MAKE_CCLO_TAG (len), (scm_t_bits) base); + s = scm_cell (SCM_MAKE_CCLO_TAG (len), (scm_t_bits) base); SCM_SET_CCLO_SUBR (s, proc); return s; } @@ -320,9 +320,9 @@ SCM_DEFINE (scm_make_procedure_with_setter, "make-procedure-with-setter", 2, 0, { SCM_VALIDATE_PROC (1, procedure); SCM_VALIDATE_PROC (2, setter); - return scm_alloc_double_cell (scm_tc7_pws, - SCM_UNPACK (procedure), - SCM_UNPACK (setter), 0); + return scm_double_cell (scm_tc7_pws, + SCM_UNPACK (procedure), + SCM_UNPACK (setter), 0); } #undef FUNC_NAME diff --git a/libguile/smob.c b/libguile/smob.c index 94133a797..e907fb107 100644 --- a/libguile/smob.c +++ b/libguile/smob.c @@ -462,7 +462,7 @@ scm_make_smob (scm_t_bits tc) scm_t_bits data = (size > 0 ? (scm_t_bits) scm_gc_malloc (size, SCM_SMOBNAME (n)) : 0); - return scm_alloc_cell (tc, data); + return scm_cell (tc, data); } diff --git a/libguile/smob.h b/libguile/smob.h index be87b255e..50de243ce 100644 --- a/libguile/smob.h +++ b/libguile/smob.h @@ -72,7 +72,7 @@ typedef struct scm_smob_descriptor #define SCM_NEWSMOB(z, tc, data) \ do { \ - z = scm_alloc_cell ((tc), (scm_t_bits) (data)); \ + z = scm_cell ((tc), (scm_t_bits) (data)); \ } while (0) #define SCM_RETURN_NEWSMOB(tc, data) \ @@ -83,8 +83,7 @@ do { \ #define SCM_NEWSMOB2(z, tc, data1, data2) \ do { \ - z = scm_alloc_double_cell ((tc), (scm_t_bits)(data1), \ - (scm_t_bits)(data2), 0); \ + z = scm_double_cell ((tc), (scm_t_bits)(data1), (scm_t_bits)(data2), 0); \ } while (0) #define SCM_RETURN_NEWSMOB2(tc, data1, data2) \ @@ -95,8 +94,8 @@ do { \ #define SCM_NEWSMOB3(z, tc, data1, data2, data3) \ do { \ - z = scm_alloc_double_cell ((tc), (scm_t_bits)(data1), \ - (scm_t_bits)(data2), (scm_t_bits)(data3)); \ + z = scm_double_cell ((tc), (scm_t_bits)(data1), \ + (scm_t_bits)(data2), (scm_t_bits)(data3)); \ } while (0) #define SCM_RETURN_NEWSMOB3(tc, data1, data2, data3) \ diff --git a/libguile/strings.c b/libguile/strings.c index c7517626d..d8580b7eb 100644 --- a/libguile/strings.c +++ b/libguile/strings.c @@ -132,7 +132,7 @@ scm_take_str (char *s, size_t len) SCM_ASSERT_RANGE (2, scm_ulong2num (len), len <= SCM_STRING_MAX_LENGTH); - answer = scm_alloc_cell (SCM_MAKE_STRING_TAG (len), (scm_t_bits) s); + answer = scm_cell (SCM_MAKE_STRING_TAG (len), (scm_t_bits) s); scm_gc_register_collectable_memory (s, len+1, "string"); return answer; @@ -194,7 +194,7 @@ scm_allocate_string (size_t len) mem = (char *) scm_gc_malloc (len + 1, "string"); mem[len] = 0; - s = scm_alloc_cell (SCM_MAKE_STRING_TAG (len), (scm_t_bits) mem); + s = scm_cell (SCM_MAKE_STRING_TAG (len), (scm_t_bits) mem); return s; } diff --git a/libguile/strports.c b/libguile/strports.c index daf68b5f3..0a75a4068 100644 --- a/libguile/strports.c +++ b/libguile/strports.c @@ -279,7 +279,7 @@ scm_mkstrport (SCM pos, SCM str, long modes, const char *caller) scm_out_of_range (caller, pos); if (!((modes & SCM_WRTNG) || (modes & SCM_RDNG))) scm_misc_error ("scm_mkstrport", "port must read or write", SCM_EOL); - z = scm_alloc_cell (scm_tc16_strport, 0); + z = scm_cell (scm_tc16_strport, 0); SCM_DEFER_INTS; pt = scm_add_to_port_table (z); SCM_SET_CELL_TYPE (z, scm_tc16_strport | modes); diff --git a/libguile/struct.c b/libguile/struct.c index a384c8647..075388e42 100644 --- a/libguile/struct.c +++ b/libguile/struct.c @@ -460,9 +460,9 @@ SCM_DEFINE (scm_make_struct, "make-struct", 2, 0, 1, data = scm_alloc_struct (basic_size + tail_elts, scm_struct_n_extra_words, "struct"); - handle = scm_alloc_double_cell ((((scm_t_bits) SCM_STRUCT_DATA (vtable)) - + scm_tc3_struct), - (scm_t_bits) data, 0, 0); + handle = scm_double_cell ((((scm_t_bits) SCM_STRUCT_DATA (vtable)) + + scm_tc3_struct), + (scm_t_bits) data, 0, 0); scm_struct_init (handle, layout, data, tail_elts, init); SCM_ALLOW_INTS; return handle; @@ -539,8 +539,8 @@ SCM_DEFINE (scm_make_vtable_vtable, "make-vtable-vtable", 2, 0, 1, data = scm_alloc_struct (basic_size + tail_elts, scm_struct_n_extra_words, "struct"); - handle = scm_alloc_double_cell ((scm_t_bits) data + scm_tc3_struct, - (scm_t_bits) data, 0, 0); + handle = scm_double_cell ((scm_t_bits) data + scm_tc3_struct, + (scm_t_bits) data, 0, 0); data [scm_vtable_index_layout] = SCM_UNPACK (layout); scm_struct_init (handle, layout, data, tail_elts, scm_cons (layout, init)); SCM_ALLOW_INTS; diff --git a/libguile/symbols.c b/libguile/symbols.c index c6979f9a4..57ead5cab 100644 --- a/libguile/symbols.c +++ b/libguile/symbols.c @@ -125,12 +125,11 @@ scm_mem2symbol (const char *name, size_t len) SCM cell; SCM slot; - symbol = scm_alloc_double_cell (SCM_MAKE_SYMBOL_TAG (len), - (scm_t_bits) scm_gc_strndup (name, len, - "symbol"), - raw_hash, - SCM_UNPACK (scm_cons (SCM_BOOL_F, - SCM_EOL))); + symbol = scm_double_cell (SCM_MAKE_SYMBOL_TAG (len), + (scm_t_bits) scm_gc_strndup (name, len, + "symbol"), + raw_hash, + SCM_UNPACK (scm_cons (SCM_BOOL_F, SCM_EOL))); slot = SCM_VELTS (symbols) [hash]; cell = scm_cons (symbol, SCM_UNDEFINED); @@ -146,12 +145,11 @@ scm_mem2uninterned_symbol (const char *name, size_t len) size_t raw_hash = (scm_string_hash ((const unsigned char *) name, len)/2 + SCM_T_BITS_MAX/2 + 1); - return scm_alloc_double_cell (SCM_MAKE_SYMBOL_TAG (len), - (scm_t_bits) scm_gc_strndup (name, len, - "symbol"), - raw_hash, - SCM_UNPACK (scm_cons (SCM_BOOL_F, - SCM_EOL))); + return scm_double_cell (SCM_MAKE_SYMBOL_TAG (len), + (scm_t_bits) scm_gc_strndup (name, len, + "symbol"), + raw_hash, + SCM_UNPACK (scm_cons (SCM_BOOL_F, SCM_EOL))); } SCM diff --git a/libguile/tags.h b/libguile/tags.h index 1e9090ede..37d4a0f60 100644 --- a/libguile/tags.h +++ b/libguile/tags.h @@ -533,7 +533,7 @@ SCM_API char *scm_isymnames[]; /* defined in print.c */ #if (SCM_ENABLE_DEPRECATED == 1) -#define SCM_CELLP(x) (((sizeof (scm_cell) - 1) & SCM_UNPACK (x)) == 0) +#define SCM_CELLP(x) (((sizeof (scm_t_cell) - 1) & SCM_UNPACK (x)) == 0) #define SCM_NCELLP(x) (!SCM_CELLP (x)) #endif diff --git a/libguile/unif.c b/libguile/unif.c index 96bdfa4f0..b900df50e 100644 --- a/libguile/unif.c +++ b/libguile/unif.c @@ -170,11 +170,11 @@ scm_make_uve (long k, SCM prot) SCM_ASSERT_RANGE (1, scm_long2num (k), k <= SCM_BITVECTOR_MAX_LENGTH); i = sizeof (long) * ((k + SCM_LONG_BIT - 1) / SCM_LONG_BIT); - v = scm_alloc_cell (SCM_MAKE_BITVECTOR_TAG (k), - (scm_t_bits) scm_gc_malloc (i, "vector")); + v = scm_cell (SCM_MAKE_BITVECTOR_TAG (k), + (scm_t_bits) scm_gc_malloc (i, "vector")); } else - v = scm_alloc_cell (SCM_MAKE_BITVECTOR_TAG (0), 0); + v = scm_cell (SCM_MAKE_BITVECTOR_TAG (0), 0); return v; } else if (SCM_CHARP (prot) && (SCM_CHAR (prot) == '\0')) @@ -239,8 +239,8 @@ scm_make_uve (long k, SCM prot) SCM_ASSERT_RANGE (1, scm_long2num (k), k <= SCM_UVECTOR_MAX_LENGTH); - return scm_alloc_cell (SCM_MAKE_UVECTOR_TAG (k, type), - (scm_t_bits) scm_gc_malloc (i, "vector")); + return scm_cell (SCM_MAKE_UVECTOR_TAG (k, type), + (scm_t_bits) scm_gc_malloc (i, "vector")); } #undef FUNC_NAME diff --git a/libguile/variable.c b/libguile/variable.c index 66f82b9de..b2710c113 100644 --- a/libguile/variable.c +++ b/libguile/variable.c @@ -68,7 +68,7 @@ scm_i_variable_print (SCM exp, SCM port, scm_print_state *pstate) static SCM make_variable (SCM init) { - return scm_alloc_cell (scm_tc7_variable, SCM_UNPACK (init)); + return scm_cell (scm_tc7_variable, SCM_UNPACK (init)); } SCM_DEFINE (scm_make_variable, "make-variable", 1, 0, 0, diff --git a/libguile/vectors.c b/libguile/vectors.c index c1dfe840f..bdc943760 100644 --- a/libguile/vectors.c +++ b/libguile/vectors.c @@ -215,8 +215,7 @@ scm_c_make_vector (unsigned long int k, SCM fill) else base = NULL; - v = scm_alloc_cell (SCM_MAKE_VECTOR_TAG (k, scm_tc7_vector), - (scm_t_bits) base); + v = scm_cell (SCM_MAKE_VECTOR_TAG (k, scm_tc7_vector), (scm_t_bits) base); scm_remember_upto_here_1 (fill); return v; diff --git a/libguile/vports.c b/libguile/vports.c index c25bc204f..2cf94feae 100644 --- a/libguile/vports.c +++ b/libguile/vports.c @@ -189,7 +189,7 @@ SCM_DEFINE (scm_make_soft_port, "make-soft-port", 2, 0, 0, SCM z; SCM_VALIDATE_VECTOR_LEN (1,pv,5); SCM_VALIDATE_STRING (2, modes); - z = scm_alloc_cell (scm_tc16_sfport, 0); + z = scm_cell (scm_tc16_sfport, 0); SCM_DEFER_INTS; pt = scm_add_to_port_table (z); scm_port_non_buffer (pt); diff --git a/libguile/weaks.c b/libguile/weaks.c index 08d570069..a5b194eca 100644 --- a/libguile/weaks.c +++ b/libguile/weaks.c @@ -84,20 +84,18 @@ allocate_weak_vector (scm_t_bits type, SCM size, SCM fill, const char* caller) base = scm_gc_malloc (c_size * sizeof (scm_t_bits), "weak vector"); for (j = 0; j != c_size; ++j) base[j] = SCM_UNPACK (fill); - v = scm_alloc_double_cell (SCM_MAKE_VECTOR_TAG (c_size, - scm_tc7_wvect), - (scm_t_bits) base, - type, - SCM_UNPACK (SCM_EOL)); + v = scm_double_cell (SCM_MAKE_VECTOR_TAG (c_size, scm_tc7_wvect), + (scm_t_bits) base, + type, + SCM_UNPACK (SCM_EOL)); scm_remember_upto_here_1 (fill); } else { - v = scm_alloc_double_cell (SCM_MAKE_VECTOR_TAG (0, - scm_tc7_wvect), - (scm_t_bits) NULL, - type, - SCM_UNPACK (SCM_EOL)); + v = scm_double_cell (SCM_MAKE_VECTOR_TAG (0, scm_tc7_wvect), + (scm_t_bits) NULL, + type, + SCM_UNPACK (SCM_EOL)); } return v; From 039576cf091f68d2956575dc827610fe36116fcb Mon Sep 17 00:00:00 2001 From: Thien-Thi Nguyen Date: Fri, 1 Mar 2002 07:37:43 +0000 Subject: [PATCH 024/131] Update. --- doc/guile-api.alist | 2255 ++++++++++++++++++++++--------------------- 1 file changed, 1134 insertions(+), 1121 deletions(-) diff --git a/doc/guile-api.alist b/doc/guile-api.alist index c1a6c46e1..4f79b6139 100644 --- a/doc/guile-api.alist +++ b/doc/guile-api.alist @@ -1,69 +1,71 @@ -;; Generated Fri Feb 15 13:35:09 PST 2002 by guile-scripts/scan-api -- do not edit! -;; guile: /home/ttn/build/.gnu/guile-core/pre-inst-guile . -;; sofile: libguile/.libs/libguile.so.10.0.0 - +;; Generated Thu Feb 28 23:33:42 PST 2002 by guile-scripts/scan-api -- do not edit! ( +(meta (GUILE_LOAD_PATH . "") + (LTDL_LOAD_PATH . "") + (guile . "pre-inst-guile") + (sofile . "libguile/.libs/libguile.so.15.0.0") + (pwd . "/home/ttn/tmp/.tmp")) (scheme -($abs "#") +($acos "#") +($acosh "#") +($asin "#") +($asinh "#") +($atan "#") +($atan2 "#") +($atanh "#") +($cos "#") +($cosh "#") +($exp "#") +($expt "#") +($log "#") +($sin "#") +($sinh "#") +($sqrt "#") +($tan "#") +($tanh "#") (%cond-expand-features "") (%cond-expand-table "") -(%deliver-signals "#") +(%get-pre-modules-obarray "#") (%guile-build-info "") -(%init-goops-builtins "#") +(%init-rdelim-builtins "#") +(%init-rw-builtins "#") +(%library-dir "#") +(%load-announce "#") (%load-extensions "") -(%load-hook "#") (%load-path "") (%load-verbosely "") -(%make-void-port "#") (%module-public-interface "") (%module-public-interface "") (%nil "") -(%package-data-dir "#") +(%print-module "#") +(%print-values "#") +(%search-load-path "#") +(%site-dir "#") +(* "#") (*features* "") (*null-device* "") (*random-state* "") (*unspecified* "") -(+ "#bool "#") +(- "#") +(->bool "#bool (x)>") +(/ "#") +(1+ "#") +(1- "#") +(< "#") +(<= "#") ( "") ( "") ( "") -(= "# "#= "# "#>") +(>= "#=>") (@apply "") (@bind "") (@call-with-current-continuation "") @@ -318,83 +320,83 @@ (_IOLBF "") (_IONBF "") (abort-hook "") -(abs "#") +(accept "#") +(access? "#") +(acons "#") +(acos "#") +(acosh "#") +(add-hook! "#") (after-backtrace-hook "") (after-error-hook "") (after-eval-hook "") (after-gc-hook "") (after-print-hook "") (after-read-hook "") -(alarm "#") (and "") -(and-map "# "#") +(and=> "# (value procedure)>") +(angle "#") (app "") -(append "#list "#") +(append! "#") +(apply "#") +(apply-to-args "#") +(apply:nconc2last "#") +(array->list "#list>") +(array-contents "#") +(array-copy! "#") +(array-copy-in-order! "#") +(array-dimensions "#") +(array-equal? "#") +(array-fill! "#") +(array-for-each "#") +(array-in-bounds? "#") +(array-index-map! "#") +(array-map! "#") +(array-map-in-order! "#") +(array-prototype "#") +(array-rank "#") +(array-ref "#") +(array-set! "#") +(array-shape "#") +(array? "#") +(ash "#") +(asin "#") +(asinh "#") +(assert-defmacro?! "#") +(assert-load-verbosity "#") +(assert-repl-print-unspecified "#") +(assert-repl-silence "#") +(assert-repl-verbosity "#") +(assoc "#") +(assoc-ref "#") +(assoc-remove! "#") +(assoc-set! "#") +(assq "#") +(assq-ref "#") +(assq-remove! "#") +(assq-set! "#") +(assv "#") +(assv-ref "#") +(assv-remove! "#") +(assv-set! "#") +(async "#") +(async-mark "#") +(atan "#") +(atanh "#") +(autoload-done! "#") +(autoload-done-or-in-progress? "#") +(autoload-in-progress! "#") (autoloads-done "") (autoloads-in-progress "") -(backtrace "#") +(bad-throw "#") +(basename "#") +(basic-load "#") +(batch-mode? "#") +(beautify-user-module! "#") (before-backtrace-hook "") (before-error-hook "") (before-eval-hook "") @@ -403,123 +405,123 @@ (before-signal-stack "") (begin "") (begin-deprecated "") -(bind "#") +(bit-count "#") +(bit-count* "#") +(bit-extract "#") +(bit-invert! "#") +(bit-position "#") +(bit-set*! "#") +(boolean? "#") +(caaaar "#") +(caaadr "#") +(caaar "#") +(caadar "#") +(caaddr "#") +(caadr "#") +(caar "#") +(cadaar "#") +(cadadr "#") +(cadar "#") +(caddar "#") +(cadddr "#") +(caddr "#") +(cadr "#") +(call-with-current-continuation "#") +(call-with-dynamic-root "#") +(call-with-input-file "#") +(call-with-input-string "#") +(call-with-new-thread "#") +(call-with-output-file "#") +(call-with-output-string "#") +(call-with-values "#") +(car "#") (case "") -(catch "#integer "#=? "#? "#") +(cdaaar "#") +(cdaadr "#") +(cdaar "#") +(cdadar "#") +(cdaddr "#") +(cdadr "#") +(cdar "#") +(cddaar "#") +(cddadr "#") +(cddar "#") +(cdddar "#") +(cddddr "#") +(cdddr "#") +(cddr "#") +(cdr "#") +(ceiling "#") +(char->integer "#integer>") +(char-alphabetic? "#") +(char-ci<=? "#") +(char-ci") +(char-ci=? "#") +(char-ci>=? "#=?>") +(char-ci>? "#?>") (char-code-limit "") -(char-downcase "#=? "#? "#") +(char-is-both? "#") +(char-lower-case? "#") +(char-numeric? "#") +(char-ready? "#") +(char-upcase "#") +(char-upper-case? "#") +(char-whitespace? "#") +(char<=? "#") +(char") +(char=? "#") +(char>=? "#=?>") +(char>? "#?>") +(char? "#") +(chdir "#") +(chmod "#") +(chown "#") +(chroot "#") +(class-of "#") +(close "#") +(close-fdes "#") +(close-input-port "#") +(close-io-port "#") +(close-output-port "#") +(close-port "#") +(closedir "#") +(closure? "#") (collect "") -(command-line "#") +(compile-define-module-args "#") +(compile-interface-spec "#") +(complex? "#") (cond "") (cond-expand "") -(cond-expand-provide "#") +(connect "#") +(cons "#") +(cons* "#") +(cons-source "#") +(copy-file "#") +(copy-random-state "#") +(copy-tree "#") +(cos "#") +(cosh "#") +(crypt "#") +(ctermid "#") +(current-error-port "#") +(current-input-port "#") +(current-load-port "#") +(current-module "#") +(current-output-port "#") +(current-time "#") +(cuserid "#") +(debug-disable "#") +(debug-enable "#") +(debug-object? "#") +(debug-options "#") +(debug-options-interface "#") (debug-set! "") -(default-lazy-handler "#") (define "") (define-macro "") (define-module "") @@ -527,967 +529,967 @@ (define-private "") (define-public "") (define-syntax-macro "") -(defined? "#") (defmacro "") (defmacro-public "") -(defmacro-transformer "#") +(defmacro:syntax-transformer "#") +(defmacro:transformer "#") +(defmacro? "#") (delay "") -(delete "#uniform-array "#") +(delete! "#") +(delete-file "#") +(delete1! "#") +(delq "#") +(delq! "#") +(delq1! "#") +(delv "#") +(delv! "#") +(delv1! "#") +(destroy-guardian! "#") +(dimensions->uniform-array "#uniform-array>") +(directory-stream? "#") +(dirname "#") +(display "#") +(display-application "#") +(display-backtrace "#") +(display-error "#") +(display-usage-report "#") (do "") -(doubly-weak-hash-table? "#fdes "#inport "#outport "#port "#") +(drain-input "#") +(dup "#") +(dup->fdes "#fdes>") +(dup->inport "#inport (port/fd . maybe-fd)>") +(dup->outport "#outport (port/fd . maybe-fd)>") +(dup->port "#port (port/fd mode . maybe-fd)>") +(dup2 "#") +(duplicate-port "#") +(dynamic-args-call "#") +(dynamic-call "#") +(dynamic-func "#") +(dynamic-link "#") +(dynamic-object? "#") +(dynamic-root "#") +(dynamic-unlink "#") +(dynamic-wind "#") +(enclose-array "#") +(endgrent "#") +(endhostent "#") +(endnetent "#") +(endprotoent "#") +(endpwent "#") +(endservent "#") +(entity? "#") +(env-module "#") +(environ "#") +(environment-bound? "#") +(environment-cell "#") +(environment-define "#") +(environment-fold "#") +(environment-module "#") +(environment-observe "#") +(environment-observe-weak "#") +(environment-ref "#") +(environment-set! "#") +(environment-undefine "#") +(environment-unobserve "#") +(environment? "#") +(eof-object? "#") +(eq? "#") +(equal? "#") +(eqv? "#") +(error "#") +(error-catching-loop "#") +(error-catching-repl "#") +(eval "#") (eval-case "") -(eval-disable "#") +(eval-enable "#") +(eval-environment-imported "#") +(eval-environment-local "#") +(eval-environment-set-imported! "#") +(eval-environment-set-local! "#") +(eval-environment? "#") +(eval-options "#") +(eval-options-interface "#") (eval-set! "") -(eval-string "#inexact "#") +(evaluator-traps-interface "#") +(even? "#") +(exact->inexact "#inexact>") +(exact? "#") +(execl "#") +(execle "#") +(execlp "#") +(exit "#") (exit-hook "") -(exp "#") (export "") -(export-environment-private "#") +(export-environment-set-private! "#") +(export-environment-set-signature! "#") +(export-environment-signature "#") +(export-environment? "#") (export-syntax "") -(expt "#") (false-if-exception "") -(fcntl "#inport "#outport "#ports "#") +(fdes->inport "#inport (fdes)>") +(fdes->outport "#outport (fdes)>") +(fdes->ports "#ports>") +(fdopen "#") +(feature? "#") +(file-exists? "#") +(file-is-directory? "#") +(file-port? "#") +(file-position "#") +(file-set-position "#") +(fileno "#") +(flock "#") +(floor "#") +(fluid-ref "#") +(fluid-set! "#") +(fluid? "#") +(flush-all-ports "#") +(for-each "#") +(for-next-option "#") +(force "#") +(force-output "#") +(format "#") +(frame-arguments "#") +(frame-evaluating-args? "#") +(frame-next "#") +(frame-number "#") +(frame-overflow? "#") +(frame-previous "#") +(frame-procedure "#") +(frame-procedure? "#") +(frame-real? "#") +(frame-source "#") +(frame? "#") +(fsync "#") +(ftell "#") +(gc "#") +(gc-run-time "#") +(gc-stats "#") +(gcd "#") +(gensym "#") +(get-internal-real-time "#") +(get-internal-run-time "#") +(get-option "#") +(get-output-string "#") +(get-print-state "#") +(getcwd "#") +(getegid "#") +(getenv "#") +(geteuid "#") +(getgid "#") +(getgr "#") +(getgrent "#") +(getgrgid "#") +(getgrnam "#") +(getgroups "#") +(gethost "#") +(gethostbyaddr "#") +(gethostbyname "#") +(gethostent "#") +(gethostname "#") +(getitimer "#") +(getlogin "#") +(getnet "#") +(getnetbyaddr "#") +(getnetbyname "#") +(getnetent "#") +(getpass "#") +(getpeername "#") +(getpgrp "#") +(getpid "#") +(getppid "#") +(getpriority "#") +(getproto "#") +(getprotobyname "#") +(getprotobynumber "#") +(getprotoent "#") +(getpw "#") +(getpwent "#") +(getpwnam "#") +(getpwuid "#") +(getserv "#") +(getservbyname "#") +(getservbyport "#") +(getservent "#") +(getsockname "#") +(getsockopt "#") +(gettimeofday "#") +(getuid "#") +(gmtime "#") +(group:gid "#") +(group:mem "#") +(group:name "#") +(group:passwd "#") +(guardian-destroyed? "#") +(guardian-greedy? "#") +(handle-system-error "#") (has-shown-backtrace-hint? "") (has-shown-debugger-hint? "") -(has-suffix? "#list "#") +(hash "#") +(hash-create-handle! "#") +(hash-fold "#") +(hash-get-handle "#") +(hash-ref "#") +(hash-remove! "#") +(hash-set! "#") +(hashq "#") +(hashq-create-handle! "#") +(hashq-get-handle "#") +(hashq-ref "#") +(hashq-remove! "#") +(hashq-set! "#") +(hashv "#") +(hashv-create-handle! "#") +(hashv-get-handle "#") +(hashv-ref "#") +(hashv-remove! "#") +(hashv-set! "#") +(hashx-create-handle! "#") +(hashx-get-handle "#") +(hashx-ref "#") +(hashx-set! "#") +(hook->list "#list>") +(hook-empty? "#") +(hook? "#") +(hostent:addr-list "#") +(hostent:addrtype "#") +(hostent:aliases "#") +(hostent:length "#") +(hostent:name "#") +(htonl "#") +(htons "#") +(identity "#") (if "") -(imag-part "#exact "#char "#") +(import-environment-imports "#") +(import-environment-set-imports! "#") +(import-environment? "#") +(in-vicinity "#") +(include-deprecated-features "#") +(inet-aton "#") +(inet-lnaof "#") +(inet-makeaddr "#") +(inet-netof "#") +(inet-ntoa "#") +(inet-ntop "#") +(inet-pton "#") +(inexact->exact "#exact>") +(inexact? "#") +(inherit-print-state "#") +(input-port? "#") +(integer->char "#char>") +(integer-expt "#") +(integer-length "#") +(integer? "#") +(interaction-environment "#") (internal-time-units-per-second "") -(iota "#symbol "#keyword "#") +(ipow-by-squaring "#") +(isatty? "#") +(issue-deprecation-warning "#") +(join-thread "#") +(keyword->symbol "#symbol (kw)>") +(keyword-dash-symbol "#") +(keyword-like-symbol->keyword "#keyword (sym)>") +(keyword? "#") +(kill "#") +(kw-arg-ref "#") (lambda "") -(last-pair "#") +(last-stack-frame "#") +(lazy-catch "#") +(lazy-handler-dispatch "#") +(lcm "#") +(leaf-environment? "#") +(length "#") (let "") (let* "") (letrec "") -(link "#array "#string "#symbol "#uniform-array "#uniform-vector "#vector "#weak-vector "#") +(list "#") +(list->array "#array (ndim lst)>") +(list->string "#string>") +(list->symbol "#symbol args>") +(list->uniform-array "#uniform-array>") +(list->uniform-vector "#uniform-vector (prot lst)>") +(list->vector "#vector>") +(list->weak-vector "#weak-vector>") +(list-cdr-ref "#") +(list-cdr-set! "#") +(list-copy "#") +(list-head "#") +(list-index "#") +(list-ref "#") +(list-set! "#") +(list-tail "#") +(list? "#") +(listen "#") +(load "#") (load-compiled "") -(load-emacs-interface "#") +(load-extension "#") +(load-from-path "#") +(load-module "#") +(load-user-init "#") +(local-define "#") +(local-eval "#") +(local-ref "#") +(local-remove "#") +(local-set! "#") +(localtime "#") +(lock-mutex "#") +(log "#") +(log10 "#") +(logand "#") +(logbit? "#") +(logcount "#") +(logior "#") +(lognot "#") +(logtest "#") +(logxor "#") +(lstat "#") +(macro-name "#") (macro-table "") -(macro-transformer "#") +(macro-type "#") +(macro? "#") +(macroexpand "#") +(macroexpand-1 "#") +(magnitude "#") +(major-version "#") +(make-arbiter "#") +(make-array "#") +(make-autoload-interface "#") +(make-class-object "#") +(make-condition-variable "#") +(make-doubly-weak-hash-table "#") +(make-eval-environment "#") +(make-export-environment "#") +(make-fluid "#") +(make-guardian "#") +(make-hash-table "#") +(make-hook "#") +(make-import-environment "#") +(make-keyword-from-dash-symbol "#") +(make-leaf-environment "#") +(make-list "#") +(make-module "#") +(make-modules-in "#") +(make-mutex "#") +(make-object-property "#") +(make-polar "#") +(make-procedure-with-setter "#") +(make-record-type "#") +(make-rectangular "#") +(make-regexp "#") +(make-root-module "#") +(make-scm-module "#") +(make-shared-array "#") +(make-soft-port "#") +(make-stack "#") +(make-string "#") +(make-struct "#") +(make-struct-layout "#") +(make-subclass-object "#") +(make-symbol "#") +(make-undefined-variable "#") +(make-uniform-array "#") +(make-uniform-vector "#uniform-array>") +(make-variable "#") +(make-vector "#") +(make-vtable-vtable "#") +(make-weak-key-hash-table "#") +(make-weak-value-hash-table "#") +(make-weak-vector "#") +(map "#") +(map-in-order "#") +(mask-signals "#") +(max "#") +(member "#") +(memoized-environment "#") +(memoized? "#") +(memq "#") +(memv "#") +(merge "#") +(merge! "#") +(micro-version "#") +(min "#") +(minor-version "#") +(mkdir "#") +(mknod "#") +(mkstemp! "#") +(mktime "#") +(module-add! "#") +(module-binder "#") +(module-bound? "#") +(module-clear! "#") +(module-constructor "#") +(module-define! "#") +(module-defined? "#") +(module-ensure-local-variable! "#") +(module-eval-closure "#") +(module-export! "#") +(module-for-each "#") +(module-kind "#") +(module-local-variable "#") +(module-locally-bound? "#") +(module-make-local-var! "#") +(module-map "#") +(module-modified "#") +(module-name "#") +(module-obarray "#") +(module-obarray-get-handle "#") +(module-obarray-ref "#") +(module-obarray-remove! "#") +(module-obarray-set! "#") +(module-observe "#") +(module-observe-weak "#") +(module-observer-id "#") +(module-observers "#") +(module-public-interface "#") +(module-re-export! "#") +(module-ref "#") +(module-remove! "#") +(module-search "#") +(module-set! "#") +(module-symbol-binding "#") +(module-symbol-interned? "#") +(module-symbol-local-binding "#") +(module-symbol-locally-interned? "#") +(module-transformer "#") (module-type "") -(module-unobserve "#") +(module-use! "#") +(module-uses "#") +(module-variable "#") +(module-weak-observers "#") +(module? "#") +(modulo "#") (most-negative-fixnum "") (most-positive-fixnum "") -(move->fdes "#fdes "#fdes (fd/port fd)>") +(named-module-use! "#") +(negative? "#") +(nested-define! "#") +(nested-ref "#") +(nested-remove! "#") +(nested-set! "#") +(netent:addrtype "#") +(netent:aliases "#") +(netent:name "#") +(netent:net "#") +(newline "#") +(nice "#") (nil-cond "") -(noop "#string "#string "#") +(not "#") +(ntohl "#") +(ntohs "#") +(null? "#") +(number->string "#string>") +(number? "#") +(object->string "#string>") +(object-address "#") +(object-properties "#") +(object-property "#") +(odd? "#") +(open "#") +(open-fdes "#") +(open-file "#") +(open-input-file "#") +(open-input-string "#") +(open-io-file "#") +(open-output-file "#") +(open-output-string "#") +(opendir "#") +(operator? "#") (or "") -(or-map "#fdes "#fdes "#") +(output-port? "#") +(pair? "#") +(parse-path "#") +(passwd:dir "#") +(passwd:gecos "#") +(passwd:gid "#") +(passwd:name "#") +(passwd:passwd "#") +(passwd:shell "#") +(passwd:uid "#") +(pause "#") +(peek "#") +(peek-char "#") +(pipe "#") +(pk "#") +(port->fdes "#fdes (port)>") +(port-closed? "#") +(port-column "#") +(port-filename "#") +(port-for-each "#") +(port-line "#") +(port-mode "#") +(port-revealed "#") +(port-with-print-state "#") +(port? "#") +(positive? "#") +(primitive-eval "#") +(primitive-exit "#") +(primitive-fork "#") +(primitive-load "#") +(primitive-load-path "#") +(primitive-macro? "#") +(primitive-make-property "#") +(primitive-move->fdes "#fdes>") +(primitive-property-del! "#") +(primitive-property-ref "#") +(primitive-property-set! "#") +(print-disable "#") +(print-enable "#") +(print-options "#") +(print-options-interface "#") (print-set! "") -(procedure "#macro "#memoizing-macro "#syntax "#") +(procedure->macro "#macro>") +(procedure->memoizing-macro "#memoizing-macro>") +(procedure->syntax "#syntax>") +(procedure-documentation "#") +(procedure-environment "#") +(procedure-name "#") +(procedure-properties "#") +(procedure-property "#") +(procedure-source "#") +(procedure-with-setter? "#") +(procedure? "#") +(process-define-module "#") +(process-use-modules "#") +(program-arguments "#") +(promise? "#") +(protoent:aliases "#") +(protoent:name "#") +(protoent:proto "#") +(provide "#") +(provided? "#") +(purify-module! "#") +(putenv "#") (quasiquote "") -(quit "#") (quote "") -(quotient "#") +(raise "#") +(random "#") +(random:exp "#") +(random:hollow-sphere! "#") +(random:normal "#") +(random:normal-vector! "#") +(random:solid-sphere! "#") +(random:uniform "#") +(rational? "#") (re-export "") (re-export-syntax "") -(read "#") +(read-char "#") +(read-disable "#") +(read-enable "#") (read-eval? "") -(read-hash-extend "#") (read-hash-procedures "") -(read-options "#") +(read-options-interface "#") (read-set! "") -(read:array "#") +(read:uniform-vector "#") +(readdir "#") +(readlink "#") +(real-part "#") +(real? "#") +(record-accessor "#") +(record-constructor "#") +(record-modifier "#") +(record-predicate "#") +(record-type-descriptor "#") +(record-type-fields "#") +(record-type-name "#") (record-type-vtable "") -(record-type? "#") +(record? "#") +(recv! "#") +(recvfrom! "#") +(redirect-port "#") +(regexp-exec "#") (regexp/basic "") (regexp/extended "") (regexp/icase "") (regexp/newline "") (regexp/notbol "") (regexp/noteol "") -(regexp? "#") +(release-arbiter "#") +(release-port-handle "#") +(remainder "#") +(remove-hook! "#") +(rename-file "#") +(repl "#") +(repl-reader "#") +(reset-hook! "#") +(resolve-interface "#") +(resolve-module "#") +(restore-signals "#") +(restricted-vector-sort! "#") +(reverse "#") +(reverse! "#") +(rewinddir "#") +(rmdir "#") +(round "#") +(run-asyncs "#") +(run-hook "#") +(save-module-excursion "#") +(save-stack "#") +(scheme-file-suffix "#") +(scm-error "#") (scm-repl-print-unspecified "") (scm-repl-prompt "") (scm-repl-silent "") (scm-repl-verbose "") -(scm-style-repl "#random-state "#") +(search-path "#") +(seed->random-state "#random-state>") +(seek "#") +(select "#") +(send "#") +(sendto "#") +(servent:aliases "#") +(servent:name "#") +(servent:port "#") +(servent:proto "#") (set! "") -(set-autoloaded! "#") +(set-batch-mode?! "#") +(set-car! "#") +(set-cdr! "#") +(set-current-error-port "#") +(set-current-input-port "#") +(set-current-module "#") +(set-current-output-port "#") +(set-defmacro-transformer! "#") +(set-module-binder! "#") +(set-module-eval-closure! "#") +(set-module-kind! "#") +(set-module-name! "#") +(set-module-obarray! "#") +(set-module-observer-id! "#") +(set-module-observers! "#") +(set-module-public-interface! "#") +(set-module-transformer! "#") +(set-module-uses! "#") +(set-object-procedure! "#") +(set-object-properties! "#") +(set-object-property! "#") +(set-port-column! "#") +(set-port-filename! "#") +(set-port-line! "#") +(set-port-revealed! "#") +(set-procedure-properties! "#") +(set-procedure-property! "#") +(set-repl-prompt! "#") +(set-source-properties! "#") +(set-source-property! "#") +(set-struct-vtable-name! "#") +(set-symbol-property! "#") +(set-system-module! "#") +(set-tm:gmtoff "#") +(set-tm:hour "#") +(set-tm:isdst "#") +(set-tm:mday "#") +(set-tm:min "#") +(set-tm:mon "#") +(set-tm:sec "#") +(set-tm:wday "#") +(set-tm:yday "#") +(set-tm:year "#") +(set-tm:zone "#") +(setegid "#") +(setenv "#") +(seteuid "#") +(setgid "#") +(setgr "#") +(setgrent "#") +(sethost "#") +(sethostent "#") +(sethostname "#") +(setitimer "#") +(setlocale "#") +(setnet "#") +(setnetent "#") +(setpgid "#") +(setpriority "#") +(setproto "#") +(setprotoent "#") +(setpw "#") +(setpwent "#") +(setserv "#") +(setservent "#") +(setsid "#") +(setsockopt "#") +(setter "#") +(setuid "#") +(setvbuf "#") +(shared-array-increments "#") +(shared-array-offset "#") +(shared-array-root "#") +(shutdown "#") +(sigaction "#") +(signal-condition-variable "#") (signal-handlers "") -(simple-format "#") +(sin "#") +(single-active-thread? "#") +(sinh "#") +(sleep "#") +(sloppy-assoc "#") +(sloppy-assq "#") +(sloppy-assv "#") +(sockaddr:addr "#") +(sockaddr:fam "#") +(sockaddr:path "#") +(sockaddr:port "#") +(socket "#") +(socketpair "#") +(sort "#") +(sort! "#") +(sort-list "#") +(sort-list! "#") +(sorted? "#") +(source-properties "#") +(source-property "#") (source-whash "") -(sqrt "#") +(stable-sort "#") +(stable-sort! "#") +(stack-id "#") +(stack-length "#") +(stack-ref "#") (stack-saved? "") -(stack? "#") +(standard-eval-closure "#") +(standard-interface-eval-closure "#") (start-stack "") -(stat "#list "#number "#symbol "#symbol "#=? "#? "#=? "#? "#keyword "#string "#") +(stat:atime "#") +(stat:blksize "#") +(stat:blocks "#") +(stat:ctime "#") +(stat:dev "#") +(stat:gid "#") +(stat:ino "#") +(stat:mode "#") +(stat:mtime "#") +(stat:nlink "#") +(stat:perms "#") +(stat:rdev "#") +(stat:size "#") +(stat:type "#") +(stat:uid "#") +(status:exit-val "#") +(status:stop-sig "#") +(status:term-sig "#") +(strerror "#") +(strftime "#") +(string "#") +(string->list "#list>") +(string->number "#number>") +(string->symbol "#symbol>") +(string-append "#") +(string-capitalize "#") +(string-capitalize! "#") +(string-ci->symbol "#symbol>") +(string-ci<=? "#") +(string-ci") +(string-ci=? "#") +(string-ci>=? "#=?>") +(string-ci>? "#?>") +(string-copy "#") +(string-downcase "#") +(string-downcase! "#") +(string-fill! "#") +(string-index "#") +(string-length "#") +(string-null? "#") +(string-ref "#") +(string-rindex "#") +(string-set! "#") +(string-split "#") +(string-upcase "#") +(string-upcase! "#") +(string<=? "#") +(string") +(string=? "#") +(string>=? "#=?>") +(string>? "#?>") +(string? "#") +(strptime "#") +(struct-layout "#") +(struct-ref "#") +(struct-set! "#") +(struct-vtable "#") +(struct-vtable-name "#") +(struct-vtable-tag "#") +(struct-vtable? "#") +(struct? "#") +(substring "#") +(substring-fill! "#") +(substring-move! "#") +(symbol "#") +(symbol->keyword "#keyword (symbol)>") +(symbol->string "#string>") +(symbol-append "#") +(symbol-fref "#") +(symbol-fset! "#") +(symbol-hash "#") +(symbol-interned? "#") +(symbol-pref "#") +(symbol-prefix-proc "#") +(symbol-property "#") +(symbol-property-remove! "#") +(symbol-pset! "#") +(symbol? "#") +(symlink "#") +(sync "#") +(system "#") +(system-async "#") +(system-async-mark "#") +(system-error-errno "#") +(tan "#") +(tanh "#") +(tcgetpgrp "#") +(tcsetpgrp "#") (the-environment "") (the-eof-object "") (the-last-stack "") (the-root-environment "") (the-root-module "") (the-scm-module "") -(throw "#") +(thunk? "#") +(times "#") +(tm:gmtoff "#") +(tm:hour "#") +(tm:isdst "#") +(tm:mday "#") +(tm:min "#") +(tm:mon "#") +(tm:sec "#") +(tm:wday "#") +(tm:yday "#") +(tm:year "#") +(tm:zone "#") +(tmpnam "#") +(tms:clock "#") +(tms:cstime "#") +(tms:cutime "#") +(tms:stime "#") +(tms:utime "#") +(top-repl "#") +(transform-usage-lambda "#") +(transpose-array "#") +(trap-disable "#") +(trap-enable "#") (trap-set! "") -(traps "#") +(truncate "#") +(truncate-file "#") +(try-arbiter "#") +(try-load-module "#") +(try-module-autoload "#") +(ttyname "#") +(turn-on-debugging "#") +(tzset "#") +(umask "#") +(uname "#") (undefine "") -(uniform-array-read! "#") +(uniform-array-set1! "#") +(uniform-array-write "#") +(uniform-vector-fill! "#") +(uniform-vector-length "#") +(uniform-vector-read! "#") +(uniform-vector-ref "#") +(uniform-vector-set! "#") +(uniform-vector-write "#") +(uniform-vector? "#") +(unlock-mutex "#") +(unmask-signals "#") +(unmemoize "#") +(unread-char "#") +(unread-string "#") +(unspecified? "#") (use-emacs-interface "") (use-modules "") -(use-srfis "#") (use-syntax "") (using-readline? "#") -(usleep "#list "#") +(utime "#") +(utsname:machine "#") +(utsname:nodename "#") +(utsname:release "#") +(utsname:sysname "#") +(utsname:version "#") +(valid-object-procedure? "#") +(values "#") +(variable-bound? "#") +(variable-ref "#") +(variable-set! "#") +(variable? "#") +(vector "#") +(vector->list "#list>") +(vector-fill! "#") +(vector-length "#") +(vector-move-left! "#") +(vector-move-right! "#") +(vector-ref "#") +(vector-set! "#") +(vector? "#") +(version "#") (vtable-index-layout "") (vtable-index-printer "") (vtable-index-vtable "") (vtable-offset-user "") -(wait-condition-variable "#") +(waitpid "#") +(warn "#") +(weak-key-hash-table? "#") +(weak-value-hash-table? "#") +(weak-vector "#") +(weak-vector? "#") (while "") -(with-error-to-file "#") +(with-error-to-port "#") +(with-error-to-string "#") (with-fluids "") -(with-fluids* "#") +(with-input-from-file "#") +(with-input-from-port "#") +(with-input-from-string "#") +(with-output-to-file "#") +(with-output-to-port "#") +(with-output-to-string "#") +(with-traps "#") +(write "#") +(write-char "#") (xformer-table "") -(yield "#") +(zero? "#") ) ;; end of scheme -(C +(C (collisionp B) (coop_abort T) (coop_condition_variable_destroy T) @@ -1648,7 +1650,6 @@ (gnfds B) (greadfds B) (gwritefds B) -(issued_msgs B) (rexceptfds B) (rreadfds B) (rwritefds B) @@ -1699,6 +1700,7 @@ (scm_array_prototype T) (scm_array_rank T) (scm_array_set_x T) +(scm_array_to_list T) (scm_ash T) (scm_asinh T) (scm_assoc T) @@ -1774,6 +1776,7 @@ (scm_c_ints2ivect T) (scm_c_ints2scm T) (scm_c_issue_deprecation_warning T) +(scm_c_issue_deprecation_warning_fmt T) (scm_c_load_extension T) (scm_c_longs2ivect T) (scm_c_longs2scm T) @@ -2128,22 +2131,29 @@ (scm_gc_cells_swept D) (scm_gc_cells_swept_acc D) (scm_gc_for_newcell T) +(scm_gc_free T) (scm_gc_heap_lock D) +(scm_gc_malloc T) (scm_gc_malloc_collected B) (scm_gc_mark T) (scm_gc_mark_dependencies T) (scm_gc_mark_time_taken D) (scm_gc_ports_collected B) (scm_gc_protect_object T) +(scm_gc_realloc T) +(scm_gc_register_collectable_memory T) (scm_gc_register_root T) (scm_gc_register_roots T) (scm_gc_running_p D) (scm_gc_stats T) +(scm_gc_strdup T) +(scm_gc_strndup T) (scm_gc_sweep T) (scm_gc_sweep_time_taken D) (scm_gc_time_taken D) (scm_gc_times D) (scm_gc_unprotect_object T) +(scm_gc_unregister_collectable_memory T) (scm_gc_unregister_root T) (scm_gc_unregister_roots T) (scm_gc_yield B) @@ -2554,6 +2564,7 @@ (scm_makmacro T) (scm_makmmacro T) (scm_makprom T) +(scm_malloc T) (scm_malloc_obj T) (scm_mallocated D) (scm_map T) @@ -2768,6 +2779,7 @@ (scm_real_equalp T) (scm_real_p T) (scm_real_part T) +(scm_realloc T) (scm_recv T) (scm_recvfrom T) (scm_redirect_port T) @@ -2927,6 +2939,7 @@ (scm_status_term_sig T) (scm_str2string T) (scm_str2symbol T) +(scm_strdup T) (scm_strerror T) (scm_strftime T) (scm_string T) @@ -2962,6 +2975,7 @@ (scm_string_to_symbol T) (scm_string_upcase T) (scm_string_upcase_x T) +(scm_strndup T) (scm_strport_to_string T) (scm_strptime T) (scm_struct_create_handle T) @@ -3073,7 +3087,6 @@ (scm_system_environment B) (scm_system_error_key B) (scm_system_module_env_p T) -(scm_t_arrayo_list T) (scm_tables_prehistory T) (scm_take0str T) (scm_take_from_input_buffers T) @@ -3198,4 +3211,4 @@ (scm_zero_p T) (terminating B) ) ;; end of C -) +) ;; eof From 2f908075a53ece4e2372a79294ad2dd9524fe81e Mon Sep 17 00:00:00 2001 From: Thien-Thi Nguyen Date: Fri, 1 Mar 2002 08:35:15 +0000 Subject: [PATCH 025/131] Remove "pwd" meta info. --- doc/guile-api.alist | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/doc/guile-api.alist b/doc/guile-api.alist index 4f79b6139..10983d0bd 100644 --- a/doc/guile-api.alist +++ b/doc/guile-api.alist @@ -3,8 +3,7 @@ (meta (GUILE_LOAD_PATH . "") (LTDL_LOAD_PATH . "") (guile . "pre-inst-guile") - (sofile . "libguile/.libs/libguile.so.15.0.0") - (pwd . "/home/ttn/tmp/.tmp")) + (sofile . "libguile/.libs/libguile.so.15.0.0")) (scheme ($abs "#") ($acos "#") From 547ba6882a15a68e6818e9f7a5b84fc6d7202786 Mon Sep 17 00:00:00 2001 From: Thien-Thi Nguyen Date: Fri, 1 Mar 2002 08:36:32 +0000 Subject: [PATCH 026/131] *** empty log message *** --- doc/ChangeLog | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/doc/ChangeLog b/doc/ChangeLog index 0703983f5..8dfc503c0 100644 --- a/doc/ChangeLog +++ b/doc/ChangeLog @@ -1,3 +1,7 @@ +2002-03-01 Thien-Thi Nguyen + + * guile-api.alist: Update. + 2001-08-27 Neil Jerram * mltext.texi (Guile Character Properties): Fix `hexidecimal' @@ -39,7 +43,7 @@ * scheme-evaluation.texi: Added `load-from-path'. Corrected `load': it doesn't use the load paths. - + 2001-07-04 Martin Grabmueller * scheme-data.texi (Hook Reference): Removed documentation for @@ -57,7 +61,7 @@ @result{} and @print{}. * scheme-data.texi (Hash Table Examples): New subsubsection. - + 2001-06-30 Martin Grabmueller * scheme-data.texi (Hash Tables): Added docs for @@ -157,7 +161,7 @@ 2001-06-04 Gary Houston - * scheme-io.texi (Block Reading and Writing): added + * scheme-io.texi (Block Reading and Writing): added write-string/partial, updated read-string!/partial. 2001-05-30 Martin Grabmueller @@ -248,7 +252,7 @@ * srfi-modules.texi (SRFI-0): New section. (SRFI-16): New section. - + Change `--' to `-' throughout. 2001-05-13 Thien-Thi Nguyen From 6a0f6ff30ce01947755276fc6e505129f921541e Mon Sep 17 00:00:00 2001 From: Dirk Herrmann Date: Sat, 2 Mar 2002 09:53:51 +0000 Subject: [PATCH 027/131] * eval.c (scm_badargsp, SCM_CEVAL): Replaced SCM_N?IMP by a more explicit predicate in some places. (CHECK_EQVISH): Removed. (SCM_CEVAL): Removed some uses of t.arg1 and proc as temporary variables. Removed side-effecting operations from conditions and macro calls. Introduced temporary variables for clarification. Sorted if-else-if check for the type of the last form in a list by frequency. Avoided some unnecessary tail-recursion calls. --- libguile/ChangeLog | 13 ++++++ libguile/eval.c | 111 +++++++++++++++++++++++++-------------------- 2 files changed, 76 insertions(+), 48 deletions(-) diff --git a/libguile/ChangeLog b/libguile/ChangeLog index f86d494d0..8d7b23f09 100644 --- a/libguile/ChangeLog +++ b/libguile/ChangeLog @@ -1,3 +1,16 @@ +2002-03-02 Dirk Herrmann + + * eval.c (scm_badargsp, SCM_CEVAL): Replaced SCM_N?IMP by a more + explicit predicate in some places. + + (CHECK_EQVISH): Removed. + + (SCM_CEVAL): Removed some uses of t.arg1 and proc as temporary + variables. Removed side-effecting operations from conditions and + macro calls. Introduced temporary variables for clarification. + Sorted if-else-if check for the type of the last form in a list by + frequency. Avoided some unnecessary tail-recursion calls. + 2002-03-01 Dirk Herrmann * gc.c (SCM_HEAP_SEG_SIZE, CELL_UP, CELL_DN, NEXT_DATA_CELL, diff --git a/libguile/eval.c b/libguile/eval.c index 4c3d53e95..44df33d18 100644 --- a/libguile/eval.c +++ b/libguile/eval.c @@ -1571,11 +1571,11 @@ scm_unmemocopy (SCM x, SCM env) int scm_badargsp (SCM formals, SCM args) { - while (SCM_NIMP (formals)) + while (!SCM_NULLP (formals)) { if (!SCM_CONSP (formals)) return 0; - if (SCM_IMP(args)) + if (SCM_NULLP (args)) return 1; formals = SCM_CDR (formals); args = SCM_CDR (args); @@ -1845,9 +1845,6 @@ deval_args (SCM l, SCM env, SCM proc, SCM *lloc) env = scm_top_level_env (p); \ } while (0) -#ifndef DEVAL -#define CHECK_EQVISH(A,B) (SCM_EQ_P ((A), (B)) || (!SCM_FALSEP (scm_eqv_p ((A), (B))))) -#endif /* DEVAL */ /* This is the evaluator. Like any real monster, it has three heads: * @@ -1926,9 +1923,11 @@ SCM_CEVAL (SCM x, SCM env) scm_report_stack_overflow (); } #endif + #ifdef DEVAL goto start; #endif + loopnoap: PREP_APPLY (SCM_UNDEFINED, SCM_EOL); loop: @@ -1951,6 +1950,7 @@ loop: SCM_SET_OVERFLOW (debug); debug.info -= 2; } + start: debug.info->e.exp = x; debug.info->e.env = env; @@ -1999,11 +1999,12 @@ dispatch: x = scm_cons (x, SCM_UNDEFINED); RETURN (*scm_lookupcar (x, env, 1)); - case SCM_BIT8(SCM_IM_AND): + case SCM_BIT8 (SCM_IM_AND): x = SCM_CDR (x); while (!SCM_NULLP (SCM_CDR (x))) { - if (SCM_FALSEP (t.arg1 = EVALCAR (x, env)) || SCM_NILP (t.arg1)) + SCM condition = EVALCAR (x, env); + if (SCM_FALSEP (condition) || SCM_NILP (condition)) RETURN (SCM_BOOL_F); else x = SCM_CDR (x); @@ -2011,7 +2012,7 @@ dispatch: PREP_APPLY (SCM_UNDEFINED, SCM_EOL); goto carloop; - case SCM_BIT8(SCM_IM_BEGIN): + case SCM_BIT8 (SCM_IM_BEGIN): if (SCM_NULLP (SCM_CDR (x))) RETURN (SCM_UNSPECIFIED); @@ -2046,59 +2047,73 @@ dispatch: nontoplevel_begin: while (!SCM_NULLP (SCM_CDR (x))) { - if (SCM_IMP (SCM_CAR (x))) + SCM form = SCM_CAR (x); + if (SCM_IMP (form)) { - if (SCM_ISYMP (SCM_CAR (x))) + if (SCM_ISYMP (form)) { x = scm_m_expand_body (x, env); goto nontoplevel_begin; } else - SCM_VALIDATE_NON_EMPTY_COMBINATION (SCM_CAR (x)); + SCM_VALIDATE_NON_EMPTY_COMBINATION (form); } else - SCM_CEVAL (SCM_CAR (x), env); + SCM_CEVAL (form, env); x = SCM_CDR (x); } - carloop: /* scm_eval car of last form in list */ - if (SCM_IMP (SCM_CAR (x))) - { - x = SCM_CAR (x); - RETURN (SCM_EVALIM (x, env)); - } + carloop: + { + /* scm_eval last form in list */ + SCM last_form = SCM_CAR (x); - if (SCM_SYMBOLP (SCM_CAR (x))) - RETURN (*scm_lookupcar (x, env, 1)); - - x = SCM_CAR (x); - goto loop; /* tail recurse */ + if (SCM_CONSP (last_form)) + { + /* This is by far the most frequent case. */ + x = last_form; + goto loop; /* tail recurse */ + } + else if (SCM_IMP (last_form)) + RETURN (SCM_EVALIM (last_form, env)); + else if (SCM_VARIABLEP (last_form)) + RETURN (SCM_VARIABLE_REF (last_form)); + else if (SCM_SYMBOLP (last_form)) + RETURN (*scm_lookupcar (x, env, 1)); + else + RETURN (last_form); + } case SCM_BIT8(SCM_IM_CASE): x = SCM_CDR (x); - t.arg1 = EVALCAR (x, env); - while (SCM_NIMP (x = SCM_CDR (x))) - { - proc = SCM_CAR (x); - if (SCM_EQ_P (scm_sym_else, SCM_CAR (proc))) - { - x = SCM_CDR (proc); - PREP_APPLY (SCM_UNDEFINED, SCM_EOL); - goto begin; - } - proc = SCM_CAR (proc); - while (SCM_NIMP (proc)) - { - if (CHECK_EQVISH (SCM_CAR (proc), t.arg1)) - { - x = SCM_CDAR (x); - PREP_APPLY (SCM_UNDEFINED, SCM_EOL); - goto begin; - } - proc = SCM_CDR (proc); - } - } + { + SCM key = EVALCAR (x, env); + x = SCM_CDR (x); + while (!SCM_NULLP (x)) + { + SCM clause = SCM_CAR (x); + SCM labels = SCM_CAR (clause); + if (SCM_EQ_P (labels, scm_sym_else)) + { + x = SCM_CDR (clause); + PREP_APPLY (SCM_UNDEFINED, SCM_EOL); + goto begin; + } + while (!SCM_NULLP (labels)) + { + SCM label = SCM_CAR (labels); + if (SCM_EQ_P (label, key) || !SCM_FALSEP (scm_eqv_p (label, key))) + { + x = SCM_CDR (clause); + PREP_APPLY (SCM_UNDEFINED, SCM_EOL); + goto begin; + } + labels = SCM_CDR (labels); + } + x = SCM_CDR (x); + } + } RETURN (SCM_UNSPECIFIED); @@ -2119,14 +2134,14 @@ dispatch: x = SCM_CDR (proc); if (SCM_NULLP (x)) RETURN (t.arg1); - if (!SCM_EQ_P (scm_sym_arrow, SCM_CAR (x))) + else if (!SCM_EQ_P (SCM_CAR (x), scm_sym_arrow)) { PREP_APPLY (SCM_UNDEFINED, SCM_EOL); goto begin; } proc = SCM_CDR (x); proc = EVALCAR (proc, env); - SCM_ASRTGO (SCM_NIMP (proc), badfun); + SCM_ASRTGO (!SCM_IMP (proc), badfun); PREP_APPLY (proc, scm_list_1 (t.arg1)); ENTER_APPLY; if (SCM_CLOSUREP(proc) && scm_badformalsp (proc, 1)) @@ -2142,7 +2157,7 @@ dispatch: x = SCM_CDR (x); proc = SCM_CADR (x); /* inits */ t.arg1 = SCM_EOL; /* values */ - while (SCM_NIMP (proc)) + while (!SCM_NULLP (proc)) { t.arg1 = scm_cons (EVALCAR (proc, env), t.arg1); proc = SCM_CDR (proc); From e5cb71a0a9ff8d1fc1592543868f4fd7cd4f7792 Mon Sep 17 00:00:00 2001 From: Dirk Herrmann Date: Sat, 2 Mar 2002 11:50:01 +0000 Subject: [PATCH 028/131] * eval.c (SCM_CEVAL): Cleaned up the handling of 'cons' and 'do': Removed some uses of t.arg1 and proc as temporary variables. Removed side-effecting operations from conditions and macro calls. Introduced temporary variables with hopefully descriptive names for clarification. Replaced SCM_N?IMP by a more explicit predicate in some places. --- libguile/ChangeLog | 9 ++++ libguile/eval.c | 128 ++++++++++++++++++++++++++++++--------------- 2 files changed, 95 insertions(+), 42 deletions(-) diff --git a/libguile/ChangeLog b/libguile/ChangeLog index 8d7b23f09..c7344414a 100644 --- a/libguile/ChangeLog +++ b/libguile/ChangeLog @@ -1,3 +1,12 @@ +2002-03-02 Dirk Herrmann + + * eval.c (SCM_CEVAL): Cleaned up the handling of 'cons' and 'do': + Removed some uses of t.arg1 and proc as temporary variables. + Removed side-effecting operations from conditions and macro calls. + Introduced temporary variables with hopefully descriptive names + for clarification. Replaced SCM_N?IMP by a more explicit + predicate in some places. + 2002-03-02 Dirk Herrmann * eval.c (scm_badargsp, SCM_CEVAL): Replaced SCM_N?IMP by a more diff --git a/libguile/eval.c b/libguile/eval.c index 44df33d18..430ba4398 100644 --- a/libguile/eval.c +++ b/libguile/eval.c @@ -2121,64 +2121,108 @@ dispatch: x = SCM_CDR (x); while (!SCM_NULLP (x)) { - proc = SCM_CAR (x); - if (SCM_EQ_P (SCM_CAR (proc), scm_sym_else)) + SCM clause = SCM_CAR (x); + if (SCM_EQ_P (SCM_CAR (clause), scm_sym_else)) { - x = SCM_CDR (proc); + x = SCM_CDR (clause); PREP_APPLY (SCM_UNDEFINED, SCM_EOL); goto begin; } - t.arg1 = EVALCAR (proc, env); - if (!SCM_FALSEP (t.arg1) && !SCM_NILP (t.arg1)) + else { - x = SCM_CDR (proc); - if (SCM_NULLP (x)) - RETURN (t.arg1); - else if (!SCM_EQ_P (SCM_CAR (x), scm_sym_arrow)) + t.arg1 = EVALCAR (clause, env); + if (!SCM_FALSEP (t.arg1) && !SCM_NILP (t.arg1)) { - PREP_APPLY (SCM_UNDEFINED, SCM_EOL); - goto begin; + x = SCM_CDR (clause); + if (SCM_NULLP (x)) + RETURN (t.arg1); + else if (!SCM_EQ_P (SCM_CAR (x), scm_sym_arrow)) + { + PREP_APPLY (SCM_UNDEFINED, SCM_EOL); + goto begin; + } + else + { + proc = SCM_CDR (x); + proc = EVALCAR (proc, env); + SCM_ASRTGO (!SCM_IMP (proc), badfun); + PREP_APPLY (proc, scm_list_1 (t.arg1)); + ENTER_APPLY; + if (SCM_CLOSUREP(proc) && scm_badformalsp (proc, 1)) + goto umwrongnumargs; + else + goto evap1; + } } - proc = SCM_CDR (x); - proc = EVALCAR (proc, env); - SCM_ASRTGO (!SCM_IMP (proc), badfun); - PREP_APPLY (proc, scm_list_1 (t.arg1)); - ENTER_APPLY; - if (SCM_CLOSUREP(proc) && scm_badformalsp (proc, 1)) - goto umwrongnumargs; - goto evap1; + x = SCM_CDR (x); } - x = SCM_CDR (x); } RETURN (SCM_UNSPECIFIED); - case SCM_BIT8(SCM_IM_DO): + case SCM_BIT8 (SCM_IM_DO): x = SCM_CDR (x); - proc = SCM_CADR (x); /* inits */ - t.arg1 = SCM_EOL; /* values */ - while (!SCM_NULLP (proc)) - { - t.arg1 = scm_cons (EVALCAR (proc, env), t.arg1); - proc = SCM_CDR (proc); - } - env = EXTEND_ENV (SCM_CAR (x), t.arg1, env); + { + /* Compute the initialization values and the initial environment. */ + SCM init_forms = SCM_CADR (x); + SCM init_values = SCM_EOL; + while (!SCM_NULLP (init_forms)) + { + init_values = scm_cons (EVALCAR (init_forms, env), init_values); + init_forms = SCM_CDR (init_forms); + } + env = EXTEND_ENV (SCM_CAR (x), init_values, env); + } x = SCM_CDDR (x); - while (proc = SCM_CAR (x), - SCM_FALSEP (t.arg1 = EVALCAR (proc, env)) || SCM_NILP (t.arg1)) - { - for (proc = SCM_CADR (x); SCM_NIMP (proc); proc = SCM_CDR (proc)) + { + SCM test_form = SCM_CAR (x); + SCM body_forms = SCM_CADR (x); + SCM step_forms = SCM_CDDR (x); + + SCM test_result = EVALCAR (test_form, env); + + while (SCM_FALSEP (test_result) || SCM_NILP (test_result)) + { { - t.arg1 = SCM_CAR (proc); /* body */ - SIDEVAL (t.arg1, env); + /* Evaluate body forms. */ + SCM temp_forms; + for (temp_forms = body_forms; + !SCM_NULLP (temp_forms); + temp_forms = SCM_CDR (temp_forms)) + { + SCM form = SCM_CAR (temp_forms); + /* Dirk:FIXME: We only need to eval forms, that may have a + * side effect here. This is only true for forms that start + * with a pair. All others are just constants. However, + * since in the common case there is no constant expression + * in a body of a do form, we just check for immediates here + * and have SCM_CEVAL take care of other cases. In the long + * run it would make sense to get rid of this test and have + * the macro transformer of 'do' eliminate all forms that + * have no sideeffect. */ + if (!SCM_IMP (form)) + SCM_CEVAL (form, env); + } } - for (t.arg1 = SCM_EOL, proc = SCM_CDDR (x); - SCM_NIMP (proc); - proc = SCM_CDR (proc)) - t.arg1 = scm_cons (EVALCAR (proc, env), t.arg1); /* steps */ - env = EXTEND_ENV (SCM_CAAR (env), t.arg1, SCM_CDR (env)); - } - x = SCM_CDR (proc); + + { + /* Evaluate the step expressions. */ + SCM temp_forms; + SCM step_values = SCM_EOL; + for (temp_forms = step_forms; + !SCM_NULLP (temp_forms); + temp_forms = SCM_CDR (temp_forms)) + { + SCM value = EVALCAR (temp_forms, env); + step_values = scm_cons (value, step_values); + } + env = EXTEND_ENV (SCM_CAAR (env), step_values, SCM_CDR (env)); + } + + test_result = EVALCAR (test_form, env); + } + } + x = SCM_CDAR (x); if (SCM_NULLP (x)) RETURN (SCM_UNSPECIFIED); PREP_APPLY (SCM_UNDEFINED, SCM_EOL); From 38ace99eb34dc50f97d730877233231943a3a49c Mon Sep 17 00:00:00 2001 From: Dirk Herrmann Date: Sat, 2 Mar 2002 12:47:45 +0000 Subject: [PATCH 029/131] * eval.c (SCM_CEVAL): Cleaned up the handling of 'if', 'let', 'letrec' and 'set*': Removed some uses of t.arg1, t.lloc and proc as temporary variables. Removed side-effecting operations from conditions and macro calls. Introduced temporary variables with hopefully descriptive names for clarification. Replaced SCM_N?IMP by a more explicit predicate in some places. Removed code that was conditionally compiled if SICP was defined - which it never is. --- libguile/ChangeLog | 11 +++++ libguile/eval.c | 107 ++++++++++++++++++++++++--------------------- 2 files changed, 68 insertions(+), 50 deletions(-) diff --git a/libguile/ChangeLog b/libguile/ChangeLog index c7344414a..496ad9afa 100644 --- a/libguile/ChangeLog +++ b/libguile/ChangeLog @@ -1,3 +1,14 @@ +2002-03-02 Dirk Herrmann + + * eval.c (SCM_CEVAL): Cleaned up the handling of 'if', 'let', + 'letrec' and 'set*': Removed some uses of t.arg1, t.lloc and proc + as temporary variables. Removed side-effecting operations from + conditions and macro calls. Introduced temporary variables with + hopefully descriptive names for clarification. Replaced SCM_N?IMP + by a more explicit predicate in some places. Removed code that + was conditionally compiled if SICP was defined - which it never + is. + 2002-03-02 Dirk Herrmann * eval.c (SCM_CEVAL): Cleaned up the handling of 'cons' and 'do': diff --git a/libguile/eval.c b/libguile/eval.c index 430ba4398..f2c8b07e8 100644 --- a/libguile/eval.c +++ b/libguile/eval.c @@ -2003,8 +2003,8 @@ dispatch: x = SCM_CDR (x); while (!SCM_NULLP (SCM_CDR (x))) { - SCM condition = EVALCAR (x, env); - if (SCM_FALSEP (condition) || SCM_NILP (condition)) + SCM test_result = EVALCAR (x, env); + if (SCM_FALSEP (test_result) || SCM_NILP (test_result)) RETURN (SCM_BOOL_F); else x = SCM_CDR (x); @@ -2085,7 +2085,7 @@ dispatch: } - case SCM_BIT8(SCM_IM_CASE): + case SCM_BIT8 (SCM_IM_CASE): x = SCM_CDR (x); { SCM key = EVALCAR (x, env); @@ -2229,46 +2229,59 @@ dispatch: goto nontoplevel_begin; - case SCM_BIT8(SCM_IM_IF): + case SCM_BIT8 (SCM_IM_IF): x = SCM_CDR (x); - if (!SCM_FALSEP (t.arg1 = EVALCAR (x, env)) && !SCM_NILP (t.arg1)) - x = SCM_CDR (x); - else if (SCM_IMP (x = SCM_CDDR (x))) - RETURN (SCM_UNSPECIFIED); + { + SCM test_result = EVALCAR (x, env); + if (!SCM_FALSEP (test_result) && !SCM_NILP (test_result)) + x = SCM_CDR (x); + else + { + x = SCM_CDDR (x); + if (SCM_NULLP (x)) + RETURN (SCM_UNSPECIFIED); + } + } PREP_APPLY (SCM_UNDEFINED, SCM_EOL); goto carloop; - case SCM_BIT8(SCM_IM_LET): + case SCM_BIT8 (SCM_IM_LET): x = SCM_CDR (x); - proc = SCM_CADR (x); - t.arg1 = SCM_EOL; - do - { - t.arg1 = scm_cons (EVALCAR (proc, env), t.arg1); - } - while (SCM_NIMP (proc = SCM_CDR (proc))); - env = EXTEND_ENV (SCM_CAR (x), t.arg1, env); + { + SCM init_forms = SCM_CADR (x); + SCM init_values = SCM_EOL; + do + { + init_values = scm_cons (EVALCAR (init_forms, env), init_values); + init_forms = SCM_CDR (init_forms); + } + while (!SCM_NULLP (init_forms)); + env = EXTEND_ENV (SCM_CAR (x), init_values, env); + } x = SCM_CDR (x); goto nontoplevel_cdrxnoap; - case SCM_BIT8(SCM_IM_LETREC): + case SCM_BIT8 (SCM_IM_LETREC): x = SCM_CDR (x); env = EXTEND_ENV (SCM_CAR (x), scm_undefineds, env); x = SCM_CDR (x); - proc = SCM_CAR (x); - t.arg1 = SCM_EOL; - do - { - t.arg1 = scm_cons (EVALCAR (proc, env), t.arg1); - } - while (SCM_NIMP (proc = SCM_CDR (proc))); - SCM_SETCDR (SCM_CAR (env), t.arg1); + { + SCM init_forms = SCM_CAR (x); + SCM init_values = SCM_EOL; + do + { + init_values = scm_cons (EVALCAR (init_forms, env), init_values); + init_forms = SCM_CDR (init_forms); + } + while (!SCM_NULLP (init_forms)); + SCM_SETCDR (SCM_CAR (env), init_values); + } goto nontoplevel_cdrxnoap; - case SCM_BIT8(SCM_IM_LETSTAR): + case SCM_BIT8 (SCM_IM_LETSTAR): x = SCM_CDR (x); { SCM bindings = SCM_CAR (x); @@ -2289,7 +2302,7 @@ dispatch: goto nontoplevel_cdrxnoap; - case SCM_BIT8(SCM_IM_OR): + case SCM_BIT8 (SCM_IM_OR): x = SCM_CDR (x); while (!SCM_NULLP (SCM_CDR (x))) { @@ -2303,43 +2316,37 @@ dispatch: goto carloop; - case SCM_BIT8(SCM_IM_LAMBDA): + case SCM_BIT8 (SCM_IM_LAMBDA): RETURN (scm_closure (SCM_CDR (x), env)); - case SCM_BIT8(SCM_IM_QUOTE): + case SCM_BIT8 (SCM_IM_QUOTE): RETURN (SCM_CADR (x)); - case SCM_BIT8(SCM_IM_SET_X): + case SCM_BIT8 (SCM_IM_SET_X): x = SCM_CDR (x); - proc = SCM_CAR (x); - switch (SCM_ITAG3 (proc)) - { - case scm_tc3_cons: - if (SCM_VARIABLEP (proc)) - t.lloc = SCM_VARIABLE_LOC (proc); - else - t.lloc = scm_lookupcar (x, env, 1); - break; + { + SCM *location; + SCM variable = SCM_CAR (x); + if (SCM_VARIABLEP (variable)) + location = SCM_VARIABLE_LOC (variable); #ifdef MEMOIZE_LOCALS - case scm_tc3_imm24: - t.lloc = scm_ilookup (proc, env); - break; + else if (SCM_ILOCP (variable)) + location = scm_ilookup (variable, env); #endif - } - x = SCM_CDR (x); - *t.lloc = EVALCAR (x, env); -#ifdef SICP - RETURN (*t.lloc); -#else + else /* (SCM_SYMBOLP (variable)) is known to be true */ + location = scm_lookupcar (x, env, 1); + x = SCM_CDR (x); + *location = EVALCAR (x, env); + } RETURN (SCM_UNSPECIFIED); -#endif case SCM_BIT8(SCM_IM_DEFINE): /* only for internal defines */ scm_misc_error (NULL, "Bad define placement", SCM_EOL); + /* new syntactic forms go here. */ case SCM_BIT8(SCM_MAKISYM (0)): proc = SCM_CAR (x); From 97820583b49502fdb72794185bb7d466efe5ab12 Mon Sep 17 00:00:00 2001 From: Stefan Jahn Date: Sat, 2 Mar 2002 14:18:38 +0000 Subject: [PATCH 030/131] 2002-03-02 Stefan Jahn * convert.i.c: Fixed int <-> long conversions which would have failed if their sizes were different. --- libguile/ChangeLog | 5 ++++ libguile/convert.c | 60 +++++++++++++++++++++++++++++--------------- libguile/convert.i.c | 58 +++++++++++++++++++++++++++++++----------- 3 files changed, 89 insertions(+), 34 deletions(-) diff --git a/libguile/ChangeLog b/libguile/ChangeLog index 496ad9afa..06f0bf053 100644 --- a/libguile/ChangeLog +++ b/libguile/ChangeLog @@ -1,3 +1,8 @@ +2002-03-02 Stefan Jahn + + * convert.i.c: Fixed int <-> long conversions which would have + failed if their sizes were different. + 2002-03-02 Dirk Herrmann * eval.c (SCM_CEVAL): Cleaned up the handling of 'if', 'let', diff --git a/libguile/convert.c b/libguile/convert.c index d6606d555..16ab366a5 100644 --- a/libguile/convert.c +++ b/libguile/convert.c @@ -56,28 +56,36 @@ #include #endif -#define CTYPE char -#define SIZEOF_CTYPE 1 -#define SCM2CTYPES_FN "scm_c_scm2chars" -#define SCM2CTYPES scm_c_scm2chars -#define CTYPES2SCM_FN "scm_c_chars2scm" -#define CTYPES2SCM scm_c_chars2scm -#define CTYPES2UVECT_FN "scm_c_chars2byvect" -#define CTYPES2UVECT scm_c_chars2byvect -#define UVECTTYPE scm_tc7_byvect -#define ARRAYTYPE scm_tc7_byvect +#define CTYPE char +#define SIZEOF_CTYPE 1 +#define SCM2CTYPES_FN "scm_c_scm2chars" +#define SCM2CTYPES scm_c_scm2chars +#define CTYPES2SCM_FN "scm_c_chars2scm" +#define CTYPES2SCM scm_c_chars2scm +#define CTYPES2UVECT_FN "scm_c_chars2byvect" +#define CTYPES2UVECT scm_c_chars2byvect +#define UVECTTYPE scm_tc7_byvect +#define SIZEOF_UVECTTYPE 1 +#define UVECTCTYPE char +#define ARRAYTYPE scm_tc7_byvect +#define SIZEOF_ARRAYTYPE 1 +#define ARRAYCTYPE char #include "convert.i.c" -#define CTYPE short -#define SIZEOF_CTYPE SIZEOF_SHORT -#define SCM2CTYPES_FN "scm_c_scm2shorts" -#define SCM2CTYPES scm_c_scm2shorts -#define CTYPES2SCM_FN "scm_c_shorts2scm" -#define CTYPES2SCM scm_c_shorts2scm -#define CTYPES2UVECT_FN "scm_c_shorts2svect" -#define CTYPES2UVECT scm_c_shorts2svect -#define UVECTTYPE scm_tc7_svect -#define ARRAYTYPE scm_tc7_svect +#define CTYPE short +#define SIZEOF_CTYPE SIZEOF_SHORT +#define SCM2CTYPES_FN "scm_c_scm2shorts" +#define SCM2CTYPES scm_c_scm2shorts +#define CTYPES2SCM_FN "scm_c_shorts2scm" +#define CTYPES2SCM scm_c_shorts2scm +#define CTYPES2UVECT_FN "scm_c_shorts2svect" +#define CTYPES2UVECT scm_c_shorts2svect +#define UVECTTYPE scm_tc7_svect +#define SIZEOF_UVECTTYPE SIZEOF_SHORT +#define UVECTCTYPE short +#define ARRAYTYPE scm_tc7_svect +#define SIZEOF_ARRAYTYPE SIZEOF_SHORT +#define ARRAYCTYPE short #include "convert.i.c" #define CTYPE int @@ -89,10 +97,14 @@ #define CTYPES2UVECT_FN "scm_c_ints2ivect" #define CTYPES2UVECT scm_c_ints2ivect #define UVECTTYPE scm_tc7_ivect +#define SIZEOF_UVECTTYPE SIZEOF_LONG +#define UVECTCTYPE long #define CTYPES2UVECT_FN_OPTIONAL "scm_c_uints2uvect" #define CTYPES2UVECT_OPTIONAL scm_c_uints2uvect #define UVECTTYPE_OPTIONAL scm_tc7_uvect #define ARRAYTYPE scm_tc7_ivect +#define SIZEOF_ARRAYTYPE SIZEOF_LONG +#define ARRAYCTYPE long #define ARRAYTYPE_OPTIONAL scm_tc7_uvect #include "convert.i.c" @@ -105,10 +117,14 @@ #define CTYPES2UVECT_FN "scm_c_longs2ivect" #define CTYPES2UVECT scm_c_longs2ivect #define UVECTTYPE scm_tc7_ivect +#define SIZEOF_UVECTTYPE SIZEOF_LONG +#define UVECTCTYPE long #define CTYPES2UVECT_FN_OPTIONAL "scm_c_ulongs2uvect" #define CTYPES2UVECT_OPTIONAL scm_c_ulongs2uvect #define UVECTTYPE_OPTIONAL scm_tc7_uvect #define ARRAYTYPE scm_tc7_ivect +#define SIZEOF_ARRAYTYPE SIZEOF_LONG +#define ARRAYCTYPE long #define ARRAYTYPE_OPTIONAL scm_tc7_uvect #include "convert.i.c" @@ -121,7 +137,9 @@ #define CTYPES2UVECT_FN "scm_c_floats2fvect" #define CTYPES2UVECT scm_c_floats2fvect #define UVECTTYPE scm_tc7_fvect +#define SIZEOF_UVECTTYPE 0 #define ARRAYTYPE scm_tc7_fvect +#define SIZEOF_ARRAYTYPE 0 #define ARRAYTYPE_OPTIONAL scm_tc7_dvect #define FLOATTYPE float #define FLOATTYPE_OPTIONAL double @@ -136,7 +154,9 @@ #define CTYPES2UVECT_FN "scm_c_doubles2dvect" #define CTYPES2UVECT scm_c_doubles2dvect #define UVECTTYPE scm_tc7_dvect +#define SIZEOF_UVECTTYPE 0 #define ARRAYTYPE scm_tc7_dvect +#define SIZEOF_ARRAYTYPE 0 #define ARRAYTYPE_OPTIONAL scm_tc7_fvect #define FLOATTYPE double #define FLOATTYPE_OPTIONAL float diff --git a/libguile/convert.i.c b/libguile/convert.i.c index 0d78711c7..e2c338a7a 100644 --- a/libguile/convert.i.c +++ b/libguile/convert.i.c @@ -54,10 +54,8 @@ SCM2CTYPES (SCM obj, CTYPE *data) /* allocate new memory if necessary */ if (data == NULL) - { - if ((data = (CTYPE *) malloc (n * sizeof (CTYPE))) == NULL) - return NULL; - } + if ((data = (CTYPE *) malloc (n * sizeof (CTYPE))) == NULL) + return NULL; /* traverse the list once more and convert each member */ list = obj; @@ -116,10 +114,8 @@ SCM2CTYPES (SCM obj, CTYPE *data) /* allocate new memory if necessary */ if (data == NULL) - { - if ((data = (CTYPE *) malloc (n * sizeof (CTYPE))) == NULL) - return NULL; - } + if ((data = (CTYPE *) malloc (n * sizeof (CTYPE))) == NULL) + return NULL; /* traverse the vector once more and convert each member */ for (i = 0; i < n; i++) @@ -146,10 +142,8 @@ SCM2CTYPES (SCM obj, CTYPE *data) /* allocate new memory if necessary */ if (data == NULL) - { - if ((data = (CTYPE *) malloc (n * sizeof (CTYPE))) == NULL) - return NULL; - } + if ((data = (CTYPE *) malloc (n * sizeof (CTYPE))) == NULL) + return NULL; #ifdef FLOATTYPE_OPTIONAL /* float <-> double conversions */ @@ -160,8 +154,14 @@ SCM2CTYPES (SCM obj, CTYPE *data) } else #endif +#if SIZEOF_CTYPE != SIZEOF_ARRAYTYPE + /* copy array element by element */ + for (i = 0; i < n; i++) + data[i] = (CTYPE) ((ARRAYCTYPE *) SCM_UVECTOR_BASE (obj))[i]; +#else /* copy whole array */ memcpy (data, (CTYPE *) SCM_UVECTOR_BASE (obj), n * sizeof (CTYPE)); +#endif break; #endif /* HAVE_ARRAYS */ @@ -191,12 +191,23 @@ SCM2CTYPES (SCM obj, CTYPE *data) SCM CTYPES2UVECT (const CTYPE *data, long n) { +#if SIZEOF_CTYPE != SIZEOF_UVECTTYPE + UVECTCTYPE *v; + long i; +#else char *v; +#endif SCM_ASSERT_RANGE (SCM_ARG2, scm_long2num (n), n > 0 && n <= SCM_UVECTOR_MAX_LENGTH); +#if SIZEOF_CTYPE != SIZEOF_UVECTTYPE + v = scm_gc_malloc (n * SIZEOF_UVECTTYPE, "uvect"); + for (i = 0; i < n; i++) + v[i] = (UVECTCTYPE) data[i]; +#else v = scm_gc_malloc (n * sizeof (CTYPE), "uvect"); memcpy (v, data, n * sizeof (CTYPE)); +#endif return scm_cell (SCM_MAKE_UVECTOR_TAG (n, UVECTTYPE), (scm_t_bits) v); } #undef FUNC_NAME @@ -206,12 +217,23 @@ CTYPES2UVECT (const CTYPE *data, long n) SCM CTYPES2UVECT_OPTIONAL (const unsigned CTYPE *data, long n) { +#if SIZEOF_CTYPE != SIZEOF_UVECTTYPE + unsigned UVECTCTYPE *v; + long i; +#else char *v; +#endif SCM_ASSERT_RANGE (SCM_ARG2, scm_long2num (n), n > 0 && n <= SCM_UVECTOR_MAX_LENGTH); - v = scm_gc_malloc (n * sizeof (unsigned CTYPE) * n, "uvect"); - memcpy (v, data, n * sizeof (unsigned CTYPE)); +#if SIZEOF_CTYPE != SIZEOF_UVECTTYPE + v = scm_gc_malloc (n * SIZEOF_UVECTTYPE, "uvect"); + for (i = 0; i < n; i++) + v[i] = (unsigned UVECTCTYPE) data[i]; +#else + v = scm_gc_malloc (n * sizeof (CTYPE), "uvect"); + memcpy (v, data, n * sizeof (CTYPE)); +#endif return scm_cell (SCM_MAKE_UVECTOR_TAG (n, UVECTTYPE_OPTIONAL), (scm_t_bits) v); } @@ -258,6 +280,8 @@ CTYPES2SCM (const CTYPE *data, long n) #undef UVECTTYPE_OPTIONAL #endif #undef SIZEOF_CTYPE +#undef SIZEOF_UVECTTYPE +#undef SIZEOF_ARRAYTYPE #undef ARRAYTYPE #ifdef ARRAYTYPE_OPTIONAL #undef ARRAYTYPE_OPTIONAL @@ -268,6 +292,12 @@ CTYPES2SCM (const CTYPE *data, long n) #ifdef FLOATTYPE_OPTIONAL #undef FLOATTYPE_OPTIONAL #endif +#ifdef UVECTCTYPE +#undef UVECTCTYPE +#endif +#ifdef ARRAYCTYPE +#undef ARRAYCTYPE +#endif /* Local Variables: From 3e76fda1f65b9d9b5eb3aecf4ed2a0e5b7a0e97b Mon Sep 17 00:00:00 2001 From: Thien-Thi Nguyen Date: Mon, 4 Mar 2002 16:35:50 +0000 Subject: [PATCH 031/131] (top_srcdir): Fix ref bug: Force absolute. --- pre-inst-guile.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pre-inst-guile.in b/pre-inst-guile.in index 5c44a9d77..149fbd338 100644 --- a/pre-inst-guile.in +++ b/pre-inst-guile.in @@ -39,7 +39,7 @@ subdirs_with_ltlibs="srfi guile-readline" # maintain me # env (set by configure) -top_srcdir="@top_srcdir@" +top_srcdir=`(cd "@top_srcdir@" ; pwd)` top_builddir="@top_builddir_absolute@" [ x"$top_srcdir" = x -o ! -d "$top_srcdir" -o \ From eb8aea9b2ea32a90c972a750a2b0864614ad203d Mon Sep 17 00:00:00 2001 From: Thien-Thi Nguyen Date: Mon, 4 Mar 2002 16:36:50 +0000 Subject: [PATCH 032/131] *** empty log message *** --- ChangeLog | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/ChangeLog b/ChangeLog index 7e0a4ed83..1fd8fa689 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2002-03-04 Thien-Thi Nguyen + + * pre-inst-guile.in (top_srcdir): Fix ref bug: Force absolute. + 2002-02-27 Thien-Thi Nguyen * pre-inst-guile.in: Typofix; nfc. From 114d6a9423b9df4709600def06ecae1d74770917 Mon Sep 17 00:00:00 2001 From: Thien-Thi Nguyen Date: Mon, 4 Mar 2002 19:28:00 +0000 Subject: [PATCH 033/131] Remove self. --- THANKS | 1 - 1 file changed, 1 deletion(-) diff --git a/THANKS b/THANKS index 4ef8ceb73..508aa098a 100644 --- a/THANKS +++ b/THANKS @@ -6,7 +6,6 @@ Contributors since the last release: Rob Browning Stefan Jahn - Thien-Thi Nguyen For fixes or providing information which led to a fix: From b51bad08b3d287ae7b1c67a4b243eaf6ac745fc0 Mon Sep 17 00:00:00 2001 From: Dirk Herrmann Date: Mon, 4 Mar 2002 20:34:30 +0000 Subject: [PATCH 034/131] * Added an entry listing removed definitions. --- NEWS | 62 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 62 insertions(+) diff --git a/NEWS b/NEWS index 76aa249c3..f6d4003f8 100644 --- a/NEWS +++ b/NEWS @@ -105,6 +105,68 @@ had problems because with them allocation and initialization was separated and the GC could sometimes observe half initialized cells. Only careful coding by the user of SCM_NEWCELL and SCM_NEWCELL2 could make this safe and efficient. +** Removed definitions: scm_lisp_nil, scm_lisp_t, s_nil_ify, scm_m_nil_ify, +s_t_ify, scm_m_t_ify, s_0_cond, scm_m_0_cond, s_0_ify, scm_m_0_ify, s_1_ify, +scm_m_1_ify, scm_debug_newcell, scm_debug_newcell2, scm_tc16_allocated, +SCM_SET_SYMBOL_HASH, SCM_IM_NIL_IFY, SCM_IM_T_IFY, SCM_IM_0_COND, +SCM_IM_0_IFY, SCM_IM_1_IFY, SCM_GC_SET_ALLOCATED, scm_debug_newcell, +scm_debug_newcell2, scm_substring_move_left_x, scm_substring_move_right_x, +long_long, ulong_long, scm_sizet, SCM_WNA, SCM_OUTOFRANGE, SCM_NALLOC, +SCM_HUP_SIGNAL, SCM_INT_SIGNAL, SCM_FPE_SIGNAL, SCM_BUS_SIGNAL, +SCM_SEGV_SIGNAL, SCM_ALRM_SIGNAL, SCM_GC_SIGNAL, SCM_TICK_SIGNAL, +SCM_SIG_ORD, SCM_ORD_SIG, SCM_NUM_SIGS, moddata, registered_mods, +scm_register_module_xxx, scm_registered_modules, +scm_clear_registered_modules, scm_wta, *top-level-lookup-closure*, +scm_top_level_lookup_closure_var, scm_system_transformer, scm_eval_3, +scm_eval2, SCM_SETAND_CAR, SCM_SETOR_CAR, SCM_SETAND_CDR, SCM_SETOR_CDR, +SCM_FREEP, SCM_NFREEP, SCM_GC8MARKP, SCM_SETGC8MARK, SCM_CLRGC8MARK, +SCM_GCTYP16, SCM_GCCDR, scm_remember, scm_protect_object, +scm_unprotect_object, root_module_lookup_closure, scm_sym_app, +scm_sym_modules, module_prefix, make_modules_in_var, +beautify_user_module_x_var, try_module_autoload_var, scm_module_full_name, +scm_the_root_module, scm_make_module, scm_ensure_user_module, +scm_load_scheme_module, scm_port, scm_ptob_descriptor, scm_port_rw_active, +scm_close_all_ports_except, scm_rstate, scm_rng, scm_i_rstate, +SCM_SLOPPY_STRINGP, SCM_RWSTRINGP, SCM_STRING_UCHARS, SCM_STRING_CHARS, +scm_read_only_string_p, scm_makstr, scm_makfromstr, +scm_make_shared_substring, scm_tc7_substring, SCM_SLOPPY_CONSP, +SCM_SLOPPY_NCONSP, scm_tc7_ssymbol, scm_tc7_msymbol, scm_tcs_symbols, +sym_huh, scm_variable_set_name_hint, scm_builtin_variable, SCM_VARVCELL, +SCM_UDVARIABLEP, SCM_DEFVARIABLEP, scm_internal_with_fluids, +scm_make_gsubr, scm_make_gsubr_with_generic, scm_create_hook, list*, +SCM_LIST0, SCM_LIST1, SCM_LIST2, SCM_LIST3, SCM_LIST4, SCM_LIST5, +SCM_LIST6, SCM_LIST7, SCM_LIST8, SCM_LIST9, scm_listify, scm_sloppy_memq, +scm_sloppy_memv, scm_sloppy_member, scm_end_of_file_key, +scm_read_and_eval_x, scm_mkbig, scm_big2inum, scm_adjbig, scm_normbig, +scm_copybig, scm_2ulong2big, scm_dbl2big, scm_big2dbl, SCM_FIXNUM_BIT, +scm_subr_entry, SCM_SUBR_DOC, scm_make_subr_opt, scm_make_subr, +scm_make_subr_with_generic, setjmp_type, setjmp_type, +scm_call_catching_errors, scm_make_smob_type_mfpe, scm_set_smob_mfpe, +scm_strprint_obj, scm_read_0str, scm_eval_0str, SCM_CHARS, SCM_UCHARS, +SCM_SETCHARS, SCM_SLOPPY_SUBSTRP, SCM_SUBSTR_STR, SCM_SUBSTR_OFFSET, +SCM_LENGTH_MAX, SCM_LENGTH, SCM_SETLENGTH, SCM_ROSTRINGP, SCM_ROLENGTH, +SCM_ROCHARS, SCM_ROUCHARS, SCM_SUBSTRP, SCM_COERCE_SUBSTR, scm_strhash, +scm_sym2vcell, scm_sym2ovcell_soft, scm_sym2ovcell, +scm_intern_obarray_soft, scm_intern_obarray, scm_intern, scm_intern0, +scm_sysintern, scm_sysintern0, scm_sysintern0_no_module_lookup, +scm_symbol_value0, scm_string_to_obarray_symbol, scm_intern_symbol, +scm_unintern_symbol, scm_symbol_binding, scm_symbol_interned_p, +scm_symbol_bound_p, scm_symbol_set_x, scm_gentemp, +scm_init_symbols_deprecated, s_vector_set_length_x, scm_vector_set_length_x, +scm_contregs, scm_debug_info, scm_debug_frame, SCM_DSIDEVAL, SCM_OPDIRP, +scm_fport, scm_option, SCM_CONST_LONG, SCM_VCELL, SCM_GLOBAL_VCELL, +SCM_VCELL_INIT, SCM_GLOBAL_VCELL_INIT, scm_srcprops, scm_srcprops_chunk, +scm_info_frame, scm_stack, scm_array, scm_array_dim, SCM_ARRAY_CONTIGUOUS, +SCM_HUGE_LENGTH, SCM_FUNC_NAME, SCM_WTA, RETURN_SCM_WTA, +SCM_VALIDATE_NUMBER_COPY, SCM_VALIDATE_NUMBER_DEF_COPY, +SCM_VALIDATE_STRINGORSUBSTR, SCM_VALIDATE_ROSTRING, +SCM_VALIDATE_ROSTRING_COPY, SCM_VALIDATE_NULLORROSTRING_COPY, +SCM_VALIDATE_RWSTRING, SCM_VALIDATE_OPDIR, DIGITS, scm_small_istr2int, +scm_istr2int, scm_istr2flo, scm_istring2number, scm_istr2int, +scm_istr2flo, scm_istring2number, scm_vtable_index_vcell, scm_si_vcell, +SCM_ECONSP, SCM_NECONSP, SCM_GLOC_VAR, SCM_GLOC_VAL, SCM_GLOC_SET_VAL, +SCM_GLOC_VAL_LOC, scm_make_gloc, scm_gloc_p, scm_tc16_variable + Changes since Guile 1.4: * Changes to the distribution From 2f13db9a0ca7d3ca3bd6254399d0ec01380c4fd2 Mon Sep 17 00:00:00 2001 From: Thien-Thi Nguyen Date: Mon, 4 Mar 2002 22:37:37 +0000 Subject: [PATCH 035/131] (top_srcdir_absolute): New AC_SUBST var. --- configure.in | 2 ++ 1 file changed, 2 insertions(+) diff --git a/configure.in b/configure.in index 8b42424cd..6c6d44197 100644 --- a/configure.in +++ b/configure.in @@ -686,6 +686,8 @@ AC_SUBST(EXTRA_DOT_X_FILES) dnl See also top_builddir in info node: (libtool)AC_PROG_LIBTOOL top_builddir_absolute=`pwd` AC_SUBST(top_builddir_absolute) +top_srcdir_absolute=`(cd $srcdir ; pwd)` +AC_SUBST(top_srcdir_absolute) AC_CONFIG_FILES([ Makefile From ce8b584c2d92cd2fd15c9727461cf2f7a719db12 Mon Sep 17 00:00:00 2001 From: Thien-Thi Nguyen Date: Mon, 4 Mar 2002 22:39:06 +0000 Subject: [PATCH 036/131] (top_srcdir): Use `top_srcdir_absolute' AC_SUBST var. --- pre-inst-guile.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pre-inst-guile.in b/pre-inst-guile.in index 149fbd338..206eab174 100644 --- a/pre-inst-guile.in +++ b/pre-inst-guile.in @@ -39,7 +39,7 @@ subdirs_with_ltlibs="srfi guile-readline" # maintain me # env (set by configure) -top_srcdir=`(cd "@top_srcdir@" ; pwd)` +top_srcdir="@top_srcdir_absolute@" top_builddir="@top_builddir_absolute@" [ x"$top_srcdir" = x -o ! -d "$top_srcdir" -o \ From 2d78a1c54cd759e855094af4608c78c9fb39d48b Mon Sep 17 00:00:00 2001 From: Thien-Thi Nguyen Date: Mon, 4 Mar 2002 22:40:21 +0000 Subject: [PATCH 037/131] *** empty log message *** --- ChangeLog | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/ChangeLog b/ChangeLog index 1fd8fa689..f574c3cd2 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,10 @@ 2002-03-04 Thien-Thi Nguyen + * configure.in (top_srcdir_absolute): New AC_SUBST var. + + * pre-inst-guile.in (top_srcdir): Use `top_srcdir_absolute' + AC_SUBST var. + * pre-inst-guile.in (top_srcdir): Fix ref bug: Force absolute. 2002-02-27 Thien-Thi Nguyen From 829fdfbc6d3578c7493c968d02e15b91f4c859e7 Mon Sep 17 00:00:00 2001 From: Thien-Thi Nguyen Date: Mon, 4 Mar 2002 22:53:34 +0000 Subject: [PATCH 038/131] (top_srcdir): Use `top_srcdir_absolute' AC_SUBST var. --- check-guile.in | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/check-guile.in b/check-guile.in index 9142fcff8..f66bf13be 100644 --- a/check-guile.in +++ b/check-guile.in @@ -11,9 +11,8 @@ set -e -# this script runs in the top-level build-dir. top_builddir=@top_builddir_absolute@ -top_srcdir=@top_srcdir@ +top_srcdir=@top_srcdir_absolute@ TEST_SUITE_DIR=${top_srcdir}/test-suite From 7ca15449ed173ed7c9753f4d030aaa035f5a2e74 Mon Sep 17 00:00:00 2001 From: Thien-Thi Nguyen Date: Mon, 4 Mar 2002 22:54:19 +0000 Subject: [PATCH 039/131] *** empty log message *** --- ChangeLog | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index f574c3cd2..03334c934 100644 --- a/ChangeLog +++ b/ChangeLog @@ -2,8 +2,8 @@ * configure.in (top_srcdir_absolute): New AC_SUBST var. - * pre-inst-guile.in (top_srcdir): Use `top_srcdir_absolute' - AC_SUBST var. + * pre-inst-guile.in, check-guile.in (top_srcdir): + Use `top_srcdir_absolute' AC_SUBST var. * pre-inst-guile.in (top_srcdir): Fix ref bug: Force absolute. From 3f04400dd27771811e32669786cdc24746f8f00e Mon Sep 17 00:00:00 2001 From: Dirk Herrmann Date: Tue, 5 Mar 2002 21:10:15 +0000 Subject: [PATCH 040/131] * eval.c (SCM_CEVAL): Cleaned up the handling of 'apply'. Removed side-effecting operations from conditions and macro calls. Replaced SCM_N?IMP by a more explicit predicate in some places. Minimized the scope of some variables. --- libguile/ChangeLog | 7 ++++++ libguile/eval.c | 63 ++++++++++++++++++++++++++-------------------- 2 files changed, 43 insertions(+), 27 deletions(-) diff --git a/libguile/ChangeLog b/libguile/ChangeLog index 06f0bf053..66d68ae0d 100644 --- a/libguile/ChangeLog +++ b/libguile/ChangeLog @@ -1,3 +1,10 @@ +2002-03-02 Dirk Herrmann + + * eval.c (SCM_CEVAL): Cleaned up the handling of 'apply'. Removed + side-effecting operations from conditions and macro calls. + Replaced SCM_N?IMP by a more explicit predicate in some places. + Minimized the scope of some variables. + 2002-03-02 Stefan Jahn * convert.i.c: Fixed int <-> long conversions which would have diff --git a/libguile/eval.c b/libguile/eval.c index f2c8b07e8..6167b5b23 100644 --- a/libguile/eval.c +++ b/libguile/eval.c @@ -2348,18 +2348,19 @@ dispatch: /* new syntactic forms go here. */ - case SCM_BIT8(SCM_MAKISYM (0)): + case SCM_BIT8 (SCM_MAKISYM (0)): proc = SCM_CAR (x); SCM_ASRTGO (SCM_ISYMP (proc), badfun); switch (SCM_ISYMNUM (proc)) { + + case (SCM_ISYMNUM (SCM_IM_APPLY)): proc = SCM_CDR (x); proc = EVALCAR (proc, env); - SCM_ASRTGO (SCM_NIMP (proc), badfun); + SCM_ASRTGO (!SCM_IMP (proc), badfun); if (SCM_CLOSUREP (proc)) { - SCM argl, tl; PREP_APPLY (proc, SCM_EOL); t.arg1 = SCM_CDDR (x); t.arg1 = EVALCAR (t.arg1, env); @@ -2367,36 +2368,44 @@ dispatch: /* Go here to tail-call a closure. PROC is the closure and T.ARG1 is the list of arguments. Do not forget to call PREP_APPLY. */ + { + SCM formals = SCM_CLOSURE_FORMALS (proc); #ifdef DEVAL - debug.info->a.args = t.arg1; + debug.info->a.args = t.arg1; #endif #ifndef SCM_RECKLESS - if (scm_badargsp (SCM_CLOSURE_FORMALS (proc), t.arg1)) - goto wrongnumargs; + if (scm_badargsp (formals, t.arg1)) + goto wrongnumargs; #endif - ENTER_APPLY; - /* Copy argument list */ - if (SCM_IMP (t.arg1)) - argl = t.arg1; - else - { - argl = tl = scm_cons (SCM_CAR (t.arg1), SCM_UNSPECIFIED); - while (SCM_NIMP (t.arg1 = SCM_CDR (t.arg1)) - && SCM_CONSP (t.arg1)) - { - SCM_SETCDR (tl, scm_cons (SCM_CAR (t.arg1), - SCM_UNSPECIFIED)); - tl = SCM_CDR (tl); - } - SCM_SETCDR (tl, t.arg1); - } + ENTER_APPLY; + /* Copy argument list */ + if (SCM_NULL_OR_NIL_P (t.arg1)) + env = EXTEND_ENV (formals, SCM_EOL, SCM_ENV (proc)); + else + { + SCM args = scm_list_1 (SCM_CAR (t.arg1)); + SCM tail = args; + t.arg1 = SCM_CDR (t.arg1); + while (!SCM_NULL_OR_NIL_P (t.arg1)) + { + SCM new_tail = scm_list_1 (SCM_CAR (t.arg1)); + SCM_SETCDR (tail, new_tail); + tail = new_tail; + t.arg1 = SCM_CDR (t.arg1); + } + env = EXTEND_ENV (formals, args, SCM_ENV (proc)); + } - env = EXTEND_ENV (SCM_CLOSURE_FORMALS (proc), argl, SCM_ENV (proc)); - x = SCM_CLOSURE_BODY (proc); - goto nontoplevel_begin; + x = SCM_CLOSURE_BODY (proc); + goto nontoplevel_begin; + } } - proc = scm_f_apply; - goto evapply; + else + { + proc = scm_f_apply; + goto evapply; + } + case (SCM_ISYMNUM (SCM_IM_CONT)): { From df6251728851efe2a62e5a887249423b01694c7b Mon Sep 17 00:00:00 2001 From: Thien-Thi Nguyen Date: Wed, 6 Mar 2002 02:43:56 +0000 Subject: [PATCH 041/131] Initial revision --- ice-9/ftw.scm | 384 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 384 insertions(+) create mode 100644 ice-9/ftw.scm diff --git a/ice-9/ftw.scm b/ice-9/ftw.scm new file mode 100644 index 000000000..1d2ec5e93 --- /dev/null +++ b/ice-9/ftw.scm @@ -0,0 +1,384 @@ +;;;; ftw.scm --- filesystem tree walk + +;;;; Copyright (C) 2002 Free Software Foundation, Inc. +;;;; +;;;; 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 +;;;; the Free Software Foundation, Inc., 59 Temple Place, Suite 330, +;;;; Boston, MA 02111-1307 USA +;;;; +;;;; 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. +;;;; If you do not wish that, delete this exception notice. + +;;; Author: Thien-Thi Nguyen + +;;; Commentary: + +;; Two procedures are provided: `ftw' and `nftw'. + +;; NOTE: The following description was adapted from the GNU libc info page, w/ +;; significant modifications for a more "Schemey" interface. Most noticible +;; are the inlining of `struct FTW *' parameters `base' and `level' and the +;; omission of `descriptors' parameters. + +;; * Types +;; +;; The X/Open specification defines two procedures to process whole +;; hierarchies of directories and the contained files. Both procedures +;; of this `ftw' family take as one of the arguments a callback procedure +;; which must be of these types. +;; +;; - Data Type: __ftw_proc_t +;; (lambda (filename statinfo flag) ...) => status +;; +;; Type for callback procedures given to the `ftw' procedure. The +;; first parameter is a filename, the second parameter is the +;; vector value as returned by calling `stat' on FILENAME. +;; +;; The last parameter is a symbol giving more information about +;; FILENAM. It can have one of the following values: +;; +;; `regular' +;; The current item is a normal file or files which do not fit +;; into one of the following categories. This means +;; especially special files, sockets etc. +;; +;; `directory' +;; The current item is a directory. +;; +;; `invalid-stat' +;; The `stat' call to fill the object pointed to by the second +;; parameter failed and so the information is invalid. +;; +;; `directory-not-readable' +;; The item is a directory which cannot be read. +;; +;; `symlink' +;; The item is a symbolic link. Since symbolic links are +;; normally followed seeing this value in a `ftw' callback +;; procedure means the referenced file does not exist. The +;; situation for `nftw' is different. +;; +;; - Data Type: __nftw_proc_t +;; (lambda (filename statinfo flag base level) ...) => status +;; +;; The first three arguments have the same as for the +;; `__ftw_proc_t' type. A difference is that for the third +;; argument some additional values are defined to allow finer +;; differentiation: +;; +;; `directory-processed' +;; The current item is a directory and all subdirectories have +;; already been visited and reported. This flag is returned +;; instead of `directory' if the `depth' flag is given to +;; `nftw' (see below). +;; +;; `stale-symlink' +;; The current item is a stale symbolic link. The file it +;; points to does not exist. +;; +;; The last two parameters are described below. They contain +;; information to help interpret FILENAME and give some information +;; about current state of the traversal of the directory hierarchy. +;; +;; `base' +;; The value specifies which part of the filename argument +;; given in the first parameter to the callback procedure is +;; the name of the file. The rest of the string is the path +;; to locate the file. This information is especially +;; important if the `chdir' flag for `nftw' was set since then +;; the current directory is the one the current item is found +;; in. +;; +;; `level' +;; While processing the directory the procedures tracks how +;; many directories have been examined to find the current +;; item. This nesting level is 0 for the item given starting +;; item (file or directory) and is incremented by one for each +;; entered directory. +;; +;; * Procedure: (ftw filename proc . options) +;; Do a filesystem tree walk starting at FILENAME using PROC. +;; +;; The `ftw' procedure calls the callback procedure given in the +;; parameter PROC for every item which is found in the directory +;; specified by FILENAME and all directories below. The procedure +;; follows symbolic links if necessary but does not process an item +;; twice. If FILENAME names no directory this item is the only +;; object reported by calling the callback procedure. +;; +;; The filename given to the callback procedure is constructed by +;; taking the FILENAME parameter and appending the names of all +;; passed directories and then the local file name. So the +;; callback procedure can use this parameter to access the file. +;; Before the callback procedure is called `ftw' calls `stat' for +;; this file and passes the information up to the callback +;; procedure. If this `stat' call was not successful the failure is +;; indicated by setting the flag argument of the callback procedure +;; to `invalid-stat'. Otherwise the flag is set according to the +;; description given in the description of `__ftw_proc_t' above. +;; +;; The callback procedure is expected to return non-#f to indicate +;; that no error occurred and the processing should be continued. +;; If an error occurred in the callback procedure or the call to +;; `ftw' shall return immediately the callback procedure can return +;; #f. This is the only correct way to stop the procedure. The +;; program must not use `throw' or similar techniques to continue +;; the program in another place. [Can we relax this? --ttn] +;; +;; The return value of the `ftw' procedure is #t if all callback +;; procedure calls returned #t and all actions performed by the +;; `ftw' succeeded. If some procedure call failed (other than +;; calling `stat' on an item) the procedure returns #f. If a +;; callback procedure returns a value other than #t this value is +;; returned as the return value of `ftw'. +;; +;; * Procedure: (nftw filename proc . control-flags) +;; Do a new-style filesystem tree walk starting at FILENAME using PROC. +;; Various optional CONTROL-FLAGS alter the default behavior. +;; +;; The `nftw' procedures works like the `ftw' procedures. It calls +;; the callback procedure PROC for all items it finds in the +;; directory FILENAME and below. +;; +;; The differences are that for one the callback procedure is of a +;; different type. It takes also `base' and `level' parameters as +;; described above. +;; +;; The second difference is that `nftw' takes additional optional +;; arguments which are zero or more of the following symbols: +;; +;; physical' +;; While traversing the directory symbolic links are not +;; followed. I.e., if this flag is given symbolic links are +;; reported using the `symlink' value for the type parameter +;; to the callback procedure. Please note that if this flag is +;; used the appearance of `symlink' in a callback procedure +;; does not mean the referenced file does not exist. To +;; indicate this the extra value `stale-symlink' exists. +;; +;; mount' +;; The callback procedure is only called for items which are on +;; the same mounted filesystem as the directory given as the +;; FILENAME parameter to `nftw'. +;; +;; chdir' +;; If this flag is given the current working directory is +;; changed to the directory containing the reported object +;; before the callback procedure is called. +;; +;; depth' +;; If this option is given the procedure visits first all files +;; and subdirectories before the callback procedure is called +;; for the directory itself (depth-first processing). This +;; also means the type flag given to the callback procedure is +;; `directory-processed' and not `directory'. +;; +;; The return value is computed in the same way as for `ftw'. +;; `nftw' returns #t if no failure occurred in `nftw' and all +;; callback procedure call return values are also #t. For internal +;; errors such as memory problems the error `ftw-error' is thrown. +;; If the return value of a callback invocation is not #t this +;; very same value is returned. + +;;; Code: + +(define-module (ice-9 ftw) + :export (ftw nftw)) + +(define (directory-files dir) + (let ((dir-stream (opendir dir))) + (let loop ((new (readdir dir-stream)) + (acc '())) + (if (eof-object? new) + acc + (loop (readdir dir-stream) + (if (or (string=? "." new) ;;; ignore + (string=? ".." new)) ;;; ignore + acc + (cons new acc))))))) + +(define (pathify . nodes) + (let loop ((nodes nodes) + (result "")) + (if (null? nodes) + (or (and (string=? "" result) "") + (substring result 1 (string-length result))) + (loop (cdr nodes) (string-append result "/" (car nodes)))))) + +(define (abs? filename) + (char=? #\/ (string-ref filename 0))) + +(define (visited?-proc size) + (let ((visited (make-hash-table size))) + (lambda (s) + (and s (let ((ino (stat:ino s))) + (or (hash-ref visited ino) + (begin + (hash-set! visited ino #t) + #f))))))) + +(define (stat-dir-readable?-proc uid gid) + (let ((uid (getuid)) + (gid (getgid))) + (lambda (s) + (let* ((perms (stat:perms s)) + (perms-bit-set? (lambda (mask) + (not (= 0 (logand mask perms)))))) + (or (and (= uid (stat:uid s)) + (perms-bit-set? #o400)) + (and (= gid (stat:gid s)) + (perms-bit-set? #o040)) + (perms-bit-set? #o004)))))) + +(define (stat&flag-proc dir-readable? . control-flags) + (let* ((directory-flag (if (memq 'depth control-flags) + 'directory-processed + 'directory)) + (stale-symlink-flag (if (memq 'nftw-style control-flags) + 'stale-symlink + 'symlink)) + (physical? (memq 'physical control-flags)) + (easy-flag (lambda (s) + (let ((type (stat:type s))) + (if (eq? 'directory type) + (if (dir-readable? s) + directory-flag + 'directory-not-readable) + 'regular))))) + (lambda (name) + (let ((s (false-if-exception (lstat name)))) + (cond ((not s) + (values s 'invalid-stat)) + ((eq? 'symlink (stat:type s)) + (let ((s-follow (false-if-exception (stat name)))) + (cond ((not s-follow) + (values s stale-symlink-flag)) + ((and s-follow physical?) + (values s 'symlink)) + ((and s-follow (not physical?)) + (values s-follow (easy-flag s-follow)))))) + (else (values s (easy-flag s)))))))) + +(define (clean name) + (let ((last-char-index (1- (string-length name)))) + (if (char=? #\/ (string-ref name last-char-index)) + (substring name 0 last-char-index) + name))) + +(define (ftw filename proc . options) + (let* ((visited? (visited?-proc (cond ((memq 'hash-size options) => cadr) + (else 211)))) + (stat&flag (stat&flag-proc + (stat-dir-readable?-proc (getuid) (getgid))))) + (letrec ((go (lambda (fullname) + (call-with-values (lambda () (stat&flag fullname)) + (lambda (s flag) + (or (visited? s) + (let ((ret (proc fullname s flag))) ; callback + (or (eq? #t ret) + (throw 'ftw-early-exit ret)) + (and (eq? 'directory flag) + (for-each + (lambda (child) + (go (pathify fullname child))) + (directory-files fullname))) + #t))))))) + (catch 'ftw-early-exit + (lambda () (go (clean filename))) + (lambda (key val) val))))) + +(define (nftw filename proc . control-flags) + (let* ((od (getcwd)) ; orig dir + (odev (let ((s (false-if-exception (lstat filename)))) + (if s (stat:dev s) -1))) + (same-dev? (if (memq 'mount control-flags) + (lambda (s) (= (stat:dev s) odev)) + (lambda (s) #t))) + (base-sub (lambda (name base) (substring name 0 base))) + (maybe-cd (if (memq 'chdir control-flags) + (if (abs? filename) + (lambda (fullname base) + (or (= 0 base) + (chdir (base-sub fullname base)))) + (lambda (fullname base) + (chdir + (pathify od (base-sub fullname base))))) + (lambda (fullname base) #t))) + (maybe-cd-back (if (memq 'chdir control-flags) + (lambda () (chdir od)) + (lambda () #t))) + (depth-first? (memq 'depth control-flags)) + (visited? (visited?-proc + (cond ((memq 'hash-size control-flags) => cadr) + (else 211)))) + (has-kids? (if depth-first? + (lambda (flag) (eq? flag 'directory-processed)) + (lambda (flag) (eq? flag 'directory)))) + (stat&flag (apply stat&flag-proc + (stat-dir-readable?-proc (getuid) (getgid)) + (cons 'nftw-style control-flags)))) + (letrec ((go (lambda (fullname base level) + (call-with-values (lambda () (stat&flag fullname)) + (lambda (s flag) + (letrec ((self (lambda () + (maybe-cd fullname base) + ;; the callback + (let ((ret (proc fullname s flag + base level))) + (maybe-cd-back) + (or (eq? #t ret) + (throw 'nftw-early-exit ret))))) + (kids (lambda () + (and (has-kids? flag) + (for-each + (lambda (child) + (go (pathify fullname child) + (1+ (string-length + fullname)) + (1+ level))) + (directory-files fullname)))))) + (or (visited? s) + (not (same-dev? s)) + (if depth-first? + (begin (kids) (self)) + (begin (self) (kids))))))) + #t))) + (let ((ret (catch 'nftw-early-exit + (lambda () (go (clean filename) 0 0)) + (lambda (key val) val)))) + (chdir od) + ret)))) + +;;; ftw.scm ends here From a3c51cc8299da7c69f8a4c2a6f2d65608be63c67 Mon Sep 17 00:00:00 2001 From: Thien-Thi Nguyen Date: Wed, 6 Mar 2002 02:45:26 +0000 Subject: [PATCH 042/131] (ice9_sources): Add ftw.scm. --- ice-9/Makefile.am | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ice-9/Makefile.am b/ice-9/Makefile.am index 721d08200..236ca62c6 100644 --- a/ice-9/Makefile.am +++ b/ice-9/Makefile.am @@ -32,7 +32,7 @@ ice9_sources = \ safe-r5rs.scm safe.scm session.scm slib.scm stack-catch.scm \ streams.scm string-fun.scm syncase.scm threads.scm \ buffered-input.scm time.scm history.scm channel.scm \ - pretty-print.scm + pretty-print.scm ftw.scm subpkgdatadir = $(pkgdatadir)/$(VERSION)/ice-9 subpkgdata_DATA = $(ice9_sources) From 6c5b8521d00b84c3347af5c4662a0c319e34d850 Mon Sep 17 00:00:00 2001 From: Thien-Thi Nguyen Date: Wed, 6 Mar 2002 02:46:28 +0000 Subject: [PATCH 043/131] *** empty log message *** --- ice-9/ChangeLog | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/ice-9/ChangeLog b/ice-9/ChangeLog index ce38693c6..4aea4cab3 100644 --- a/ice-9/ChangeLog +++ b/ice-9/ChangeLog @@ -1,3 +1,9 @@ +2002-03-05 Thien-Thi Nguyen + + * ftw.scm: New file. + + * Makefile.am (ice9_sources): Add ftw.scm. + 2002-02-26 Thien-Thi Nguyen * Makefile.am: Update path to pre-inst-guile automake frag. From d902b02a5dcec410b30cce259b023c6b28a1ed82 Mon Sep 17 00:00:00 2001 From: Thien-Thi Nguyen Date: Wed, 6 Mar 2002 20:46:41 +0000 Subject: [PATCH 044/131] Handle "--source" option. --- guile-tools.in | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/guile-tools.in b/guile-tools.in index aaa5309cc..8b32ba648 100644 --- a/guile-tools.in +++ b/guile-tools.in @@ -36,6 +36,7 @@ If PROGRAM is "list" or omitted, display contents of scripts dir, otherwise PROGRAM is run w/ ARGS. Options (only one of which may be used at a time): --scriptsdir DIR -- Look in DIR for scripts --guileversion VERS -- Look in $pkgdatadir/VERS/scripts for scripts + --source -- Display PROGRAM source (ignore ARGS) to stdout Default scripts dir: $default_scriptsdir EOF @@ -89,6 +90,17 @@ if [ x"$1" = x -o x"$1" = xlist ] ; then exit 0 fi +if [ x"$1" = x--source ] ; then + if [ x"$2" = x ] ; then echo $0: need to specify program ; exit 1 ; fi + if [ -x $scriptsdir/$2 ] ; then + cat $scriptsdir/$2 + exit 0 + else + echo $0: no such program: $2 + exit 1 + fi +fi + program=$scriptsdir/$1 shift From 9b398b673091473b08a76a665b86a934eafee246 Mon Sep 17 00:00:00 2001 From: Thien-Thi Nguyen Date: Wed, 6 Mar 2002 20:47:26 +0000 Subject: [PATCH 045/131] *** empty log message *** --- ChangeLog | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/ChangeLog b/ChangeLog index 03334c934..b68846df5 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2002-03-06 Thien-Thi Nguyen + + * guile-tools.in: Handle "--source" option. + 2002-03-04 Thien-Thi Nguyen * configure.in (top_srcdir_absolute): New AC_SUBST var. From abae30146f66bfb822b43cfdb96603ea0b40375a Mon Sep 17 00:00:00 2001 From: Thien-Thi Nguyen Date: Wed, 6 Mar 2002 20:54:27 +0000 Subject: [PATCH 046/131] Initial revision --- doc/ref/tools.texi | 97 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 97 insertions(+) create mode 100644 doc/ref/tools.texi diff --git a/doc/ref/tools.texi b/doc/ref/tools.texi new file mode 100644 index 000000000..3629b93b1 --- /dev/null +++ b/doc/ref/tools.texi @@ -0,0 +1,97 @@ +@page +@node Executable Modules +@chapter Executable Modules +@cindex guile-tools +@cindex modules, executable +@cindex executable modules +@cindex scripts + +When Guile is installed, in addition to the @code{(ice-9 FOO)} modules, +a set of @dfn{executable modules} @code{(scripts BAR)} is also installed. +Each is a regular Scheme module that has some additional packaging so +that it can be called as a program in its own right, from the shell. For this +reason, we sometimes use the term @dfn{script} in this context to mean the +same thing. + +As a convenience, the @code{guile-tools} wrapper program is installed along w/ +@code{guile}; it knows where a particular module is installed and calls it +passing its args to the program. The result is that you need not augment your +PATH. Usage is straightforward: + +@example +guile-tools --help +guile-tools --version +guile-tools [OPTION] PROGRAM [ARGS ...] + +If PROGRAM is "list" or omitted, display contents of scripts dir, otherwise +PROGRAM is run w/ ARGS. Options (only one of which may be used at a time): + --scriptsdir DIR -- Look in DIR for scripts + --guileversion VERS -- Look in $pkgdatadir/VERS/scripts for scripts + --source -- Display PROGRAM source (ignore ARGS) to stdout +@end example + +The modules are self-documenting. For example, to see the documentation for +@code{lint}, use one (or both) of the shell commands: + +@example +guile-tools display-commentary '(scripts lint)' +guile-tools --source lint +@end example + +The rest of this chapter describes the packaging that goes into creating an +executable module. Feel free to skip to the next chapter. + +@section Writing Executable Modules + +@c adapted from scripts/README + +See template file @code{PROGRAM} for a quick start. + +Programs must follow the @dfn{executable module} convention, documented here: + +@itemize + +@item +The file name must not end in ".scm". + +@item +The file must be executable (chmod +x). + +@item +The module name must be "(scripts PROGRAM)". A procedure named PROGRAM w/ +signature "(PROGRAM . args)" must be exported. Basically, use some variant +of the form: + +@example + (define-module (scripts PROGRAM) + :export (PROGRAM)) +@end example + +Feel free to export other definitions useful in the module context. + +@item +There must be the alias: + +@example + (define main PROGRAM) +@end example + +However, `main' must NOT be exported. + +@item +The beginning of the file must use the following invocation sequence: + +@example + #!/bin/sh + main='(module-ref (resolve-module '\''(scripts PROGRAM)) '\'main')' + exec ${GUILE-guile} -l $0 -c "(apply $main (cdr (command-line)))" "$@" + !# +@end example + +@end itemize + +Following these conventions allows the program file to be used as module +@code{(scripts PROGRAM)} in addition to as a standalone executable. Please +also include a helpful Commentary section w/ some usage info. + +@c tools.texi ends here From 54737001bbecb54d1184500973e7b1c057107358 Mon Sep 17 00:00:00 2001 From: Marius Vollmer Date: Wed, 6 Mar 2002 21:12:43 +0000 Subject: [PATCH 047/131] Removed maintainer section. --- THANKS | 4 ---- 1 file changed, 4 deletions(-) diff --git a/THANKS b/THANKS index 508aa098a..2a43632eb 100644 --- a/THANKS +++ b/THANKS @@ -1,7 +1,3 @@ -The Guile maintainer committee consists of - - Marius Vollmer - Contributors since the last release: Rob Browning From 020c890ccc305a9be7a6d2fc7f12328dfe7adfb1 Mon Sep 17 00:00:00 2001 From: Neil Jerram Date: Fri, 8 Mar 2002 13:07:50 +0000 Subject: [PATCH 048/131] * Fix bug caused by frame size overflowing its field. --- libguile/ChangeLog | 9 +++++++++ libguile/debug.h | 2 +- libguile/eval.c | 2 +- 3 files changed, 11 insertions(+), 2 deletions(-) diff --git a/libguile/ChangeLog b/libguile/ChangeLog index 66d68ae0d..8bda007cf 100644 --- a/libguile/ChangeLog +++ b/libguile/ChangeLog @@ -1,3 +1,12 @@ +2002-03-08 Neil Jerram + + * debug.h (SCM_MAX_FRAME_SIZE): Remove incorrect comment about use + of SCM_MAX_FRAME_SIZE as a bit mask; it isn't used like this. + + * eval.c (SCM_CEVAL): Don't store scm_debug_eframe_size in + debug.status. It isn't needed, and it can overflow the bits + reserved for it (which may lead to a segv or a GC abort). + 2002-03-02 Dirk Herrmann * eval.c (SCM_CEVAL): Cleaned up the handling of 'apply'. Removed diff --git a/libguile/debug.h b/libguile/debug.h index f7059266f..da7cad68f 100644 --- a/libguile/debug.h +++ b/libguile/debug.h @@ -141,7 +141,7 @@ SCM_API scm_t_debug_frame *scm_last_debug_frame; #define SCM_TRACED_FRAME (1L << 8) #define SCM_ARGS_READY (1L << 7) #define SCM_DOVERFLOW (1L << 6) -#define SCM_MAX_FRAME_SIZE 63 /* also used as a mask for the size field */ +#define SCM_MAX_FRAME_SIZE 63 #define SCM_FRAMETYPE (3L << 11) diff --git a/libguile/eval.c b/libguile/eval.c index 6167b5b23..c4dc8e6e8 100644 --- a/libguile/eval.c +++ b/libguile/eval.c @@ -1899,7 +1899,7 @@ SCM_CEVAL (SCM x, SCM env) scm_t_debug_frame debug; scm_t_debug_info *debug_info_end; debug.prev = scm_last_debug_frame; - debug.status = scm_debug_eframe_size; + debug.status = 0; /* * The debug.vect contains twice as much scm_t_debug_info frames as the * user has specified with (debug-set! frames ). From 58d233cca9756e8e4c11ba2122159ade7c933fa3 Mon Sep 17 00:00:00 2001 From: Neil Jerram Date: Fri, 8 Mar 2002 13:11:34 +0000 Subject: [PATCH 049/131] * srcprop.c (scm_set_source_property_x): If SRCPROPS obj already exists when adding a source property other than those that are handled explicitly, add the new property to the SRCPROPS obj's plist. --- libguile/ChangeLog | 5 +++++ libguile/srcprop.c | 7 ++++++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/libguile/ChangeLog b/libguile/ChangeLog index 8bda007cf..3d491d288 100644 --- a/libguile/ChangeLog +++ b/libguile/ChangeLog @@ -1,5 +1,10 @@ 2002-03-08 Neil Jerram + * srcprop.c (scm_set_source_property_x): If SRCPROPS obj already + exists when adding a source property other than those that are + handled explicitly, add the new property to the SRCPROPS obj's + plist. + * debug.h (SCM_MAX_FRAME_SIZE): Remove incorrect comment about use of SCM_MAX_FRAME_SIZE as a bit mask; it isn't used like this. diff --git a/libguile/srcprop.c b/libguile/srcprop.c index f00828b79..e909991a5 100644 --- a/libguile/srcprop.c +++ b/libguile/srcprop.c @@ -317,7 +317,12 @@ SCM_DEFINE (scm_set_source_property_x, "set-source-property!", 3, 0, 0, SCM_WHASHSET (scm_source_whash, h, scm_make_srcprops (0, 0, SCM_UNDEFINED, datum, p)); } else - SCM_WHASHSET (scm_source_whash, h, scm_acons (key, datum, p)); + { + if (SRCPROPSP (p)) + SRCPROPPLIST (p) = scm_acons (key, datum, SRCPROPPLIST (p)); + else + SCM_WHASHSET (scm_source_whash, h, scm_acons (key, datum, p)); + } return SCM_UNSPECIFIED; } #undef FUNC_NAME From ecfeac8c95c4335f942e4e0028d7b593be59664b Mon Sep 17 00:00:00 2001 From: Neil Jerram Date: Fri, 8 Mar 2002 13:13:36 +0000 Subject: [PATCH 050/131] * docstring.el (docstring-libguile-directory, docstring-display-location, docstring-show-source): New. --- doc/maint/ChangeLog | 5 ++++ doc/maint/docstring.el | 58 ++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 63 insertions(+) diff --git a/doc/maint/ChangeLog b/doc/maint/ChangeLog index 37e19e73d..3508a73be 100644 --- a/doc/maint/ChangeLog +++ b/doc/maint/ChangeLog @@ -1,3 +1,8 @@ +2002-03-08 Neil Jerram + + * docstring.el (docstring-libguile-directory, + docstring-display-location, docstring-show-source): New. + 2001-11-16 Neil Jerram * guile.texi: Replaced by regenerated libguile version. diff --git a/doc/maint/docstring.el b/doc/maint/docstring.el index 58d07eaa3..9177d33c5 100644 --- a/doc/maint/docstring.el +++ b/doc/maint/docstring.el @@ -539,6 +539,64 @@ new snarfed docstring file.\n\n") ;(find-tracking-docstring '(guile) "primitive sloppy-assq") ;(find-snarfed-docstring '(guile) "primitive sloppy-assq") +(defvar docstring-libguile-directory (expand-file-name "libguile" + guile-core-dir) + "*The directory containing the C source for libguile.") + +(defun docstring-display-location (file line) + (let ((buffer (find-file-noselect + (expand-file-name file docstring-libguile-directory)))) + (if buffer + (let* ((window (or (get-buffer-window buffer) + (display-buffer buffer))) + (pos (save-excursion + (set-buffer buffer) + (goto-line line) + (point)))) + (set-window-point window pos))))) + +(defun docstring-show-source () + "Given that point is sitting in a docstring in one of the Texinfo +source files for the Guile manual, and that that docstring may be +snarfed automatically from a libguile C file, determine whether the +docstring is from libguile and, if it is, display the relevant C file +at the line from which the docstring was snarfed. + +Why? When updating snarfed docstrings, you should usually edit the C +source rather than the Texinfo source, so that your updates benefit +Guile's online help as well. This function locates the C source for a +docstring so that it is easy for you to do this." + (interactive) + (let* ((deffn-line + (save-excursion + (end-of-line) + (or (re-search-backward "^@deffn " nil t) + (error "No docstring here!")) + (buffer-substring (point) + (progn + (end-of-line) + (point))))) + (guile-texi-file + (expand-file-name "guile.texi" docstring-libguile-directory)) + (source-location + (save-excursion + (set-buffer (find-file-noselect guile-texi-file)) + (save-excursion + (goto-char (point-min)) + (or (re-search-forward (concat "^" + (regexp-quote deffn-line) + "$") + nil t) + (error "Docstring not from libguile")) + (forward-line -1) + (if (looking-at "^@c snarfed from \\([^:]+\\):\\([0-9]+\\)$") + (cons (match-string 1) + (string-to-int (match-string 2))) + (error "Corrupt docstring entry in guile.texi")))))) + (docstring-display-location (car source-location) + (cdr source-location)))) + + (provide 'docstring) ;;; docstring.el ends here From a3f0622d5d1b9ea1e6c38b966412d4aa446e83b8 Mon Sep 17 00:00:00 2001 From: Neil Jerram Date: Fri, 8 Mar 2002 13:18:00 +0000 Subject: [PATCH 051/131] * Insert missing `of' in autoconf.texi. --- doc/ref/ChangeLog | 4 ++++ doc/ref/autoconf.texi | 7 ++++--- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/doc/ref/ChangeLog b/doc/ref/ChangeLog index aa7ea31fe..52d9fa840 100644 --- a/doc/ref/ChangeLog +++ b/doc/ref/ChangeLog @@ -1,3 +1,7 @@ +2002-03-03 Neil Jerram + + * autoconf.texi (Autoconf Background): Insert missing `of'. + 2002-03-01 Dirk Herrmann * api.txt, data-rep.texi: Renamed the struct scm_cell to diff --git a/doc/ref/autoconf.texi b/doc/ref/autoconf.texi index 301dc440f..8d05b2ecc 100644 --- a/doc/ref/autoconf.texi +++ b/doc/ref/autoconf.texi @@ -30,9 +30,10 @@ by the @file{configure} script, typically by adding the tests to Users of your package then run @file{configure} in the normal way. Macros are a way to make common feature tests easy to express. Autoconf -provides a wide range macros (@pxref{Existing Tests,,,autoconf}), and Guile -installation provides Guile-specific tests in the areas of: program detection, -compilation flags reporting, and Scheme module checks. +provides a wide range of macros (@pxref{Existing Tests,,,autoconf}), and +Guile installation provides Guile-specific tests in the areas of: +program detection, compilation flags reporting, and Scheme module +checks. @node Autoconf Macros From e12ed7aa92fa3c98e00f674e76cf1c0ee436c92f Mon Sep 17 00:00:00 2001 From: Neil Jerram Date: Fri, 8 Mar 2002 13:18:59 +0000 Subject: [PATCH 052/131] * Grammatical correction: change `are' to `is' in guile.m4 docstring. --- guile-config/ChangeLog | 4 ++++ guile-config/guile.m4 | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/guile-config/ChangeLog b/guile-config/ChangeLog index 0fce8d321..607d01322 100644 --- a/guile-config/ChangeLog +++ b/guile-config/ChangeLog @@ -1,3 +1,7 @@ +2002-03-03 Neil Jerram + + * guile.m4 (GUILE_PROGS): In docstring, change `are' to `is'. + 2002-01-02 Thien-Thi Nguyen * guile.m4: Rewrite comments in texi. diff --git a/guile-config/guile.m4 b/guile-config/guile.m4 index fa098eecf..020de5a05 100644 --- a/guile-config/guile.m4 +++ b/guile-config/guile.m4 @@ -67,7 +67,7 @@ # This macro looks for programs @code{guile}, @code{guile-config} and # @code{guile-tools}, and sets variables @var{GUILE}, @var{GUILE_CONFIG} and # @var{GUILE_TOOLS}, to their paths, respectively. If either of the first two -# are not found, signal error. +# is not found, signal error. # # The variables are marked for substitution, as by @code{AC_SUBST}. # From 27c54e0b59511f264354d2432e1d60cf09dc715c Mon Sep 17 00:00:00 2001 From: Neil Jerram Date: Fri, 8 Mar 2002 13:19:42 +0000 Subject: [PATCH 053/131] * snarf-guile-m4-docs (display-texi): Strip off `# ' from start of docstring lines if possible, rather than just `#'. --- scripts/ChangeLog | 5 +++++ scripts/snarf-guile-m4-docs | 9 ++++++--- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/scripts/ChangeLog b/scripts/ChangeLog index 912000ea8..7d619d2b0 100644 --- a/scripts/ChangeLog +++ b/scripts/ChangeLog @@ -1,3 +1,8 @@ +2002-03-03 Neil Jerram + + * snarf-guile-m4-docs (display-texi): Strip off `# ' from start of + docstring lines if possible, rather than just `#'. + 2002-02-26 Thien-Thi Nguyen * Makefile.am: Update path to pre-inst-guile automake frag. diff --git a/scripts/snarf-guile-m4-docs b/scripts/snarf-guile-m4-docs index 8a724ca67..45d258c61 100755 --- a/scripts/snarf-guile-m4-docs +++ b/scripts/snarf-guile-m4-docs @@ -43,9 +43,12 @@ exec ${GUILE-guile} -l $0 -c "(apply $main (cdr (command-line)))" "$@" (define (display-texi lines) (display "@deffn {Autoconf Macro}") (for-each (lambda (line) - (display (if (string=? "#" (substring line 0 1)) - (substring line 1) - line)) + (display (cond ((and (>= (string-length line) 2) + (string=? "# " (substring line 0 2))) + (substring line 2)) + ((string=? "#" (substring line 0 1)) + (substring line 1)) + (else line))) (newline)) lines) (display "@end deffn") From e07983b4b410ea5fe157a039444a709b0616a433 Mon Sep 17 00:00:00 2001 From: Neil Jerram Date: Fri, 8 Mar 2002 18:04:57 +0000 Subject: [PATCH 054/131] A couple of bug status updates. --- BUGS | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/BUGS b/BUGS index 37016476c..230e0ad6b 100644 --- a/BUGS +++ b/BUGS @@ -27,7 +27,7 @@ bugs are good. bug 1 -- (debug-disable 'debug) has no effect if first form in ~/.guile reported-by: Sven.Hartrumpf@fernuni-hagen.de / 2001-08-31 -fixed: not-yet +fixed: 2001-11-07 (1.7.x) ttn sez: buggy behavior confirmed on both 1.5.x and 1.7.x. @@ -36,6 +36,12 @@ on the other hand, when second or later, the expected effect (disabling use of debugging evaluator) seems to be reflected when viewing the debug options. it could be that the bug is in display and not the actual setting. +NJ 2002-03-08: + +Problem was caused by (top-repl)'s loading of (ice-9 debug), which +ended with unconditional `(debug-enable 'debug)'. Fixed by removing +the offending lines. + bug 2 -- documentation mirroring not complete reported-by: lord@regexps.com / 2001-08 @@ -170,6 +176,14 @@ Keith Wright sez: > I get the impression that it is supposed to build without 'makeinfo', > if this is not so it should be mentioned in the README or INSTALL. +NJ 2002-03-08: + +Addressed partially in Makefile.am, by copying guile-procedures.texi +to guile-procedures.txt if makeinfo is not available. + +However, a better IMO fix would be to include a prebuilt +guile-procedures.txt in the distribution. + bug 9 -- sibling threads not infinite looping reported-by: giraud@tif.inria.fr / 2001-09-24 From fc17ed5b72633016a14be2f3d026992ea0a197cb Mon Sep 17 00:00:00 2001 From: Thien-Thi Nguyen Date: Fri, 8 Mar 2002 21:20:31 +0000 Subject: [PATCH 055/131] (Miscellaneous Tools): New node/chapter. (Snarfing, Init Snarfing with guile-snarf, How guile-snarf works, Macros guile-snarf recognizes, Doc Snarfing): New nodes/(sub)sections. (Executable Modules): Now a section under "Miscellaneous Tools". --- doc/ref/tools.texi | 267 +++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 257 insertions(+), 10 deletions(-) diff --git a/doc/ref/tools.texi b/doc/ref/tools.texi index 3629b93b1..18448bfd8 100644 --- a/doc/ref/tools.texi +++ b/doc/ref/tools.texi @@ -1,6 +1,251 @@ @page +@node Miscellaneous Tools +@chapter Miscellaneous Tools + +Programming is more fun with a good tools. This chapter describes snarfing +tools, and the @code{guile-tools} program which can be used to invoke the rest +of the tools (which are self-documenting). Some of these are used in Guile +development, too. Imagine that! + +@menu +* Snarfing:: Grepping the source in various ways. +* Executable Modules:: Modules callable via guile-tools. +@end menu + +@c --------------------------------------------------------------------------- +@node Snarfing +@section Snarfing +@cindex snarfing + +Because it's easier to maintain documentation, code, and other metainfo in one +source file than in many files, there have evolved many methods for grepping +source to lift and separate these kinds of info, in the process generating +docs or fragments of source or what have you. This is known generally as +@dfn{snarfing}, which comes from the verb ``to snarf'', here meaning ``to +unceremoniously extract information from a somewhat unwilling source.'' + +This section documents the installed program @code{guile-snarf} which does +@dfn{init snarfing}, and also touches upon guile's doc snarfing process which +is not yet finalized (i.e., doc snarfing programs are not installed at this +time). + +@menu +* Init Snarfing with guile-snarf:: Exposing C subrs and friends to Scheme. +* Doc Snarfing:: Generating GDFv2 or texi from source. +@end menu + +@c --------------------------------------------------------------------------- +@node Init Snarfing with guile-snarf +@subsection Init Snarfing with guile-snarf +@c NOTE: This node and two subnodes are adapted from ../sources/snarf.texi. +@cindex snarfing, init +@cindex primitive functions +@cindex subrs, defining + +When writing C code for use with Guile, you typically define a set of C +functions, and then make some of them visible to the Scheme world by +calling the @code{scm_c_define_gsubr} function; a C function published in +this way is called a @dfn{subr}. If you have many subrs to publish, it +can sometimes be annoying to keep the list of calls to +@code{scm_c_define_gsubr} in sync with the list of function definitions. +Frequently, a programmer will define a new subr in C, recompile the +application, and then discover that the Scheme interpreter cannot see +the subr, because of a missed call to @code{scm_c_define_gsubr}. + +Guile provides the @code{guile-snarf} command to manage this problem. +Using this tool, you can keep all the information needed to define the +subr alongside the function definition itself; @code{guile-snarf} will +extract this information from your source code, and automatically +generate a file of calls to @code{scm_c_define_gsubr} which you can +@code{#include} into an initialization function. + +@menu +* How guile-snarf works:: Using @code{guile-snarf}, with example. +* Macros guile-snarf recognizes:: How to mark up code for @code{guile-snarf}. +@end menu + +@c --------------------------------------------------------------------------- +@node How guile-snarf works +@subsubsection How guile-snarf works +@cindex guile-snarf invocation +@cindex guile-snarf example + +Usage: @code{guile-snarf} [CPP-OPTIONS ...] SOURCE.c + +@code{guile-snarf} uses cpp to process SOURCE.c, writing C language +initialization calls to standard output, based on special (some would say +magic) cpp macros found in the input (@pxref{Macros guile-snarf recognizes}). + +For example, here is how you might define a new subr called +@code{clear-image}, implemented by the C function @code{clear_image}: + +@example +@group +#include + +SCM_DEFINE (clear_image, "clear-image", 1, 0, 0, + (SCM image_smob), + "Clear the image.") +#define FUNC_NAME s_clear_image +@{ + /* C code to clear the image... */ +@} +#undef FUNC_NAME + +void +init_image_type () +@{ +#include "image-type.x" +@} +@end group +@end example + +The @code{SCM_DEFINE} declaration says that the C function +@code{clear_image} implements a Scheme subr called @code{clear-image}, +which takes one required argument (type @code{SCM} named +@code{image_smob}), no optional arguments, and no tail argument. +@xref{Doc Snarfing}, for info on the docstring. + +This works in concert with @code{FUNC_NAME} to also define a static +array of characters named @code{s_clear_image}, initialized to the +string "clear-image". The body of @code{clear_image} may use the array +in error messages, instead of writing out the literal string; this may +save string space on some systems. + +Assuming the text above lives in a file named @file{image-type.c}, you will +need to execute the following command to prepare this file for compilation: + +@example +guile-snarf image-type.c > image-type.x +@end example + +This scans @file{image-type.c} for @code{SCM_DEFINE} +declarations, and writes to @file{image-type.x} the output: + +@example +scm_c_define_gsubr (s_clear_image, 1, 0, 0, (SCM (*)() ) clear_image); +@end example + +When compiled normally, @code{SCM_DEFINE} is a macro which expands to a +declaration of the @code{s_clear_image} string. + +Note that the output file name matches the @code{#include} from the +input file. Also, you still need to provide all the same information +you would if you were using @code{scm_c_define_gsubr} yourself, but you +can place the information near the function definition itself, so it is +less likely to become incorrect or out-of-date. + +If you have many files that @code{guile-snarf} must process, you should +consider using a rule like the following in your Makefile: + +@example +.SUFFIXES: .x +.c.x: + guile-snarf $(DEFS) $(INCLUDES) $(CPPFLAGS) $(CFLAGS) $< > $@@ +@end example + +This tells make to run @code{guile-snarf} to produce each needed +@file{.x} file from the corresponding @file{.c} file. + +@code{guile-snarf} passes all its command-line arguments directly to the +C preprocessor, which it uses to extract the information it needs from +the source code. this means you can pass normal compilation flags to +@code{guile-snarf} to define preprocessor symbols, add header file +directories, and so on. + +@c --------------------------------------------------------------------------- +@node Macros guile-snarf recognizes +@subsubsection Macros guile-snarf recognizes +@cindex guile-snarf recognized macros + +Here are the macros you can use in your source code from which +@code{guile-snarf} can construct initialization code: + +@example +/* procedures */ +SCM_DEFINE (FNAME, PRIMNAME, REQ, OPT, VAR, ARGLIST, DOCSTRING) + +SCM_PROC (RANAME, STR, REQ, OPT, VAR, CFN) +SCM_REGISTER_PROC (RANAME, STR, REQ, OPT, VAR, CFN) + +SCM_GPROC (RANAME, STR, REQ, OPT, VAR, CFN, GF) + +/* everything else */ +SCM_SYMBOL (c_name, scheme_name) +SCM_GLOBAL_SYMBOL (c_name, scheme_name) + +SCM_KEYWORD (c_name, scheme_name) +SCM_GLOBAL_KEYWORD (c_name, scheme_name) + +SCM_VARIABLE (c_name, scheme_name) +SCM_GLOBAL_VARIABLE (c_name, scheme_name) + +SCM_VARIABLE_INIT (c_name, scheme_name, init_val) +SCM_GLOBAL_VARIABLE_INIT (c_name, scheme_name, init_val) +@end example + +@c i like things dense, but maybe someone else will reformat this +@c into an easier-to-read list. also, all-upcase to me is a form +@c of quoting, so @var{} is not necessary there. --ttn +REQ and OPT are numbers indicating required and optional argument +counts, respectively; VAR is a number that, if non-zero, means the +function will accept any remaining arguments as a list; DOCSTRING is a +string (use @code{\n\} at eol for multi-line); FNAME is a C-language +identifier, CFN and GF and @var{c_name} likewise; PRIMNAME is a string +denoting the name available to Scheme code, STR and @var{scheme_name} +likewise; RANAME is the name of the static string (must match that +declared by the associated definition of cpp macro @var{FUNC_NAME}); +ARGLIST is an argument list (in parentheses); and lastly, @var{init_val} +is a expression suitable for initializing a new variable. + +For procedures, you can use @code{SCM_DEFINE} for most purposes. Use +@code{SCM_PROC} along with @code{SCM_REGISTER_PROC} when you don't want +to be bothered with docstrings. Use @code{SCM_GPROC} for generic +functions (@pxref{GOOPS,,,goops}). All procedures are declared +@code{static} with return type @code{SCM}. + +For everything else, use the appropriate macro (@code{SCM_SYMBOL} for +symbols, and so on). The "_GLOBAL_" variants omit @code{static} +declaration. + +All these macros should be used at top-level, outside function bodies. +Also, it's a good idea to define @var{FUNC_NAME} immediately after using +@code{SCM_DEFINE} (and similar), and then the function body, and then +@code{#undef FUNC_NAME}. + +@xref{How guile-snarf works}, and also libguile source, for examples. +@xref{Subrs}, for details on argument passing and how to write C +functions. + +@c --------------------------------------------------------------------------- +@node Doc Snarfing +@subsection Doc Snarfing + +In addition to init snarfing (@pxref{Init Snarfing with guile-snarf}), +the libguile sources are also subject to doc snarfing, by programs that +are included in the distribution (but not installed at this time). The +output is the file @file{guile-procedures.txt} which is installed, and +subsequently used by module @code{(ice-9 documentation)}. + +Here is a list of what does what according to @file{libguile/Makefile.am}: + +@itemize +@item guile-snarf-docs runs cpp defining SCM_MAGIC_SNARF_DOCS +@item guile_filter_doc_snarfage parses guile-snarf-docs output to produce .doc +@item ../scripts/snarf-check-and-output-texi makes guile.texi +@item ../scripts/snarf-check-and-output-texi makes guile-procedures.txt +@item guile-func-name-check checks source snarf-syntax integrity (optional?) +@item guile-doc-snarf calls guile-snarf-docs (to make .doc) and guile-snarf +@end itemize + +Note that for guile-1.4, a completely different approach was used! All this +is rather byzantine, so for now @emph{NO} doc snarfing programs are installed. + +[fixme: Document further once doc snarfing is tamed somewhat. --ttn] + +@c --------------------------------------------------------------------------- @node Executable Modules -@chapter Executable Modules +@section Executable Modules @cindex guile-tools @cindex modules, executable @cindex executable modules @@ -13,6 +258,8 @@ that it can be called as a program in its own right, from the shell. For this reason, we sometimes use the term @dfn{script} in this context to mean the same thing. +@c wow look at this hole^! variable-width font users eat your heart out. + As a convenience, the @code{guile-tools} wrapper program is installed along w/ @code{guile}; it knows where a particular module is installed and calls it passing its args to the program. The result is that you need not augment your @@ -38,10 +285,10 @@ guile-tools display-commentary '(scripts lint)' guile-tools --source lint @end example -The rest of this chapter describes the packaging that goes into creating an +The rest of this section describes the packaging that goes into creating an executable module. Feel free to skip to the next chapter. -@section Writing Executable Modules +@subsection Writing Executable Modules @c adapted from scripts/README @@ -63,8 +310,8 @@ signature "(PROGRAM . args)" must be exported. Basically, use some variant of the form: @example - (define-module (scripts PROGRAM) - :export (PROGRAM)) +(define-module (scripts PROGRAM) + :export (PROGRAM)) @end example Feel free to export other definitions useful in the module context. @@ -73,7 +320,7 @@ Feel free to export other definitions useful in the module context. There must be the alias: @example - (define main PROGRAM) +(define main PROGRAM) @end example However, `main' must NOT be exported. @@ -82,10 +329,10 @@ However, `main' must NOT be exported. The beginning of the file must use the following invocation sequence: @example - #!/bin/sh - main='(module-ref (resolve-module '\''(scripts PROGRAM)) '\'main')' - exec ${GUILE-guile} -l $0 -c "(apply $main (cdr (command-line)))" "$@" - !# +#!/bin/sh +main='(module-ref (resolve-module '\''(scripts PROGRAM)) '\'main')' +exec $@{GUILE-guile@} -l $0 -c "(apply $main (cdr (command-line)))" "$@@" +!# @end example @end itemize From 73ede5920e74809fa8797345e65fa343b2179938 Mon Sep 17 00:00:00 2001 From: Thien-Thi Nguyen Date: Fri, 8 Mar 2002 21:23:36 +0000 Subject: [PATCH 056/131] (Miscellaneous Tools): Add under "Part II". Implement by including tools.texi. --- doc/ref/guile.texi | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/doc/ref/guile.texi b/doc/ref/guile.texi index c0d6cdae7..d078c465b 100644 --- a/doc/ref/guile.texi +++ b/doc/ref/guile.texi @@ -94,7 +94,7 @@ by the Free Software Foundation. @sp 10 @comment The title is printed in a large font. @title Guile Reference Manual -@subtitle $Id: guile.texi,v 1.12 2002-01-08 08:29:00 ttn Exp $ +@subtitle $Id: guile.texi,v 1.13 2002-03-08 21:23:36 ttn Exp $ @subtitle For use with Guile @value{VERSION} @c AUTHORS @@ -203,7 +203,7 @@ Preface Part I: Introduction to Guile * What is Guile?:: And what does it do? -* Whirlwind Tour:: An introductory whirlwind tour. +* Whirlwind Tour:: An introductory whirlwind tour. * Obtaining and Installing Guile:: * Reporting Bugs:: Reporting bugs in Guile or this manual. @@ -221,6 +221,7 @@ Part II: Programming with Guile * GH:: The deprecated GH interface. * Debugger User Interface:: * Autoconf Support:: Guile-specific configure.in macros. +* Miscellaneous Tools:: Snarfing, linting, etc. * Further Reading:: Where to find out more about Scheme programming. Part III: Guile API Reference @@ -302,6 +303,7 @@ options available. @include gh.texi @include debugging.texi @include autoconf.texi +@include tools.texi @include scheme-reading.texi @page From f394773de5634b870203811aee213dad48575757 Mon Sep 17 00:00:00 2001 From: Thien-Thi Nguyen Date: Fri, 8 Mar 2002 21:24:30 +0000 Subject: [PATCH 057/131] (guile_TEXINFOS): Add tools.texi. --- doc/ref/Makefile.am | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/ref/Makefile.am b/doc/ref/Makefile.am index 5935dc7fc..42760453c 100644 --- a/doc/ref/Makefile.am +++ b/doc/ref/Makefile.am @@ -33,7 +33,7 @@ guile_TEXINFOS = preface.texi intro.texi program.texi scheme-intro.texi \ expect.texi scsh.texi tcltk.texi scripts.texi gh.texi scm.texi \ debugging.texi indices.texi script-getopt.texi data-rep.texi \ extend.texi repl-modules.texi srfi-modules.texi misc-modules.texi \ - scheme-compound.texi autoconf.texi autoconf-macros.texi + scheme-compound.texi autoconf.texi autoconf-macros.texi tools.texi ETAGS_ARGS = $(info_TEXINFOS) $(guile_TEXINFOS) From 604a672efe41fca2026684efdb8a5ade66291b55 Mon Sep 17 00:00:00 2001 From: Thien-Thi Nguyen Date: Fri, 8 Mar 2002 21:28:07 +0000 Subject: [PATCH 058/131] (bin_SCRIPTS): Revive this decl, w/ initial element "guile-snarf" moved back from `noinst_SCRIPTS'. --- libguile/Makefile.am | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/libguile/Makefile.am b/libguile/Makefile.am index 504152619..3946801b5 100644 --- a/libguile/Makefile.am +++ b/libguile/Makefile.am @@ -141,10 +141,11 @@ modinclude_HEADERS = __scm.h alist.h arbiters.h async.h backtrace.h boolean.h \ ## and not a header -- headers are included in the distribution. modinclude_DATA = scmconfig.h +bin_SCRIPTS = guile-snarf + # We can re-enable install for some of these if/when they are documented # and people feel like maintaining them. For now, this is not the case. -noinst_SCRIPTS = guile-snarf guile-doc-snarf guile-snarf-docs \ - guile-func-name-check +noinst_SCRIPTS = guile-doc-snarf guile-snarf-docs guile-func-name-check EXTRA_DIST = ChangeLog-gh ChangeLog-scm ChangeLog-threads \ ChangeLog-1996-1999 ChangeLog-2000 cpp_signal.c \ From 1ebf1566bc8ebae430138f21650bf72ffc511b67 Mon Sep 17 00:00:00 2001 From: Thien-Thi Nguyen Date: Fri, 8 Mar 2002 21:29:19 +0000 Subject: [PATCH 059/131] *** empty log message *** --- doc/ref/ChangeLog | 16 ++++++++++++++++ libguile/ChangeLog | 7 ++++++- 2 files changed, 22 insertions(+), 1 deletion(-) diff --git a/doc/ref/ChangeLog b/doc/ref/ChangeLog index 52d9fa840..ec8a5ada7 100644 --- a/doc/ref/ChangeLog +++ b/doc/ref/ChangeLog @@ -1,3 +1,19 @@ +2002-03-08 Thien-Thi Nguyen + + * tools.texi (Miscellaneous Tools): New node/chapter. + (Snarfing, Init Snarfing with guile-snarf, How guile-snarf works, + Macros guile-snarf recognizes, Doc Snarfing): New nodes/(sub)sections. + (Executable Modules): Now a section under "Miscellaneous Tools". + + * guile.texi (Miscellaneous Tools): Add under "Part II". + Implement by including tools.texi. + + * Makefile.am (guile_TEXINFOS): Add tools.texi. + +2002-03-07 Thien-Thi Nguyen + + * tools.texi: New file. + 2002-03-03 Neil Jerram * autoconf.texi (Autoconf Background): Insert missing `of'. diff --git a/libguile/ChangeLog b/libguile/ChangeLog index 3d491d288..5806d2df4 100644 --- a/libguile/ChangeLog +++ b/libguile/ChangeLog @@ -1,3 +1,8 @@ +2002-03-08 Thien-Thi Nguyen + + * Makefile.am (bin_SCRIPTS): Revive this decl, w/ initial element + "guile-snarf" moved back from `noinst_SCRIPTS'. + 2002-03-08 Neil Jerram * srcprop.c (scm_set_source_property_x): If SRCPROPS obj already @@ -96,7 +101,7 @@ * inet_aton.c, fports.c: Commented the inclusion of . - * deprecation.c (vsnprintf): Define to `_vsnprintf' for + * deprecation.c (vsnprintf): Define to `_vsnprintf' for Windows (MinGW). 2002-02-26 Thien-Thi Nguyen From f12745b633ad25a59f8800524b6d9dd685544d6b Mon Sep 17 00:00:00 2001 From: Dirk Herrmann Date: Sat, 9 Mar 2002 20:15:16 +0000 Subject: [PATCH 060/131] * eval.c (SCM_CEVAL): Cleaned up the handling of #@dispatch. Added lots of comments regarding the implementation of #@dispatch. Changed intra-procedure communication to use t.arg1 instead of arg2. Removed some uses of t.arg1, t.lloc and proc as temporary variables. Introduced temporary variables with hopefully descriptive names for clarification. Replaced SCM_N?IMP by a more explicit predicate in some places. Use SCM_INSTANCE_HASH instead of computing the expression explicitly. Eliminate now unused label nontoplevel_cdrxbegin. * goops.h (SCM_INSTANCE_HASH): New macro. * objects.h (SCM_CMETHOD_FORMALS, SCM_CMETHOD_BODY): New macros. --- libguile/ChangeLog | 16 +++ libguile/eval.c | 241 ++++++++++++++++++++++++++++----------------- libguile/goops.h | 1 + libguile/objects.h | 2 + 4 files changed, 169 insertions(+), 91 deletions(-) diff --git a/libguile/ChangeLog b/libguile/ChangeLog index 5806d2df4..e28e1590f 100644 --- a/libguile/ChangeLog +++ b/libguile/ChangeLog @@ -1,3 +1,19 @@ +2002-03-02 Dirk Herrmann + + * eval.c (SCM_CEVAL): Cleaned up the handling of #@dispatch. + Added lots of comments regarding the implementation of #@dispatch. + Changed intra-procedure communication to use t.arg1 instead of + arg2. Removed some uses of t.arg1, t.lloc and proc as temporary + variables. Introduced temporary variables with hopefully + descriptive names for clarification. Replaced SCM_N?IMP by a more + explicit predicate in some places. Use SCM_INSTANCE_HASH instead + of computing the expression explicitly. Eliminate now unused + label nontoplevel_cdrxbegin. + + * goops.h (SCM_INSTANCE_HASH): New macro. + + * objects.h (SCM_CMETHOD_FORMALS, SCM_CMETHOD_BODY): New macros. + 2002-03-08 Thien-Thi Nguyen * Makefile.am (bin_SCRIPTS): Revive this decl, w/ initial element diff --git a/libguile/eval.c b/libguile/eval.c index c4dc8e6e8..9ffd561f9 100644 --- a/libguile/eval.c +++ b/libguile/eval.c @@ -96,6 +96,7 @@ char *alloca (); #include "libguile/root.h" #include "libguile/vectors.h" #include "libguile/fluids.h" +#include "libguile/goops.h" #include "libguile/values.h" #include "libguile/validate.h" @@ -2042,7 +2043,6 @@ dispatch: nontoplevel_cdrxnoap: PREP_APPLY (SCM_UNDEFINED, SCM_EOL); - nontoplevel_cdrxbegin: x = SCM_CDR (x); nontoplevel_begin: while (!SCM_NULLP (SCM_CDR (x))) @@ -2430,99 +2430,158 @@ dispatch: RETURN (scm_makprom (scm_closure (SCM_CDR (x), env))); case (SCM_ISYMNUM (SCM_IM_DISPATCH)): - proc = SCM_CADR (x); /* unevaluated operands */ - PREP_APPLY (SCM_UNDEFINED, SCM_EOL); - if (SCM_IMP (proc)) - arg2 = *scm_ilookup (proc, env); - else if (!SCM_CONSP (proc)) - { - if (SCM_VARIABLEP (proc)) - arg2 = SCM_VARIABLE_REF (proc); - else - arg2 = *scm_lookupcar (SCM_CDR (x), env, 1); - } - else - { - arg2 = scm_list_1 (EVALCAR (proc, env)); - t.lloc = SCM_CDRLOC (arg2); - while (SCM_NIMP (proc = SCM_CDR (proc))) - { - *t.lloc = scm_list_1 (EVALCAR (proc, env)); - t.lloc = SCM_CDRLOC (*t.lloc); - } - } - - type_dispatch: - /* The type dispatch code is duplicated here - * (c.f. objects.c:scm_mcache_compute_cmethod) since that - * cuts down execution time for type dispatch to 50%. - */ { - long i, n, end, mask; - SCM z = SCM_CDDR (x); - n = SCM_INUM (SCM_CAR (z)); /* maximum number of specializers */ - proc = SCM_CADR (z); - - if (SCM_NIMP (proc)) - { - /* Prepare for linear search */ - mask = -1; - i = 0; - end = SCM_VECTOR_LENGTH (proc); - } + /* If not done yet, evaluate the operand forms. The result is a + * list of arguments stored in t.arg1, which is used to perform the + * function dispatch. */ + SCM operand_forms = SCM_CADR (x); + PREP_APPLY (SCM_UNDEFINED, SCM_EOL); + if (SCM_ILOCP (operand_forms)) + t.arg1 = *scm_ilookup (operand_forms, env); + else if (SCM_VARIABLEP (operand_forms)) + t.arg1 = SCM_VARIABLE_REF (operand_forms); + else if (!SCM_CONSP (operand_forms)) + t.arg1 = *scm_lookupcar (SCM_CDR (x), env, 1); else { - /* Compute a hash value */ - long hashset = SCM_INUM (proc); - long j = n; - z = SCM_CDDR (z); - mask = SCM_INUM (SCM_CAR (z)); - proc = SCM_CADR (z); - i = 0; - t.arg1 = arg2; - if (SCM_NIMP (t.arg1)) - do - { - i += SCM_STRUCT_DATA (scm_class_of (SCM_CAR (t.arg1))) - [scm_si_hashsets + hashset]; - t.arg1 = SCM_CDR (t.arg1); - } - while (j-- && SCM_NIMP (t.arg1)); - i &= mask; - end = i; + SCM tail = t.arg1 = scm_list_1 (EVALCAR (operand_forms, env)); + operand_forms = SCM_CDR (operand_forms); + while (!SCM_NULLP (operand_forms)) + { + SCM new_tail = scm_list_1 (EVALCAR (operand_forms, env)); + SCM_SETCDR (tail, new_tail); + tail = new_tail; + operand_forms = SCM_CDR (operand_forms); + } } + } - /* Search for match */ - do - { - long j = n; - z = SCM_VELTS (proc)[i]; - t.arg1 = arg2; /* list of arguments */ - if (SCM_NIMP (t.arg1)) - do + /* The type dispatch code is duplicated below + * (c.f. objects.c:scm_mcache_compute_cmethod) since that + * cuts down execution time for type dispatch to 50%. */ + type_dispatch: /* inputs: x, t.arg1 */ + /* Type dispatch means to determine from the types of the function + * arguments (i. e. the 'signature' of the call), which method from + * a generic function is to be called. This process of selecting + * the right method takes some time. To speed it up, guile uses + * caching: Together with the macro call to dispatch the signatures + * of some previous calls to that generic function from the same + * place are stored (in the code!) in a cache that we call the + * 'method cache'. This is done since it is likely, that + * consecutive calls to dispatch from that position in the code will + * have the same signature. Thus, the type dispatch works as + * follows: First, determine a hash value from the signature of the + * actual arguments. Second, use this hash value as an index to + * find that same signature in the method cache stored at this + * position in the code. If found, you have also found the + * corresponding method that belongs to that signature. If the + * signature is not found in the method cache, you have to perform a + * full search over all signatures stored with the generic + * function. */ + { + unsigned long int specializers; + unsigned long int hash_value; + unsigned long int cache_end_pos; + unsigned long int mask; + SCM method_cache; + + { + SCM z = SCM_CDDR (x); + SCM tmp = SCM_CADR (z); + specializers = SCM_INUM (SCM_CAR (z)); + + /* Compute a hash value for searching the method cache. There + * are two variants for computing the hash value, a (rather) + * complicated one, and a simple one. For the complicated one + * explained below, tmp holds a number that is used in the + * computation. */ + if (SCM_INUMP (tmp)) + { + /* Use the signature of the actual arguments to determine + * the hash value. This is done as follows: Each class has + * an array of random numbers, that are determined when the + * class is created. The integer 'hashset' is an index into + * that array of random numbers. Now, from all classes that + * are part of the signature of the actual arguments, the + * random numbers at index 'hashset' are taken and summed + * up, giving the hash value. The value of 'hashset' is + * stored at the call to dispatch. This allows to have + * different 'formulas' for calculating the hash value at + * different places where dispatch is called. This allows + * to optimize the hash formula at every individual place + * where dispatch is called, such that hopefully the hash + * value that is computed will directly point to the right + * method in the method cache. */ + unsigned long int hashset = SCM_INUM (tmp); + unsigned long int counter = specializers + 1; + SCM tmp_arg = t.arg1; + hash_value = 0; + while (!SCM_NULLP (tmp_arg) && counter != 0) + { + SCM class = scm_class_of (SCM_CAR (tmp_arg)); + hash_value += SCM_INSTANCE_HASH (class, hashset); + tmp_arg = SCM_CDR (tmp_arg); + counter--; + } + z = SCM_CDDR (z); + method_cache = SCM_CADR (z); + mask = SCM_INUM (SCM_CAR (z)); + hash_value &= mask; + cache_end_pos = hash_value; + } + else + { + /* This method of determining the hash value is much + * simpler: Set the hash value to zero and just perform a + * linear search through the method cache. */ + method_cache = tmp; + mask = (unsigned long int) ((long) -1); + hash_value = 0; + cache_end_pos = SCM_VECTOR_LENGTH (method_cache); + } + } + + { + /* Search the method cache for a method with a matching + * signature. Start the search at position 'hash_value'. The + * hashing implementation uses linear probing for conflict + * resolution, that is, if the signature in question is not + * found at the starting index in the hash table, the next table + * entry is tried, and so on, until in the worst case the whole + * cache has been searched, but still the signature has not been + * found. */ + SCM z; + do + { + SCM args = t.arg1; /* list of arguments */ + z = SCM_VELTS (method_cache)[hash_value]; + while (!SCM_NULLP (args)) { /* More arguments than specifiers => CLASS != ENV */ - if (! SCM_EQ_P (scm_class_of (SCM_CAR (t.arg1)), SCM_CAR (z))) + SCM class_of_arg = scm_class_of (SCM_CAR (args)); + if (!SCM_EQ_P (class_of_arg, SCM_CAR (z))) goto next_method; - t.arg1 = SCM_CDR (t.arg1); + args = SCM_CDR (args); z = SCM_CDR (z); } - while (j-- && SCM_NIMP (t.arg1)); - /* Fewer arguments than specifiers => CAR != ENV */ - if (!(SCM_IMP (SCM_CAR (z)) || SCM_CONSP (SCM_CAR (z)))) - goto next_method; - apply_cmethod: - env = EXTEND_ENV (SCM_CAR (SCM_CMETHOD_CODE (z)), - arg2, - SCM_CMETHOD_ENV (z)); - x = SCM_CMETHOD_CODE (z); - goto nontoplevel_cdrxbegin; - next_method: - i = (i + 1) & mask; - } while (i != end); - - z = scm_memoize_method (x, arg2); - goto apply_cmethod; + /* Fewer arguments than specifiers => CAR != ENV */ + if (SCM_NULLP (SCM_CAR (z)) || SCM_CONSP (SCM_CAR (z))) + goto apply_cmethod; + next_method: + hash_value = (hash_value + 1) & mask; + } while (hash_value != cache_end_pos); + + /* No appropriate method was found in the cache. */ + z = scm_memoize_method (x, t.arg1); + + apply_cmethod: /* inputs: z, t.arg1 */ + { + SCM formals = SCM_CMETHOD_FORMALS (z); + env = EXTEND_ENV (formals, t.arg1, SCM_CMETHOD_ENV (z)); + x = SCM_CMETHOD_BODY (z); + goto nontoplevel_begin; + } + } } case (SCM_ISYMNUM (SCM_IM_SLOT_REF)): @@ -2806,7 +2865,7 @@ evapply: if (SCM_OBJ_CLASS_FLAGS (proc) & SCM_CLASSF_PURE_GENERIC) { x = SCM_ENTITY_PROCEDURE (proc); - arg2 = SCM_EOL; + t.arg1 = SCM_EOL; goto type_dispatch; } else if (!SCM_I_OPERATORP (proc)) @@ -2951,9 +3010,9 @@ evapply: { x = SCM_ENTITY_PROCEDURE (proc); #ifdef DEVAL - arg2 = debug.info->a.args; + t.arg1 = debug.info->a.args; #else - arg2 = scm_list_1 (t.arg1); + t.arg1 = scm_list_1 (t.arg1); #endif goto type_dispatch; } @@ -3047,9 +3106,9 @@ evapply: { x = SCM_ENTITY_PROCEDURE (proc); #ifdef DEVAL - arg2 = debug.info->a.args; + t.arg1 = debug.info->a.args; #else - arg2 = scm_list_2 (t.arg1, arg2); + t.arg1 = scm_list_2 (t.arg1, arg2); #endif goto type_dispatch; } @@ -3259,9 +3318,9 @@ evapply: if (SCM_OBJ_CLASS_FLAGS (proc) & SCM_CLASSF_PURE_GENERIC) { #ifdef DEVAL - arg2 = debug.info->a.args; + t.arg1 = debug.info->a.args; #else - arg2 = scm_cons2 (t.arg1, arg2, scm_eval_args (x, env, proc)); + t.arg1 = scm_cons2 (t.arg1, arg2, scm_eval_args (x, env, proc)); #endif x = SCM_ENTITY_PROCEDURE (proc); goto type_dispatch; diff --git a/libguile/goops.h b/libguile/goops.h index fb83005a9..6f4b48c1d 100644 --- a/libguile/goops.h +++ b/libguile/goops.h @@ -144,6 +144,7 @@ typedef struct scm_t_method { #define SCM_SLOT(x, i) (SCM_PACK (SCM_INST (x) [i])) #define SCM_SET_SLOT(x, i, v) (SCM_INST (x) [i] = SCM_UNPACK (v)) +#define SCM_INSTANCE_HASH(c, i) (SCM_INST (c) [scm_si_hashsets + (i)]) #define SCM_SET_HASHSET(c, i, h) (SCM_INST (c) [scm_si_hashsets + (i)] = (h)) #define SCM_SUBCLASSP(c1, c2) (!SCM_FALSEP (scm_c_memq (c2, SCM_SLOT (c1, scm_si_cpl)))) diff --git a/libguile/objects.h b/libguile/objects.h index a2d77a23d..afeeb181a 100644 --- a/libguile/objects.h +++ b/libguile/objects.h @@ -190,6 +190,8 @@ typedef struct scm_effective_slot_definition { #define SCM_ESLOTDEF(x) ((scm_effective_slot_definition *) SCM_CDR (x)) #define SCM_CMETHOD_CODE(cmethod) SCM_CDR (cmethod) +#define SCM_CMETHOD_FORMALS(cmethod) SCM_CAR (SCM_CMETHOD_CODE (cmethod)) +#define SCM_CMETHOD_BODY(cmethod) SCM_CDR (SCM_CMETHOD_CODE (cmethod)) #define SCM_CMETHOD_ENV(cmethod) SCM_CAR (cmethod) /* Port classes */ From 1d15ecd303107c83a6da132b4f945b70ebbb182b Mon Sep 17 00:00:00 2001 From: Dirk Herrmann Date: Sun, 10 Mar 2002 07:53:27 +0000 Subject: [PATCH 061/131] * eval.c (SCM_CEVAL): Cleaned up the handling of 'slot-ref', 'slot-set!' and 'nil-cond'. Removed some uses of t.arg1, arg2 and proc as temporary variables. Introduced temporary variables with hopefully descriptive names for clarification. Replaced SCM_N?IMP by a more explicit predicate in some places. --- libguile/ChangeLog | 10 +++++- libguile/eval.c | 79 +++++++++++++++++++++++++++------------------- 2 files changed, 56 insertions(+), 33 deletions(-) diff --git a/libguile/ChangeLog b/libguile/ChangeLog index e28e1590f..d38558ab3 100644 --- a/libguile/ChangeLog +++ b/libguile/ChangeLog @@ -1,4 +1,12 @@ -2002-03-02 Dirk Herrmann +2002-03-10 Dirk Herrmann + + * eval.c (SCM_CEVAL): Cleaned up the handling of 'slot-ref', + 'slot-set!' and 'nil-cond'. Removed some uses of t.arg1, arg2 and + proc as temporary variables. Introduced temporary variables with + hopefully descriptive names for clarification. Replaced SCM_N?IMP + by a more explicit predicate in some places. + +2002-03-09 Dirk Herrmann * eval.c (SCM_CEVAL): Cleaned up the handling of #@dispatch. Added lots of comments regarding the implementation of #@dispatch. diff --git a/libguile/eval.c b/libguile/eval.c index 9ffd561f9..7869ecc23 100644 --- a/libguile/eval.c +++ b/libguile/eval.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1995,1996,1997,1998,1999,2000,2001 Free Software Foundation, Inc. +/* Copyright (C) 1995,1996,1997,1998,1999,2000,2001,2002 Free Software Foundation, Inc. * * 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 @@ -2584,40 +2584,54 @@ dispatch: } } + case (SCM_ISYMNUM (SCM_IM_SLOT_REF)): x = SCM_CDR (x); - t.arg1 = EVALCAR (x, env); - RETURN (SCM_PACK (SCM_STRUCT_DATA (t.arg1) [SCM_INUM (SCM_CADR (x))])); - + { + SCM instance = EVALCAR (x, env); + unsigned long int slot = SCM_INUM (SCM_CADR (x)); + RETURN (SCM_PACK (SCM_STRUCT_DATA (instance) [slot])); + } + + case (SCM_ISYMNUM (SCM_IM_SLOT_SET_X)): x = SCM_CDR (x); - t.arg1 = EVALCAR (x, env); - x = SCM_CDR (x); - proc = SCM_CDR (x); - SCM_STRUCT_DATA (t.arg1) [SCM_INUM (SCM_CAR (x))] - = SCM_UNPACK (EVALCAR (proc, env)); - RETURN (SCM_UNSPECIFIED); + { + SCM instance = EVALCAR (x, env); + unsigned long int slot = SCM_INUM (SCM_CADR (x)); + SCM value = EVALCAR (SCM_CDDR (x), env); + SCM_STRUCT_DATA (instance) [slot] = SCM_UNPACK (value); + RETURN (SCM_UNSPECIFIED); + } + #ifdef SCM_ENABLE_ELISP case (SCM_ISYMNUM (SCM_IM_NIL_COND)): - proc = SCM_CDR (x); - while (SCM_NIMP (x = SCM_CDR (proc))) - { - if (!(SCM_FALSEP (t.arg1 = EVALCAR (proc, env)) - || SCM_NILP (t.arg1) - || SCM_NULLP (t.arg1))) - { - if (SCM_EQ_P (SCM_CAR (x), SCM_UNSPECIFIED)) - RETURN (t.arg1); - PREP_APPLY (SCM_UNDEFINED, SCM_EOL); - goto carloop; - } - proc = SCM_CDR (x); - } - x = proc; - PREP_APPLY (SCM_UNDEFINED, SCM_EOL); - goto carloop; + { + SCM test_form = SCM_CDR (x); + x = SCM_CDR (test_form); + while (!SCM_NULL_OR_NIL_P (x)) + { + SCM test_result = EVALCAR (test_form, env); + if (!(SCM_FALSEP (test_result) + || SCM_NULL_OR_NIL_P (test_result))) + { + if (SCM_EQ_P (SCM_CAR (x), SCM_UNSPECIFIED)) + RETURN (test_result); + PREP_APPLY (SCM_UNDEFINED, SCM_EOL); + goto carloop; + } + else + { + test_form = SCM_CDR (x); + x = SCM_CDR (test_form); + } + } + x = test_form; + PREP_APPLY (SCM_UNDEFINED, SCM_EOL); + goto carloop; + } #endif /* SCM_ENABLE_ELISP */ @@ -2639,12 +2653,12 @@ dispatch: scm_swap_bindings (vars, vals); scm_dynwinds = scm_acons (vars, vals, scm_dynwinds); - - arg2 = x = SCM_CDR (x); - while (!SCM_NULLP (arg2 = SCM_CDR (arg2))) + + /* Ignore all but the last evaluation result. */ + for (x = SCM_CDR (x); !SCM_NULLP (SCM_CDR (x)); x = SCM_CDR (x)) { - SIDEVAL (SCM_CAR (x), env); - x = arg2; + if (SCM_CONSP (SCM_CAR (x))) + SCM_CEVAL (SCM_CAR (x), env); } proc = EVALCAR (x, env); @@ -2654,6 +2668,7 @@ dispatch: RETURN (proc); } + case (SCM_ISYMNUM (SCM_IM_CALL_WITH_VALUES)): { proc = SCM_CDR (x); From ff0a837c208113f186a67505372995712c46e281 Mon Sep 17 00:00:00 2001 From: Marius Vollmer Date: Mon, 11 Mar 2002 17:51:18 +0000 Subject: [PATCH 062/131] (scm_string_capitalize_x): Treat characters as unsigned so that 8-bit chars work. Thanks to David Pirotte! --- libguile/strop.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libguile/strop.c b/libguile/strop.c index 89cd02f62..d0696add5 100644 --- a/libguile/strop.c +++ b/libguile/strop.c @@ -410,12 +410,12 @@ SCM_DEFINE (scm_string_downcase, "string-downcase", 1, 0, 0, static SCM string_capitalize_x (SCM str) { - char *sz; + unsigned char *sz; long i, len; int in_word=0; len = SCM_STRING_LENGTH(str); - sz = SCM_STRING_CHARS (str); + sz = SCM_STRING_UCHARS (str); for(i=0; i Date: Mon, 11 Mar 2002 17:51:52 +0000 Subject: [PATCH 063/131] Removed FIXME comment about hoos for malloc and free. --- libguile/convert.i.c | 4 ---- 1 file changed, 4 deletions(-) diff --git a/libguile/convert.i.c b/libguile/convert.i.c index e2c338a7a..45a3ea443 100644 --- a/libguile/convert.i.c +++ b/libguile/convert.i.c @@ -1,9 +1,5 @@ /* this file is #include'd (x times) by convert.c */ -/* FIXME: Should we use exported wrappers for malloc (and free), which - * allow windows DLLs to call the correct freeing function? */ - - /* Convert a vector, weak vector, (if possible string, substring), list or uniform vector into an C array. If the result array in argument 2 is NULL, malloc() a new one. If out of memory, return NULL. */ From bd7c7fc63729adf957331174badfba5f87f18d80 Mon Sep 17 00:00:00 2001 From: Marius Vollmer Date: Mon, 11 Mar 2002 17:52:41 +0000 Subject: [PATCH 064/131] (string_titlecase_x): Treat characters as unsigned so that 8-bit chars work. Thanks to David Pirotte! --- srfi/srfi-13.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/srfi/srfi-13.c b/srfi/srfi-13.c index 3d32cf744..38d53fece 100644 --- a/srfi/srfi-13.c +++ b/srfi/srfi-13.c @@ -2106,10 +2106,10 @@ SCM_DEFINE (scm_string_downcaseS, "string-downcase", 1, 2, 0, static SCM string_titlecase_x (SCM str, int start, int end) { - char * sz; + unsigned char * sz; int i, in_word = 0; - sz = SCM_STRING_CHARS (str); + sz = SCM_STRING_UCHARS (str); for(i = start; i < end; i++) { if (!SCM_FALSEP (scm_char_alphabetic_p (SCM_MAKE_CHAR (sz[i])))) From 16d98032a4d403ddc8f2c01f5d1413af40c71f32 Mon Sep 17 00:00:00 2001 From: Marius Vollmer Date: Mon, 11 Mar 2002 17:52:56 +0000 Subject: [PATCH 065/131] *** empty log message *** --- TODO | 2 ++ libguile/ChangeLog | 5 +++++ srfi/ChangeLog | 5 +++++ 3 files changed, 12 insertions(+) diff --git a/TODO b/TODO index 905253d91..7f952e053 100644 --- a/TODO +++ b/TODO @@ -18,6 +18,8 @@ that user-visible changes are reflected in NEWS. * Eventually +- Unify SRFI-4 and the existing uniform array code, cleaning it up in + the process. - [after signal handling and threading have been fixed] remove the code corresponding to GUILE_OLD_ASYNC_CLICK and the corresponding GUILE_OLD_ASYNC_CLICK macro. diff --git a/libguile/ChangeLog b/libguile/ChangeLog index d38558ab3..94b68996f 100644 --- a/libguile/ChangeLog +++ b/libguile/ChangeLog @@ -1,3 +1,8 @@ +2002-03-11 Marius Vollmer + + * strop.c (scm_string_capitalize_x): Treat characters as unsigned + so that 8-bit chars work. Thanks to David Pirotte! + 2002-03-10 Dirk Herrmann * eval.c (SCM_CEVAL): Cleaned up the handling of 'slot-ref', diff --git a/srfi/ChangeLog b/srfi/ChangeLog index 85d30f6f8..ed187389a 100644 --- a/srfi/ChangeLog +++ b/srfi/ChangeLog @@ -1,3 +1,8 @@ +2002-03-11 Marius Vollmer + + * srfi-13.c (string_titlecase_x): Treat characters as unsigned so + that 8-bit chars work. Thanks to David Pirotte! + 2002-02-24 Rob Browning * Makefile.am (libguile_srfi_srfi_4_la_LDFLAGS): use From 8794207d2ea092a901d3efc1f2d12ffa0b80de83 Mon Sep 17 00:00:00 2001 From: Marius Vollmer Date: Mon, 11 Mar 2002 17:57:47 +0000 Subject: [PATCH 066/131] Corrected function name in entry header. --- libguile/ChangeLog | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libguile/ChangeLog b/libguile/ChangeLog index 94b68996f..0f529a5eb 100644 --- a/libguile/ChangeLog +++ b/libguile/ChangeLog @@ -1,7 +1,7 @@ 2002-03-11 Marius Vollmer - * strop.c (scm_string_capitalize_x): Treat characters as unsigned - so that 8-bit chars work. Thanks to David Pirotte! + * strop.c (string_capitalize_x): Treat characters as unsigned so + that 8-bit chars work. Thanks to David Pirotte! 2002-03-10 Dirk Herrmann From ba74ef4eae2649905eeb03e573fee5cd669ca371 Mon Sep 17 00:00:00 2001 From: Marius Vollmer Date: Mon, 11 Mar 2002 19:10:01 +0000 Subject: [PATCH 067/131] (scm_divide): Adapt code from libstdc++/f2c to void potential overflow problems. Thanks to John W Eaton! --- libguile/numbers.c | 65 +++++++++++++++++++++++++++++++++++++++++----- 1 file changed, 58 insertions(+), 7 deletions(-) diff --git a/libguile/numbers.c b/libguile/numbers.c index 98c045b78..baecf0210 100644 --- a/libguile/numbers.c +++ b/libguile/numbers.c @@ -1,4 +1,8 @@ /* Copyright (C) 1995,1996,1997,1998,1999,2000,2001 Free Software Foundation, Inc. + * + * Portions Copyright 1990, 1991, 1992, 1993 by AT&T Bell Laboratories + * and Bellcore. See scm_divide. + * * * 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 @@ -3691,6 +3695,33 @@ scm_num2dbl (SCM a, const char *why) #undef FUNC_NAME +/* The code below for complex division is adapted from the GNU + libstdc++, which adapted it from f2c's libF77, and is subject to + this copyright: */ + +/**************************************************************** +Copyright 1990, 1991, 1992, 1993 by AT&T Bell Laboratories and Bellcore. + +Permission to use, copy, modify, and distribute this software +and its documentation for any purpose and without fee is hereby +granted, provided that the above copyright notice appear in all +copies and that both that the copyright notice and this +permission notice and warranty disclaimer appear in supporting +documentation, and that the names of AT&T Bell Laboratories or +Bellcore or any of their entities not be used in advertising or +publicity pertaining to distribution of the software without +specific, written prior permission. + +AT&T and Bellcore disclaim all warranties with regard to this +software, including all implied warranties of merchantability +and fitness. In no event shall AT&T or Bellcore be liable for +any special, indirect or consequential damages or any damages +whatsoever resulting from loss of use, data or profits, whether +in an action of contract, negligence or other tortious action, +arising out of or in connection with the use or performance of +this software. +****************************************************************/ + SCM_GPROC1 (s_divide, "/", scm_tc7_asubr, scm_divide, g_divide); /* Divide the first argument by the product of the remaining arguments. If called with one argument @var{z1}, 1/@var{z1} is @@ -3724,8 +3755,15 @@ scm_divide (SCM x, SCM y) } else if (SCM_COMPLEXP (x)) { double r = SCM_COMPLEX_REAL (x); double i = SCM_COMPLEX_IMAG (x); - double d = r * r + i * i; - return scm_make_complex (r / d, -i / d); + if (r <= i) { + double t = r / i; + double d = i * (1.0 + t * t); + return scm_make_complex (t / d, -1.0 / d); + } else { + double t = i / r; + double d = r * (1.0 + t * t); + return scm_make_complex (1.0 / d, -t / d); + } } else { SCM_WTA_DISPATCH_1 (g_divide, x, SCM_ARG1, s_divide); } @@ -3765,8 +3803,15 @@ scm_divide (SCM x, SCM y) { double r = SCM_COMPLEX_REAL (y); double i = SCM_COMPLEX_IMAG (y); - double d = r * r + i * i; - return scm_make_complex ((a * r) / d, (-a * i) / d); + if (r <= i) { + double t = r / i; + double d = i * (1.0 + t * t); + return scm_make_complex ((a * t) / d, -a / d); + } else { + double t = i / r; + double d = r * (1.0 + t * t); + return scm_make_complex (a / d, -(a * t) / d); + } } } else { SCM_WTA_DISPATCH_2 (g_divide, x, y, SCM_ARGn, s_divide); @@ -3870,9 +3915,15 @@ scm_divide (SCM x, SCM y) } else if (SCM_COMPLEXP (y)) { double ry = SCM_COMPLEX_REAL (y); double iy = SCM_COMPLEX_IMAG (y); - double d = ry * ry + iy * iy; - return scm_make_complex ((rx * ry + ix * iy) / d, - (ix * ry - rx * iy) / d); + if (ry <= iy) { + double t = ry / iy; + double d = iy * (1.0 + t * t); + return scm_make_complex ((rx * t + ix) / d, (ix * t - rx) / d); + } else { + double t = iy / ry; + double d = ry * (1.0 + t * t); + return scm_make_complex ((rx + ix * t) / d, (ix - rx * t) / d); + } } else { SCM_WTA_DISPATCH_2 (g_divide, x, y, SCM_ARGn, s_divide); } From 469b963c661fe72f218e7765adfa1ef37952c7f0 Mon Sep 17 00:00:00 2001 From: Marius Vollmer Date: Mon, 11 Mar 2002 19:10:28 +0000 Subject: [PATCH 068/131] New tests for complex division. --- test-suite/tests/numbers.test | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) diff --git a/test-suite/tests/numbers.test b/test-suite/tests/numbers.test index 03998bd41..e0577a008 100644 --- a/test-suite/tests/numbers.test +++ b/test-suite/tests/numbers.test @@ -1421,7 +1421,30 @@ (pass-if-exception "(/ +i 0.0)" exception:numerical-overflow - (/ +i 0.0)))) + (/ +i 0.0))) + + (with-test-prefix "complex division" + + (pass-if "(/ 3+4i)" + (= (/ 3+4i) 0.12-0.16i)) + + (pass-if "(/ 4+3i)" + (= (/ 4+3i) 0.16-0.12i)) + + (pass-if "(/ 25+125i 3+4i)" + (= (/ 25+125i 3+4i) 23.0+11.0i)) + + (pass-if "(/ 25+125i 4+3i)" + (= (/ 25+125i 4+3i) 19.0+17.0i)) + + (pass-if "(/ 25 3+4i)" + (= (/ 25 3+4i) 3.0-4.0i)) + + (pass-if "(/ 25 4+3i)" + (= (/ 25 4+3i) 4.0-3.0i)) + + (pass-if "(/ 1e200+1e200i)" + (= (/ 1e200+1e200i) 5.0e-201-5.0e-201i)))) ;;; ;;; truncate From 5046250eb77e43ff571bd0926f3403b5e07ce5b6 Mon Sep 17 00:00:00 2001 From: Marius Vollmer Date: Mon, 11 Mar 2002 19:10:47 +0000 Subject: [PATCH 069/131] *** empty log message *** --- AUTHORS | 3 +++ THANKS | 2 ++ libguile/ChangeLog | 3 +++ 3 files changed, 8 insertions(+) diff --git a/AUTHORS b/AUTHORS index 74cdb2ba1..9df01eb13 100644 --- a/AUTHORS +++ b/AUTHORS @@ -322,3 +322,6 @@ In the subdirectory libguile, changes to: continuations.h continuations.c gc.c + +John W. Eaton, based on code from AT&T Bell Laboratories and Bellcore: + The complex number division method in libguile/numbers.c. diff --git a/THANKS b/THANKS index 2a43632eb..1dd99f015 100644 --- a/THANKS +++ b/THANKS @@ -12,11 +12,13 @@ For fixes or providing information which led to a fix: Brian Crowder Christopher Cramer Alexandre Duret-Lutz + John W Eaton Aubrey Jaffer Eric Gillespie, Jr John Goerzen Han-Wen Nienhuys Ron Peterson + David Pirotte Ken Raeburn Bill Schottstaedt Momchil Velikov diff --git a/libguile/ChangeLog b/libguile/ChangeLog index 0f529a5eb..812415ad4 100644 --- a/libguile/ChangeLog +++ b/libguile/ChangeLog @@ -1,5 +1,8 @@ 2002-03-11 Marius Vollmer + * numbers.c (scm_divide): Adapt code from libstdc++/f2c to void + potential overflow problems. Thanks to John W Eaton! + * strop.c (string_capitalize_x): Treat characters as unsigned so that 8-bit chars work. Thanks to David Pirotte! From fd1fcb7f9e26945ce8b1314a4e40557112ecd441 Mon Sep 17 00:00:00 2001 From: Marius Vollmer Date: Mon, 11 Mar 2002 19:29:35 +0000 Subject: [PATCH 070/131] *** empty log message *** --- TODO | 120 ----------------------------------------------------------- 1 file changed, 120 deletions(-) diff --git a/TODO b/TODO index 7f952e053..e69de29bb 100644 --- a/TODO +++ b/TODO @@ -1,120 +0,0 @@ -The Guile TODO List (actually, an -*-outline-*-) - -* Protocol - -These TODO items are grouped by target release version. The first group is -the "Eventually" group, which is not associated w/ any particular version. -Items should be initially added to this group, and then later moved under a -version upon either ownership or sponsorship. - -Maintainers (w/ write privs) indicate ownership by `[USERNAME]'. Use -`[ACTUAL-OWNER:MAINTAINER]' to indicate sponsorship, where both elements are -usernames. - -Upon completion, simply change the "-" to a "+", but do not delete the item. -At release time, the "+" entries will be deleted after review to make sure -that user-visible changes are reflected in NEWS. - - -* Eventually - -- Unify SRFI-4 and the existing uniform array code, cleaning it up in - the process. -- [after signal handling and threading have been fixed] remove the code - corresponding to GUILE_OLD_ASYNC_CLICK and the corresponding - GUILE_OLD_ASYNC_CLICK macro. -- implement and integrate generational garbage collection -- add POSIX thread support -- factor thread support out of libguile -- protect common resources using mutecis from the new interface -- remove the dynamic roots -- revise the fluid implementation -- implement the GC thread synchronization (all threads: go to sleep!) -- implementing the libguileposix threads glue library -- develop better representation for GOOPS objects -- write Orbit CORBA interface -- [after new module system] factor out modules sort.c and random.c should be - factored out into separate modules -- include malloc debugging code in an optional file in libguile -- fix looking up procedure names in environment in backtraces -- implement srcprops using double cells -- use "real" procprops -- add facilities for easily debugging Scheme programs from Emacs -- write good interface to Tk -- write translators for additional languages - - Perl - - Python - - TCL - - Emacs Lisp - - Rexx -- make GDB work with Guile -- use the SCM trick of tagging environments with immediates (see m_letrec1) - to convert source correctly in unmemocopy -- eliminate argument checking for closures -- Implement a thread-safe alternative to SCM's environment caches -- rename ice-9 to something more obvious -- implement implicitly shared substrings (thread-safe, copy on write). In - this context, the concept of read-only-strings might be re-introduced to - implement the symbol->string semantics of R5RS. -- implement internationalized strings -- revise the uniform vector implementation -- make the set of error signalling functions more consistent -- Fix bug reported by Sven.Hartrumpf@fernuni-hagen.de 2001-08-31: - (debug-disable 'debug) has no effect if it is the first form in ~/.guile. -- provide a non-extended implementation of 'define' for the R5RS module. - - -* Before releasing 1.8.0: - -- deprecate old uniform vector interface. - -- add DLL support [ela] <-- set by ttn (my bad) - -- write emacs/patch.el [ttn] - + outgoing - - incoming - -+ sync srfi-modules.texi [ttn] - -- For GOOPS: [ttn] - - rewrite method cache management in C - - rewrite core macros (define-class et al) in C - - define C API - -- Compile with --enable-error-on-warning without failure. Requires a - number of fixes, including num2integral.i.c and on some platforms - gc_os_dep.c. Also SCM_FIXABLE etc. will produce unavoidable - warnings on some platforms with some vars as written now. i.e. on - alphas, SCM_FIXABLE(some_int) is always true. We need more - conditional compilation or similar. - -- Move sample .gdbinit in HACKING to somewhere more appropriate (manual?). - -- Make sure we have appropriate interface numbers for shared - libraries, and that we document and use the libtool - conventions. [rlb]. - -- Update the version numbers in GUILE-VERSION and README. [rlb] - -- Start a new section of the NEWS file. - - -* Before releasing 1.10.0: - -- in boot-9.scm: - remove deprecated function `feature?´. - -- gc.c and gc.h: - remove deprecated macros SCM_NEWCELL and SCM_NEWCELL2 together with - their support staffing scm_deprecated_newcell, - scm_deprecated_newcell2, scm_tc16_allocated, mark_allocated. - -- in gc.c and gc.h: - Remove deprecated functions scm_must_malloc, - scm_must_realloc, scm_must_free, scm_done_malloc, scm_done_free, - scm_must_strndup, scm_must_strdup. - -- Change return types of smob and port free functions to void. - They should all return zero by now. - -[TODO ends here] From 413d32b658ced090c4d068863e29948b79243bd6 Mon Sep 17 00:00:00 2001 From: Neil Jerram Date: Tue, 12 Mar 2002 21:08:57 +0000 Subject: [PATCH 071/131] Various minor enhancements ported from the stable CVS branch. --- doc/ref/ChangeLog | 6 ++++++ doc/ref/data-rep.texi | 3 ++- doc/ref/scheme-evaluation.texi | 4 ++-- doc/ref/scheme-options.texi | 1 + doc/ref/scheme-translation.texi | 2 +- 5 files changed, 12 insertions(+), 4 deletions(-) diff --git a/doc/ref/ChangeLog b/doc/ref/ChangeLog index ec8a5ada7..18ecbffe5 100644 --- a/doc/ref/ChangeLog +++ b/doc/ref/ChangeLog @@ -1,3 +1,9 @@ +2002-03-12 Neil Jerram + + * data-rep.texi, guile.texi, scheme-evaluation.texi, + scheme-options.texi, scheme-translation.texi: Various minor + enhancements ported from the stable CVS branch. + 2002-03-08 Thien-Thi Nguyen * tools.texi (Miscellaneous Tools): New node/chapter. diff --git a/doc/ref/data-rep.texi b/doc/ref/data-rep.texi index d3a9aa678..6e0dc1ae0 100644 --- a/doc/ref/data-rep.texi +++ b/doc/ref/data-rep.texi @@ -46,7 +46,7 @@ @c essay @sp 10 @c essay @comment The title is printed in a large font. @c essay @title Data Representation in Guile -@c essay @subtitle $Id: data-rep.texi,v 1.5 2002-03-01 00:19:20 dirk Exp $ +@c essay @subtitle $Id: data-rep.texi,v 1.6 2002-03-12 21:08:57 ossau Exp $ @c essay @subtitle For use with Guile @value{VERSION} @c essay @author Jim Blandy @c essay @author Free Software Foundation @@ -1609,6 +1609,7 @@ make_image (SCM name, SCM s_width, SCM s_height) @} @end example + @node Type checking @subsection Type checking diff --git a/doc/ref/scheme-evaluation.texi b/doc/ref/scheme-evaluation.texi index d9854fe6d..fbfcd87a8 100644 --- a/doc/ref/scheme-evaluation.texi +++ b/doc/ref/scheme-evaluation.texi @@ -175,7 +175,7 @@ options and switches them on, @code{read-disable} switches them off. @deffnx {C Function} scm_read_options (setting) Option interface for the read options. Instead of using this procedure directly, use the procedures @code{read-enable}, -@code{read-disable}, @code{read-set!} and @var{read-options}. +@code{read-disable}, @code{read-set!} and @code{read-options}. @end deffn @@ -386,7 +386,7 @@ options and switches them on, @code{eval-disable} switches them off. @deffnx {C Function} scm_eval_options_interface (setting) Option interface for the evaluation options. Instead of using this procedure directly, use the procedures @code{eval-enable}, -@code{eval-disable}, @code{eval-set!} and @var{eval-options}. +@code{eval-disable}, @code{eval-set!} and @code{eval-options}. @end deffn @c FIXME::martin: Why aren't these procedure named like the other options diff --git a/doc/ref/scheme-options.texi b/doc/ref/scheme-options.texi index 12c49c3a8..e2ab70429 100644 --- a/doc/ref/scheme-options.texi +++ b/doc/ref/scheme-options.texi @@ -154,6 +154,7 @@ closure-hook #f Hook for printing closures. @node Evaluator options @section Evaluator options + These are the evaluator options with their default values, as they are printed by typing @code{(eval-options 'full)} in Guile. diff --git a/doc/ref/scheme-translation.texi b/doc/ref/scheme-translation.texi index e0e1aff41..4d398c60f 100644 --- a/doc/ref/scheme-translation.texi +++ b/doc/ref/scheme-translation.texi @@ -28,7 +28,7 @@ is Scheme's end-of-list. @deffnx {C Function} scm_nil_cons (x, y) Create a new cons cell with @var{x} as the car and @var{y} as the cdr, but convert @var{y} to Scheme's end-of-list if it is -a LISP nil. +a Lisp nil. @end deffn @deffn {Scheme Procedure} nil-eq x y From 04a98cff96351d0e3dd47a201592d84ba3edd688 Mon Sep 17 00:00:00 2001 From: Neil Jerram Date: Tue, 12 Mar 2002 21:12:25 +0000 Subject: [PATCH 072/131] * iselect.c (collisionp, gnfds, greadfds, gwritefds, gexceptfds, rreadfds, rwritefds, rexceptfds): Made static. * gc.c (terminating), fports.c (terminating): Renamed scm_i_terminating. --- libguile/ChangeLog | 8 ++++++++ libguile/fports.c | 4 ++-- libguile/gc.c | 4 ++-- libguile/iselect.c | 16 ++++++++-------- 4 files changed, 20 insertions(+), 12 deletions(-) diff --git a/libguile/ChangeLog b/libguile/ChangeLog index 812415ad4..2adb13d62 100644 --- a/libguile/ChangeLog +++ b/libguile/ChangeLog @@ -1,3 +1,11 @@ +2002-03-12 Neil Jerram + + * iselect.c (collisionp, gnfds, greadfds, gwritefds, gexceptfds, + rreadfds, rwritefds, rexceptfds): Made static. + + * gc.c (terminating), fports.c (terminating): Renamed + scm_i_terminating. + 2002-03-11 Marius Vollmer * numbers.c (scm_divide): Adapt code from libstdc++/f2c to void diff --git a/libguile/fports.c b/libguile/fports.c index 2fe0bee0c..55f4782a3 100644 --- a/libguile/fports.c +++ b/libguile/fports.c @@ -727,7 +727,7 @@ fport_write (SCM port, const void *data, size_t size) /* becomes 1 when process is exiting: normal exception handling won't work by this time. */ -extern int terminating; +extern int scm_i_terminating; static void fport_flush (SCM port) @@ -759,7 +759,7 @@ fport_flush (SCM port) } pt->write_pos = pt->write_buf + remaining; } - if (terminating) + if (scm_i_terminating) { const char *msg = "Error: could not flush file-descriptor "; char buf[11]; diff --git a/libguile/gc.c b/libguile/gc.c index 3da2861e1..a96e9df9c 100644 --- a/libguile/gc.c +++ b/libguile/gc.c @@ -2585,7 +2585,7 @@ scm_gc_unregister_roots (SCM *b, unsigned long n) scm_gc_unregister_root (p); } -int terminating; +int scm_i_terminating; /* called on process termination. */ #ifdef HAVE_ATEXIT @@ -2602,7 +2602,7 @@ cleanup (int status, void *arg) #endif #endif { - terminating = 1; + scm_i_terminating = 1; scm_flush_all_ports (); } diff --git a/libguile/iselect.c b/libguile/iselect.c index 2024f15f3..215258001 100644 --- a/libguile/iselect.c +++ b/libguile/iselect.c @@ -100,21 +100,21 @@ int scm_I_am_dead; /* This flag indicates that several threads are waiting on the same file descriptor. When this is the case, the common fd sets are updated in a more inefficient way. */ -int collisionp; +static int collisionp; /* These are the common fd sets. When new select calls are made, those sets are merged into these. */ -int gnfds; -SELECT_TYPE greadfds; -SELECT_TYPE gwritefds; -SELECT_TYPE gexceptfds; +static int gnfds; +static SELECT_TYPE greadfds; +static SELECT_TYPE gwritefds; +static SELECT_TYPE gexceptfds; /* These are the result sets. They are used when we call OS select. We couldn't use the common fd sets above, since that would destroy them. */ -SELECT_TYPE rreadfds; -SELECT_TYPE rwritefds; -SELECT_TYPE rexceptfds; +static SELECT_TYPE rreadfds; +static SELECT_TYPE rwritefds; +static SELECT_TYPE rexceptfds; /* Constant timeval struct representing a zero timeout which we use when polling. */ From efb378b01fca21fe3d569b5de02a532eba8782f3 Mon Sep 17 00:00:00 2001 From: Rob Browning Date: Tue, 12 Mar 2002 21:52:40 +0000 Subject: [PATCH 073/131] * guile-config.in (build-link): don't output -L/usr/lib. (build-compile): don't output -I/usr/include. --- guile-config/guile-config.in | 85 +++++++++++++++++++++--------------- 1 file changed, 50 insertions(+), 35 deletions(-) diff --git a/guile-config/guile-config.in b/guile-config/guile-config.in index 54ed9772e..ff3f08a7e 100644 --- a/guile-config/guile-config.in +++ b/guile-config/guile-config.in @@ -140,35 +140,45 @@ (string-append program-name " link: arguments to subcommand not yet implemented"))) - (let* ((flags - (let loop ((libs - ;; Get the string of linker flags we used to build - ;; Guile, and break it up into a list. - (separate-fields-discarding-char #\space - (get-build-info 'LIBS) - list))) - - (cond - ((null? libs) '()) - - ;; Turn any "FOO/libBAR.a" elements into "-lBAR". - ((match-lib (car libs)) - => (lambda (bar) - (cons (string-append "-l" bar) - (loop (cdr libs))))) - - ;; Remove any empty strings that may have seeped in there. - ((string=? (car libs) "") (loop (cdr libs))) - - (else (cons (car libs) (loop (cdr libs))))))) - - ;; Include libguile itself in the list, along with the - ;; directory it was installed in. - (flags (cons (string-append "-L" (get-build-info 'libdir)) - (cons "-lguile" flags)))) - + (let ((libdir (get-build-info 'libdir)) + (other-flags + (let loop ((libs + ;; Get the string of linker flags we used to build + ;; Guile, and break it up into a list. + (separate-fields-discarding-char #\space + (get-build-info 'LIBS) + list))) + + (cond + ((null? libs) '()) + + ;; Turn any "FOO/libBAR.a" elements into "-lBAR". + ((match-lib (car libs)) + => (lambda (bar) + (cons (string-append "-l" bar) + (loop (cdr libs))))) + + ;; Remove any empty strings that may have seeped in there. + ((string=? (car libs) "") (loop (cdr libs))) + + (else (cons (car libs) (loop (cdr libs)))))))) + + ;; Include libguile itself in the list, along with the directory + ;; it was installed in, but do *not* add /usr/lib since that may + ;; prevent other programs from specifying non-/usr/lib versions + ;; via their foo-config scripts. If *any* app puts -L/usr/lib in + ;; the output of its foo-config script then it may prevent the use + ;; a non-/usr/lib install of anything that also has a /usr/lib + ;; install. For now we hard-code /usr/lib, but later maybe we can + ;; do something more dynamic (i.e. what do we need. + ;; Display the flags, separated by spaces. - (display-separated flags) + (if (or (string=? libdir "/usr/lib") + (string=? libdir "/usr/lib/")) + (display-separated (cons "-lguile" other-flags)) + (display-separated (cons + (string-append "-L" (get-build-info 'libdir)) + (cons "-lguile" other-flags)))) (newline))) (define (help-link) @@ -191,7 +201,12 @@ (error (string-append program-name " compile: no arguments expected"))) - (display-line "-I" (get-build-info 'includedir))) + + ;; See gcc manual wrt fixincludes. Search for "Use of + ;; `-I/usr/include' may cause trouble." For now we hard-code this. + ;; Later maybe we can do something more dynamic. + (if (not (string=? (get-build-info 'includedir) "/usr/include")) + (display-line "-I" (get-build-info 'includedir)))) (define (help-compile) (let ((dle display-line-error)) @@ -258,12 +273,12 @@ (newline port)) (define (display-separated args) - (let loop ((args args)) - (cond ((null? args)) - ((null? (cdr args)) (display (car args))) - (else (display (car args)) - (display " ") - (loop (cdr args)))))) + (if (not (null? args)) + (begin + (display (car args)) + (for-each + (lambda (arg) (display " ") (display arg)) + (cdr args))))) ;;;; the command table From 56fd1933cc51d7e817bc0a1b515da8629c9c892f Mon Sep 17 00:00:00 2001 From: Rob Browning Date: Tue, 12 Mar 2002 21:53:56 +0000 Subject: [PATCH 074/131] * syncase.scm: fix bad let. (gensym): fix failure on non-threaded --- ice-9/syncase.scm | 39 +++++++++++++++++++++++++++++---------- 1 file changed, 29 insertions(+), 10 deletions(-) diff --git a/ice-9/syncase.scm b/ice-9/syncase.scm index dc8c321c7..1a2cc01c4 100644 --- a/ice-9/syncase.scm +++ b/ice-9/syncase.scm @@ -160,17 +160,36 @@ ;; (define gensym (let ((counter 0)) + + (define next-id + (if (provided? 'threads) + (let ((symlock (make-mutex))) + (lambda () + (let ((result #f)) + (with-mutex symlock + (set! result counter) + (set! counter (+ counter 1))) + result))) + ;; faster, non-threaded case. + (lambda () + (let ((result counter)) + (set! counter (+ counter 1)) + result)))) + + ;; actual gensym body code. (lambda (. rest) - (let ((val (number->string counter))) - (set! counter (+ counter 1)) - (cond - ((null? rest) - (string->symbol (string-append "syntmp-" val))) - ((null? (cdr rest)) - (string->symbol (string-append "syntmp-" (car rest) "-" val))) - (else - (error - "syncase's gensym called with the wrong number of arguments"))))))) + (let* ((next-val (next-id)) + (valstr (number->string next-val))) + (cond + ((null? rest) + (string->symbol (string-append "syntmp-" valstr))) + ((null? (cdr rest)) + (string->symbol (string-append "syntmp-" (car rest) "-" valstr))) + (else + (error + (string-append + "syncase's gensym expected 0 or 1 arguments, got " + (length rest))))))))) ;;; Load the preprocessed code From 21b83aabb2c479d333a8a4e3f719f3c177da3689 Mon Sep 17 00:00:00 2001 From: Neil Jerram Date: Tue, 12 Mar 2002 21:54:22 +0000 Subject: [PATCH 075/131] Automatic updates from snarfed libguile docstrings. --- doc/maint/ChangeLog | 4 + doc/maint/guile.texi | 810 +++++++++++++++++++++++++++++++++-- doc/ref/ChangeLog | 3 + doc/ref/new-docstrings.texi | 10 + doc/ref/scheme-compound.texi | 2 +- doc/ref/scheme-data.texi | 2 +- 6 files changed, 791 insertions(+), 40 deletions(-) diff --git a/doc/maint/ChangeLog b/doc/maint/ChangeLog index 3508a73be..013a5377d 100644 --- a/doc/maint/ChangeLog +++ b/doc/maint/ChangeLog @@ -1,3 +1,7 @@ +2002-03-12 Neil Jerram + + * guile.texi: Replaced by regenerated libguile version. + 2002-03-08 Neil Jerram * docstring.el (docstring-libguile-directory, diff --git a/doc/maint/guile.texi b/doc/maint/guile.texi index 1b7eb67c9..516591987 100644 --- a/doc/maint/guile.texi +++ b/doc/maint/guile.texi @@ -1,6 +1,6 @@ -@paragraphindent 0 acons +@c snarfed from alist.c:59 @deffn {Scheme Procedure} acons key value alist @deffnx {C Function} scm_acons (key, value, alist) Add a new key-value pair to @var{alist}. A new pair is @@ -10,6 +10,7 @@ function is @emph{not} destructive; @var{alist} is not modified. @end deffn sloppy-assq +@c snarfed from alist.c:73 @deffn {Scheme Procedure} sloppy-assq key alist @deffnx {C Function} scm_sloppy_assq (key, alist) Behaves like @code{assq} but does not do any error checking. @@ -17,6 +18,7 @@ Recommended only for use in Guile internals. @end deffn sloppy-assv +@c snarfed from alist.c:91 @deffn {Scheme Procedure} sloppy-assv key alist @deffnx {C Function} scm_sloppy_assv (key, alist) Behaves like @code{assv} but does not do any error checking. @@ -24,6 +26,7 @@ Recommended only for use in Guile internals. @end deffn sloppy-assoc +@c snarfed from alist.c:109 @deffn {Scheme Procedure} sloppy-assoc key alist @deffnx {C Function} scm_sloppy_assoc (key, alist) Behaves like @code{assoc} but does not do any error checking. @@ -31,6 +34,7 @@ Recommended only for use in Guile internals. @end deffn assq +@c snarfed from alist.c:136 @deffn {Scheme Procedure} assq key alist @deffnx {Scheme Procedure} assv key alist @deffnx {Scheme Procedure} assoc key alist @@ -45,18 +49,21 @@ return the entire alist entry found (i.e. both the key and the value). @end deffn assv +@c snarfed from alist.c:157 @deffn {Scheme Procedure} assv key alist @deffnx {C Function} scm_assv (key, alist) Behaves like @code{assq} but uses @code{eqv?} for key comparison. @end deffn assoc +@c snarfed from alist.c:178 @deffn {Scheme Procedure} assoc key alist @deffnx {C Function} scm_assoc (key, alist) Behaves like @code{assq} but uses @code{equal?} for key comparison. @end deffn assq-ref +@c snarfed from alist.c:222 @deffn {Scheme Procedure} assq-ref alist key @deffnx {Scheme Procedure} assv-ref alist key @deffnx {Scheme Procedure} assoc-ref alist key @@ -74,18 +81,21 @@ where @var{associator} is one of @code{assq}, @code{assv} or @code{assoc}. @end deffn assv-ref +@c snarfed from alist.c:239 @deffn {Scheme Procedure} assv-ref alist key @deffnx {C Function} scm_assv_ref (alist, key) Behaves like @code{assq-ref} but uses @code{eqv?} for key comparison. @end deffn assoc-ref +@c snarfed from alist.c:256 @deffn {Scheme Procedure} assoc-ref alist key @deffnx {C Function} scm_assoc_ref (alist, key) Behaves like @code{assq-ref} but uses @code{equal?} for key comparison. @end deffn assq-set! +@c snarfed from alist.c:285 @deffn {Scheme Procedure} assq-set! alist key val @deffnx {Scheme Procedure} assv-set! alist key value @deffnx {Scheme Procedure} assoc-set! alist key value @@ -101,18 +111,21 @@ association list. @end deffn assv-set! +@c snarfed from alist.c:303 @deffn {Scheme Procedure} assv-set! alist key val @deffnx {C Function} scm_assv_set_x (alist, key, val) Behaves like @code{assq-set!} but uses @code{eqv?} for key comparison. @end deffn assoc-set! +@c snarfed from alist.c:321 @deffn {Scheme Procedure} assoc-set! alist key val @deffnx {C Function} scm_assoc_set_x (alist, key, val) Behaves like @code{assq-set!} but uses @code{equal?} for key comparison. @end deffn assq-remove! +@c snarfed from alist.c:345 @deffn {Scheme Procedure} assq-remove! alist key @deffnx {Scheme Procedure} assv-remove! alist key @deffnx {Scheme Procedure} assoc-remove! alist key @@ -122,18 +135,21 @@ the resulting alist. @end deffn assv-remove! +@c snarfed from alist.c:361 @deffn {Scheme Procedure} assv-remove! alist key @deffnx {C Function} scm_assv_remove_x (alist, key) Behaves like @code{assq-remove!} but uses @code{eqv?} for key comparison. @end deffn assoc-remove! +@c snarfed from alist.c:377 @deffn {Scheme Procedure} assoc-remove! alist key @deffnx {C Function} scm_assoc_remove_x (alist, key) Behaves like @code{assq-remove!} but uses @code{equal?} for key comparison. @end deffn make-arbiter +@c snarfed from arbiters.c:82 @deffn {Scheme Procedure} make-arbiter name @deffnx {C Function} scm_make_arbiter (name) Return an object of type arbiter and name @var{name}. Its @@ -142,6 +158,7 @@ process synchronization. @end deffn try-arbiter +@c snarfed from arbiters.c:92 @deffn {Scheme Procedure} try-arbiter arb @deffnx {C Function} scm_try_arbiter (arb) Return @code{#t} and lock the arbiter @var{arb} if the arbiter @@ -149,6 +166,7 @@ was unlocked. Otherwise, return @code{#f}. @end deffn release-arbiter +@c snarfed from arbiters.c:113 @deffn {Scheme Procedure} release-arbiter arb @deffnx {C Function} scm_release_arbiter (arb) Return @code{#t} and unlock the arbiter @var{arb} if the @@ -156,12 +174,14 @@ arbiter was locked. Otherwise, return @code{#f}. @end deffn async +@c snarfed from async.c:289 @deffn {Scheme Procedure} async thunk @deffnx {C Function} scm_async (thunk) Create a new async for the procedure @var{thunk}. @end deffn system-async +@c snarfed from async.c:299 @deffn {Scheme Procedure} system-async thunk @deffnx {C Function} scm_system_async (thunk) Create a new async for the procedure @var{thunk}. Also @@ -169,24 +189,28 @@ add it to the system's list of active async objects. @end deffn async-mark +@c snarfed from async.c:310 @deffn {Scheme Procedure} async-mark a @deffnx {C Function} scm_async_mark (a) Mark the async @var{a} for future execution. @end deffn system-async-mark +@c snarfed from async.c:326 @deffn {Scheme Procedure} system-async-mark a @deffnx {C Function} scm_system_async_mark (a) Mark the async @var{a} for future execution. @end deffn run-asyncs +@c snarfed from async.c:351 @deffn {Scheme Procedure} run-asyncs list_of_a @deffnx {C Function} scm_run_asyncs (list_of_a) Execute all thunks from the asyncs of the list @var{list_of_a}. @end deffn noop +@c snarfed from async.c:385 @deffn {Scheme Procedure} noop . args @deffnx {C Function} scm_noop (args) Do nothing. When called without arguments, return @code{#f}, @@ -194,18 +218,21 @@ otherwise return the first argument. @end deffn unmask-signals +@c snarfed from async.c:437 @deffn {Scheme Procedure} unmask-signals @deffnx {C Function} scm_unmask_signals () Unmask signals. The returned value is not specified. @end deffn mask-signals +@c snarfed from async.c:448 @deffn {Scheme Procedure} mask-signals @deffnx {C Function} scm_mask_signals () Mask signals. The returned value is not specified. @end deffn display-error +@c snarfed from backtrace.c:266 @deffn {Scheme Procedure} display-error stack port subr message args rest @deffnx {C Function} scm_display_error (stack, port, subr, message, args, rest) Display an error message to the output port @var{port}. @@ -218,6 +245,7 @@ ignored. @end deffn display-application +@c snarfed from backtrace.c:402 @deffn {Scheme Procedure} display-application frame [port [indent]] @deffnx {C Function} scm_display_application (frame, port, indent) Display a procedure application @var{frame} to the output port @@ -226,6 +254,7 @@ output. @end deffn display-backtrace +@c snarfed from backtrace.c:713 @deffn {Scheme Procedure} display-backtrace stack port [first [depth]] @deffnx {C Function} scm_display_backtrace (stack, port, first, depth) Display a backtrace to the output port @var{port}. @var{stack} @@ -236,6 +265,7 @@ which means that default values will be used. @end deffn backtrace +@c snarfed from backtrace.c:736 @deffn {Scheme Procedure} backtrace @deffnx {C Function} scm_backtrace () Display a backtrace of the stack saved by the last error @@ -243,83 +273,97 @@ to the current output port. @end deffn not +@c snarfed from boolean.c:55 @deffn {Scheme Procedure} not x @deffnx {C Function} scm_not (x) Return @code{#t} iff @var{x} is @code{#f}, else return @code{#f}. @end deffn boolean? +@c snarfed from boolean.c:65 @deffn {Scheme Procedure} boolean? obj @deffnx {C Function} scm_boolean_p (obj) Return @code{#t} iff @var{obj} is either @code{#t} or @code{#f}. @end deffn char? +@c snarfed from chars.c:54 @deffn {Scheme Procedure} char? x @deffnx {C Function} scm_char_p (x) Return @code{#t} iff @var{x} is a character, else @code{#f}. @end deffn char=? +@c snarfed from chars.c:63 @deffn {Scheme Procedure} char=? x y Return @code{#t} iff @var{x} is the same character as @var{y}, else @code{#f}. @end deffn char? +@c snarfed from chars.c:100 @deffn {Scheme Procedure} char>? x y Return @code{#t} iff @var{x} is greater than @var{y} in the ASCII sequence, else @code{#f}. @end deffn char>=? +@c snarfed from chars.c:112 @deffn {Scheme Procedure} char>=? x y Return @code{#t} iff @var{x} is greater than or equal to @var{y} in the ASCII sequence, else @code{#f}. @end deffn char-ci=? +@c snarfed from chars.c:124 @deffn {Scheme Procedure} char-ci=? x y Return @code{#t} iff @var{x} is the same character as @var{y} ignoring case, else @code{#f}. @end deffn char-ci? +@c snarfed from chars.c:160 @deffn {Scheme Procedure} char-ci>? x y Return @code{#t} iff @var{x} is greater than @var{y} in the ASCII sequence ignoring case, else @code{#f}. @end deffn char-ci>=? +@c snarfed from chars.c:172 @deffn {Scheme Procedure} char-ci>=? x y Return @code{#t} iff @var{x} is greater than or equal to @var{y} in the ASCII sequence ignoring case, else @code{#f}. @end deffn char-alphabetic? +@c snarfed from chars.c:185 @deffn {Scheme Procedure} char-alphabetic? chr @deffnx {C Function} scm_char_alphabetic_p (chr) Return @code{#t} iff @var{chr} is alphabetic, else @code{#f}. @@ -327,6 +371,7 @@ Alphabetic means the same thing as the isalpha C library function. @end deffn char-numeric? +@c snarfed from chars.c:196 @deffn {Scheme Procedure} char-numeric? chr @deffnx {C Function} scm_char_numeric_p (chr) Return @code{#t} iff @var{chr} is numeric, else @code{#f}. @@ -334,6 +379,7 @@ Numeric means the same thing as the isdigit C library function. @end deffn char-whitespace? +@c snarfed from chars.c:207 @deffn {Scheme Procedure} char-whitespace? chr @deffnx {C Function} scm_char_whitespace_p (chr) Return @code{#t} iff @var{chr} is whitespace, else @code{#f}. @@ -341,6 +387,7 @@ Whitespace means the same thing as the isspace C library function. @end deffn char-upper-case? +@c snarfed from chars.c:220 @deffn {Scheme Procedure} char-upper-case? chr @deffnx {C Function} scm_char_upper_case_p (chr) Return @code{#t} iff @var{chr} is uppercase, else @code{#f}. @@ -348,6 +395,7 @@ Uppercase means the same thing as the isupper C library function. @end deffn char-lower-case? +@c snarfed from chars.c:232 @deffn {Scheme Procedure} char-lower-case? chr @deffnx {C Function} scm_char_lower_case_p (chr) Return @code{#t} iff @var{chr} is lowercase, else @code{#f}. @@ -355,6 +403,7 @@ Lowercase means the same thing as the islower C library function. @end deffn char-is-both? +@c snarfed from chars.c:246 @deffn {Scheme Procedure} char-is-both? chr @deffnx {C Function} scm_char_is_both_p (chr) Return @code{#t} iff @var{chr} is either uppercase or lowercase, else @code{#f}. @@ -363,6 +412,7 @@ C library functions. @end deffn char->integer +@c snarfed from chars.c:260 @deffn {Scheme Procedure} char->integer chr @deffnx {C Function} scm_char_to_integer (chr) Return the number corresponding to ordinal position of @var{chr} in the @@ -370,24 +420,28 @@ ASCII sequence. @end deffn integer->char +@c snarfed from chars.c:272 @deffn {Scheme Procedure} integer->char n @deffnx {C Function} scm_integer_to_char (n) Return the character at position @var{n} in the ASCII sequence. @end deffn char-upcase +@c snarfed from chars.c:283 @deffn {Scheme Procedure} char-upcase chr @deffnx {C Function} scm_char_upcase (chr) Return the uppercase character version of @var{chr}. @end deffn char-downcase +@c snarfed from chars.c:294 @deffn {Scheme Procedure} char-downcase chr @deffnx {C Function} scm_char_downcase (chr) Return the lowercase character version of @var{chr}. @end deffn debug-options-interface +@c snarfed from debug.c:79 @deffn {Scheme Procedure} debug-options-interface [setting] @deffnx {C Function} scm_debug_options (setting) Option interface for the debug options. Instead of using @@ -396,48 +450,56 @@ this procedure directly, use the procedures @code{debug-enable}, @end deffn with-traps +@c snarfed from debug.c:127 @deffn {Scheme Procedure} with-traps thunk @deffnx {C Function} scm_with_traps (thunk) Call @var{thunk} with traps enabled. @end deffn memoized? +@c snarfed from debug.c:169 @deffn {Scheme Procedure} memoized? obj @deffnx {C Function} scm_memoized_p (obj) Return @code{#t} if @var{obj} is memoized. @end deffn unmemoize +@c snarfed from debug.c:333 @deffn {Scheme Procedure} unmemoize m @deffnx {C Function} scm_unmemoize (m) Unmemoize the memoized expression @var{m}, @end deffn memoized-environment +@c snarfed from debug.c:343 @deffn {Scheme Procedure} memoized-environment m @deffnx {C Function} scm_memoized_environment (m) Return the environment of the memoized expression @var{m}. @end deffn procedure-name +@c snarfed from debug.c:353 @deffn {Scheme Procedure} procedure-name proc @deffnx {C Function} scm_procedure_name (proc) Return the name of the procedure @var{proc} @end deffn procedure-source +@c snarfed from debug.c:379 @deffn {Scheme Procedure} procedure-source proc @deffnx {C Function} scm_procedure_source (proc) Return the source of the procedure @var{proc}. @end deffn procedure-environment +@c snarfed from debug.c:412 @deffn {Scheme Procedure} procedure-environment proc @deffnx {C Function} scm_procedure_environment (proc) Return the environment of the procedure @var{proc}. @end deffn local-eval +@c snarfed from debug.c:444 @deffn {Scheme Procedure} local-eval exp [env] @deffnx {C Function} scm_local_eval (exp, env) Evaluate @var{exp} in its environment. If @var{env} is supplied, @@ -447,12 +509,14 @@ is implicit). @end deffn debug-object? +@c snarfed from debug.c:531 @deffn {Scheme Procedure} debug-object? obj @deffnx {C Function} scm_debug_object_p (obj) Return @code{#t} if @var{obj} is a debug object. @end deffn dynamic-link +@c snarfed from dynl.c:266 @deffn {Scheme Procedure} dynamic-link filename @deffnx {C Function} scm_dynamic_link (filename) Open the dynamic library called @var{filename}. A library @@ -462,6 +526,7 @@ functions. @end deffn dynamic-object? +@c snarfed from dynl.c:281 @deffn {Scheme Procedure} dynamic-object? obj @deffnx {C Function} scm_dynamic_object_p (obj) Return @code{#t} if @var{obj} is a dynamic library handle, or @code{#f} @@ -469,6 +534,7 @@ otherwise. @end deffn dynamic-unlink +@c snarfed from dynl.c:294 @deffn {Scheme Procedure} dynamic-unlink dobj @deffnx {C Function} scm_dynamic_unlink (dobj) Unlink the indicated object file from the application. The @@ -478,6 +544,7 @@ called on @var{dobj}, its content is no longer accessible. @end deffn dynamic-func +@c snarfed from dynl.c:321 @deffn {Scheme Procedure} dynamic-func name dobj @deffnx {C Function} scm_dynamic_func (name, dobj) Search the dynamic object @var{dobj} for the C function @@ -492,6 +559,7 @@ needed or not and will add it when necessary. @end deffn dynamic-call +@c snarfed from dynl.c:360 @deffn {Scheme Procedure} dynamic-call func dobj @deffnx {C Function} scm_dynamic_call (func, dobj) Call the C function indicated by @var{func} and @var{dobj}. @@ -509,6 +577,7 @@ Interrupts are deferred while the C function is executing (with @end deffn dynamic-args-call +@c snarfed from dynl.c:388 @deffn {Scheme Procedure} dynamic-args-call func dobj args @deffnx {C Function} scm_dynamic_args_call (func, dobj, args) Call the C function indicated by @var{func} and @var{dobj}, @@ -527,6 +596,7 @@ converted to a Scheme number and returned from the call to @end deffn dynamic-wind +@c snarfed from dynwind.c:119 @deffn {Scheme Procedure} dynamic-wind in_guard thunk out_guard @deffnx {C Function} scm_dynamic_wind (in_guard, thunk, out_guard) All three arguments must be 0-argument procedures. @@ -580,6 +650,7 @@ a-cont @end deffn environment? +@c snarfed from environments.c:129 @deffn {Scheme Procedure} environment? obj @deffnx {C Function} scm_environment_p (obj) Return @code{#t} if @var{obj} is an environment, or @code{#f} @@ -587,6 +658,7 @@ otherwise. @end deffn environment-bound? +@c snarfed from environments.c:140 @deffn {Scheme Procedure} environment-bound? env sym @deffnx {C Function} scm_environment_bound_p (env, sym) Return @code{#t} if @var{sym} is bound in @var{env}, or @@ -594,6 +666,7 @@ Return @code{#t} if @var{sym} is bound in @var{env}, or @end deffn environment-ref +@c snarfed from environments.c:155 @deffn {Scheme Procedure} environment-ref env sym @deffnx {C Function} scm_environment_ref (env, sym) Return the value of the location bound to @var{sym} in @@ -602,6 +675,7 @@ Return the value of the location bound to @var{sym} in @end deffn environment-fold +@c snarfed from environments.c:225 @deffn {Scheme Procedure} environment-fold env proc init @deffnx {C Function} scm_environment_fold (env, proc, init) Iterate over all the bindings in @var{env}, accumulating some @@ -638,6 +712,7 @@ using environment-fold: @end deffn environment-define +@c snarfed from environments.c:260 @deffn {Scheme Procedure} environment-define env sym val @deffnx {C Function} scm_environment_define (env, sym, val) Bind @var{sym} to a new location containing @var{val} in @@ -650,6 +725,7 @@ immutable, signal an @code{environment:immutable-binding} error. @end deffn environment-undefine +@c snarfed from environments.c:286 @deffn {Scheme Procedure} environment-undefine env sym @deffnx {C Function} scm_environment_undefine (env, sym) Remove any binding for @var{sym} from @var{env}. If @var{sym} @@ -660,6 +736,7 @@ immutable, signal an @code{environment:immutable-binding} error. @end deffn environment-set! +@c snarfed from environments.c:314 @deffn {Scheme Procedure} environment-set! env sym val @deffnx {C Function} scm_environment_set_x (env, sym, val) If @var{env} binds @var{sym} to some location, change that @@ -672,6 +749,7 @@ to an immutable location, signal an @end deffn environment-cell +@c snarfed from environments.c:349 @deffn {Scheme Procedure} environment-cell env sym for_write @deffnx {C Function} scm_environment_cell (env, sym, for_write) Return the value cell which @var{env} binds to @var{sym}, or @@ -689,6 +767,7 @@ re-bound to a new value cell, or becomes undefined. @end deffn environment-observe +@c snarfed from environments.c:401 @deffn {Scheme Procedure} environment-observe env proc @deffnx {C Function} scm_environment_observe (env, proc) Whenever @var{env}'s bindings change, apply @var{proc} to @@ -700,6 +779,7 @@ token is unspecified. @end deffn environment-observe-weak +@c snarfed from environments.c:418 @deffn {Scheme Procedure} environment-observe-weak env proc @deffnx {C Function} scm_environment_observe_weak (env, proc) This function is the same as environment-observe, except that @@ -711,6 +791,7 @@ list of observing procedures. @end deffn environment-unobserve +@c snarfed from environments.c:454 @deffn {Scheme Procedure} environment-unobserve token @deffnx {C Function} scm_environment_unobserve (token) Cancel the observation request which returned the value @@ -722,6 +803,7 @@ bindings change. @end deffn make-leaf-environment +@c snarfed from environments.c:1031 @deffn {Scheme Procedure} make-leaf-environment @deffnx {C Function} scm_make_leaf_environment () Create a new leaf environment, containing no bindings. @@ -730,6 +812,7 @@ will be mutable. @end deffn leaf-environment? +@c snarfed from environments.c:1054 @deffn {Scheme Procedure} leaf-environment? object @deffnx {C Function} scm_leaf_environment_p (object) Return @code{#t} if object is a leaf environment, or @code{#f} @@ -737,6 +820,7 @@ otherwise. @end deffn make-eval-environment +@c snarfed from environments.c:1419 @deffn {Scheme Procedure} make-eval-environment local imported @deffnx {C Function} scm_make_eval_environment (local, imported) Return a new environment object eval whose bindings are the @@ -763,6 +847,7 @@ In typical use, @var{local} will be a finite environment, and @end deffn eval-environment? +@c snarfed from environments.c:1456 @deffn {Scheme Procedure} eval-environment? object @deffnx {C Function} scm_eval_environment_p (object) Return @code{#t} if object is an eval environment, or @code{#f} @@ -770,30 +855,35 @@ otherwise. @end deffn eval-environment-local +@c snarfed from environments.c:1466 @deffn {Scheme Procedure} eval-environment-local env @deffnx {C Function} scm_eval_environment_local (env) Return the local environment of eval environment @var{env}. @end deffn eval-environment-set-local! +@c snarfed from environments.c:1478 @deffn {Scheme Procedure} eval-environment-set-local! env local @deffnx {C Function} scm_eval_environment_set_local_x (env, local) Change @var{env}'s local environment to @var{local}. @end deffn eval-environment-imported +@c snarfed from environments.c:1504 @deffn {Scheme Procedure} eval-environment-imported env @deffnx {C Function} scm_eval_environment_imported (env) Return the imported environment of eval environment @var{env}. @end deffn eval-environment-set-imported! +@c snarfed from environments.c:1516 @deffn {Scheme Procedure} eval-environment-set-imported! env imported @deffnx {C Function} scm_eval_environment_set_imported_x (env, imported) Change @var{env}'s imported environment to @var{imported}. @end deffn make-import-environment +@c snarfed from environments.c:1839 @deffn {Scheme Procedure} make-import-environment imports conflict_proc @deffnx {C Function} scm_make_import_environment (imports, conflict_proc) Return a new environment @var{imp} whose bindings are the union @@ -824,6 +914,7 @@ if one of its imported environments changes. @end deffn import-environment? +@c snarfed from environments.c:1868 @deffn {Scheme Procedure} import-environment? object @deffnx {C Function} scm_import_environment_p (object) Return @code{#t} if object is an import environment, or @@ -831,6 +922,7 @@ Return @code{#t} if object is an import environment, or @end deffn import-environment-imports +@c snarfed from environments.c:1879 @deffn {Scheme Procedure} import-environment-imports env @deffnx {C Function} scm_import_environment_imports (env) Return the list of environments imported by the import @@ -838,6 +930,7 @@ environment @var{env}. @end deffn import-environment-set-imports! +@c snarfed from environments.c:1892 @deffn {Scheme Procedure} import-environment-set-imports! env imports @deffnx {C Function} scm_import_environment_set_imports_x (env, imports) Change @var{env}'s list of imported environments to @@ -845,6 +938,7 @@ Change @var{env}'s list of imported environments to @end deffn make-export-environment +@c snarfed from environments.c:2159 @deffn {Scheme Procedure} make-export-environment private signature @deffnx {C Function} scm_make_export_environment (private, signature) Return a new environment @var{exp} containing only those @@ -894,6 +988,7 @@ if the bindings in private change. @end deffn export-environment? +@c snarfed from environments.c:2194 @deffn {Scheme Procedure} export-environment? object @deffnx {C Function} scm_export_environment_p (object) Return @code{#t} if object is an export environment, or @@ -901,30 +996,35 @@ Return @code{#t} if object is an export environment, or @end deffn export-environment-private +@c snarfed from environments.c:2204 @deffn {Scheme Procedure} export-environment-private env @deffnx {C Function} scm_export_environment_private (env) Return the private environment of export environment @var{env}. @end deffn export-environment-set-private! +@c snarfed from environments.c:2216 @deffn {Scheme Procedure} export-environment-set-private! env private @deffnx {C Function} scm_export_environment_set_private_x (env, private) Change the private environment of export environment @var{env}. @end deffn export-environment-signature +@c snarfed from environments.c:2238 @deffn {Scheme Procedure} export-environment-signature env @deffnx {C Function} scm_export_environment_signature (env) Return the signature of export environment @var{env}. @end deffn export-environment-set-signature! +@c snarfed from environments.c:2312 @deffn {Scheme Procedure} export-environment-set-signature! env signature @deffnx {C Function} scm_export_environment_set_signature_x (env, signature) Change the signature of export environment @var{env}. @end deffn eq? +@c snarfed from eq.c:62 @deffn {Scheme Procedure} eq? x y Return @code{#t} iff @var{x} references the same object as @var{y}. @code{eq?} is similar to @code{eqv?} except that in some cases it is @@ -933,6 +1033,7 @@ capable of discerning distinctions finer than those detectable by @end deffn eqv? +@c snarfed from eq.c:76 @deffn {Scheme Procedure} eqv? x y The @code{eqv?} procedure defines a useful equivalence relation on objects. Briefly, it returns @code{#t} if @var{x} and @var{y} should normally be @@ -942,6 +1043,7 @@ and inexact numbers. @end deffn equal? +@c snarfed from eq.c:125 @deffn {Scheme Procedure} equal? x y Return @code{#t} iff @var{x} and @var{y} are recursively @code{eqv?} equivalent. @code{equal?} recursively compares the contents of pairs, @@ -952,6 +1054,7 @@ terminate if its arguments are circular data structures. @end deffn scm-error +@c snarfed from error.c:117 @deffn {Scheme Procedure} scm-error key subr message args data @deffnx {C Function} scm_error_scm (key, subr, message, args, data) Raise an error with key @var{key}. @var{subr} can be a string @@ -970,6 +1073,7 @@ it will usually be @code{#f}. @end deffn strerror +@c snarfed from error.c:168 @deffn {Scheme Procedure} strerror err @deffnx {C Function} scm_strerror (err) Return the Unix error message corresponding to @var{err}, which @@ -977,6 +1081,7 @@ must be an integer value. @end deffn apply:nconc2last +@c snarfed from eval.c:3485 @deffn {Scheme Procedure} apply:nconc2last lst @deffnx {C Function} scm_nconc2last (lst) Given a list (@var{arg1} @dots{} @var{args}), this function @@ -989,6 +1094,7 @@ destroys its argument, so use with care. @end deffn force +@c snarfed from eval.c:4021 @deffn {Scheme Procedure} force x @deffnx {C Function} scm_force (x) If the promise @var{x} has not been computed yet, compute and @@ -997,6 +1103,7 @@ value. @end deffn promise? +@c snarfed from eval.c:4044 @deffn {Scheme Procedure} promise? obj @deffnx {C Function} scm_promise_p (obj) Return true if @var{obj} is a promise, i.e. a delayed computation @@ -1004,6 +1111,7 @@ Return true if @var{obj} is a promise, i.e. a delayed computation @end deffn cons-source +@c snarfed from eval.c:4056 @deffn {Scheme Procedure} cons-source xorig x y @deffnx {C Function} scm_cons_source (xorig, x, y) Create and return a new pair whose car and cdr are @var{x} and @var{y}. @@ -1012,6 +1120,7 @@ with the new pair. @end deffn copy-tree +@c snarfed from eval.c:4076 @deffn {Scheme Procedure} copy-tree obj @deffnx {C Function} scm_copy_tree (obj) Recursively copy the data tree that is bound to @var{obj}, and return a @@ -1022,6 +1131,7 @@ any other object. @end deffn primitive-eval +@c snarfed from eval.c:4169 @deffn {Scheme Procedure} primitive-eval exp @deffnx {C Function} scm_primitive_eval (exp) Evaluate @var{exp} in the top-level environment specified by @@ -1029,6 +1139,7 @@ the current module. @end deffn eval +@c snarfed from eval.c:4238 @deffn {Scheme Procedure} eval exp module @deffnx {C Function} scm_eval (exp, module) Evaluate @var{exp}, a list representing a Scheme expression, @@ -1039,6 +1150,7 @@ is reset to its previous value when @var{eval} returns. @end deffn eval-options-interface +@c snarfed from eval.c:1782 @deffn {Scheme Procedure} eval-options-interface [setting] @deffnx {C Function} scm_eval_options_interface (setting) Option interface for the evaluation options. Instead of using @@ -1047,23 +1159,27 @@ this procedure directly, use the procedures @code{eval-enable}, @end deffn evaluator-traps-interface +@c snarfed from eval.c:1799 @deffn {Scheme Procedure} evaluator-traps-interface [setting] @deffnx {C Function} scm_evaluator_traps (setting) Option interface for the evaluator trap options. @end deffn defined? +@c snarfed from evalext.c:75 @deffn {Scheme Procedure} defined? sym [env] @deffnx {C Function} scm_definedp (sym, env) Return @code{#t} if @var{sym} is defined in the lexical environment @var{env}. When @var{env} is not specified, look in the top-level environment as defined by the current module. @end deffn map-in-order +@c snarfed from evalext.c:144 @deffn {Scheme Procedure} map-in-order implemented by the C function "scm_map" @end deffn load-extension +@c snarfed from extensions.c:152 @deffn {Scheme Procedure} load-extension lib init @deffnx {C Function} scm_load_extension (lib, init) Load and initialize the extension designated by LIB and INIT. @@ -1103,6 +1219,7 @@ well. For example, @end deffn program-arguments +@c snarfed from feature.c:77 @deffn {Scheme Procedure} program-arguments @deffnx {Scheme Procedure} command-line @deffnx {C Function} scm_program_arguments () @@ -1113,6 +1230,7 @@ options like @code{-e} and @code{-l}. @end deffn make-fluid +@c snarfed from fluids.c:124 @deffn {Scheme Procedure} make-fluid @deffnx {C Function} scm_make_fluid () Return a newly created fluid. @@ -1125,6 +1243,7 @@ in its own dynamic root, you can use fluids for thread local storage. @end deffn fluid? +@c snarfed from fluids.c:137 @deffn {Scheme Procedure} fluid? obj @deffnx {C Function} scm_fluid_p (obj) Return @code{#t} iff @var{obj} is a fluid; otherwise, return @@ -1132,6 +1251,7 @@ Return @code{#t} iff @var{obj} is a fluid; otherwise, return @end deffn fluid-ref +@c snarfed from fluids.c:148 @deffn {Scheme Procedure} fluid-ref fluid @deffnx {C Function} scm_fluid_ref (fluid) Return the value associated with @var{fluid} in the current @@ -1140,12 +1260,14 @@ dynamic root. If @var{fluid} has not been set, then return @end deffn fluid-set! +@c snarfed from fluids.c:164 @deffn {Scheme Procedure} fluid-set! fluid value @deffnx {C Function} scm_fluid_set_x (fluid, value) Set the value associated with @var{fluid} in the current dynamic root. @end deffn with-fluids* +@c snarfed from fluids.c:223 @deffn {Scheme Procedure} with-fluids* fluids values thunk @deffnx {C Function} scm_with_fluids (fluids, values, thunk) Set @var{fluids} to @var{values} temporary, and call @var{thunk}. @@ -1155,6 +1277,7 @@ one after another. @var{thunk} must be a procedure with no argument. @end deffn setvbuf +@c snarfed from fports.c:156 @deffn {Scheme Procedure} setvbuf port mode [size] @deffnx {C Function} scm_setvbuf (port, mode, size) Set the buffering mode for @var{port}. @var{mode} can be: @@ -1170,12 +1293,14 @@ If @var{size} is omitted, a default size will be used. @end deffn file-port? +@c snarfed from fports.c:245 @deffn {Scheme Procedure} file-port? obj @deffnx {C Function} scm_file_port_p (obj) Determine whether @var{obj} is a port that is related to a file. @end deffn open-file +@c snarfed from fports.c:299 @deffn {Scheme Procedure} open-file filename mode @deffnx {C Function} scm_open_file (filename, mode) Open the file whose name is @var{filename}, and return a port @@ -1218,6 +1343,7 @@ requested, @code{open-file} throws an exception. @end deffn gc-stats +@c snarfed from gc.c:735 @deffn {Scheme Procedure} gc-stats @deffnx {C Function} scm_gc_stats () Return an association list of statistics about Guile's current @@ -1225,6 +1351,7 @@ use of storage. @end deffn object-address +@c snarfed from gc.c:832 @deffn {Scheme Procedure} object-address obj @deffnx {C Function} scm_object_address (obj) Return an integer that for the lifetime of @var{obj} is uniquely @@ -1232,6 +1359,7 @@ returned by this function for @var{obj} @end deffn gc +@c snarfed from gc.c:843 @deffn {Scheme Procedure} gc @deffnx {C Function} scm_gc () Scans all of SCM objects and reclaims for further use those that are @@ -1239,6 +1367,7 @@ no longer accessible. @end deffn %compute-slots +@c snarfed from goops.c:291 @deffn {Scheme Procedure} %compute-slots class @deffnx {C Function} scm_sys_compute_slots (class) Return a list consisting of the names of all slots belonging to @@ -1247,6 +1376,7 @@ its superclasses. @end deffn get-keyword +@c snarfed from goops.c:376 @deffn {Scheme Procedure} get-keyword key l default_value @deffnx {C Function} scm_get_keyword (key, l, default_value) Determine an associated value for the keyword @var{key} from @@ -1258,6 +1388,7 @@ If @var{l} does not hold a value for @var{key}, the value @end deffn %initialize-object +@c snarfed from goops.c:399 @deffn {Scheme Procedure} %initialize-object obj initargs @deffnx {C Function} scm_sys_initialize_object (obj, initargs) Initialize the object @var{obj} with the given arguments @@ -1265,126 +1396,147 @@ Initialize the object @var{obj} with the given arguments @end deffn %prep-layout! +@c snarfed from goops.c:479 @deffn {Scheme Procedure} %prep-layout! class @deffnx {C Function} scm_sys_prep_layout_x (class) @end deffn %inherit-magic! +@c snarfed from goops.c:556 @deffn {Scheme Procedure} %inherit-magic! class dsupers @deffnx {C Function} scm_sys_inherit_magic_x (class, dsupers) @end deffn instance? +@c snarfed from goops.c:799 @deffn {Scheme Procedure} instance? obj @deffnx {C Function} scm_instance_p (obj) Return @code{#t} if @var{obj} is an instance. @end deffn class-name +@c snarfed from goops.c:814 @deffn {Scheme Procedure} class-name obj @deffnx {C Function} scm_class_name (obj) Return the class name of @var{obj}. @end deffn class-direct-supers +@c snarfed from goops.c:824 @deffn {Scheme Procedure} class-direct-supers obj @deffnx {C Function} scm_class_direct_supers (obj) Return the direct superclasses of the class @var{obj}. @end deffn class-direct-slots +@c snarfed from goops.c:834 @deffn {Scheme Procedure} class-direct-slots obj @deffnx {C Function} scm_class_direct_slots (obj) Return the direct slots of the class @var{obj}. @end deffn class-direct-subclasses +@c snarfed from goops.c:844 @deffn {Scheme Procedure} class-direct-subclasses obj @deffnx {C Function} scm_class_direct_subclasses (obj) Return the direct subclasses of the class @var{obj}. @end deffn class-direct-methods +@c snarfed from goops.c:854 @deffn {Scheme Procedure} class-direct-methods obj @deffnx {C Function} scm_class_direct_methods (obj) Return the direct methods of the class @var{obj} @end deffn class-precedence-list +@c snarfed from goops.c:864 @deffn {Scheme Procedure} class-precedence-list obj @deffnx {C Function} scm_class_precedence_list (obj) Return the class precedence list of the class @var{obj}. @end deffn class-slots +@c snarfed from goops.c:874 @deffn {Scheme Procedure} class-slots obj @deffnx {C Function} scm_class_slots (obj) Return the slot list of the class @var{obj}. @end deffn class-environment +@c snarfed from goops.c:884 @deffn {Scheme Procedure} class-environment obj @deffnx {C Function} scm_class_environment (obj) Return the environment of the class @var{obj}. @end deffn generic-function-name +@c snarfed from goops.c:895 @deffn {Scheme Procedure} generic-function-name obj @deffnx {C Function} scm_generic_function_name (obj) Return the name of the generic function @var{obj}. @end deffn generic-function-methods +@c snarfed from goops.c:905 @deffn {Scheme Procedure} generic-function-methods obj @deffnx {C Function} scm_generic_function_methods (obj) Return the methods of the generic function @var{obj}. @end deffn method-generic-function +@c snarfed from goops.c:916 @deffn {Scheme Procedure} method-generic-function obj @deffnx {C Function} scm_method_generic_function (obj) Return the generic function fot the method @var{obj}. @end deffn method-specializers +@c snarfed from goops.c:926 @deffn {Scheme Procedure} method-specializers obj @deffnx {C Function} scm_method_specializers (obj) Return specializers of the method @var{obj}. @end deffn method-procedure +@c snarfed from goops.c:936 @deffn {Scheme Procedure} method-procedure obj @deffnx {C Function} scm_method_procedure (obj) Return the procedure of the method @var{obj}. @end deffn accessor-method-slot-definition +@c snarfed from goops.c:946 @deffn {Scheme Procedure} accessor-method-slot-definition obj @deffnx {C Function} scm_accessor_method_slot_definition (obj) Return the slot definition of the accessor @var{obj}. @end deffn %tag-body +@c snarfed from goops.c:956 @deffn {Scheme Procedure} %tag-body body @deffnx {C Function} scm_sys_tag_body (body) Internal GOOPS magic---don't use this function! @end deffn make-unbound +@c snarfed from goops.c:971 @deffn {Scheme Procedure} make-unbound @deffnx {C Function} scm_make_unbound () Return the unbound value. @end deffn unbound? +@c snarfed from goops.c:980 @deffn {Scheme Procedure} unbound? obj @deffnx {C Function} scm_unbound_p (obj) Return @code{#t} if @var{obj} is unbound. @end deffn assert-bound +@c snarfed from goops.c:990 @deffn {Scheme Procedure} assert-bound value obj @deffnx {C Function} scm_assert_bound (value, obj) Return @var{value} if it is bound, and invoke the @@ -1392,6 +1544,7 @@ Return @var{value} if it is bound, and invoke the @end deffn @@assert-bound-ref +@c snarfed from goops.c:1002 @deffn {Scheme Procedure} @@assert-bound-ref obj index @deffnx {C Function} scm_at_assert_bound_ref (obj, index) Like @code{assert-bound}, but use @var{index} for accessing @@ -1399,12 +1552,14 @@ the value from @var{obj}. @end deffn %fast-slot-ref +@c snarfed from goops.c:1014 @deffn {Scheme Procedure} %fast-slot-ref obj index @deffnx {C Function} scm_sys_fast_slot_ref (obj, index) Return the slot value with index @var{index} from @var{obj}. @end deffn %fast-slot-set! +@c snarfed from goops.c:1032 @deffn {Scheme Procedure} %fast-slot-set! obj index value @deffnx {C Function} scm_sys_fast_slot_set_x (obj, index, value) Set the slot with index @var{index} in @var{obj} to @@ -1412,30 +1567,35 @@ Set the slot with index @var{index} in @var{obj} to @end deffn slot-ref-using-class +@c snarfed from goops.c:1162 @deffn {Scheme Procedure} slot-ref-using-class class obj slot_name @deffnx {C Function} scm_slot_ref_using_class (class, obj, slot_name) @end deffn slot-set-using-class! +@c snarfed from goops.c:1181 @deffn {Scheme Procedure} slot-set-using-class! class obj slot_name value @deffnx {C Function} scm_slot_set_using_class_x (class, obj, slot_name, value) @end deffn slot-bound-using-class? +@c snarfed from goops.c:1195 @deffn {Scheme Procedure} slot-bound-using-class? class obj slot_name @deffnx {C Function} scm_slot_bound_using_class_p (class, obj, slot_name) @end deffn slot-exists-using-class? +@c snarfed from goops.c:1210 @deffn {Scheme Procedure} slot-exists-using-class? class obj slot_name @deffnx {C Function} scm_slot_exists_using_class_p (class, obj, slot_name) @end deffn slot-ref +@c snarfed from goops.c:1226 @deffn {Scheme Procedure} slot-ref obj slot_name @deffnx {C Function} scm_slot_ref (obj, slot_name) Return the value from @var{obj}'s slot with the name @@ -1443,12 +1603,14 @@ Return the value from @var{obj}'s slot with the name @end deffn slot-set! +@c snarfed from goops.c:1243 @deffn {Scheme Procedure} slot-set! obj slot_name value @deffnx {C Function} scm_slot_set_x (obj, slot_name, value) Set the slot named @var{slot_name} of @var{obj} to @var{value}. @end deffn slot-bound? +@c snarfed from goops.c:1260 @deffn {Scheme Procedure} slot-bound? obj slot_name @deffnx {C Function} scm_slot_bound_p (obj, slot_name) Return @code{#t} if the slot named @var{slot_name} of @var{obj} @@ -1456,12 +1618,14 @@ is bound. @end deffn slot-exists? +@c snarfed from goops.c:1278 @deffn {Scheme Procedure} slot-exists? obj slot_name @deffnx {C Function} scm_slots_exists_p (obj, slot_name) Return @code{#t} if @var{obj} has a slot named @var{slot_name}. @end deffn %allocate-instance +@c snarfed from goops.c:1317 @deffn {Scheme Procedure} %allocate-instance class initargs @deffnx {C Function} scm_sys_allocate_instance (class, initargs) Create a new instance of class @var{class} and initialize it @@ -1469,54 +1633,63 @@ from the arguments @var{initargs}. @end deffn %set-object-setter! +@c snarfed from goops.c:1387 @deffn {Scheme Procedure} %set-object-setter! obj setter @deffnx {C Function} scm_sys_set_object_setter_x (obj, setter) @end deffn %modify-instance +@c snarfed from goops.c:1412 @deffn {Scheme Procedure} %modify-instance old new @deffnx {C Function} scm_sys_modify_instance (old, new) @end deffn %modify-class +@c snarfed from goops.c:1438 @deffn {Scheme Procedure} %modify-class old new @deffnx {C Function} scm_sys_modify_class (old, new) @end deffn %invalidate-class +@c snarfed from goops.c:1462 @deffn {Scheme Procedure} %invalidate-class class @deffnx {C Function} scm_sys_invalidate_class (class) @end deffn %invalidate-method-cache! +@c snarfed from goops.c:1589 @deffn {Scheme Procedure} %invalidate-method-cache! gf @deffnx {C Function} scm_sys_invalidate_method_cache_x (gf) @end deffn generic-capability? +@c snarfed from goops.c:1615 @deffn {Scheme Procedure} generic-capability? proc @deffnx {C Function} scm_generic_capability_p (proc) @end deffn enable-primitive-generic! +@c snarfed from goops.c:1628 @deffn {Scheme Procedure} enable-primitive-generic! . subrs @deffnx {C Function} scm_enable_primitive_generic_x (subrs) @end deffn primitive-generic-generic +@c snarfed from goops.c:1649 @deffn {Scheme Procedure} primitive-generic-generic subr @deffnx {C Function} scm_primitive_generic_generic (subr) @end deffn make +@c snarfed from goops.c:2010 @deffn {Scheme Procedure} make . args @deffnx {C Function} scm_make (args) Make a new object. @var{args} must contain the class and @@ -1524,18 +1697,21 @@ all necessary initialization information. @end deffn find-method +@c snarfed from goops.c:2103 @deffn {Scheme Procedure} find-method . l @deffnx {C Function} scm_find_method (l) @end deffn %method-more-specific? +@c snarfed from goops.c:2123 @deffn {Scheme Procedure} %method-more-specific? m1 m2 targs @deffnx {C Function} scm_sys_method_more_specific_p (m1, m2, targs) @end deffn %goops-loaded +@c snarfed from goops.c:2648 @deffn {Scheme Procedure} %goops-loaded @deffnx {C Function} scm_sys_goops_loaded () Announce that GOOPS is loaded and perform initialization @@ -1543,6 +1719,7 @@ on the C level which depends on the loaded GOOPS modules. @end deffn make-guardian +@c snarfed from guardians.c:330 @deffn {Scheme Procedure} make-guardian [greedy_p] @deffnx {C Function} scm_make_guardian (greedy_p) Create a new guardian. @@ -1573,18 +1750,21 @@ paper still (mostly) accurately describes the interface). @end deffn guardian-destroyed? +@c snarfed from guardians.c:358 @deffn {Scheme Procedure} guardian-destroyed? guardian @deffnx {C Function} scm_guardian_destroyed_p (guardian) Return @code{#t} if @var{guardian} has been destroyed, otherwise @code{#f}. @end deffn guardian-greedy? +@c snarfed from guardians.c:376 @deffn {Scheme Procedure} guardian-greedy? guardian @deffnx {C Function} scm_guardian_greedy_p (guardian) Return @code{#t} if @var{guardian} is a greedy guardian, otherwise @code{#f}. @end deffn destroy-guardian! +@c snarfed from guardians.c:387 @deffn {Scheme Procedure} destroy-guardian! guardian @deffnx {C Function} scm_destroy_guardian_x (guardian) Destroys @var{guardian}, by making it impossible to put any more @@ -1593,6 +1773,7 @@ objects guarded by @var{guardian}. @end deffn hashq +@c snarfed from hash.c:200 @deffn {Scheme Procedure} hashq key size @deffnx {C Function} scm_hashq (key, size) Determine a hash value for @var{key} that is suitable for @@ -1608,6 +1789,7 @@ different values, since @code{foo} will be garbage collected. @end deffn hashv +@c snarfed from hash.c:236 @deffn {Scheme Procedure} hashv key size @deffnx {C Function} scm_hashv (key, size) Determine a hash value for @var{key} that is suitable for @@ -1623,6 +1805,7 @@ different values, since @code{foo} will be garbage collected. @end deffn hash +@c snarfed from hash.c:259 @deffn {Scheme Procedure} hash key size @deffnx {C Function} scm_hash (key, size) Determine a hash value for @var{key} that is suitable for @@ -1632,6 +1815,7 @@ integer in the range 0 to @var{size} - 1. @end deffn hashq-get-handle +@c snarfed from hashtab.c:173 @deffn {Scheme Procedure} hashq-get-handle table key @deffnx {C Function} scm_hashq_get_handle (table, key) This procedure returns the @code{(key . value)} pair from the @@ -1641,6 +1825,7 @@ Uses @code{eq?} for equality testing. @end deffn hashq-create-handle! +@c snarfed from hashtab.c:185 @deffn {Scheme Procedure} hashq-create-handle! table key init @deffnx {C Function} scm_hashq_create_handle_x (table, key, init) This function looks up @var{key} in @var{table} and returns its handle. @@ -1649,6 +1834,7 @@ associates @var{key} with @var{init}. @end deffn hashq-ref +@c snarfed from hashtab.c:198 @deffn {Scheme Procedure} hashq-ref table key [dflt] @deffnx {C Function} scm_hashq_ref (table, key, dflt) Look up @var{key} in the hash table @var{table}, and return the @@ -1658,6 +1844,7 @@ is supplied). Uses @code{eq?} for equality testing. @end deffn hashq-set! +@c snarfed from hashtab.c:212 @deffn {Scheme Procedure} hashq-set! table key val @deffnx {C Function} scm_hashq_set_x (table, key, val) Find the entry in @var{table} associated with @var{key}, and @@ -1665,6 +1852,7 @@ store @var{value} there. Uses @code{eq?} for equality testing. @end deffn hashq-remove! +@c snarfed from hashtab.c:224 @deffn {Scheme Procedure} hashq-remove! table key @deffnx {C Function} scm_hashq_remove_x (table, key) Remove @var{key} (and any value associated with it) from @@ -1672,6 +1860,7 @@ Remove @var{key} (and any value associated with it) from @end deffn hashv-get-handle +@c snarfed from hashtab.c:240 @deffn {Scheme Procedure} hashv-get-handle table key @deffnx {C Function} scm_hashv_get_handle (table, key) This procedure returns the @code{(key . value)} pair from the @@ -1681,6 +1870,7 @@ Uses @code{eqv?} for equality testing. @end deffn hashv-create-handle! +@c snarfed from hashtab.c:252 @deffn {Scheme Procedure} hashv-create-handle! table key init @deffnx {C Function} scm_hashv_create_handle_x (table, key, init) This function looks up @var{key} in @var{table} and returns its handle. @@ -1689,6 +1879,7 @@ associates @var{key} with @var{init}. @end deffn hashv-ref +@c snarfed from hashtab.c:266 @deffn {Scheme Procedure} hashv-ref table key [dflt] @deffnx {C Function} scm_hashv_ref (table, key, dflt) Look up @var{key} in the hash table @var{table}, and return the @@ -1698,6 +1889,7 @@ is supplied). Uses @code{eqv?} for equality testing. @end deffn hashv-set! +@c snarfed from hashtab.c:280 @deffn {Scheme Procedure} hashv-set! table key val @deffnx {C Function} scm_hashv_set_x (table, key, val) Find the entry in @var{table} associated with @var{key}, and @@ -1705,6 +1897,7 @@ store @var{value} there. Uses @code{eqv?} for equality testing. @end deffn hashv-remove! +@c snarfed from hashtab.c:291 @deffn {Scheme Procedure} hashv-remove! table key @deffnx {C Function} scm_hashv_remove_x (table, key) Remove @var{key} (and any value associated with it) from @@ -1712,6 +1905,7 @@ Remove @var{key} (and any value associated with it) from @end deffn hash-get-handle +@c snarfed from hashtab.c:306 @deffn {Scheme Procedure} hash-get-handle table key @deffnx {C Function} scm_hash_get_handle (table, key) This procedure returns the @code{(key . value)} pair from the @@ -1721,6 +1915,7 @@ Uses @code{equal?} for equality testing. @end deffn hash-create-handle! +@c snarfed from hashtab.c:318 @deffn {Scheme Procedure} hash-create-handle! table key init @deffnx {C Function} scm_hash_create_handle_x (table, key, init) This function looks up @var{key} in @var{table} and returns its handle. @@ -1729,6 +1924,7 @@ associates @var{key} with @var{init}. @end deffn hash-ref +@c snarfed from hashtab.c:331 @deffn {Scheme Procedure} hash-ref table key [dflt] @deffnx {C Function} scm_hash_ref (table, key, dflt) Look up @var{key} in the hash table @var{table}, and return the @@ -1738,6 +1934,7 @@ is supplied). Uses @code{equal?} for equality testing. @end deffn hash-set! +@c snarfed from hashtab.c:346 @deffn {Scheme Procedure} hash-set! table key val @deffnx {C Function} scm_hash_set_x (table, key, val) Find the entry in @var{table} associated with @var{key}, and @@ -1746,6 +1943,7 @@ testing. @end deffn hash-remove! +@c snarfed from hashtab.c:358 @deffn {Scheme Procedure} hash-remove! table key @deffnx {C Function} scm_hash_remove_x (table, key) Remove @var{key} (and any value associated with it) from @@ -1753,6 +1951,7 @@ Remove @var{key} (and any value associated with it) from @end deffn hashx-get-handle +@c snarfed from hashtab.c:422 @deffn {Scheme Procedure} hashx-get-handle hash assoc table key @deffnx {C Function} scm_hashx_get_handle (hash, assoc, table, key) This behaves the same way as the corresponding @@ -1764,6 +1963,7 @@ table size. @code{assoc} must be an associator function, like @end deffn hashx-create-handle! +@c snarfed from hashtab.c:441 @deffn {Scheme Procedure} hashx-create-handle! hash assoc table key init @deffnx {C Function} scm_hashx_create_handle_x (hash, assoc, table, key, init) This behaves the same way as the corresponding @@ -1775,6 +1975,7 @@ table size. @code{assoc} must be an associator function, like @end deffn hashx-ref +@c snarfed from hashtab.c:464 @deffn {Scheme Procedure} hashx-ref hash assoc table key [dflt] @deffnx {C Function} scm_hashx_ref (hash, assoc, table, key, dflt) This behaves the same way as the corresponding @code{ref} @@ -1789,6 +1990,7 @@ equivalent to @code{hashx-ref hashq assq table key}. @end deffn hashx-set! +@c snarfed from hashtab.c:490 @deffn {Scheme Procedure} hashx-set! hash assoc table key val @deffnx {C Function} scm_hashx_set_x (hash, assoc, table, key, val) This behaves the same way as the corresponding @code{set!} @@ -1803,6 +2005,7 @@ equivalent to @code{hashx-set! hashq assq table key}. @end deffn hash-fold +@c snarfed from hashtab.c:528 @deffn {Scheme Procedure} hash-fold proc init table @deffnx {C Function} scm_hash_fold (proc, init, table) An iterator over hash-table elements. @@ -1816,6 +2019,7 @@ table into an a-list of key-value pairs. @end deffn make-hook +@c snarfed from hooks.c:178 @deffn {Scheme Procedure} make-hook [n_args] @deffnx {C Function} scm_make_hook (n_args) Create a hook for storing procedure of arity @var{n_args}. @@ -1824,12 +2028,14 @@ object to be used with the other hook procedures. @end deffn hook? +@c snarfed from hooks.c:201 @deffn {Scheme Procedure} hook? x @deffnx {C Function} scm_hook_p (x) Return @code{#t} if @var{x} is a hook, @code{#f} otherwise. @end deffn hook-empty? +@c snarfed from hooks.c:212 @deffn {Scheme Procedure} hook-empty? hook @deffnx {C Function} scm_hook_empty_p (hook) Return @code{#t} if @var{hook} is an empty hook, @code{#f} @@ -1837,6 +2043,7 @@ otherwise. @end deffn add-hook! +@c snarfed from hooks.c:226 @deffn {Scheme Procedure} add-hook! hook proc [append_p] @deffnx {C Function} scm_add_hook_x (hook, proc, append_p) Add the procedure @var{proc} to the hook @var{hook}. The @@ -1846,6 +2053,7 @@ procedure is not specified. @end deffn remove-hook! +@c snarfed from hooks.c:253 @deffn {Scheme Procedure} remove-hook! hook proc @deffnx {C Function} scm_remove_hook_x (hook, proc) Remove the procedure @var{proc} from the hook @var{hook}. The @@ -1853,6 +2061,7 @@ return value of this procedure is not specified. @end deffn reset-hook! +@c snarfed from hooks.c:267 @deffn {Scheme Procedure} reset-hook! hook @deffnx {C Function} scm_reset_hook_x (hook) Remove all procedures from the hook @var{hook}. The return @@ -1860,6 +2069,7 @@ value of this procedure is not specified. @end deffn run-hook +@c snarfed from hooks.c:281 @deffn {Scheme Procedure} run-hook hook . args @deffnx {C Function} scm_run_hook (hook, args) Apply all procedures from the hook @var{hook} to the arguments @@ -1868,12 +2078,14 @@ last. The return value of this procedure is not specified. @end deffn hook->list +@c snarfed from hooks.c:308 @deffn {Scheme Procedure} hook->list hook @deffnx {C Function} scm_hook_to_list (hook) Convert the procedure list of @var{hook} to a list. @end deffn ftell +@c snarfed from ioext.c:73 @deffn {Scheme Procedure} ftell fd_port @deffnx {C Function} scm_ftell (fd_port) Return an integer representing the current position of @@ -1885,6 +2097,7 @@ Return an integer representing the current position of @end deffn redirect-port +@c snarfed from ioext.c:91 @deffn {Scheme Procedure} redirect-port old new @deffnx {C Function} scm_redirect_port (old, new) This procedure takes two ports and duplicates the underlying file @@ -1903,6 +2116,7 @@ revealed counts. @end deffn dup->fdes +@c snarfed from ioext.c:130 @deffn {Scheme Procedure} dup->fdes fd_or_port [fd] @deffnx {C Function} scm_dup_to_fdes (fd_or_port, fd) Return a new integer file descriptor referring to the open file @@ -1911,6 +2125,7 @@ file port or a file descriptor. @end deffn dup2 +@c snarfed from ioext.c:177 @deffn {Scheme Procedure} dup2 oldfd newfd @deffnx {C Function} scm_dup2 (oldfd, newfd) A simple wrapper for the @code{dup2} system call. @@ -1924,6 +2139,7 @@ The return value is unspecified. @end deffn fileno +@c snarfed from ioext.c:196 @deffn {Scheme Procedure} fileno port @deffnx {C Function} scm_fileno (port) Return the integer file descriptor underlying @var{port}. Does @@ -1931,6 +2147,7 @@ not change its revealed count. @end deffn isatty? +@c snarfed from ioext.c:216 @deffn {Scheme Procedure} isatty? port @deffnx {C Function} scm_isatty_p (port) Return @code{#t} if @var{port} is using a serial non--file @@ -1938,6 +2155,7 @@ device, otherwise @code{#f}. @end deffn fdopen +@c snarfed from ioext.c:238 @deffn {Scheme Procedure} fdopen fdes modes @deffnx {C Function} scm_fdopen (fdes, modes) Return a new port based on the file descriptor @var{fdes}. @@ -1947,6 +2165,7 @@ same as that accepted by @ref{File Ports, open-file}. @end deffn primitive-move->fdes +@c snarfed from ioext.c:262 @deffn {Scheme Procedure} primitive-move->fdes port fd @deffnx {C Function} scm_primitive_move_to_fdes (port, fd) Moves the underlying file descriptor for @var{port} to the integer @@ -1958,6 +2177,7 @@ required value or @code{#t} if it was moved. @end deffn fdes->ports +@c snarfed from ioext.c:296 @deffn {Scheme Procedure} fdes->ports fd @deffnx {C Function} scm_fdes_to_ports (fd) Return a list of existing ports which have @var{fdes} as an @@ -1966,12 +2186,14 @@ counts. @end deffn make-keyword-from-dash-symbol +@c snarfed from keywords.c:74 @deffn {Scheme Procedure} make-keyword-from-dash-symbol symbol @deffnx {C Function} scm_make_keyword_from_dash_symbol (symbol) Make a keyword object from a @var{symbol} that starts with a dash. @end deffn keyword? +@c snarfed from keywords.c:112 @deffn {Scheme Procedure} keyword? obj @deffnx {C Function} scm_keyword_p (obj) Return @code{#t} if the argument @var{obj} is a keyword, else @@ -1979,48 +2201,15 @@ Return @code{#t} if the argument @var{obj} is a keyword, else @end deffn keyword-dash-symbol +@c snarfed from keywords.c:123 @deffn {Scheme Procedure} keyword-dash-symbol keyword @deffnx {C Function} scm_keyword_dash_symbol (keyword) Return the dash symbol for @var{keyword}. This is the inverse of @code{make-keyword-from-dash-symbol}. @end deffn - nil-cons -@deffn {Scheme Procedure} nil-cons x y -@deffnx {C Function} scm_nil_cons (x, y) -Create a new cons cell with @var{x} as the car and @var{y} as -the cdr, but convert @var{y} to Scheme's end-of-list if it is -a LISP nil. -@end deffn - - nil-car -@deffn {Scheme Procedure} nil-car x -@deffnx {C Function} scm_nil_car (x) -Return the car of @var{x}, but convert it to LISP nil if it -is Scheme's end-of-list. -@end deffn - - nil-cdr -@deffn {Scheme Procedure} nil-cdr x -@deffnx {C Function} scm_nil_cdr (x) -Return the cdr of @var{x}, but convert it to LISP nil if it -is Scheme's end-of-list. -@end deffn - - null -@deffn {Scheme Procedure} null x -@deffnx {C Function} scm_null (x) -Return LISP's @code{t} if @var{x} is nil in the LISP sense, -return LISP's nil otherwise. -@end deffn - - nil-eq -@deffn {Scheme Procedure} nil-eq x y -Compare @var{x} and @var{y} and return LISP's t if they are -@code{eq?}, return LISP's nil otherwise. -@end deffn - list +@c snarfed from list.c:127 @deffn {Scheme Procedure} list . objs @deffnx {C Function} scm_list (objs) Return a list containing @var{objs}, the arguments to @@ -2028,6 +2217,7 @@ Return a list containing @var{objs}, the arguments to @end deffn cons* +@c snarfed from list.c:142 @deffn {Scheme Procedure} cons* arg . rest @deffnx {C Function} scm_cons_star (arg, rest) Like @code{list}, but the last arg provides the tail of the @@ -2039,24 +2229,28 @@ Schemes and in Common LISP. @end deffn null? +@c snarfed from list.c:166 @deffn {Scheme Procedure} null? x @deffnx {C Function} scm_null_p (x) Return @code{#t} iff @var{x} is the empty list, else @code{#f}. @end deffn list? +@c snarfed from list.c:176 @deffn {Scheme Procedure} list? x @deffnx {C Function} scm_list_p (x) Return @code{#t} iff @var{x} is a proper list, else @code{#f}. @end deffn length +@c snarfed from list.c:217 @deffn {Scheme Procedure} length lst @deffnx {C Function} scm_length (lst) Return the number of elements in list @var{lst}. @end deffn append +@c snarfed from list.c:246 @deffn {Scheme Procedure} append . args @deffnx {C Function} scm_append (args) Return a list consisting of the elements the lists passed as @@ -2077,6 +2271,7 @@ if the last argument is not a proper list. @end deffn append! +@c snarfed from list.c:280 @deffn {Scheme Procedure} append! . lists @deffnx {C Function} scm_append_x (lists) A destructive version of @code{append} (@pxref{Pairs and @@ -2087,6 +2282,7 @@ the mutated list. @end deffn last-pair +@c snarfed from list.c:306 @deffn {Scheme Procedure} last-pair lst @deffnx {C Function} scm_last_pair (lst) Return a pointer to the last pair in @var{lst}, signalling an error if @@ -2094,6 +2290,7 @@ Return a pointer to the last pair in @var{lst}, signalling an error if @end deffn reverse +@c snarfed from list.c:336 @deffn {Scheme Procedure} reverse lst @deffnx {C Function} scm_reverse (lst) Return a new list that contains the elements of @var{lst} but @@ -2101,6 +2298,7 @@ in reverse order. @end deffn reverse! +@c snarfed from list.c:370 @deffn {Scheme Procedure} reverse! lst [new_tail] @deffnx {C Function} scm_reverse_x (lst, new_tail) A destructive version of @code{reverse} (@pxref{Pairs and Lists,,,r5rs, @@ -2117,23 +2315,27 @@ of the modified list is not lost, it is wise to save the return value of @end deffn list-ref +@c snarfed from list.c:396 @deffn {Scheme Procedure} list-ref list k @deffnx {C Function} scm_list_ref (list, k) Return the @var{k}th element from @var{list}. @end deffn list-set! +@c snarfed from list.c:420 @deffn {Scheme Procedure} list-set! list k val @deffnx {C Function} scm_list_set_x (list, k, val) Set the @var{k}th element of @var{list} to @var{val}. @end deffn list-cdr-ref +@c snarfed from list.c:443 @deffn {Scheme Procedure} list-cdr-ref implemented by the C function "scm_list_tail" @end deffn list-tail +@c snarfed from list.c:452 @deffn {Scheme Procedure} list-tail lst k @deffnx {Scheme Procedure} list-cdr-ref lst k @deffnx {C Function} scm_list_tail (lst, k) @@ -2146,12 +2348,14 @@ or returning the results of cdring @var{k} times down @var{lst}. @end deffn list-cdr-set! +@c snarfed from list.c:468 @deffn {Scheme Procedure} list-cdr-set! list k val @deffnx {C Function} scm_list_cdr_set_x (list, k, val) Set the @var{k}th cdr of @var{list} to @var{val}. @end deffn list-head +@c snarfed from list.c:497 @deffn {Scheme Procedure} list-head lst k @deffnx {C Function} scm_list_head (lst, k) Copy the first @var{k} elements from @var{lst} into a new list, and @@ -2159,12 +2363,14 @@ return it. @end deffn list-copy +@c snarfed from list.c:521 @deffn {Scheme Procedure} list-copy lst @deffnx {C Function} scm_list_copy (lst) Return a (newly-created) copy of @var{lst}. @end deffn memq +@c snarfed from list.c:575 @deffn {Scheme Procedure} memq x lst @deffnx {C Function} scm_memq (x, lst) Return the first sublist of @var{lst} whose car is @code{eq?} @@ -2176,6 +2382,7 @@ returned. @end deffn memv +@c snarfed from list.c:591 @deffn {Scheme Procedure} memv x lst @deffnx {C Function} scm_memv (x, lst) Return the first sublist of @var{lst} whose car is @code{eqv?} @@ -2187,6 +2394,7 @@ returned. @end deffn member +@c snarfed from list.c:612 @deffn {Scheme Procedure} member x lst @deffnx {C Function} scm_member (x, lst) Return the first sublist of @var{lst} whose car is @@ -2198,6 +2406,7 @@ empty list) is returned. @end deffn delq! +@c snarfed from list.c:637 @deffn {Scheme Procedure} delq! item lst @deffnx {Scheme Procedure} delv! item lst @deffnx {Scheme Procedure} delete! item lst @@ -2211,6 +2420,7 @@ destructive list functions, these functions cannot modify the binding of @end deffn delv! +@c snarfed from list.c:661 @deffn {Scheme Procedure} delv! item lst @deffnx {C Function} scm_delv_x (item, lst) Destructively remove all elements from @var{lst} that are @@ -2218,6 +2428,7 @@ Destructively remove all elements from @var{lst} that are @end deffn delete! +@c snarfed from list.c:686 @deffn {Scheme Procedure} delete! item lst @deffnx {C Function} scm_delete_x (item, lst) Destructively remove all elements from @var{lst} that are @@ -2225,6 +2436,7 @@ Destructively remove all elements from @var{lst} that are @end deffn delq +@c snarfed from list.c:715 @deffn {Scheme Procedure} delq item lst @deffnx {C Function} scm_delq (item, lst) Return a newly-created copy of @var{lst} with elements @@ -2234,6 +2446,7 @@ Return a newly-created copy of @var{lst} with elements @end deffn delv +@c snarfed from list.c:728 @deffn {Scheme Procedure} delv item lst @deffnx {C Function} scm_delv (item, lst) Return a newly-created copy of @var{lst} with elements @@ -2243,6 +2456,7 @@ Return a newly-created copy of @var{lst} with elements @end deffn delete +@c snarfed from list.c:741 @deffn {Scheme Procedure} delete item lst @deffnx {C Function} scm_delete (item, lst) Return a newly-created copy of @var{lst} with elements @@ -2252,6 +2466,7 @@ against @var{item} with @code{equal?}. @end deffn delq1! +@c snarfed from list.c:754 @deffn {Scheme Procedure} delq1! item lst @deffnx {C Function} scm_delq1_x (item, lst) Like @code{delq!}, but only deletes the first occurrence of @@ -2260,6 +2475,7 @@ Like @code{delq!}, but only deletes the first occurrence of @end deffn delv1! +@c snarfed from list.c:782 @deffn {Scheme Procedure} delv1! item lst @deffnx {C Function} scm_delv1_x (item, lst) Like @code{delv!}, but only deletes the first occurrence of @@ -2268,6 +2484,7 @@ Like @code{delv!}, but only deletes the first occurrence of @end deffn delete1! +@c snarfed from list.c:810 @deffn {Scheme Procedure} delete1! item lst @deffnx {C Function} scm_delete1_x (item, lst) Like @code{delete!}, but only deletes the first occurrence of @@ -2276,6 +2493,7 @@ Like @code{delete!}, but only deletes the first occurrence of @end deffn primitive-load +@c snarfed from load.c:111 @deffn {Scheme Procedure} primitive-load filename @deffnx {C Function} scm_primitive_load (filename) Load the file named @var{filename} and evaluate its contents in @@ -2288,6 +2506,7 @@ documentation for @code{%load-hook} later in this section. @end deffn %package-data-dir +@c snarfed from load.c:151 @deffn {Scheme Procedure} %package-data-dir @deffnx {C Function} scm_sys_package_data_dir () Return the name of the directory where Scheme packages, modules and @@ -2296,6 +2515,7 @@ libraries are kept. On most Unix systems, this will be @end deffn %library-dir +@c snarfed from load.c:163 @deffn {Scheme Procedure} %library-dir @deffnx {C Function} scm_sys_library_dir () Return the directory where the Guile Scheme library files are installed. @@ -2303,6 +2523,7 @@ E.g., may return "/usr/share/guile/1.3.5". @end deffn %site-dir +@c snarfed from load.c:175 @deffn {Scheme Procedure} %site-dir @deffnx {C Function} scm_sys_site_dir () Return the directory where the Guile site files are installed. @@ -2310,6 +2531,7 @@ E.g., may return "/usr/share/guile/site". @end deffn parse-path +@c snarfed from load.c:227 @deffn {Scheme Procedure} parse-path path [tail] @deffnx {C Function} scm_parse_path (path, tail) Parse @var{path}, which is expected to be a colon-separated @@ -2319,6 +2541,7 @@ is returned. @end deffn search-path +@c snarfed from load.c:277 @deffn {Scheme Procedure} search-path path filename [extensions] @deffnx {C Function} scm_search_path (path, filename, extensions) Search @var{path} for a directory containing a file named @@ -2331,6 +2554,7 @@ concatenated with each @var{extension}. @end deffn %search-load-path +@c snarfed from load.c:423 @deffn {Scheme Procedure} %search-load-path filename @deffnx {C Function} scm_sys_search_load_path (filename) Search @var{%load-path} for the file named @var{filename}, @@ -2343,6 +2567,7 @@ will try each extension automatically. @end deffn primitive-load-path +@c snarfed from load.c:444 @deffn {Scheme Procedure} primitive-load-path filename @deffnx {C Function} scm_primitive_load_path (filename) Search @var{%load-path} for the file named @var{filename} and @@ -2352,6 +2577,7 @@ an error is signalled. @end deffn procedure->syntax +@c snarfed from macros.c:104 @deffn {Scheme Procedure} procedure->syntax code @deffnx {C Function} scm_makacro (code) Return a @dfn{macro} which, when a symbol defined to this value @@ -2361,6 +2587,7 @@ environment. @end deffn procedure->macro +@c snarfed from macros.c:127 @deffn {Scheme Procedure} procedure->macro code @deffnx {C Function} scm_makmacro (code) Return a @dfn{macro} which, when a symbol defined to this value @@ -2380,6 +2607,7 @@ passed to @var{code}. For example: @end deffn procedure->memoizing-macro +@c snarfed from macros.c:150 @deffn {Scheme Procedure} procedure->memoizing-macro code @deffnx {C Function} scm_makmmacro (code) Return a @dfn{macro} which, when a symbol defined to this value @@ -2399,6 +2627,7 @@ passed to @var{proc}. For example: @end deffn macro? +@c snarfed from macros.c:162 @deffn {Scheme Procedure} macro? obj @deffnx {C Function} scm_macro_p (obj) Return @code{#t} if @var{obj} is a regular macro, a memoizing macro or a @@ -2406,6 +2635,7 @@ syntax transformer. @end deffn macro-type +@c snarfed from macros.c:180 @deffn {Scheme Procedure} macro-type m @deffnx {C Function} scm_macro_type (m) Return one of the symbols @code{syntax}, @code{macro} or @@ -2416,24 +2646,28 @@ returned. @end deffn macro-name +@c snarfed from macros.c:198 @deffn {Scheme Procedure} macro-name m @deffnx {C Function} scm_macro_name (m) Return the name of the macro @var{m}. @end deffn macro-transformer +@c snarfed from macros.c:209 @deffn {Scheme Procedure} macro-transformer m @deffnx {C Function} scm_macro_transformer (m) Return the transformer of the macro @var{m}. @end deffn current-module +@c snarfed from modules.c:69 @deffn {Scheme Procedure} current-module @deffnx {C Function} scm_current_module () Return the current module. @end deffn set-current-module +@c snarfed from modules.c:81 @deffn {Scheme Procedure} set-current-module module @deffnx {C Function} scm_set_current_module (module) Set the current module to @var{module} and return @@ -2441,6 +2675,7 @@ the previous current module. @end deffn interaction-environment +@c snarfed from modules.c:104 @deffn {Scheme Procedure} interaction-environment @deffnx {C Function} scm_interaction_environment () Return a specifier for the environment that contains @@ -2451,30 +2686,35 @@ evaluate expressions dynamically typed by the user. @end deffn env-module +@c snarfed from modules.c:271 @deffn {Scheme Procedure} env-module env @deffnx {C Function} scm_env_module (env) Return the module of @var{ENV}, a lexical environment. @end deffn standard-eval-closure +@c snarfed from modules.c:348 @deffn {Scheme Procedure} standard-eval-closure module @deffnx {C Function} scm_standard_eval_closure (module) Return an eval closure for the module @var{module}. @end deffn standard-interface-eval-closure +@c snarfed from modules.c:359 @deffn {Scheme Procedure} standard-interface-eval-closure module @deffnx {C Function} scm_standard_interface_eval_closure (module) Return a interface eval closure for the module @var{module}. Such a closure does not allow new bindings to be added. @end deffn %get-pre-modules-obarray +@c snarfed from modules.c:582 @deffn {Scheme Procedure} %get-pre-modules-obarray @deffnx {C Function} scm_get_pre_modules_obarray () Return the obarray that is used for all new bindings before the module system is booted. The first call to @code{set-current-module} will boot the module system. @end deffn exact? +@c snarfed from numbers.c:101 @deffn {Scheme Procedure} exact? x @deffnx {C Function} scm_exact_p (x) Return @code{#t} if @var{x} is an exact number, @code{#f} @@ -2482,6 +2722,7 @@ otherwise. @end deffn odd? +@c snarfed from numbers.c:118 @deffn {Scheme Procedure} odd? n @deffnx {C Function} scm_odd_p (n) Return @code{#t} if @var{n} is an odd number, @code{#f} @@ -2489,6 +2730,7 @@ otherwise. @end deffn even? +@c snarfed from numbers.c:135 @deffn {Scheme Procedure} even? n @deffnx {C Function} scm_even_p (n) Return @code{#t} if @var{n} is an even number, @code{#f} @@ -2496,6 +2738,7 @@ otherwise. @end deffn logand +@c snarfed from numbers.c:748 @deffn {Scheme Procedure} logand n1 n2 Return the bitwise AND of the integer arguments. @@ -2507,6 +2750,7 @@ Return the bitwise AND of the integer arguments. @end deffn logior +@c snarfed from numbers.c:834 @deffn {Scheme Procedure} logior n1 n2 Return the bitwise OR of the integer arguments. @@ -2518,6 +2762,7 @@ Return the bitwise OR of the integer arguments. @end deffn logxor +@c snarfed from numbers.c:921 @deffn {Scheme Procedure} logxor n1 n2 Return the bitwise XOR of the integer arguments. A bit is set in the result if it is set in an odd number of arguments. @@ -2530,6 +2775,7 @@ set in the result if it is set in an odd number of arguments. @end deffn logtest +@c snarfed from numbers.c:990 @deffn {Scheme Procedure} logtest j k @deffnx {C Function} scm_logtest (j, k) @lisp @@ -2541,6 +2787,7 @@ set in the result if it is set in an odd number of arguments. @end deffn logbit? +@c snarfed from numbers.c:1047 @deffn {Scheme Procedure} logbit? index j @deffnx {C Function} scm_logbit_p (index, j) @lisp @@ -2555,6 +2802,7 @@ set in the result if it is set in an odd number of arguments. @end deffn lognot +@c snarfed from numbers.c:1096 @deffn {Scheme Procedure} lognot n @deffnx {C Function} scm_lognot (n) Return the integer which is the 2s-complement of the integer @@ -2569,6 +2817,7 @@ argument. @end deffn integer-expt +@c snarfed from numbers.c:1113 @deffn {Scheme Procedure} integer-expt n k @deffnx {C Function} scm_integer_expt (n, k) Return @var{n} raised to the non-negative integer exponent @@ -2583,6 +2832,7 @@ Return @var{n} raised to the non-negative integer exponent @end deffn ash +@c snarfed from numbers.c:1168 @deffn {Scheme Procedure} ash n cnt @deffnx {C Function} scm_ash (n, cnt) The function ash performs an arithmetic shift left by @var{cnt} @@ -2603,6 +2853,7 @@ Formally, the function returns an integer equivalent to @end deffn bit-extract +@c snarfed from numbers.c:1221 @deffn {Scheme Procedure} bit-extract n start end @deffnx {C Function} scm_bit_extract (n, start, end) Return the integer composed of the @var{start} (inclusive) @@ -2618,6 +2869,7 @@ through @var{end} (exclusive) bits of @var{n}. The @end deffn logcount +@c snarfed from numbers.c:1293 @deffn {Scheme Procedure} logcount n @deffnx {C Function} scm_logcount (n) Return the number of bits in integer @var{n}. If integer is @@ -2636,6 +2888,7 @@ representation are counted. If 0, 0 is returned. @end deffn integer-length +@c snarfed from numbers.c:1344 @deffn {Scheme Procedure} integer-length n @deffnx {C Function} scm_integer_length (n) Return the number of bits neccessary to represent @var{n}. @@ -2651,6 +2904,7 @@ Return the number of bits neccessary to represent @var{n}. @end deffn number->string +@c snarfed from numbers.c:2177 @deffn {Scheme Procedure} number->string n [radix] @deffnx {C Function} scm_number_to_string (n, radix) Return a string holding the external representation of the @@ -2659,6 +2913,7 @@ inexact, a radix of 10 will be used. @end deffn string->number +@c snarfed from numbers.c:2812 @deffn {Scheme Procedure} string->number string [radix] @deffnx {C Function} scm_string_to_number (string, radix) Return a number of the maximally precise representation @@ -2672,11 +2927,13 @@ syntactically valid notation for a number, then @end deffn number? +@c snarfed from numbers.c:2881 @deffn {Scheme Procedure} number? implemented by the C function "scm_number_p" @end deffn complex? +@c snarfed from numbers.c:2893 @deffn {Scheme Procedure} complex? x @deffnx {C Function} scm_number_p (x) Return @code{#t} if @var{x} is a complex number, @code{#f} @@ -2687,11 +2944,13 @@ rational or integer number. @end deffn real? +@c snarfed from numbers.c:2901 @deffn {Scheme Procedure} real? implemented by the C function "scm_real_p" @end deffn rational? +@c snarfed from numbers.c:2914 @deffn {Scheme Procedure} rational? x @deffnx {C Function} scm_real_p (x) Return @code{#t} if @var{x} is a rational number, @code{#f} @@ -2703,6 +2962,7 @@ precision. @end deffn integer? +@c snarfed from numbers.c:2935 @deffn {Scheme Procedure} integer? x @deffnx {C Function} scm_integer_p (x) Return @code{#t} if @var{x} is an integer number, @code{#f} @@ -2710,6 +2970,7 @@ else. @end deffn inexact? +@c snarfed from numbers.c:2960 @deffn {Scheme Procedure} inexact? x @deffnx {C Function} scm_inexact_p (x) Return @code{#t} if @var{x} is an inexact number, @code{#f} @@ -2717,6 +2978,7 @@ else. @end deffn $expt +@c snarfed from numbers.c:4084 @deffn {Scheme Procedure} $expt x y @deffnx {C Function} scm_sys_expt (x, y) Return @var{x} raised to the power of @var{y}. This @@ -2724,6 +2986,7 @@ procedure does not accept complex arguments. @end deffn $atan2 +@c snarfed from numbers.c:4100 @deffn {Scheme Procedure} $atan2 x y @deffnx {C Function} scm_sys_atan2 (x, y) Return the arc tangent of the two arguments @var{x} and @@ -2734,6 +2997,7 @@ procedure does not accept complex arguments. @end deffn make-rectangular +@c snarfed from numbers.c:4113 @deffn {Scheme Procedure} make-rectangular real imaginary @deffnx {C Function} scm_make_rectangular (real, imaginary) Return a complex number constructed of the given @var{real} and @@ -2741,42 +3005,49 @@ Return a complex number constructed of the given @var{real} and @end deffn make-polar +@c snarfed from numbers.c:4126 @deffn {Scheme Procedure} make-polar x y @deffnx {C Function} scm_make_polar (x, y) Return the complex number @var{x} * e^(i * @var{y}). @end deffn inexact->exact +@c snarfed from numbers.c:4261 @deffn {Scheme Procedure} inexact->exact z @deffnx {C Function} scm_inexact_to_exact (z) Return an exact number that is numerically closest to @var{z}. @end deffn class-of +@c snarfed from objects.c:86 @deffn {Scheme Procedure} class-of x @deffnx {C Function} scm_class_of (x) Return the class of @var{x}. @end deffn entity? +@c snarfed from objects.c:360 @deffn {Scheme Procedure} entity? obj @deffnx {C Function} scm_entity_p (obj) Return @code{#t} if @var{obj} is an entity. @end deffn operator? +@c snarfed from objects.c:369 @deffn {Scheme Procedure} operator? obj @deffnx {C Function} scm_operator_p (obj) Return @code{#t} if @var{obj} is an operator. @end deffn valid-object-procedure? +@c snarfed from objects.c:385 @deffn {Scheme Procedure} valid-object-procedure? proc @deffnx {C Function} scm_valid_object_procedure_p (proc) Return @code{#t} iff @var{proc} is a procedure that can be used with @code{set-object-procedure}. It is always valid to use a closure constructed by @code{lambda}. @end deffn set-object-procedure! +@c snarfed from objects.c:407 @deffn {Scheme Procedure} set-object-procedure! obj proc @deffnx {C Function} scm_set_object_procedure_x (obj, proc) Set the object procedure of @var{obj} to @var{proc}. @@ -2784,6 +3055,7 @@ Set the object procedure of @var{obj} to @var{proc}. @end deffn make-class-object +@c snarfed from objects.c:467 @deffn {Scheme Procedure} make-class-object metaclass layout @deffnx {C Function} scm_make_class_object (metaclass, layout) Create a new class object of class @var{metaclass}, with the @@ -2791,6 +3063,7 @@ slot layout specified by @var{layout}. @end deffn make-subclass-object +@c snarfed from objects.c:482 @deffn {Scheme Procedure} make-subclass-object class layout @deffnx {C Function} scm_make_subclass_object (class, layout) Create a subclass object of @var{class}, with the slot layout @@ -2798,24 +3071,28 @@ specified by @var{layout}. @end deffn object-properties +@c snarfed from objprop.c:59 @deffn {Scheme Procedure} object-properties obj @deffnx {C Function} scm_object_properties (obj) Return @var{obj}'s property list. @end deffn set-object-properties! +@c snarfed from objprop.c:69 @deffn {Scheme Procedure} set-object-properties! obj alist @deffnx {C Function} scm_set_object_properties_x (obj, alist) Set @var{obj}'s property list to @var{alist}. @end deffn object-property +@c snarfed from objprop.c:80 @deffn {Scheme Procedure} object-property obj key @deffnx {C Function} scm_object_property (obj, key) Return the property of @var{obj} with name @var{key}. @end deffn set-object-property! +@c snarfed from objprop.c:92 @deffn {Scheme Procedure} set-object-property! obj key value @deffnx {C Function} scm_set_object_property_x (obj, key, value) In @var{obj}'s property list, set the property named @var{key} @@ -2823,6 +3100,7 @@ to @var{value}. @end deffn cons +@c snarfed from pairs.c:80 @deffn {Scheme Procedure} cons x y @deffnx {C Function} scm_cons (x, y) Return a newly allocated pair whose car is @var{x} and whose @@ -2831,6 +3109,7 @@ sense of @code{eq?}) from every previously existing object. @end deffn pair? +@c snarfed from pairs.c:98 @deffn {Scheme Procedure} pair? x @deffnx {C Function} scm_pair_p (x) Return @code{#t} if @var{x} is a pair; otherwise return @@ -2838,6 +3117,7 @@ Return @code{#t} if @var{x} is a pair; otherwise return @end deffn set-car! +@c snarfed from pairs.c:109 @deffn {Scheme Procedure} set-car! pair value @deffnx {C Function} scm_set_car_x (pair, value) Stores @var{value} in the car field of @var{pair}. The value returned @@ -2845,6 +3125,7 @@ by @code{set-car!} is unspecified. @end deffn set-cdr! +@c snarfed from pairs.c:122 @deffn {Scheme Procedure} set-cdr! pair value @deffnx {C Function} scm_set_cdr_x (pair, value) Stores @var{value} in the cdr field of @var{pair}. The value returned @@ -2852,6 +3133,7 @@ by @code{set-cdr!} is unspecified. @end deffn char-ready? +@c snarfed from ports.c:259 @deffn {Scheme Procedure} char-ready? [port] @deffnx {C Function} scm_char_ready_p (port) Return @code{#t} if a character is ready on input @var{port} @@ -2870,6 +3152,7 @@ interactive port that has no ready characters.} @end deffn drain-input +@c snarfed from ports.c:336 @deffn {Scheme Procedure} drain-input port @deffnx {C Function} scm_drain_input (port) This procedure clears a port's input buffers, similar @@ -2889,6 +3172,7 @@ for further input. @end deffn current-input-port +@c snarfed from ports.c:363 @deffn {Scheme Procedure} current-input-port @deffnx {C Function} scm_current_input_port () Return the current input port. This is the default port used @@ -2897,6 +3181,7 @@ returns the @dfn{standard input} in Unix and C terminology. @end deffn current-output-port +@c snarfed from ports.c:375 @deffn {Scheme Procedure} current-output-port @deffnx {C Function} scm_current_output_port () Return the current output port. This is the default port used @@ -2906,6 +3191,7 @@ Unix and C terminology. @end deffn current-error-port +@c snarfed from ports.c:385 @deffn {Scheme Procedure} current-error-port @deffnx {C Function} scm_current_error_port () Return the port to which errors and warnings should be sent (the @@ -2913,6 +3199,7 @@ Return the port to which errors and warnings should be sent (the @end deffn current-load-port +@c snarfed from ports.c:395 @deffn {Scheme Procedure} current-load-port @deffnx {C Function} scm_current_load_port () Return the current-load-port. @@ -2920,6 +3207,7 @@ The load port is used internally by @code{primitive-load}. @end deffn set-current-input-port +@c snarfed from ports.c:408 @deffn {Scheme Procedure} set-current-input-port port @deffnx {Scheme Procedure} set-current-output-port port @deffnx {Scheme Procedure} set-current-error-port port @@ -2930,24 +3218,28 @@ so that they use the supplied @var{port} for input or output. @end deffn set-current-output-port +@c snarfed from ports.c:421 @deffn {Scheme Procedure} set-current-output-port port @deffnx {C Function} scm_set_current_output_port (port) Set the current default output port to @var{port}. @end deffn set-current-error-port +@c snarfed from ports.c:435 @deffn {Scheme Procedure} set-current-error-port port @deffnx {C Function} scm_set_current_error_port (port) Set the current default error port to @var{port}. @end deffn port-revealed +@c snarfed from ports.c:578 @deffn {Scheme Procedure} port-revealed port @deffnx {C Function} scm_port_revealed (port) Return the revealed count for @var{port}. @end deffn set-port-revealed! +@c snarfed from ports.c:591 @deffn {Scheme Procedure} set-port-revealed! port rcount @deffnx {C Function} scm_set_port_revealed_x (port, rcount) Sets the revealed count for a port to a given value. @@ -2955,6 +3247,7 @@ The return value is unspecified. @end deffn port-mode +@c snarfed from ports.c:634 @deffn {Scheme Procedure} port-mode port @deffnx {C Function} scm_port_mode (port) Return the port modes associated with the open port @var{port}. @@ -2964,6 +3257,7 @@ used only during port creation are not retained. @end deffn close-port +@c snarfed from ports.c:671 @deffn {Scheme Procedure} close-port port @deffnx {C Function} scm_close_port (port) Close the specified port object. Return @code{#t} if it @@ -2975,6 +3269,7 @@ descriptors. @end deffn close-input-port +@c snarfed from ports.c:699 @deffn {Scheme Procedure} close-input-port port @deffnx {C Function} scm_close_input_port (port) Close the specified input port object. The routine has no effect if @@ -2986,6 +3281,7 @@ which can close file descriptors. @end deffn close-output-port +@c snarfed from ports.c:714 @deffn {Scheme Procedure} close-output-port port @deffnx {C Function} scm_close_output_port (port) Close the specified output port object. The routine has no effect if @@ -2997,6 +3293,7 @@ which can close file descriptors. @end deffn port-for-each +@c snarfed from ports.c:731 @deffn {Scheme Procedure} port-for-each proc @deffnx {C Function} scm_port_for_each (proc) Apply @var{proc} to each port in the Guile port table @@ -3008,6 +3305,7 @@ have no effect as far as @var{port-for-each} is concerned. @end deffn input-port? +@c snarfed from ports.c:772 @deffn {Scheme Procedure} input-port? x @deffnx {C Function} scm_input_port_p (x) Return @code{#t} if @var{x} is an input port, otherwise return @@ -3016,6 +3314,7 @@ Return @code{#t} if @var{x} is an input port, otherwise return @end deffn output-port? +@c snarfed from ports.c:783 @deffn {Scheme Procedure} output-port? x @deffnx {C Function} scm_output_port_p (x) Return @code{#t} if @var{x} is an output port, otherwise return @@ -3024,6 +3323,7 @@ Return @code{#t} if @var{x} is an output port, otherwise return @end deffn port? +@c snarfed from ports.c:795 @deffn {Scheme Procedure} port? x @deffnx {C Function} scm_port_p (x) Return a boolean indicating whether @var{x} is a port. @@ -3032,6 +3332,7 @@ Equivalent to @code{(or (input-port? @var{x}) (output-port? @end deffn port-closed? +@c snarfed from ports.c:805 @deffn {Scheme Procedure} port-closed? port @deffnx {C Function} scm_port_closed_p (port) Return @code{#t} if @var{port} is closed or @code{#f} if it is @@ -3039,6 +3340,7 @@ open. @end deffn eof-object? +@c snarfed from ports.c:816 @deffn {Scheme Procedure} eof-object? x @deffnx {C Function} scm_eof_object_p (x) Return @code{#t} if @var{x} is an end-of-file object; otherwise @@ -3046,6 +3348,7 @@ return @code{#f}. @end deffn force-output +@c snarfed from ports.c:830 @deffn {Scheme Procedure} force-output [port] @deffnx {C Function} scm_force_output (port) Flush the specified output port, or the current output port if @var{port} @@ -3058,6 +3361,7 @@ The return value is unspecified. @end deffn flush-all-ports +@c snarfed from ports.c:848 @deffn {Scheme Procedure} flush-all-ports @deffnx {C Function} scm_flush_all_ports () Equivalent to calling @code{force-output} on @@ -3065,6 +3369,7 @@ all open output ports. The return value is unspecified. @end deffn read-char +@c snarfed from ports.c:866 @deffn {Scheme Procedure} read-char [port] @deffnx {C Function} scm_read_char (port) Return the next character available from @var{port}, updating @@ -3073,6 +3378,7 @@ characters are available, the end-of-file object is returned. @end deffn peek-char +@c snarfed from ports.c:1192 @deffn {Scheme Procedure} peek-char [port] @deffnx {C Function} scm_peek_char (port) Return the next character available from @var{port}, @@ -3090,6 +3396,7 @@ to @code{read-char} would have hung.} @end deffn unread-char +@c snarfed from ports.c:1213 @deffn {Scheme Procedure} unread-char cobj [port] @deffnx {C Function} scm_unread_char (cobj, port) Place @var{char} in @var{port} so that it will be read by the @@ -3099,6 +3406,7 @@ not supplied, the current input port is used. @end deffn unread-string +@c snarfed from ports.c:1236 @deffn {Scheme Procedure} unread-string str port @deffnx {C Function} scm_unread_string (str, port) Place the string @var{str} in @var{port} so that its characters will be @@ -3108,6 +3416,7 @@ unread characters will be read again in last-in first-out order. If @end deffn seek +@c snarfed from ports.c:1275 @deffn {Scheme Procedure} seek fd_port offset whence @deffnx {C Function} scm_seek (fd_port, offset, whence) Sets the current position of @var{fd/port} to the integer @@ -3136,6 +3445,7 @@ that the current position of a port can be obtained using: @end deffn truncate-file +@c snarfed from ports.c:1330 @deffn {Scheme Procedure} truncate-file object [length] @deffnx {C Function} scm_truncate_file (object, length) Truncates the object referred to by @var{object} to at most @@ -3147,18 +3457,21 @@ position. The return value is unspecified. @end deffn port-line +@c snarfed from ports.c:1383 @deffn {Scheme Procedure} port-line port @deffnx {C Function} scm_port_line (port) Return the current line number for @var{port}. @end deffn set-port-line! +@c snarfed from ports.c:1394 @deffn {Scheme Procedure} set-port-line! port line @deffnx {C Function} scm_set_port_line_x (port, line) Set the current line number for @var{port} to @var{line}. @end deffn port-column +@c snarfed from ports.c:1415 @deffn {Scheme Procedure} port-column port @deffnx {Scheme Procedure} port-line port @deffnx {C Function} scm_port_column (port) @@ -3173,6 +3486,7 @@ what non-programmers will find most natural.) @end deffn set-port-column! +@c snarfed from ports.c:1428 @deffn {Scheme Procedure} set-port-column! port column @deffnx {Scheme Procedure} set-port-line! port line @deffnx {C Function} scm_set_port_column_x (port, column) @@ -3181,6 +3495,7 @@ current input port if none is specified. @end deffn port-filename +@c snarfed from ports.c:1443 @deffn {Scheme Procedure} port-filename port @deffnx {C Function} scm_port_filename (port) Return the filename associated with @var{port}. This function returns @@ -3189,6 +3504,7 @@ when called on the current input, output and error ports respectively. @end deffn set-port-filename! +@c snarfed from ports.c:1457 @deffn {Scheme Procedure} set-port-filename! port filename @deffnx {C Function} scm_set_port_filename_x (port, filename) Change the filename associated with @var{port}, using the current input @@ -3198,6 +3514,7 @@ source of data, but only the value that is returned by @end deffn %make-void-port +@c snarfed from ports.c:1551 @deffn {Scheme Procedure} %make-void-port mode @deffnx {C Function} scm_sys_make_void_port (mode) Create and return a new void port. A void port acts like @@ -3207,6 +3524,7 @@ documentation for @code{open-file} in @ref{File Ports}. @end deffn print-options-interface +@c snarfed from print.c:142 @deffn {Scheme Procedure} print-options-interface [setting] @deffnx {C Function} scm_print_options (setting) Option interface for the print options. Instead of using @@ -3216,6 +3534,7 @@ and @code{print-options}. @end deffn simple-format +@c snarfed from print.c:921 @deffn {Scheme Procedure} simple-format destination message . args @deffnx {C Function} scm_simple_format (destination, message, args) Write @var{message} to @var{destination}, defaulting to @@ -3232,6 +3551,7 @@ containing the formatted text. Does not add a trailing newline. @end deffn newline +@c snarfed from print.c:1008 @deffn {Scheme Procedure} newline [port] @deffnx {C Function} scm_newline (port) Send a newline to @var{port}. @@ -3239,12 +3559,14 @@ If @var{port} is omitted, send to the current output port. @end deffn write-char +@c snarfed from print.c:1023 @deffn {Scheme Procedure} write-char chr [port] @deffnx {C Function} scm_write_char (chr, port) Send character @var{chr} to @var{port}. @end deffn port-with-print-state +@c snarfed from print.c:1077 @deffn {Scheme Procedure} port-with-print-state port pstate @deffnx {C Function} scm_port_with_print_state (port, pstate) Create a new port which behaves like @var{port}, but with an @@ -3252,6 +3574,7 @@ included print state @var{pstate}. @end deffn get-print-state +@c snarfed from print.c:1092 @deffn {Scheme Procedure} get-print-state port @deffnx {C Function} scm_get_print_state (port) Return the print state of the port @var{port}. If @var{port} @@ -3259,24 +3582,28 @@ has no associated print state, @code{#f} is returned. @end deffn procedure-properties +@c snarfed from procprop.c:176 @deffn {Scheme Procedure} procedure-properties proc @deffnx {C Function} scm_procedure_properties (proc) Return @var{obj}'s property list. @end deffn set-procedure-properties! +@c snarfed from procprop.c:189 @deffn {Scheme Procedure} set-procedure-properties! proc new_val @deffnx {C Function} scm_set_procedure_properties_x (proc, new_val) Set @var{obj}'s property list to @var{alist}. @end deffn procedure-property +@c snarfed from procprop.c:202 @deffn {Scheme Procedure} procedure-property p k @deffnx {C Function} scm_procedure_property (p, k) Return the property of @var{obj} with name @var{key}. @end deffn set-procedure-property! +@c snarfed from procprop.c:225 @deffn {Scheme Procedure} set-procedure-property! p k v @deffnx {C Function} scm_set_procedure_property_x (p, k, v) In @var{obj}'s property list, set the property named @var{key} to @@ -3284,24 +3611,28 @@ In @var{obj}'s property list, set the property named @var{key} to @end deffn procedure? +@c snarfed from procs.c:186 @deffn {Scheme Procedure} procedure? obj @deffnx {C Function} scm_procedure_p (obj) Return @code{#t} if @var{obj} is a procedure. @end deffn closure? +@c snarfed from procs.c:213 @deffn {Scheme Procedure} closure? obj @deffnx {C Function} scm_closure_p (obj) Return @code{#t} if @var{obj} is a closure. @end deffn thunk? +@c snarfed from procs.c:222 @deffn {Scheme Procedure} thunk? obj @deffnx {C Function} scm_thunk_p (obj) Return @code{#t} if @var{obj} is a thunk. @end deffn procedure-documentation +@c snarfed from procs.c:272 @deffn {Scheme Procedure} procedure-documentation proc @deffnx {C Function} scm_procedure_documentation (proc) Return the documentation string associated with @code{proc}. By @@ -3311,6 +3642,7 @@ documentation for that procedure. @end deffn procedure-with-setter? +@c snarfed from procs.c:308 @deffn {Scheme Procedure} procedure-with-setter? obj @deffnx {C Function} scm_procedure_with_setter_p (obj) Return @code{#t} if @var{obj} is a procedure with an @@ -3318,6 +3650,7 @@ associated setter procedure. @end deffn make-procedure-with-setter +@c snarfed from procs.c:318 @deffn {Scheme Procedure} make-procedure-with-setter procedure setter @deffnx {C Function} scm_make_procedure_with_setter (procedure, setter) Create a new procedure which behaves like @var{procedure}, but @@ -3325,6 +3658,7 @@ with the associated setter @var{setter}. @end deffn procedure +@c snarfed from procs.c:332 @deffn {Scheme Procedure} procedure proc @deffnx {C Function} scm_procedure (proc) Return the procedure of @var{proc}, which must be either a @@ -3332,6 +3666,7 @@ procedure with setter, or an operator struct. @end deffn primitive-make-property +@c snarfed from properties.c:64 @deffn {Scheme Procedure} primitive-make-property not_found_proc @deffnx {C Function} scm_primitive_make_property (not_found_proc) Create a @dfn{property token} that can be used with @@ -3341,6 +3676,7 @@ See @code{primitive-property-ref} for the significance of @end deffn primitive-property-ref +@c snarfed from properties.c:82 @deffn {Scheme Procedure} primitive-property-ref prop obj @deffnx {C Function} scm_primitive_property_ref (prop, obj) Return the property @var{prop} of @var{obj}. When no value @@ -3353,18 +3689,21 @@ default value of @var{prop}. @end deffn primitive-property-set! +@c snarfed from properties.c:113 @deffn {Scheme Procedure} primitive-property-set! prop obj val @deffnx {C Function} scm_primitive_property_set_x (prop, obj, val) Associate @var{code} with @var{prop} and @var{obj}. @end deffn primitive-property-del! +@c snarfed from properties.c:134 @deffn {Scheme Procedure} primitive-property-del! prop obj @deffnx {C Function} scm_primitive_property_del_x (prop, obj) Remove any value associated with @var{prop} and @var{obj}. @end deffn random +@c snarfed from random.c:376 @deffn {Scheme Procedure} random n [state] @deffnx {C Function} scm_random (n, state) Return a number in [0,N). @@ -3382,18 +3721,21 @@ as a side effect of the random operation. @end deffn copy-random-state +@c snarfed from random.c:399 @deffn {Scheme Procedure} copy-random-state [state] @deffnx {C Function} scm_copy_random_state (state) Return a copy of the random state @var{state}. @end deffn seed->random-state +@c snarfed from random.c:411 @deffn {Scheme Procedure} seed->random-state seed @deffnx {C Function} scm_seed_to_random_state (seed) Return a new random state using @var{seed}. @end deffn random:uniform +@c snarfed from random.c:425 @deffn {Scheme Procedure} random:uniform [state] @deffnx {C Function} scm_random_uniform (state) Return a uniformly distributed inexact real random number in @@ -3401,6 +3743,7 @@ Return a uniformly distributed inexact real random number in @end deffn random:normal +@c snarfed from random.c:440 @deffn {Scheme Procedure} random:normal [state] @deffnx {C Function} scm_random_normal (state) Return an inexact real in a normal distribution. The @@ -3410,6 +3753,7 @@ normal distribution with mean m and standard deviation d use @end deffn random:solid-sphere! +@c snarfed from random.c:496 @deffn {Scheme Procedure} random:solid-sphere! v [state] @deffnx {C Function} scm_random_solid_sphere_x (v, state) Fills vect with inexact real random numbers @@ -3421,6 +3765,7 @@ The sum of the squares of the numbers is returned. @end deffn random:hollow-sphere! +@c snarfed from random.c:519 @deffn {Scheme Procedure} random:hollow-sphere! v [state] @deffnx {C Function} scm_random_hollow_sphere_x (v, state) Fills vect with inexact real random numbers @@ -3432,6 +3777,7 @@ unit n-sphere. @end deffn random:normal-vector! +@c snarfed from random.c:537 @deffn {Scheme Procedure} random:normal-vector! v [state] @deffnx {C Function} scm_random_normal_vector_x (v, state) Fills vect with inexact real random numbers that are @@ -3440,6 +3786,7 @@ independent and standard normally distributed @end deffn random:exp +@c snarfed from random.c:562 @deffn {Scheme Procedure} random:exp [state] @deffnx {C Function} scm_random_exp (state) Return an inexact real in an exponential distribution with mean @@ -3448,6 +3795,7 @@ Return an inexact real in an exponential distribution with mean @end deffn %read-delimited! +@c snarfed from rdelim.c:78 @deffn {Scheme Procedure} %read-delimited! delims str gobble [port [start [end]]] @deffnx {C Function} scm_read_delimited_x (delims, str, gobble, port, start, end) Read characters from @var{port} into @var{str} until one of the @@ -3468,6 +3816,7 @@ a delimiter, this value is @code{#f}. @end deffn %read-line +@c snarfed from rdelim.c:222 @deffn {Scheme Procedure} %read-line [port] @deffnx {C Function} scm_read_line (port) Read a newline-terminated line from @var{port}, allocating storage as @@ -3479,6 +3828,7 @@ delimiter may be either a newline or the @var{eof-object}; if @end deffn write-line +@c snarfed from rdelim.c:275 @deffn {Scheme Procedure} write-line obj [port] @deffnx {C Function} scm_write_line (obj, port) Display @var{obj} and a newline character to @var{port}. If @@ -3491,6 +3841,7 @@ used. This function is equivalent to: @end deffn read-options-interface +@c snarfed from read.c:82 @deffn {Scheme Procedure} read-options-interface [setting] @deffnx {C Function} scm_read_options (setting) Option interface for the read options. Instead of using @@ -3499,6 +3850,7 @@ this procedure directly, use the procedures @code{read-enable}, @end deffn read +@c snarfed from read.c:102 @deffn {Scheme Procedure} read [port] @deffnx {C Function} scm_read (port) Read an s-expression from the input port @var{port}, or from @@ -3507,6 +3859,7 @@ Any whitespace before the next token is discarded. @end deffn read-hash-extend +@c snarfed from read.c:769 @deffn {Scheme Procedure} read-hash-extend chr proc @deffnx {C Function} scm_read_hash_extend (chr, proc) Install the procedure @var{proc} for reading expressions @@ -3517,6 +3870,7 @@ returned will be the return value of @code{read}. @end deffn call-with-dynamic-root +@c snarfed from root.c:352 @deffn {Scheme Procedure} call-with-dynamic-root thunk handler @deffnx {C Function} scm_call_with_dynamic_root (thunk, handler) Evaluate @code{(thunk)} in a new dynamic context, returning its value. @@ -3564,6 +3918,7 @@ be under a new dynamic root.) @end deffn dynamic-root +@c snarfed from root.c:365 @deffn {Scheme Procedure} dynamic-root @deffnx {C Function} scm_dynamic_root () Return an object representing the current dynamic root. @@ -3574,6 +3929,7 @@ in no way depend on this. @end deffn read-string!/partial +@c snarfed from rw.c:121 @deffn {Scheme Procedure} read-string!/partial str [port_or_fdes [start [end]]] @deffnx {C Function} scm_read_string_x_partial (str, port_or_fdes, start, end) Read characters from a port or file descriptor into a @@ -3616,6 +3972,7 @@ end-of-file check. @end deffn write-string/partial +@c snarfed from rw.c:215 @deffn {Scheme Procedure} write-string/partial str [port_or_fdes [start [end]]] @deffnx {C Function} scm_write_string_partial (str, port_or_fdes, start, end) Write characters from a string @var{str} to a port or file @@ -3662,6 +4019,7 @@ return 0 immediately if the request size is 0 bytes. @end deffn sigaction +@c snarfed from scmsigs.c:182 @deffn {Scheme Procedure} sigaction signum [handler [flags]] @deffnx {C Function} scm_sigaction (signum, handler, flags) Install or report the signal handler for a specified signal. @@ -3693,6 +4051,7 @@ structures. @end deffn restore-signals +@c snarfed from scmsigs.c:345 @deffn {Scheme Procedure} restore-signals @deffnx {C Function} scm_restore_signals () Return all signal handlers to the values they had before any call to @@ -3700,6 +4059,7 @@ Return all signal handlers to the values they had before any call to @end deffn alarm +@c snarfed from scmsigs.c:384 @deffn {Scheme Procedure} alarm i @deffnx {C Function} scm_alarm (i) Set a timer to raise a @code{SIGALRM} signal after the specified @@ -3714,6 +4074,7 @@ no previous alarm, the return value is zero. @end deffn setitimer +@c snarfed from scmsigs.c:414 @deffn {Scheme Procedure} setitimer which_timer interval_seconds interval_microseconds value_seconds value_microseconds @deffnx {C Function} scm_setitimer (which_timer, interval_seconds, interval_microseconds, value_seconds, value_microseconds) Set the timer specified by @var{which_timer} according to the given @@ -3734,6 +4095,7 @@ the seconds and microseconds of the timer @code{it_value}. @end deffn getitimer +@c snarfed from scmsigs.c:455 @deffn {Scheme Procedure} getitimer which_timer @deffnx {C Function} scm_getitimer (which_timer) Return information about the timer specified by @var{which_timer} @@ -3750,6 +4112,7 @@ the seconds and microseconds of the timer @code{it_value}. @end deffn pause +@c snarfed from scmsigs.c:482 @deffn {Scheme Procedure} pause @deffnx {C Function} scm_pause () Pause the current process (thread?) until a signal arrives whose @@ -3758,6 +4121,7 @@ handler procedure. The return value is unspecified. @end deffn sleep +@c snarfed from scmsigs.c:495 @deffn {Scheme Procedure} sleep i @deffnx {C Function} scm_sleep (i) Wait for the given number of seconds (an integer) or until a signal @@ -3766,6 +4130,7 @@ of seconds remaining otherwise. @end deffn usleep +@c snarfed from scmsigs.c:513 @deffn {Scheme Procedure} usleep i @deffnx {C Function} scm_usleep (i) Sleep for I microseconds. @code{usleep} is not available on @@ -3773,6 +4138,7 @@ all platforms. @end deffn raise +@c snarfed from scmsigs.c:542 @deffn {Scheme Procedure} raise sig @deffnx {C Function} scm_raise (sig) Sends a specified signal @var{sig} to the current process, where @@ -3780,6 +4146,7 @@ Sends a specified signal @var{sig} to the current process, where @end deffn system +@c snarfed from simpos.c:76 @deffn {Scheme Procedure} system [cmd] @deffnx {C Function} scm_system (cmd) Execute @var{cmd} using the operating system's "command @@ -3793,6 +4160,7 @@ indicating whether the command processor is available. @end deffn getenv +@c snarfed from simpos.c:103 @deffn {Scheme Procedure} getenv nam @deffnx {C Function} scm_getenv (nam) Looks up the string @var{name} in the current environment. The return @@ -3801,6 +4169,7 @@ found, in which case the string @code{VALUE} is returned. @end deffn primitive-exit +@c snarfed from simpos.c:118 @deffn {Scheme Procedure} primitive-exit [status] @deffnx {C Function} scm_primitive_exit (status) Terminate the current process without unwinding the Scheme stack. @@ -3809,6 +4178,7 @@ is @var{status} if supplied, otherwise zero. @end deffn restricted-vector-sort! +@c snarfed from sort.c:422 @deffn {Scheme Procedure} restricted-vector-sort! vec less startpos endpos @deffnx {C Function} scm_restricted_vector_sort_x (vec, less, startpos, endpos) Sort the vector @var{vec}, using @var{less} for comparing @@ -3818,6 +4188,7 @@ is not specified. @end deffn sorted? +@c snarfed from sort.c:453 @deffn {Scheme Procedure} sorted? items less @deffnx {C Function} scm_sorted_p (items, less) Return @code{#t} iff @var{items} is a list or a vector such that @@ -3826,6 +4197,7 @@ applied to all elements i - 1 and i @end deffn merge +@c snarfed from sort.c:526 @deffn {Scheme Procedure} merge alist blist less @deffnx {C Function} scm_merge (alist, blist, less) Merge two already sorted lists into one. @@ -3838,6 +4210,7 @@ Note: this does _not_ accept vectors. @end deffn merge! +@c snarfed from sort.c:639 @deffn {Scheme Procedure} merge! alist blist less @deffnx {C Function} scm_merge_x (alist, blist, less) Takes two lists @var{alist} and @var{blist} such that @@ -3850,6 +4223,7 @@ Note: this does _not_ accept vectors. @end deffn sort! +@c snarfed from sort.c:715 @deffn {Scheme Procedure} sort! items less @deffnx {C Function} scm_sort_x (items, less) Sort the sequence @var{items}, which may be a list or a @@ -3860,6 +4234,7 @@ This is not a stable sort. @end deffn sort +@c snarfed from sort.c:749 @deffn {Scheme Procedure} sort items less @deffnx {C Function} scm_sort (items, less) Sort the sequence @var{items}, which may be a list or a @@ -3868,6 +4243,7 @@ elements. This is not a stable sort. @end deffn stable-sort! +@c snarfed from sort.c:845 @deffn {Scheme Procedure} stable-sort! items less @deffnx {C Function} scm_stable_sort_x (items, less) Sort the sequence @var{items}, which may be a list or a @@ -3878,6 +4254,7 @@ This is a stable sort. @end deffn stable-sort +@c snarfed from sort.c:885 @deffn {Scheme Procedure} stable-sort items less @deffnx {C Function} scm_stable_sort (items, less) Sort the sequence @var{items}, which may be a list or a @@ -3886,6 +4263,7 @@ This is a stable sort. @end deffn sort-list! +@c snarfed from sort.c:931 @deffn {Scheme Procedure} sort-list! items less @deffnx {C Function} scm_sort_list_x (items, less) Sort the list @var{items}, using @var{less} for comparing the @@ -3895,6 +4273,7 @@ This is a stable sort. @end deffn sort-list +@c snarfed from sort.c:945 @deffn {Scheme Procedure} sort-list items less @deffnx {C Function} scm_sort_list (items, less) Sort the list @var{items}, using @var{less} for comparing the @@ -3902,12 +4281,14 @@ list elements. This is a stable sort. @end deffn source-properties +@c snarfed from srcprop.c:170 @deffn {Scheme Procedure} source-properties obj @deffnx {C Function} scm_source_properties (obj) Return the source property association list of @var{obj}. @end deffn set-source-properties! +@c snarfed from srcprop.c:193 @deffn {Scheme Procedure} set-source-properties! obj plist @deffnx {C Function} scm_set_source_properties_x (obj, plist) Install the association list @var{plist} as the source property @@ -3915,6 +4296,7 @@ list for @var{obj}. @end deffn source-property +@c snarfed from srcprop.c:213 @deffn {Scheme Procedure} source-property obj key @deffnx {C Function} scm_source_property (obj, key) Return the source property specified by @var{key} from @@ -3922,6 +4304,7 @@ Return the source property specified by @var{key} from @end deffn set-source-property! +@c snarfed from srcprop.c:246 @deffn {Scheme Procedure} set-source-property! obj key datum @deffnx {C Function} scm_set_source_property_x (obj, key, datum) Set the source property of object @var{obj}, which is specified by @@ -3929,12 +4312,14 @@ Set the source property of object @var{obj}, which is specified by @end deffn stack? +@c snarfed from stacks.c:411 @deffn {Scheme Procedure} stack? obj @deffnx {C Function} scm_stack_p (obj) Return @code{#t} if @var{obj} is a calling stack. @end deffn make-stack +@c snarfed from stacks.c:442 @deffn {Scheme Procedure} make-stack obj . args @deffnx {C Function} scm_make_stack (obj, args) Create a new stack. If @var{obj} is @code{#t}, the current @@ -3968,30 +4353,35 @@ taken as 0. @end deffn stack-id +@c snarfed from stacks.c:534 @deffn {Scheme Procedure} stack-id stack @deffnx {C Function} scm_stack_id (stack) Return the identifier given to @var{stack} by @code{start-stack}. @end deffn stack-ref +@c snarfed from stacks.c:575 @deffn {Scheme Procedure} stack-ref stack index @deffnx {C Function} scm_stack_ref (stack, index) Return the @var{index}'th frame from @var{stack}. @end deffn stack-length +@c snarfed from stacks.c:591 @deffn {Scheme Procedure} stack-length stack @deffnx {C Function} scm_stack_length (stack) Return the length of @var{stack}. @end deffn frame? +@c snarfed from stacks.c:604 @deffn {Scheme Procedure} frame? obj @deffnx {C Function} scm_frame_p (obj) Return @code{#t} if @var{obj} is a stack frame. @end deffn last-stack-frame +@c snarfed from stacks.c:615 @deffn {Scheme Procedure} last-stack-frame obj @deffnx {C Function} scm_last_stack_frame (obj) Return a stack which consists of a single frame, which is the @@ -4000,18 +4390,21 @@ debug object or a continuation. @end deffn frame-number +@c snarfed from stacks.c:657 @deffn {Scheme Procedure} frame-number frame @deffnx {C Function} scm_frame_number (frame) Return the frame number of @var{frame}. @end deffn frame-source +@c snarfed from stacks.c:667 @deffn {Scheme Procedure} frame-source frame @deffnx {C Function} scm_frame_source (frame) Return the source of @var{frame}. @end deffn frame-procedure +@c snarfed from stacks.c:678 @deffn {Scheme Procedure} frame-procedure frame @deffnx {C Function} scm_frame_procedure (frame) Return the procedure for @var{frame}, or @code{#f} if no @@ -4019,12 +4412,14 @@ procedure is associated with @var{frame}. @end deffn frame-arguments +@c snarfed from stacks.c:690 @deffn {Scheme Procedure} frame-arguments frame @deffnx {C Function} scm_frame_arguments (frame) Return the arguments of @var{frame}. @end deffn frame-previous +@c snarfed from stacks.c:701 @deffn {Scheme Procedure} frame-previous frame @deffnx {C Function} scm_frame_previous (frame) Return the previous frame of @var{frame}, or @code{#f} if @@ -4032,6 +4427,7 @@ Return the previous frame of @var{frame}, or @code{#f} if @end deffn frame-next +@c snarfed from stacks.c:717 @deffn {Scheme Procedure} frame-next frame @deffnx {C Function} scm_frame_next (frame) Return the next frame of @var{frame}, or @code{#f} if @@ -4039,30 +4435,35 @@ Return the next frame of @var{frame}, or @code{#f} if @end deffn frame-real? +@c snarfed from stacks.c:732 @deffn {Scheme Procedure} frame-real? frame @deffnx {C Function} scm_frame_real_p (frame) Return @code{#t} if @var{frame} is a real frame. @end deffn frame-procedure? +@c snarfed from stacks.c:742 @deffn {Scheme Procedure} frame-procedure? frame @deffnx {C Function} scm_frame_procedure_p (frame) Return @code{#t} if a procedure is associated with @var{frame}. @end deffn frame-evaluating-args? +@c snarfed from stacks.c:752 @deffn {Scheme Procedure} frame-evaluating-args? frame @deffnx {C Function} scm_frame_evaluating_args_p (frame) Return @code{#t} if @var{frame} contains evaluated arguments. @end deffn frame-overflow? +@c snarfed from stacks.c:762 @deffn {Scheme Procedure} frame-overflow? frame @deffnx {C Function} scm_frame_overflow_p (frame) Return @code{#t} if @var{frame} is an overflow frame. @end deffn get-internal-real-time +@c snarfed from stime.c:143 @deffn {Scheme Procedure} get-internal-real-time @deffnx {C Function} scm_get_internal_real_time () Return the number of time units since the interpreter was @@ -4070,6 +4471,7 @@ started. @end deffn times +@c snarfed from stime.c:188 @deffn {Scheme Procedure} times @deffnx {C Function} scm_times () Return an object with information about real and processor @@ -4096,6 +4498,7 @@ terminated child processes. @end deffn get-internal-run-time +@c snarfed from stime.c:220 @deffn {Scheme Procedure} get-internal-run-time @deffnx {C Function} scm_get_internal_run_time () Return the number of time units of processor time used by the @@ -4104,6 +4507,7 @@ included but subprocesses are not. @end deffn current-time +@c snarfed from stime.c:230 @deffn {Scheme Procedure} current-time @deffnx {C Function} scm_current_time () Return the number of seconds since 1970-01-01 00:00:00 UTC, @@ -4111,6 +4515,7 @@ excluding leap seconds. @end deffn gettimeofday +@c snarfed from stime.c:248 @deffn {Scheme Procedure} gettimeofday @deffnx {C Function} scm_gettimeofday () Return a pair containing the number of seconds and microseconds @@ -4120,6 +4525,7 @@ operating system. @end deffn localtime +@c snarfed from stime.c:347 @deffn {Scheme Procedure} localtime time [zone] @deffnx {C Function} scm_localtime (time, zone) Return an object representing the broken down components of @@ -4130,6 +4536,7 @@ optionally specified by @var{zone} (a string), otherwise the @end deffn gmtime +@c snarfed from stime.c:420 @deffn {Scheme Procedure} gmtime time @deffnx {C Function} scm_gmtime (time) Return an object representing the broken down components of @@ -4138,6 +4545,7 @@ Return an object representing the broken down components of @end deffn mktime +@c snarfed from stime.c:482 @deffn {Scheme Procedure} mktime sbd_time [zone] @deffnx {C Function} scm_mktime (sbd_time, zone) @var{bd-time} is an object representing broken down time and @code{zone} @@ -4151,6 +4559,7 @@ as @var{bd-time} but with normalized values. @end deffn tzset +@c snarfed from stime.c:556 @deffn {Scheme Procedure} tzset @deffnx {C Function} scm_tzset () Initialize the timezone from the TZ environment variable @@ -4160,6 +4569,7 @@ timezone. @end deffn strftime +@c snarfed from stime.c:573 @deffn {Scheme Procedure} strftime format stime @deffnx {C Function} scm_strftime (format, stime) Formats a time specification @var{time} using @var{template}. @var{time} @@ -4172,6 +4582,7 @@ is the formatted string. @end deffn strptime +@c snarfed from stime.c:670 @deffn {Scheme Procedure} strptime format string @deffnx {C Function} scm_strptime (format, string) Performs the reverse action to @code{strftime}, parsing @@ -4187,17 +4598,20 @@ which were used for the conversion. @end deffn string? +@c snarfed from strings.c:61 @deffn {Scheme Procedure} string? obj @deffnx {C Function} scm_string_p (obj) Return @code{#t} iff @var{obj} is a string, else @code{#f}. @end deffn list->string +@c snarfed from strings.c:69 @deffn {Scheme Procedure} list->string implemented by the C function "scm_string" @end deffn string +@c snarfed from strings.c:75 @deffn {Scheme Procedure} string . chrs @deffnx {Scheme Procedure} list->string chrs @deffnx {C Function} scm_string (chrs) @@ -4206,6 +4620,7 @@ Return a newly allocated string composed of the arguments, @end deffn make-string +@c snarfed from strings.c:209 @deffn {Scheme Procedure} make-string k [chr] @deffnx {C Function} scm_make_string (k, chr) Return a newly allocated string of @@ -4215,12 +4630,14 @@ of the @var{string} are unspecified. @end deffn string-length +@c snarfed from strings.c:242 @deffn {Scheme Procedure} string-length string @deffnx {C Function} scm_string_length (string) Return the number of characters in @var{string}. @end deffn string-ref +@c snarfed from strings.c:253 @deffn {Scheme Procedure} string-ref str k @deffnx {C Function} scm_string_ref (str, k) Return character @var{k} of @var{str} using zero-origin @@ -4228,6 +4645,7 @@ indexing. @var{k} must be a valid index of @var{str}. @end deffn string-set! +@c snarfed from strings.c:270 @deffn {Scheme Procedure} string-set! str k chr @deffnx {C Function} scm_string_set_x (str, k, chr) Store @var{chr} in element @var{k} of @var{str} and return @@ -4236,6 +4654,7 @@ an unspecified value. @var{k} must be a valid index of @end deffn substring +@c snarfed from strings.c:289 @deffn {Scheme Procedure} substring str start [end] @deffnx {C Function} scm_substring (str, start, end) Return a newly allocated string formed from the characters @@ -4248,6 +4667,7 @@ exact integers satisfying: @end deffn string-append +@c snarfed from strings.c:315 @deffn {Scheme Procedure} string-append . args @deffnx {C Function} scm_string_append (args) Return a newly allocated string whose characters form the @@ -4255,6 +4675,7 @@ concatenation of the given strings, @var{args}. @end deffn string-index +@c snarfed from strop.c:138 @deffn {Scheme Procedure} string-index str chr [frm [to]] @deffnx {C Function} scm_string_index (str, chr, frm, to) Return the index of the first occurrence of @var{chr} in @@ -4276,6 +4697,7 @@ procedure essentially implements the @code{index} or @end deffn string-rindex +@c snarfed from strop.c:168 @deffn {Scheme Procedure} string-rindex str chr [frm [to]] @deffnx {C Function} scm_string_rindex (str, chr, frm, to) Like @code{string-index}, but search from the right of the @@ -4296,6 +4718,7 @@ the C library. @end deffn substring-move! +@c snarfed from strop.c:188 @deffn {Scheme Procedure} substring-move! str1 start1 end1 str2 start2 @deffnx {C Function} scm_substring_move_x (str1, start1, end1, str2, start2) Copy the substring of @var{str1} bounded by @var{start1} and @var{end1} @@ -4304,6 +4727,7 @@ into @var{str2} beginning at position @var{start2}. @end deffn substring-fill! +@c snarfed from strop.c:224 @deffn {Scheme Procedure} substring-fill! str start end fill @deffnx {C Function} scm_substring_fill_x (str, start, end, fill) Change every character in @var{str} between @var{start} and @@ -4318,6 +4742,7 @@ y @end deffn string-null? +@c snarfed from strop.c:249 @deffn {Scheme Procedure} string-null? str @deffnx {C Function} scm_string_null_p (str) Return @code{#t} if @var{str}'s length is zero, and @@ -4330,6 +4755,7 @@ y @result{} "foo" @end deffn string->list +@c snarfed from strop.c:263 @deffn {Scheme Procedure} string->list str @deffnx {C Function} scm_string_to_list (str) Return a newly allocated list of the characters that make up @@ -4339,12 +4765,14 @@ concerned. @end deffn string-copy +@c snarfed from strop.c:292 @deffn {Scheme Procedure} string-copy str @deffnx {C Function} scm_string_copy (str) Return a newly allocated copy of the given @var{string}. @end deffn string-fill! +@c snarfed from strop.c:305 @deffn {Scheme Procedure} string-fill! str chr @deffnx {C Function} scm_string_fill_x (str, chr) Store @var{char} in every element of the given @var{string} and @@ -4352,6 +4780,7 @@ return an unspecified value. @end deffn string-upcase! +@c snarfed from strop.c:340 @deffn {Scheme Procedure} string-upcase! str @deffnx {C Function} scm_string_upcase_x (str) Destructively upcase every character in @var{str} and return @@ -4364,6 +4793,7 @@ y @result{} "ARRDEFG" @end deffn string-upcase +@c snarfed from strop.c:353 @deffn {Scheme Procedure} string-upcase str @deffnx {C Function} scm_string_upcase (str) Return a freshly allocated string containing the characters of @@ -4371,6 +4801,7 @@ Return a freshly allocated string containing the characters of @end deffn string-downcase! +@c snarfed from strop.c:385 @deffn {Scheme Procedure} string-downcase! str @deffnx {C Function} scm_string_downcase_x (str) Destructively downcase every character in @var{str} and return @@ -4383,6 +4814,7 @@ y @result{} "arrdefg" @end deffn string-downcase +@c snarfed from strop.c:398 @deffn {Scheme Procedure} string-downcase str @deffnx {C Function} scm_string_downcase (str) Return a freshly allocation string containing the characters in @@ -4390,6 +4822,7 @@ Return a freshly allocation string containing the characters in @end deffn string-capitalize! +@c snarfed from strop.c:443 @deffn {Scheme Procedure} string-capitalize! str @deffnx {C Function} scm_string_capitalize_x (str) Upcase the first character of every word in @var{str} @@ -4403,6 +4836,7 @@ y @result{} "Hello World" @end deffn string-capitalize +@c snarfed from strop.c:457 @deffn {Scheme Procedure} string-capitalize str @deffnx {C Function} scm_string_capitalize (str) Return a freshly allocated string with the characters in @@ -4411,6 +4845,7 @@ capitalized. @end deffn string-split +@c snarfed from strop.c:486 @deffn {Scheme Procedure} string-split str chr @deffnx {C Function} scm_string_split (str, chr) Split the string @var{str} into the a list of the substrings delimited @@ -4434,6 +4869,7 @@ result list. @end deffn string-ci->symbol +@c snarfed from strop.c:521 @deffn {Scheme Procedure} string-ci->symbol str @deffnx {C Function} scm_string_ci_to_symbol (str) Return the symbol whose name is @var{str}. @var{str} is @@ -4442,6 +4878,7 @@ is currently reading symbols case-insensitively. @end deffn string=? +@c snarfed from strorder.c:62 @deffn {Scheme Procedure} string=? s1 s2 Lexicographic equality predicate; return @code{#t} if the two strings are the same length and contain the same characters in @@ -4454,6 +4891,7 @@ characters. @end deffn string-ci=? +@c snarfed from strorder.c:97 @deffn {Scheme Procedure} string-ci=? s1 s2 Case-insensitive string equality predicate; return @code{#t} if the two strings are the same length and their component @@ -4462,30 +4900,35 @@ return @code{#f}. @end deffn string? +@c snarfed from strorder.c:182 @deffn {Scheme Procedure} string>? s1 s2 Lexicographic ordering predicate; return @code{#t} if @var{s1} is lexicographically greater than @var{s2}. @end deffn string>=? +@c snarfed from strorder.c:196 @deffn {Scheme Procedure} string>=? s1 s2 Lexicographic ordering predicate; return @code{#t} if @var{s1} is lexicographically greater than or equal to @var{s2}. @end deffn string-ci? +@c snarfed from strorder.c:265 @deffn {Scheme Procedure} string-ci>? s1 s2 Case insensitive lexicographic ordering predicate; return @code{#t} if @var{s1} is lexicographically greater than @@ -4507,6 +4952,7 @@ Case insensitive lexicographic ordering predicate; return @end deffn string-ci>=? +@c snarfed from strorder.c:280 @deffn {Scheme Procedure} string-ci>=? s1 s2 Case insensitive lexicographic ordering predicate; return @code{#t} if @var{s1} is lexicographically greater than or @@ -4514,6 +4960,7 @@ equal to @var{s2} regardless of case. @end deffn object->string +@c snarfed from strports.c:321 @deffn {Scheme Procedure} object->string obj [printer] @deffnx {C Function} scm_object_to_string (obj, printer) Return a Scheme string obtained by printing @var{obj}. @@ -4522,6 +4969,7 @@ argument @var{printer} (default: @code{write}). @end deffn call-with-output-string +@c snarfed from strports.c:345 @deffn {Scheme Procedure} call-with-output-string proc @deffnx {C Function} scm_call_with_output_string (proc) Calls the one-argument procedure @var{proc} with a newly created output @@ -4530,6 +4978,7 @@ written into the port is returned. @end deffn call-with-input-string +@c snarfed from strports.c:364 @deffn {Scheme Procedure} call-with-input-string string proc @deffnx {C Function} scm_call_with_input_string (string, proc) Calls the one-argument procedure @var{proc} with a newly @@ -4538,6 +4987,7 @@ read. The value yielded by the @var{proc} is returned. @end deffn open-input-string +@c snarfed from strports.c:377 @deffn {Scheme Procedure} open-input-string str @deffnx {C Function} scm_open_input_string (str) Take a string and return an input port that delivers characters @@ -4547,6 +4997,7 @@ by the garbage collector if it becomes inaccessible. @end deffn open-output-string +@c snarfed from strports.c:391 @deffn {Scheme Procedure} open-output-string @deffnx {C Function} scm_open_output_string () Return an output port that will accumulate characters for @@ -4557,6 +5008,7 @@ inaccessible. @end deffn get-output-string +@c snarfed from strports.c:408 @deffn {Scheme Procedure} get-output-string port @deffnx {C Function} scm_get_output_string (port) Given an output port created by @code{open-output-string}, @@ -4565,6 +5017,7 @@ output to the port so far. @end deffn eval-string +@c snarfed from strports.c:467 @deffn {Scheme Procedure} eval-string string @deffnx {C Function} scm_eval_string (string) Evaluate @var{string} as the text representation of a Scheme @@ -4574,6 +5027,7 @@ procedure @code{interaction-environment}. @end deffn make-struct-layout +@c snarfed from struct.c:77 @deffn {Scheme Procedure} make-struct-layout fields @deffnx {C Function} scm_make_struct_layout (fields) Return a new structure layout object. @@ -4589,6 +5043,7 @@ indicate that the field is a tail-array. @end deffn struct? +@c snarfed from struct.c:244 @deffn {Scheme Procedure} struct? x @deffnx {C Function} scm_struct_p (x) Return @code{#t} iff @var{x} is a structure object, else @@ -4596,12 +5051,14 @@ Return @code{#t} iff @var{x} is a structure object, else @end deffn struct-vtable? +@c snarfed from struct.c:253 @deffn {Scheme Procedure} struct-vtable? x @deffnx {C Function} scm_struct_vtable_p (x) Return @code{#t} iff @var{x} is a vtable structure. @end deffn make-struct +@c snarfed from struct.c:434 @deffn {Scheme Procedure} make-struct vtable tail_array_size . init @deffnx {C Function} scm_make_struct (vtable, tail_array_size, init) Create a new structure. @@ -4632,6 +5089,7 @@ For more information, see the documentation for @code{make-vtable-vtable}. @end deffn make-vtable-vtable +@c snarfed from struct.c:519 @deffn {Scheme Procedure} make-vtable-vtable user_fields tail_array_size . init @deffnx {C Function} scm_make_vtable_vtable (user_fields, tail_array_size, init) Return a new, self-describing vtable structure. @@ -4693,6 +5151,7 @@ ball @result{} # @end deffn struct-ref +@c snarfed from struct.c:560 @deffn {Scheme Procedure} struct-ref handle pos @deffnx {Scheme Procedure} struct-set! struct n value @deffnx {C Function} scm_struct_ref (handle, pos) @@ -4705,6 +5164,7 @@ integer value small enough to fit in one machine word. @end deffn struct-set! +@c snarfed from struct.c:638 @deffn {Scheme Procedure} struct-set! handle pos val @deffnx {C Function} scm_struct_set_x (handle, pos, val) Set the slot of the structure @var{handle} with index @var{pos} @@ -4713,37 +5173,58 @@ to. @end deffn struct-vtable +@c snarfed from struct.c:708 @deffn {Scheme Procedure} struct-vtable handle @deffnx {C Function} scm_struct_vtable (handle) Return the vtable structure that describes the type of @var{struct}. @end deffn struct-vtable-tag +@c snarfed from struct.c:719 @deffn {Scheme Procedure} struct-vtable-tag handle @deffnx {C Function} scm_struct_vtable_tag (handle) Return the vtable tag of the structure @var{handle}. @end deffn struct-vtable-name +@c snarfed from struct.c:758 @deffn {Scheme Procedure} struct-vtable-name vtable @deffnx {C Function} scm_struct_vtable_name (vtable) Return the name of the vtable @var{vtable}. @end deffn set-struct-vtable-name! +@c snarfed from struct.c:768 @deffn {Scheme Procedure} set-struct-vtable-name! vtable name @deffnx {C Function} scm_set_struct_vtable_name_x (vtable, name) Set the name of the vtable @var{vtable} to @var{name}. @end deffn symbol? +@c snarfed from symbols.c:164 @deffn {Scheme Procedure} symbol? obj @deffnx {C Function} scm_symbol_p (obj) Return @code{#t} if @var{obj} is a symbol, otherwise return @code{#f}. @end deffn + symbol-interned? +@c snarfed from symbols.c:174 +@deffn {Scheme Procedure} symbol-interned? symbol +@deffnx {C Function} scm_symbol_interned_p (symbol) +Return @code{#t} if @var{symbol} is interned, otherwise return +@code{#f}. +@end deffn + + make-symbol +@c snarfed from symbols.c:186 +@deffn {Scheme Procedure} make-symbol name +@deffnx {C Function} scm_make_symbol (name) +Return a new uninterned symbol with the name @var{name}. The returned symbol is guaranteed to be unique and future calls to @code{string->symbol} will not return it. +@end deffn + symbol->string +@c snarfed from symbols.c:222 @deffn {Scheme Procedure} symbol->string s @deffnx {C Function} scm_symbol_to_string (s) Return the name of @var{symbol} as a string. If the symbol was @@ -4772,6 +5253,7 @@ standard case is lower case: @end deffn string->symbol +@c snarfed from symbols.c:255 @deffn {Scheme Procedure} string->symbol string @deffnx {C Function} scm_string_to_symbol (string) Return the symbol whose name is @var{string}. This procedure @@ -4797,46 +5279,53 @@ standard case is lower case: @end deffn gensym +@c snarfed from symbols.c:277 @deffn {Scheme Procedure} gensym [prefix] @deffnx {C Function} scm_gensym (prefix) Create a new symbol with a name constructed from a prefix and a counter value. The string @var{prefix} can be specified as -an optional argument. Default prefix is @code{g}. The counter +an optional argument. Default prefix is @code{ g}. The counter is increased by 1 at each call. There is no provision for resetting the counter. @end deffn symbol-hash +@c snarfed from symbols.c:309 @deffn {Scheme Procedure} symbol-hash symbol @deffnx {C Function} scm_symbol_hash (symbol) Return a hash value for @var{symbol}. @end deffn symbol-fref +@c snarfed from symbols.c:319 @deffn {Scheme Procedure} symbol-fref s @deffnx {C Function} scm_symbol_fref (s) Return the contents of @var{symbol}'s @dfn{function slot}. @end deffn symbol-pref +@c snarfed from symbols.c:330 @deffn {Scheme Procedure} symbol-pref s @deffnx {C Function} scm_symbol_pref (s) Return the @dfn{property list} currently associated with @var{symbol}. @end deffn symbol-fset! +@c snarfed from symbols.c:341 @deffn {Scheme Procedure} symbol-fset! s val @deffnx {C Function} scm_symbol_fset_x (s, val) Change the binding of @var{symbol}'s function slot. @end deffn symbol-pset! +@c snarfed from symbols.c:353 @deffn {Scheme Procedure} symbol-pset! s val @deffnx {C Function} scm_symbol_pset_x (s, val) Change the binding of @var{symbol}'s property slot. @end deffn catch +@c snarfed from throw.c:534 @deffn {Scheme Procedure} catch key thunk handler @deffnx {C Function} scm_catch (key, thunk, handler) Invoke @var{thunk} in the dynamic context of @var{handler} for @@ -4860,6 +5349,7 @@ match this call to @code{catch}. @end deffn lazy-catch +@c snarfed from throw.c:562 @deffn {Scheme Procedure} lazy-catch key thunk handler @deffnx {C Function} scm_lazy_catch (key, thunk, handler) This behaves exactly like @code{catch}, except that it does @@ -4869,6 +5359,7 @@ it must throw to another catch, or otherwise exit non-locally. @end deffn throw +@c snarfed from throw.c:595 @deffn {Scheme Procedure} throw key . args @deffnx {C Function} scm_throw (key, args) Invoke the catch form matching @var{key}, passing @var{args} to the @@ -4881,6 +5372,7 @@ If there is no handler at all, Guile prints an error and then exits. @end deffn values +@c snarfed from values.c:77 @deffn {Scheme Procedure} values . args @deffnx {C Function} scm_values (args) Delivers all of its arguments to its continuation. Except for @@ -4891,18 +5383,21 @@ were not created by @code{call-with-values} is unspecified. @end deffn make-variable +@c snarfed from variable.c:76 @deffn {Scheme Procedure} make-variable init @deffnx {C Function} scm_make_variable (init) Return a variable initialized to value @var{init}. @end deffn make-undefined-variable +@c snarfed from variable.c:86 @deffn {Scheme Procedure} make-undefined-variable @deffnx {C Function} scm_make_undefined_variable () Return a variable that is initially unbound. @end deffn variable? +@c snarfed from variable.c:97 @deffn {Scheme Procedure} variable? obj @deffnx {C Function} scm_variable_p (obj) Return @code{#t} iff @var{obj} is a variable object, else @@ -4910,6 +5405,7 @@ return @code{#f}. @end deffn variable-ref +@c snarfed from variable.c:109 @deffn {Scheme Procedure} variable-ref var @deffnx {C Function} scm_variable_ref (var) Dereference @var{var} and return its value. @@ -4918,6 +5414,7 @@ and @code{make-undefined-variable}. @end deffn variable-set! +@c snarfed from variable.c:125 @deffn {Scheme Procedure} variable-set! var val @deffnx {C Function} scm_variable_set_x (var, val) Set the value of the variable @var{var} to @var{val}. @@ -4926,6 +5423,7 @@ value. Return an unspecified value. @end deffn variable-bound? +@c snarfed from variable.c:137 @deffn {Scheme Procedure} variable-bound? var @deffnx {C Function} scm_variable_bound_p (var) Return @code{#t} iff @var{var} is bound to a value. @@ -4933,6 +5431,7 @@ Throws an error if @var{var} is not a variable object. @end deffn vector? +@c snarfed from vectors.c:59 @deffn {Scheme Procedure} vector? obj @deffnx {C Function} scm_vector_p (obj) Return @code{#t} if @var{obj} is a vector, otherwise return @@ -4940,11 +5439,13 @@ Return @code{#t} if @var{obj} is a vector, otherwise return @end deffn list->vector +@c snarfed from vectors.c:76 @deffn {Scheme Procedure} list->vector implemented by the C function "scm_vector" @end deffn vector +@c snarfed from vectors.c:93 @deffn {Scheme Procedure} vector . l @deffnx {Scheme Procedure} list->vector l @deffnx {C Function} scm_vector (l) @@ -4957,6 +5458,7 @@ given arguments. Analogous to @code{list}. @end deffn make-vector +@c snarfed from vectors.c:179 @deffn {Scheme Procedure} make-vector k [fill] @deffnx {C Function} scm_make_vector (k, fill) Return a newly allocated vector of @var{k} elements. If a @@ -4966,6 +5468,7 @@ unspecified. @end deffn vector->list +@c snarfed from vectors.c:233 @deffn {Scheme Procedure} vector->list v @deffnx {C Function} scm_vector_to_list (v) Return a newly allocated list composed of the elements of @var{v}. @@ -4977,6 +5480,7 @@ Return a newly allocated list composed of the elements of @var{v}. @end deffn vector-fill! +@c snarfed from vectors.c:250 @deffn {Scheme Procedure} vector-fill! v fill @deffnx {C Function} scm_vector_fill_x (v, fill) Store @var{fill} in every position of @var{vector}. The value @@ -4984,6 +5488,7 @@ returned by @code{vector-fill!} is unspecified. @end deffn vector-move-left! +@c snarfed from vectors.c:283 @deffn {Scheme Procedure} vector-move-left! vec1 start1 end1 vec2 start2 @deffnx {C Function} scm_vector_move_left_x (vec1, start1, end1, vec2, start2) Copy elements from @var{vec1}, positions @var{start1} to @var{end1}, @@ -4997,6 +5502,7 @@ same vector, @code{vector-move-left!} is usually appropriate when @end deffn vector-move-right! +@c snarfed from vectors.c:312 @deffn {Scheme Procedure} vector-move-right! vec1 start1 end1 vec2 start2 @deffnx {C Function} scm_vector_move_right_x (vec1, start1, end1, vec2, start2) Copy elements from @var{vec1}, positions @var{start1} to @var{end1}, @@ -5010,6 +5516,7 @@ same vector, @code{vector-move-right!} is usually appropriate when @end deffn major-version +@c snarfed from version.c:59 @deffn {Scheme Procedure} major-version @deffnx {C Function} scm_major_version () Return a string containing Guile's major version number. @@ -5017,6 +5524,7 @@ E.g., the 1 in "1.6.5". @end deffn minor-version +@c snarfed from version.c:72 @deffn {Scheme Procedure} minor-version @deffnx {C Function} scm_minor_version () Return a string containing Guile's minor version number. @@ -5024,6 +5532,7 @@ E.g., the 6 in "1.6.5". @end deffn micro-version +@c snarfed from version.c:85 @deffn {Scheme Procedure} micro-version @deffnx {C Function} scm_micro_version () Return a string containing Guile's micro version number. @@ -5031,6 +5540,7 @@ E.g., the 5 in "1.6.5". @end deffn version +@c snarfed from version.c:107 @deffn {Scheme Procedure} version @deffnx {Scheme Procedure} major-version @deffnx {Scheme Procedure} minor-version @@ -5048,6 +5558,7 @@ or micro version number, respectively. @end deffn make-soft-port +@c snarfed from vports.c:185 @deffn {Scheme Procedure} make-soft-port pv modes @deffnx {C Function} scm_make_soft_port (pv, modes) Return a port capable of receiving or delivering characters as @@ -5094,6 +5605,7 @@ For example: @end deffn make-weak-vector +@c snarfed from weaks.c:116 @deffn {Scheme Procedure} make-weak-vector size [fill] @deffnx {C Function} scm_make_weak_vector (size, fill) Return a weak vector with @var{size} elements. If the optional @@ -5103,11 +5615,13 @@ empty list. @end deffn list->weak-vector +@c snarfed from weaks.c:124 @deffn {Scheme Procedure} list->weak-vector implemented by the C function "scm_weak_vector" @end deffn weak-vector +@c snarfed from weaks.c:132 @deffn {Scheme Procedure} weak-vector . l @deffnx {Scheme Procedure} list->weak-vector l @deffnx {C Function} scm_weak_vector (l) @@ -5118,6 +5632,7 @@ the same way @code{list->vector} would. @end deffn weak-vector? +@c snarfed from weaks.c:160 @deffn {Scheme Procedure} weak-vector? obj @deffnx {C Function} scm_weak_vector_p (obj) Return @code{#t} if @var{obj} is a weak vector. Note that all @@ -5125,6 +5640,7 @@ weak hashes are also weak vectors. @end deffn make-weak-key-hash-table +@c snarfed from weaks.c:178 @deffn {Scheme Procedure} make-weak-key-hash-table size @deffnx {Scheme Procedure} make-weak-value-hash-table size @deffnx {Scheme Procedure} make-doubly-weak-hash-table size @@ -5138,6 +5654,7 @@ would modify regular hash tables. (@pxref{Hash Tables}) @end deffn make-weak-value-hash-table +@c snarfed from weaks.c:189 @deffn {Scheme Procedure} make-weak-value-hash-table size @deffnx {C Function} scm_make_weak_value_hash_table (size) Return a hash table with weak values with @var{size} buckets. @@ -5145,6 +5662,7 @@ Return a hash table with weak values with @var{size} buckets. @end deffn make-doubly-weak-hash-table +@c snarfed from weaks.c:200 @deffn {Scheme Procedure} make-doubly-weak-hash-table size @deffnx {C Function} scm_make_doubly_weak_hash_table (size) Return a hash table with weak keys and values with @var{size} @@ -5152,6 +5670,7 @@ buckets. (@pxref{Hash Tables}) @end deffn weak-key-hash-table? +@c snarfed from weaks.c:214 @deffn {Scheme Procedure} weak-key-hash-table? obj @deffnx {Scheme Procedure} weak-value-hash-table? obj @deffnx {Scheme Procedure} doubly-weak-hash-table? obj @@ -5162,18 +5681,21 @@ nor a weak value hash table. @end deffn weak-value-hash-table? +@c snarfed from weaks.c:224 @deffn {Scheme Procedure} weak-value-hash-table? obj @deffnx {C Function} scm_weak_value_hash_table_p (obj) Return @code{#t} if @var{obj} is a weak value hash table. @end deffn doubly-weak-hash-table? +@c snarfed from weaks.c:234 @deffn {Scheme Procedure} doubly-weak-hash-table? obj @deffnx {C Function} scm_doubly_weak_hash_table_p (obj) Return @code{#t} if @var{obj} is a doubly weak hash table. @end deffn regexp? +@c snarfed from regex-posix.c:137 @deffn {Scheme Procedure} regexp? obj @deffnx {C Function} scm_regexp_p (obj) Return @code{#t} if @var{obj} is a compiled regular expression, @@ -5181,6 +5703,7 @@ or @code{#f} otherwise. @end deffn make-regexp +@c snarfed from regex-posix.c:182 @deffn {Scheme Procedure} make-regexp pat . flags @deffnx {C Function} scm_make_regexp (pat, flags) Compile the regular expression described by @var{pat}, and @@ -5223,6 +5746,7 @@ one which comes last will override the earlier one. @end deffn regexp-exec +@c snarfed from regex-posix.c:243 @deffn {Scheme Procedure} regexp-exec rx str [start [flags]] @deffnx {C Function} scm_regexp_exec (rx, str, start, flags) Match the compiled regular expression @var{rx} against @@ -5247,6 +5771,7 @@ considered the end of a line. @end deffn array-fill! +@c snarfed from ramap.c:462 @deffn {Scheme Procedure} array-fill! ra fill @deffnx {C Function} scm_array_fill_x (ra, fill) Store @var{fill} in every element of @var{array}. The value returned @@ -5254,11 +5779,13 @@ is unspecified. @end deffn array-copy-in-order! +@c snarfed from ramap.c:827 @deffn {Scheme Procedure} array-copy-in-order! implemented by the C function "scm_array_copy_x" @end deffn array-copy! +@c snarfed from ramap.c:836 @deffn {Scheme Procedure} array-copy! src dst @deffnx {Scheme Procedure} array-copy-in-order! src dst @deffnx {C Function} scm_array_copy_x (src, dst) @@ -5269,11 +5796,13 @@ dimension. The order is unspecified. @end deffn array-map-in-order! +@c snarfed from ramap.c:1510 @deffn {Scheme Procedure} array-map-in-order! implemented by the C function "scm_array_map_x" @end deffn array-map! +@c snarfed from ramap.c:1521 @deffn {Scheme Procedure} array-map! ra0 proc . lra @deffnx {Scheme Procedure} array-map-in-order! ra0 proc . lra @deffnx {C Function} scm_array_map_x (ra0, proc, lra) @@ -5286,6 +5815,7 @@ unspecified. The order of application is unspecified. @end deffn array-for-each +@c snarfed from ramap.c:1668 @deffn {Scheme Procedure} array-for-each proc ra0 . lra @deffnx {C Function} scm_array_for_each (proc, ra0, lra) Apply @var{proc} to each tuple of elements of @var{array0} @dots{} @@ -5293,6 +5823,7 @@ in row-major order. The value returned is unspecified. @end deffn array-index-map! +@c snarfed from ramap.c:1696 @deffn {Scheme Procedure} array-index-map! ra proc @deffnx {C Function} scm_array_index_map_x (ra, proc) Apply @var{proc} to the indices of each element of @var{array} in @@ -5316,12 +5847,14 @@ Another example: @end deffn uniform-vector-length +@c snarfed from unif.c:250 @deffn {Scheme Procedure} uniform-vector-length v @deffnx {C Function} scm_uniform_vector_length (v) Return the number of elements in @var{uve}. @end deffn array? +@c snarfed from unif.c:284 @deffn {Scheme Procedure} array? v [prot] @deffnx {C Function} scm_array_p (v, prot) Return @code{#t} if the @var{obj} is an array, and @code{#f} if @@ -5330,6 +5863,7 @@ and is described elsewhere. @end deffn array-rank +@c snarfed from unif.c:355 @deffn {Scheme Procedure} array-rank ra @deffnx {C Function} scm_array_rank (ra) Return the number of dimensions of @var{obj}. If @var{obj} is @@ -5337,6 +5871,7 @@ not an array, @code{0} is returned. @end deffn array-dimensions +@c snarfed from unif.c:393 @deffn {Scheme Procedure} array-dimensions ra @deffnx {C Function} scm_array_dimensions (ra) @code{Array-dimensions} is similar to @code{array-shape} but replaces @@ -5347,24 +5882,28 @@ elements with a @code{0} minimum with one greater than the maximum. So: @end deffn shared-array-root +@c snarfed from unif.c:440 @deffn {Scheme Procedure} shared-array-root ra @deffnx {C Function} scm_shared_array_root (ra) Return the root vector of a shared array. @end deffn shared-array-offset +@c snarfed from unif.c:451 @deffn {Scheme Procedure} shared-array-offset ra @deffnx {C Function} scm_shared_array_offset (ra) Return the root vector index of the first element in the array. @end deffn shared-array-increments +@c snarfed from unif.c:462 @deffn {Scheme Procedure} shared-array-increments ra @deffnx {C Function} scm_shared_array_increments (ra) For each dimension, return the distance between elements in the root vector. @end deffn dimensions->uniform-array +@c snarfed from unif.c:581 @deffn {Scheme Procedure} dimensions->uniform-array dims prot [fill] @deffnx {Scheme Procedure} make-uniform-vector length prototype [fill] @deffnx {C Function} scm_dimensions_to_uniform_array (dims, prot, fill) @@ -5375,6 +5914,7 @@ fill the array, otherwise @var{prototype} is used. @end deffn make-shared-array +@c snarfed from unif.c:670 @deffn {Scheme Procedure} make-shared-array oldra mapfunc . dims @deffnx {C Function} scm_make_shared_array (oldra, mapfunc, dims) @code{make-shared-array} can be used to create shared subarrays of other @@ -5395,6 +5935,7 @@ it can be otherwise arbitrary. A simple example: @end deffn transpose-array +@c snarfed from unif.c:802 @deffn {Scheme Procedure} transpose-array ra . args @deffnx {C Function} scm_transpose_array (ra, args) Return an array sharing contents with @var{array}, but with @@ -5419,6 +5960,7 @@ have smaller rank than @var{array}. @end deffn enclose-array +@c snarfed from unif.c:911 @deffn {Scheme Procedure} enclose-array ra . axes @deffnx {C Function} scm_enclose_array (ra, axes) @var{dim0}, @var{dim1} @dots{} should be nonnegative integers less than @@ -5445,6 +5987,7 @@ examples: @end deffn array-in-bounds? +@c snarfed from unif.c:995 @deffn {Scheme Procedure} array-in-bounds? v . args @deffnx {C Function} scm_array_in_bounds_p (v, args) Return @code{#t} if its arguments would be acceptable to @@ -5452,11 +5995,13 @@ Return @code{#t} if its arguments would be acceptable to @end deffn array-ref +@c snarfed from unif.c:1074 @deffn {Scheme Procedure} array-ref implemented by the C function "scm_uniform_vector_ref" @end deffn uniform-vector-ref +@c snarfed from unif.c:1081 @deffn {Scheme Procedure} uniform-vector-ref v args @deffnx {Scheme Procedure} array-ref v . args @deffnx {C Function} scm_uniform_vector_ref (v, args) @@ -5465,11 +6010,13 @@ Return the element at the @code{(index1, index2)} element in @end deffn uniform-array-set1! +@c snarfed from unif.c:1250 @deffn {Scheme Procedure} uniform-array-set1! implemented by the C function "scm_array_set_x" @end deffn array-set! +@c snarfed from unif.c:1259 @deffn {Scheme Procedure} array-set! v obj . args @deffnx {Scheme Procedure} uniform-array-set1! v obj args @deffnx {C Function} scm_array_set_x (v, obj, args) @@ -5478,6 +6025,7 @@ Set the element at the @code{(index1, index2)} element in @var{array} to @end deffn array-contents +@c snarfed from unif.c:1374 @deffn {Scheme Procedure} array-contents ra [strict] @deffnx {C Function} scm_array_contents (ra, strict) If @var{array} may be @dfn{unrolled} into a one dimensional shared array @@ -5493,6 +6041,7 @@ memory. @end deffn uniform-array-read! +@c snarfed from unif.c:1488 @deffn {Scheme Procedure} uniform-array-read! ra [port_or_fd [start [end]]] @deffnx {Scheme Procedure} uniform-vector-read! uve [port-or-fdes] [start] [end] @deffnx {C Function} scm_uniform_array_read_x (ra, port_or_fd, start, end) @@ -5513,6 +6062,7 @@ returned by @code{(current-input-port)}. @end deffn uniform-array-write +@c snarfed from unif.c:1653 @deffn {Scheme Procedure} uniform-array-write v [port_or_fd [start [end]]] @deffnx {Scheme Procedure} uniform-vector-write uve [port-or-fdes] [start] [end] @deffnx {C Function} scm_uniform_array_write (v, port_or_fd, start, end) @@ -5530,6 +6080,7 @@ omitted, in which case it defaults to the value returned by @end deffn bit-count +@c snarfed from unif.c:1780 @deffn {Scheme Procedure} bit-count b bitvector @deffnx {C Function} scm_bit_count (b, bitvector) Return the number of occurrences of the boolean @var{b} in @@ -5537,6 +6088,7 @@ Return the number of occurrences of the boolean @var{b} in @end deffn bit-position +@c snarfed from unif.c:1819 @deffn {Scheme Procedure} bit-position item v k @deffnx {C Function} scm_bit_position (item, v, k) Return the minimum index of an occurrence of @var{bool} in @@ -5545,6 +6097,7 @@ within the specified range @code{#f} is returned. @end deffn bit-set*! +@c snarfed from unif.c:1887 @deffn {Scheme Procedure} bit-set*! v kv obj @deffnx {C Function} scm_bit_set_star_x (v, kv, obj) If uve is a bit-vector @var{bv} and uve must be of the same @@ -5559,6 +6112,7 @@ of @var{bv} corresponding to the indexes in uve are set to @end deffn bit-count* +@c snarfed from unif.c:1941 @deffn {Scheme Procedure} bit-count* v kv obj @deffnx {C Function} scm_bit_count_star (v, kv, obj) Return @@ -5569,19 +6123,22 @@ Return @end deffn bit-invert! +@c snarfed from unif.c:2005 @deffn {Scheme Procedure} bit-invert! v @deffnx {C Function} scm_bit_invert_x (v) Modify @var{bv} by replacing each element with its negation. @end deffn array->list +@c snarfed from unif.c:2084 @deffn {Scheme Procedure} array->list v -@deffnx {C Function} scm_t_arrayo_list (v) +@deffnx {C Function} scm_array_to_list (v) Return a list consisting of all the elements, in order, of @var{array}. @end deffn list->uniform-array +@c snarfed from unif.c:2185 @deffn {Scheme Procedure} list->uniform-array ndim prot lst @deffnx {Scheme Procedure} list->uniform-vector prot lst @deffnx {C Function} scm_list_to_uniform_array (ndim, prot, lst) @@ -5592,6 +6149,7 @@ done. @end deffn array-prototype +@c snarfed from unif.c:2536 @deffn {Scheme Procedure} array-prototype ra @deffnx {C Function} scm_array_prototype (ra) Return an object that would produce an array of the same type @@ -5600,6 +6158,7 @@ as @var{array}, if used as the @var{prototype} for @end deffn chown +@c snarfed from filesys.c:214 @deffn {Scheme Procedure} chown object owner group @deffnx {C Function} scm_chown (object, owner, group) Change the ownership and group of the file referred to by @var{object} to @@ -5617,6 +6176,7 @@ as @code{-1}, then that ID is not changed. @end deffn chmod +@c snarfed from filesys.c:254 @deffn {Scheme Procedure} chmod object mode @deffnx {C Function} scm_chmod (object, mode) Changes the permissions of the file referred to by @var{obj}. @@ -5629,6 +6189,7 @@ The return value is unspecified. @end deffn umask +@c snarfed from filesys.c:287 @deffn {Scheme Procedure} umask [mode] @deffnx {C Function} scm_umask (mode) If @var{mode} is omitted, retuns a decimal number representing the current @@ -5639,6 +6200,7 @@ E.g., @code{(umask #o022)} sets the mask to octal 22, decimal 18. @end deffn open-fdes +@c snarfed from filesys.c:310 @deffn {Scheme Procedure} open-fdes path flags [mode] @deffnx {C Function} scm_open_fdes (path, flags, mode) Similar to @code{open} but return a file descriptor instead of @@ -5646,6 +6208,7 @@ a port. @end deffn open +@c snarfed from filesys.c:352 @deffn {Scheme Procedure} open path flags [mode] @deffnx {C Function} scm_open (path, flags, mode) Open the file named by @var{path} for reading and/or writing. @@ -5678,6 +6241,7 @@ for additional flags. @end deffn close +@c snarfed from filesys.c:390 @deffn {Scheme Procedure} close fd_or_port @deffnx {C Function} scm_close (fd_or_port) Similar to close-port (@pxref{Closing, close-port}), @@ -5688,6 +6252,7 @@ their revealed counts set to zero. @end deffn close-fdes +@c snarfed from filesys.c:418 @deffn {Scheme Procedure} close-fdes fd @deffnx {C Function} scm_close_fdes (fd) A simple wrapper for the @code{close} system call. @@ -5698,6 +6263,7 @@ The return value is unspecified. @end deffn stat +@c snarfed from filesys.c:621 @deffn {Scheme Procedure} stat object @deffnx {C Function} scm_stat (object) Return an object containing various information about the file @@ -5759,6 +6325,7 @@ An integer representing the access permission bits. @end deffn link +@c snarfed from filesys.c:684 @deffn {Scheme Procedure} link oldpath newpath @deffnx {C Function} scm_link (oldpath, newpath) Creates a new name @var{newpath} in the file system for the @@ -5768,6 +6335,7 @@ system. @end deffn rename-file +@c snarfed from filesys.c:705 @deffn {Scheme Procedure} rename-file oldname newname @deffnx {C Function} scm_rename (oldname, newname) Renames the file specified by @var{oldname} to @var{newname}. @@ -5775,12 +6343,14 @@ The return value is unspecified. @end deffn delete-file +@c snarfed from filesys.c:732 @deffn {Scheme Procedure} delete-file str @deffnx {C Function} scm_delete_file (str) Deletes (or "unlinks") the file specified by @var{path}. @end deffn mkdir +@c snarfed from filesys.c:750 @deffn {Scheme Procedure} mkdir path [mode] @deffnx {C Function} scm_mkdir (path, mode) Create a new directory named by @var{path}. If @var{mode} is omitted @@ -5790,6 +6360,7 @@ umask. Otherwise they are set to the decimal value specified with @end deffn rmdir +@c snarfed from filesys.c:778 @deffn {Scheme Procedure} rmdir path @deffnx {C Function} scm_rmdir (path) Remove the existing directory named by @var{path}. The directory must @@ -5797,6 +6368,7 @@ be empty for this to succeed. The return value is unspecified. @end deffn directory-stream? +@c snarfed from filesys.c:803 @deffn {Scheme Procedure} directory-stream? obj @deffnx {C Function} scm_directory_stream_p (obj) Return a boolean indicating whether @var{object} is a directory @@ -5804,6 +6376,7 @@ stream as returned by @code{opendir}. @end deffn opendir +@c snarfed from filesys.c:814 @deffn {Scheme Procedure} opendir dirname @deffnx {C Function} scm_opendir (dirname) Open the directory specified by @var{path} and return a directory @@ -5811,6 +6384,7 @@ stream. @end deffn readdir +@c snarfed from filesys.c:831 @deffn {Scheme Procedure} readdir port @deffnx {C Function} scm_readdir (port) Return (as a string) the next directory entry from the directory stream @@ -5819,6 +6393,7 @@ end of file object is returned. @end deffn rewinddir +@c snarfed from filesys.c:854 @deffn {Scheme Procedure} rewinddir port @deffnx {C Function} scm_rewinddir (port) Reset the directory port @var{stream} so that the next call to @@ -5826,6 +6401,7 @@ Reset the directory port @var{stream} so that the next call to @end deffn closedir +@c snarfed from filesys.c:871 @deffn {Scheme Procedure} closedir port @deffnx {C Function} scm_closedir (port) Close the directory stream @var{stream}. @@ -5833,6 +6409,7 @@ The return value is unspecified. @end deffn chdir +@c snarfed from filesys.c:921 @deffn {Scheme Procedure} chdir str @deffnx {C Function} scm_chdir (str) Change the current working directory to @var{path}. @@ -5840,12 +6417,14 @@ The return value is unspecified. @end deffn getcwd +@c snarfed from filesys.c:937 @deffn {Scheme Procedure} getcwd @deffnx {C Function} scm_getcwd () Return the name of the current working directory. @end deffn select +@c snarfed from filesys.c:1133 @deffn {Scheme Procedure} select reads writes excepts [secs [usecs]] @deffnx {C Function} scm_select (reads, writes, excepts, secs, usecs) This procedure has a variety of uses: waiting for the ability @@ -5880,6 +6459,7 @@ An additional @code{select!} interface is provided. @end deffn fcntl +@c snarfed from filesys.c:1279 @deffn {Scheme Procedure} fcntl object cmd [value] @deffnx {C Function} scm_fcntl (object, cmd, value) Apply @var{command} to the specified file descriptor or the underlying @@ -5910,6 +6490,7 @@ The value used to indicate the "close on exec" flag with @code{F_GETFL} or @end deffn fsync +@c snarfed from filesys.c:1316 @deffn {Scheme Procedure} fsync object @deffnx {C Function} scm_fsync (object) Copies any unwritten data for the specified output file descriptor to disk. @@ -5919,6 +6500,7 @@ The return value is unspecified. @end deffn symlink +@c snarfed from filesys.c:1343 @deffn {Scheme Procedure} symlink oldpath newpath @deffnx {C Function} scm_symlink (oldpath, newpath) Create a symbolic link named @var{path-to} with the value (i.e., pointing to) @@ -5926,6 +6508,7 @@ Create a symbolic link named @var{path-to} with the value (i.e., pointing to) @end deffn readlink +@c snarfed from filesys.c:1362 @deffn {Scheme Procedure} readlink path @deffnx {C Function} scm_readlink (path) Return the value of the symbolic link named by @var{path} (a @@ -5933,6 +6516,7 @@ string), i.e., the file that the link points to. @end deffn lstat +@c snarfed from filesys.c:1391 @deffn {Scheme Procedure} lstat str @deffnx {C Function} scm_lstat (str) Similar to @code{stat}, but does not follow symbolic links, i.e., @@ -5941,6 +6525,7 @@ file it points to. @var{path} must be a string. @end deffn copy-file +@c snarfed from filesys.c:1415 @deffn {Scheme Procedure} copy-file oldfile newfile @deffnx {C Function} scm_copy_file (oldfile, newfile) Copy the file specified by @var{path-from} to @var{path-to}. @@ -5948,6 +6533,7 @@ The return value is unspecified. @end deffn dirname +@c snarfed from filesys.c:1460 @deffn {Scheme Procedure} dirname filename @deffnx {C Function} scm_dirname (filename) Return the directory name component of the file name @@ -5956,6 +6542,7 @@ component, @code{.} is returned. @end deffn basename +@c snarfed from filesys.c:1503 @deffn {Scheme Procedure} basename filename [suffix] @deffnx {C Function} scm_basename (filename, suffix) Return the base name of the file name @var{filename}. The @@ -5965,6 +6552,7 @@ If @var{suffix} is privided, and is equal to the end of @end deffn pipe +@c snarfed from posix.c:201 @deffn {Scheme Procedure} pipe @deffnx {C Function} scm_pipe () Return a newly created pipe: a pair of ports which are linked @@ -5983,6 +6571,7 @@ from the input port. @end deffn getgroups +@c snarfed from posix.c:222 @deffn {Scheme Procedure} getgroups @deffnx {C Function} scm_getgroups () Return a vector of integers representing the current @@ -5990,6 +6579,7 @@ supplimentary group IDs. @end deffn getpw +@c snarfed from posix.c:253 @deffn {Scheme Procedure} getpw [user] @deffnx {C Function} scm_getpwuid (user) Look up an entry in the user database. @var{obj} can be an integer, @@ -5998,6 +6588,7 @@ or getpwent respectively. @end deffn setpw +@c snarfed from posix.c:306 @deffn {Scheme Procedure} setpw [arg] @deffnx {C Function} scm_setpwent (arg) If called with a true argument, initialize or reset the password data @@ -6006,6 +6597,7 @@ stream. Otherwise, close the stream. The @code{setpwent} and @end deffn getgr +@c snarfed from posix.c:325 @deffn {Scheme Procedure} getgr [name] @deffnx {C Function} scm_getgrgid (name) Look up an entry in the group database. @var{obj} can be an integer, @@ -6014,6 +6606,7 @@ or getgrent respectively. @end deffn setgr +@c snarfed from posix.c:365 @deffn {Scheme Procedure} setgr [arg] @deffnx {C Function} scm_setgrent (arg) If called with a true argument, initialize or reset the group data @@ -6022,6 +6615,7 @@ stream. Otherwise, close the stream. The @code{setgrent} and @end deffn kill +@c snarfed from posix.c:401 @deffn {Scheme Procedure} kill pid sig @deffnx {C Function} scm_kill (pid, sig) Sends a signal to the specified process or group of processes. @@ -6054,6 +6648,7 @@ Interrupt signal. @end deffn waitpid +@c snarfed from posix.c:454 @deffn {Scheme Procedure} waitpid pid [options] @deffnx {C Function} scm_waitpid (pid, options) This procedure collects status information from a child process which @@ -6100,6 +6695,7 @@ The integer status value. @end deffn status:exit-val +@c snarfed from posix.c:482 @deffn {Scheme Procedure} status:exit-val status @deffnx {C Function} scm_status_exit_val (status) Return the exit status value, as would be set if a process @@ -6108,6 +6704,7 @@ if any, otherwise @code{#f}. @end deffn status:term-sig +@c snarfed from posix.c:502 @deffn {Scheme Procedure} status:term-sig status @deffnx {C Function} scm_status_term_sig (status) Return the signal number which terminated the process, if any, @@ -6115,6 +6712,7 @@ otherwise @code{#f}. @end deffn status:stop-sig +@c snarfed from posix.c:520 @deffn {Scheme Procedure} status:stop-sig status @deffnx {C Function} scm_status_stop_sig (status) Return the signal number which stopped the process, if any, @@ -6122,6 +6720,7 @@ otherwise @code{#f}. @end deffn getppid +@c snarfed from posix.c:540 @deffn {Scheme Procedure} getppid @deffnx {C Function} scm_getppid () Return an integer representing the process ID of the parent @@ -6129,18 +6728,21 @@ process. @end deffn getuid +@c snarfed from posix.c:552 @deffn {Scheme Procedure} getuid @deffnx {C Function} scm_getuid () Return an integer representing the current real user ID. @end deffn getgid +@c snarfed from posix.c:563 @deffn {Scheme Procedure} getgid @deffnx {C Function} scm_getgid () Return an integer representing the current real group ID. @end deffn geteuid +@c snarfed from posix.c:577 @deffn {Scheme Procedure} geteuid @deffnx {C Function} scm_geteuid () Return an integer representing the current effective user ID. @@ -6150,6 +6752,7 @@ system supports effective IDs. @end deffn getegid +@c snarfed from posix.c:594 @deffn {Scheme Procedure} getegid @deffnx {C Function} scm_getegid () Return an integer representing the current effective group ID. @@ -6159,6 +6762,7 @@ system supports effective IDs. @end deffn setuid +@c snarfed from posix.c:610 @deffn {Scheme Procedure} setuid id @deffnx {C Function} scm_setuid (id) Sets both the real and effective user IDs to the integer @var{id}, provided @@ -6167,6 +6771,7 @@ The return value is unspecified. @end deffn setgid +@c snarfed from posix.c:624 @deffn {Scheme Procedure} setgid id @deffnx {C Function} scm_setgid (id) Sets both the real and effective group IDs to the integer @var{id}, provided @@ -6175,6 +6780,7 @@ The return value is unspecified. @end deffn seteuid +@c snarfed from posix.c:640 @deffn {Scheme Procedure} seteuid id @deffnx {C Function} scm_seteuid (id) Sets the effective user ID to the integer @var{id}, provided the process @@ -6185,6 +6791,7 @@ The return value is unspecified. @end deffn setegid +@c snarfed from posix.c:666 @deffn {Scheme Procedure} setegid id @deffnx {C Function} scm_setegid (id) Sets the effective group ID to the integer @var{id}, provided the process @@ -6195,6 +6802,7 @@ The return value is unspecified. @end deffn getpgrp +@c snarfed from posix.c:690 @deffn {Scheme Procedure} getpgrp @deffnx {C Function} scm_getpgrp () Return an integer representing the current process group ID. @@ -6202,6 +6810,7 @@ This is the POSIX definition, not BSD. @end deffn setpgid +@c snarfed from posix.c:708 @deffn {Scheme Procedure} setpgid pid pgid @deffnx {C Function} scm_setpgid (pid, pgid) Move the process @var{pid} into the process group @var{pgid}. @var{pid} or @@ -6212,6 +6821,7 @@ The return value is unspecified. @end deffn setsid +@c snarfed from posix.c:727 @deffn {Scheme Procedure} setsid @deffnx {C Function} scm_setsid () Creates a new session. The current process becomes the session leader @@ -6221,6 +6831,7 @@ The return value is an integer representing the new process group ID. @end deffn ttyname +@c snarfed from posix.c:742 @deffn {Scheme Procedure} ttyname port @deffnx {C Function} scm_ttyname (port) Return a string with the name of the serial terminal device @@ -6228,6 +6839,7 @@ underlying @var{port}. @end deffn ctermid +@c snarfed from posix.c:766 @deffn {Scheme Procedure} ctermid @deffnx {C Function} scm_ctermid () Return a string containing the file name of the controlling @@ -6235,6 +6847,7 @@ terminal for the current process. @end deffn tcgetpgrp +@c snarfed from posix.c:789 @deffn {Scheme Procedure} tcgetpgrp port @deffnx {C Function} scm_tcgetpgrp (port) Return the process group ID of the foreground process group @@ -6250,6 +6863,7 @@ foreground. @end deffn tcsetpgrp +@c snarfed from posix.c:813 @deffn {Scheme Procedure} tcsetpgrp port pgid @deffnx {C Function} scm_tcsetpgrp (port, pgid) Set the foreground process group ID for the terminal used by the file @@ -6260,6 +6874,7 @@ controlling terminal. The return value is unspecified. @end deffn execl +@c snarfed from posix.c:873 @deffn {Scheme Procedure} execl filename . args @deffnx {C Function} scm_execl (filename, args) Executes the file named by @var{path} as a new process image. @@ -6276,6 +6891,7 @@ call, but we call it @code{execl} because of its Scheme calling interface. @end deffn execlp +@c snarfed from posix.c:893 @deffn {Scheme Procedure} execlp filename . args @deffnx {C Function} scm_execlp (filename, args) Similar to @code{execl}, however if @@ -6288,6 +6904,7 @@ call, but we call it @code{execlp} because of its Scheme calling interface. @end deffn execle +@c snarfed from posix.c:943 @deffn {Scheme Procedure} execle filename env . args @deffnx {C Function} scm_execle (filename, env, args) Similar to @code{execl}, but the environment of the new process is @@ -6299,6 +6916,7 @@ call, but we call it @code{execle} because of its Scheme calling interface. @end deffn primitive-fork +@c snarfed from posix.c:967 @deffn {Scheme Procedure} primitive-fork @deffnx {C Function} scm_fork () Creates a new "child" process by duplicating the current "parent" process. @@ -6310,6 +6928,7 @@ with the scsh fork. @end deffn uname +@c snarfed from posix.c:987 @deffn {Scheme Procedure} uname @deffnx {C Function} scm_uname () Return an object with some information about the computer @@ -6317,6 +6936,7 @@ system the program is running on. @end deffn environ +@c snarfed from posix.c:1017 @deffn {Scheme Procedure} environ [env] @deffnx {C Function} scm_environ (env) If @var{env} is omitted, return the current environment (in the @@ -6329,6 +6949,7 @@ then the return value is unspecified. @end deffn tmpnam +@c snarfed from posix.c:1055 @deffn {Scheme Procedure} tmpnam @deffnx {C Function} scm_tmpnam () Return a name in the file system that does not match any @@ -6339,6 +6960,7 @@ Care should be taken if opening the file, e.g., use the @end deffn mkstemp! +@c snarfed from posix.c:1081 @deffn {Scheme Procedure} mkstemp! tmpl @deffnx {C Function} scm_mkstemp (tmpl) Create a new unique file in the file system and returns a new @@ -6349,6 +6971,7 @@ place to return the name of the temporary file. @end deffn utime +@c snarfed from posix.c:1106 @deffn {Scheme Procedure} utime pathname [actime [modtime]] @deffnx {C Function} scm_utime (pathname, actime, modtime) @code{utime} sets the access and modification times for the @@ -6364,6 +6987,7 @@ modification time to the current time. @end deffn access? +@c snarfed from posix.c:1154 @deffn {Scheme Procedure} access? path how @deffnx {C Function} scm_access (path, how) Return @code{#t} if @var{path} corresponds to an existing file @@ -6392,12 +7016,14 @@ test for existence of the file. @end deffn getpid +@c snarfed from posix.c:1168 @deffn {Scheme Procedure} getpid @deffnx {C Function} scm_getpid () Return an integer representing the current process ID. @end deffn putenv +@c snarfed from posix.c:1185 @deffn {Scheme Procedure} putenv str @deffnx {C Function} scm_putenv (str) Modifies the environment of the current process, which is @@ -6414,6 +7040,7 @@ The return value is unspecified. @end deffn setlocale +@c snarfed from posix.c:1216 @deffn {Scheme Procedure} setlocale category [locale] @deffnx {C Function} scm_setlocale (category, locale) If @var{locale} is omitted, return the current value of the @@ -6428,6 +7055,7 @@ the locale will be set using envirionment variables. @end deffn mknod +@c snarfed from posix.c:1256 @deffn {Scheme Procedure} mknod path type perms dev @deffnx {C Function} scm_mknod (path, type, perms, dev) Creates a new special file, such as a file corresponding to a device. @@ -6448,6 +7076,7 @@ The return value is unspecified. @end deffn nice +@c snarfed from posix.c:1302 @deffn {Scheme Procedure} nice incr @deffnx {C Function} scm_nice (incr) Increment the priority of the current process by @var{incr}. A higher @@ -6456,6 +7085,7 @@ The return value is unspecified. @end deffn sync +@c snarfed from posix.c:1317 @deffn {Scheme Procedure} sync @deffnx {C Function} scm_sync () Flush the operating system disk buffers. @@ -6463,6 +7093,7 @@ The return value is unspecified. @end deffn crypt +@c snarfed from posix.c:1330 @deffn {Scheme Procedure} crypt key salt @deffnx {C Function} scm_crypt (key, salt) Encrypt @var{key} using @var{salt} as the salt value to the @@ -6470,6 +7101,7 @@ crypt(3) library call. @end deffn chroot +@c snarfed from posix.c:1351 @deffn {Scheme Procedure} chroot path @deffnx {C Function} scm_chroot (path) Change the root directory to that specified in @var{path}. @@ -6480,6 +7112,7 @@ root directory. @end deffn getlogin +@c snarfed from posix.c:1383 @deffn {Scheme Procedure} getlogin @deffnx {C Function} scm_getlogin () Return a string containing the name of the user logged in on @@ -6488,6 +7121,7 @@ information cannot be obtained. @end deffn cuserid +@c snarfed from posix.c:1401 @deffn {Scheme Procedure} cuserid @deffnx {C Function} scm_cuserid () Return a string containing a user name associated with the @@ -6496,6 +7130,7 @@ information cannot be obtained. @end deffn getpriority +@c snarfed from posix.c:1426 @deffn {Scheme Procedure} getpriority which who @deffnx {C Function} scm_getpriority (which, who) Return the scheduling priority of the process, process group @@ -6511,6 +7146,7 @@ specified processes. @end deffn setpriority +@c snarfed from posix.c:1460 @deffn {Scheme Procedure} setpriority which who prio @deffnx {C Function} scm_setpriority (which, who, prio) Set the scheduling priority of the process, process group @@ -6529,6 +7165,7 @@ The return value is not specified. @end deffn getpass +@c snarfed from posix.c:1485 @deffn {Scheme Procedure} getpass prompt @deffnx {C Function} scm_getpass (prompt) Display @var{prompt} to the standard error output and read @@ -6541,6 +7178,7 @@ characters is disabled. @end deffn flock +@c snarfed from posix.c:1589 @deffn {Scheme Procedure} flock file operation @deffnx {C Function} scm_flock (file, operation) Apply or remove an advisory lock on an open file. @@ -6563,6 +7201,7 @@ file descriptor or an open file descriptior port. @end deffn sethostname +@c snarfed from posix.c:1615 @deffn {Scheme Procedure} sethostname name @deffnx {C Function} scm_sethostname (name) Set the host name of the current processor to @var{name}. May @@ -6571,12 +7210,14 @@ specified. @end deffn gethostname +@c snarfed from posix.c:1630 @deffn {Scheme Procedure} gethostname @deffnx {C Function} scm_gethostname () Return the host name of the current processor. @end deffn gethost +@c snarfed from net_db.c:153 @deffn {Scheme Procedure} gethost [host] @deffnx {Scheme Procedure} gethostbyname hostname @deffnx {Scheme Procedure} gethostbyaddr address @@ -6593,6 +7234,7 @@ Unusual conditions may result in errors thrown to the @end deffn getnet +@c snarfed from net_db.c:232 @deffn {Scheme Procedure} getnet [net] @deffnx {Scheme Procedure} getnetbyname net-name @deffnx {Scheme Procedure} getnetbyaddr net-number @@ -6605,6 +7247,7 @@ given. @end deffn getproto +@c snarfed from net_db.c:281 @deffn {Scheme Procedure} getproto [protocol] @deffnx {Scheme Procedure} getprotobyname name @deffnx {Scheme Procedure} getprotobynumber number @@ -6616,6 +7259,7 @@ argument. @code{getproto} will accept either type, behaving like @end deffn getserv +@c snarfed from net_db.c:347 @deffn {Scheme Procedure} getserv [name [protocol]] @deffnx {Scheme Procedure} getservbyname name protocol @deffnx {Scheme Procedure} getservbyport port protocol @@ -6631,6 +7275,7 @@ as its first argument; if given no arguments, it behaves like @end deffn sethost +@c snarfed from net_db.c:384 @deffn {Scheme Procedure} sethost [stayopen] @deffnx {C Function} scm_sethost (stayopen) If @var{stayopen} is omitted, this is equivalent to @code{endhostent}. @@ -6638,6 +7283,7 @@ Otherwise it is equivalent to @code{sethostent stayopen}. @end deffn setnet +@c snarfed from net_db.c:400 @deffn {Scheme Procedure} setnet [stayopen] @deffnx {C Function} scm_setnet (stayopen) If @var{stayopen} is omitted, this is equivalent to @code{endnetent}. @@ -6645,6 +7291,7 @@ Otherwise it is equivalent to @code{setnetent stayopen}. @end deffn setproto +@c snarfed from net_db.c:416 @deffn {Scheme Procedure} setproto [stayopen] @deffnx {C Function} scm_setproto (stayopen) If @var{stayopen} is omitted, this is equivalent to @code{endprotoent}. @@ -6652,6 +7299,7 @@ Otherwise it is equivalent to @code{setprotoent stayopen}. @end deffn setserv +@c snarfed from net_db.c:432 @deffn {Scheme Procedure} setserv [stayopen] @deffnx {C Function} scm_setserv (stayopen) If @var{stayopen} is omitted, this is equivalent to @code{endservent}. @@ -6659,6 +7307,7 @@ Otherwise it is equivalent to @code{setservent stayopen}. @end deffn htons +@c snarfed from socket.c:108 @deffn {Scheme Procedure} htons value @deffnx {C Function} scm_htons (value) Convert a 16 bit quantity from host to network byte ordering. @@ -6667,6 +7316,7 @@ and returned as a new integer. @end deffn ntohs +@c snarfed from socket.c:125 @deffn {Scheme Procedure} ntohs value @deffnx {C Function} scm_ntohs (value) Convert a 16 bit quantity from network to host byte ordering. @@ -6675,6 +7325,7 @@ and returned as a new integer. @end deffn htonl +@c snarfed from socket.c:142 @deffn {Scheme Procedure} htonl value @deffnx {C Function} scm_htonl (value) Convert a 32 bit quantity from host to network byte ordering. @@ -6683,6 +7334,7 @@ and returned as a new integer. @end deffn ntohl +@c snarfed from socket.c:155 @deffn {Scheme Procedure} ntohl value @deffnx {C Function} scm_ntohl (value) Convert a 32 bit quantity from network to host byte ordering. @@ -6691,6 +7343,7 @@ and returned as a new integer. @end deffn inet-aton +@c snarfed from socket.c:175 @deffn {Scheme Procedure} inet-aton address @deffnx {C Function} scm_inet_aton (address) Convert an IPv4 Internet address from printable string @@ -6702,6 +7355,7 @@ Convert an IPv4 Internet address from printable string @end deffn inet-ntoa +@c snarfed from socket.c:194 @deffn {Scheme Procedure} inet-ntoa inetid @deffnx {C Function} scm_inet_ntoa (inetid) Convert an IPv4 Internet address to a printable @@ -6713,6 +7367,7 @@ Convert an IPv4 Internet address to a printable @end deffn inet-netof +@c snarfed from socket.c:214 @deffn {Scheme Procedure} inet-netof address @deffnx {C Function} scm_inet_netof (address) Return the network number part of the given IPv4 @@ -6724,6 +7379,7 @@ Internet address. E.g., @end deffn inet-lnaof +@c snarfed from socket.c:232 @deffn {Scheme Procedure} inet-lnaof address @deffnx {C Function} scm_lnaof (address) Return the local-address-with-network part of the given @@ -6736,6 +7392,7 @@ E.g., @end deffn inet-makeaddr +@c snarfed from socket.c:250 @deffn {Scheme Procedure} inet-makeaddr net lna @deffnx {C Function} scm_inet_makeaddr (net, lna) Make an IPv4 Internet address by combining the network number @@ -6748,6 +7405,7 @@ Make an IPv4 Internet address by combining the network number @end deffn inet-pton +@c snarfed from socket.c:368 @deffn {Scheme Procedure} inet-pton family address @deffnx {C Function} scm_inet_pton (family, address) Convert a string containing a printable network address to @@ -6763,6 +7421,7 @@ the result is an integer with normal host byte ordering. @end deffn inet-ntop +@c snarfed from socket.c:403 @deffn {Scheme Procedure} inet-ntop family address @deffnx {C Function} scm_inet_ntop (family, address) Convert a network address into a printable string. @@ -6778,6 +7437,7 @@ ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff @end deffn socket +@c snarfed from socket.c:448 @deffn {Scheme Procedure} socket family style proto @deffnx {C Function} scm_socket (family, style, proto) Return a new socket port of the type specified by @var{family}, @@ -6796,6 +7456,7 @@ has been connected to another socket. @end deffn socketpair +@c snarfed from socket.c:470 @deffn {Scheme Procedure} socketpair family style proto @deffnx {C Function} scm_socketpair (family, style, proto) Return a pair of connected (but unnamed) socket ports of the @@ -6806,6 +7467,7 @@ family. Zero is likely to be the only meaningful value for @end deffn getsockopt +@c snarfed from socket.c:499 @deffn {Scheme Procedure} getsockopt sock level optname @deffnx {C Function} scm_getsockopt (sock, level, optname) Return the value of a particular socket option for the socket @@ -6820,6 +7482,7 @@ returns a pair of integers. @end deffn setsockopt +@c snarfed from socket.c:567 @deffn {Scheme Procedure} setsockopt sock level optname value @deffnx {C Function} scm_setsockopt (sock, level, optname, value) Set the value of a particular socket option for the socket @@ -6836,6 +7499,7 @@ The return value is unspecified. @end deffn shutdown +@c snarfed from socket.c:671 @deffn {Scheme Procedure} shutdown sock how @deffnx {C Function} scm_shutdown (sock, how) Sockets can be closed simply by using @code{close-port}. The @@ -6858,6 +7522,7 @@ The return value is unspecified. @end deffn connect +@c snarfed from socket.c:815 @deffn {Scheme Procedure} connect sock fam address . args @deffnx {C Function} scm_connect (sock, fam, address, args) Initiate a connection from a socket using a specified address @@ -6884,6 +7549,7 @@ The return value is unspecified. @end deffn bind +@c snarfed from socket.c:875 @deffn {Scheme Procedure} bind sock fam address . args @deffnx {C Function} scm_bind (sock, fam, address, args) Assign an address to the socket port @var{sock}. @@ -6932,6 +7598,7 @@ The return value is unspecified. @end deffn listen +@c snarfed from socket.c:909 @deffn {Scheme Procedure} listen sock backlog @deffnx {C Function} scm_listen (sock, backlog) Enable @var{sock} to accept connection @@ -6945,6 +7612,7 @@ The return value is unspecified. @end deffn accept +@c snarfed from socket.c:1014 @deffn {Scheme Procedure} accept sock @deffnx {C Function} scm_accept (sock) Accept a connection on a bound, listening socket. @@ -6964,6 +7632,7 @@ connection and will continue to accept new requests. @end deffn getsockname +@c snarfed from socket.c:1041 @deffn {Scheme Procedure} getsockname sock @deffnx {C Function} scm_getsockname (sock) Return the address of @var{sock}, in the same form as the @@ -6972,6 +7641,7 @@ of a socket in the @code{AF_FILE} namespace cannot be read. @end deffn getpeername +@c snarfed from socket.c:1063 @deffn {Scheme Procedure} getpeername sock @deffnx {C Function} scm_getpeername (sock) Return the address that @var{sock} @@ -6981,6 +7651,7 @@ is connected to, in the same form as the object returned by @end deffn recv! +@c snarfed from socket.c:1098 @deffn {Scheme Procedure} recv! sock buf [flags] @deffnx {C Function} scm_recv (sock, buf, flags) Receive data from a socket port. @@ -7006,6 +7677,7 @@ any unread buffered port data is ignored. @end deffn send +@c snarfed from socket.c:1131 @deffn {Scheme Procedure} send sock message [flags] @deffnx {C Function} scm_send (sock, message, flags) Transmit the string @var{message} on a socket port @var{sock}. @@ -7024,6 +7696,7 @@ any unflushed buffered port data is ignored. @end deffn recvfrom! +@c snarfed from socket.c:1171 @deffn {Scheme Procedure} recvfrom! sock str [flags [start [end]]] @deffnx {C Function} scm_recvfrom (sock, str, flags, start, end) Return data from the socket port @var{sock} and also @@ -7052,6 +7725,7 @@ descriptor: any unread buffered port data is ignored. @end deffn sendto +@c snarfed from socket.c:1229 @deffn {Scheme Procedure} sendto sock message fam address . args_and_flags @deffnx {C Function} scm_sendto (sock, message, fam, address, args_and_flags) Transmit the string @var{message} on the socket port @@ -7073,3 +7747,63 @@ Note that the data is written directly to the socket file descriptor: any unflushed buffered port data is ignored. @end deffn + + single-active-thread? +@c snarfed from threads.c:79 +@deffn {Scheme Procedure} single-active-thread? +implemented by the C function "scm_single_thread_p" +@end deffn + + yield +@c snarfed from threads.c:85 +@deffn {Scheme Procedure} yield +implemented by the C function "scm_yield" +@end deffn + + call-with-new-thread +@c snarfed from threads.c:90 +@deffn {Scheme Procedure} call-with-new-thread +implemented by the C function "scm_call_with_new_thread" +@end deffn + + join-thread +@c snarfed from threads.c:104 +@deffn {Scheme Procedure} join-thread +implemented by the C function "scm_join_thread" +@end deffn + + make-mutex +@c snarfed from threads.c:109 +@deffn {Scheme Procedure} make-mutex +implemented by the C function "scm_make_mutex" +@end deffn + + lock-mutex +@c snarfed from threads.c:112 +@deffn {Scheme Procedure} lock-mutex +implemented by the C function "scm_lock_mutex" +@end deffn + + unlock-mutex +@c snarfed from threads.c:117 +@deffn {Scheme Procedure} unlock-mutex +implemented by the C function "scm_unlock_mutex" +@end deffn + + make-condition-variable +@c snarfed from threads.c:123 +@deffn {Scheme Procedure} make-condition-variable +implemented by the C function "scm_make_condition_variable" +@end deffn + + wait-condition-variable +@c snarfed from threads.c:125 +@deffn {Scheme Procedure} wait-condition-variable +implemented by the C function "scm_wait_condition_variable" +@end deffn + + signal-condition-variable +@c snarfed from threads.c:127 +@deffn {Scheme Procedure} signal-condition-variable +implemented by the C function "scm_signal_condition_variable" +@end deffn diff --git a/doc/ref/ChangeLog b/doc/ref/ChangeLog index 18ecbffe5..fbbb86d10 100644 --- a/doc/ref/ChangeLog +++ b/doc/ref/ChangeLog @@ -1,5 +1,8 @@ 2002-03-12 Neil Jerram + * scheme-compound.texi, scheme-data.texi, new-docstrings.texi: + Automatic updates from snarfed libguile docstrings. + * data-rep.texi, guile.texi, scheme-evaluation.texi, scheme-options.texi, scheme-translation.texi: Various minor enhancements ported from the stable CVS branch. diff --git a/doc/ref/new-docstrings.texi b/doc/ref/new-docstrings.texi index 5116cb18e..169f4c20e 100644 --- a/doc/ref/new-docstrings.texi +++ b/doc/ref/new-docstrings.texi @@ -679,3 +679,13 @@ well. For example, (load-extension "libguile-bla-blum" "bla_init_blum") @end lisp @end deffn + +@deffn {Scheme Procedure} single-active-thread? +implemented by the C function "scm_single_thread_p" +@end deffn + +@deffn {Scheme Procedure} object-address obj +@deffnx {C Function} scm_object_address (obj) +Return an integer that for the lifetime of @var{obj} is uniquely +returned by this function for @var{obj} +@end deffn diff --git a/doc/ref/scheme-compound.texi b/doc/ref/scheme-compound.texi index 0ab5e309d..ec49bccd7 100644 --- a/doc/ref/scheme-compound.texi +++ b/doc/ref/scheme-compound.texi @@ -1343,7 +1343,7 @@ not an array, @code{0} is returned. @end deffn @deffn {Scheme Procedure} array->list v -@deffnx {C Function} scm_t_arrayo_list (v) +@deffnx {C Function} scm_array_to_list (v) Return a list consisting of all the elements, in order, of @var{array}. @end deffn diff --git a/doc/ref/scheme-data.texi b/doc/ref/scheme-data.texi index 0aeb7de6c..6404da80f 100755 --- a/doc/ref/scheme-data.texi +++ b/doc/ref/scheme-data.texi @@ -2347,7 +2347,7 @@ Return a hash value for @var{symbol}. @deffnx {C Function} scm_gensym (prefix) Create a new symbol with a name constructed from a prefix and a counter value. The string @var{prefix} can be specified as -an optional argument. Default prefix is @code{g}. The counter +an optional argument. Default prefix is @code{ g}. The counter is increased by 1 at each call. There is no provision for resetting the counter. @end deffn From e21f90f0de25a177808d4a42e27d776645c54e44 Mon Sep 17 00:00:00 2001 From: Neil Jerram Date: Tue, 12 Mar 2002 21:54:52 +0000 Subject: [PATCH 076/131] * snarf-check-and-output-texi (snarf-check-and-output-texi): If supplied, the `--manual' flag arrives as a string, not a symbol, so test for it as such. --- scripts/ChangeLog | 6 ++++++ scripts/snarf-check-and-output-texi | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/scripts/ChangeLog b/scripts/ChangeLog index 7d619d2b0..484c62c67 100644 --- a/scripts/ChangeLog +++ b/scripts/ChangeLog @@ -1,3 +1,9 @@ +2002-03-12 Neil Jerram + + * snarf-check-and-output-texi (snarf-check-and-output-texi): If + supplied, the `--manual' flag arrives as a string, not a symbol, + so test for it as such. + 2002-03-03 Neil Jerram * snarf-guile-m4-docs (display-texi): Strip off `# ' from start of diff --git a/scripts/snarf-check-and-output-texi b/scripts/snarf-check-and-output-texi index 37d751c86..d669cab86 100755 --- a/scripts/snarf-check-and-output-texi +++ b/scripts/snarf-check-and-output-texi @@ -42,7 +42,7 @@ exec ${GUILE-guile} -l $0 -c "(apply $main (cdr (command-line)))" "$@" (define *manual-flag* #f) (define (snarf-check-and-output-texi . flags) - (if (memq '--manual flags) + (if (member "--manual" flags) (set! *manual-flag* #t)) (process-stream (current-input-port))) From c87af2d55b247760a74a4e616d9827b24ed34334 Mon Sep 17 00:00:00 2001 From: Rob Browning Date: Tue, 12 Mar 2002 21:57:07 +0000 Subject: [PATCH 077/131] *** empty log message *** --- THANKS | 4 ++++ guile-config/ChangeLog | 5 +++++ ice-9/ChangeLog | 5 +++++ 3 files changed, 14 insertions(+) diff --git a/THANKS b/THANKS index 1dd99f015..0b046a1fd 100644 --- a/THANKS +++ b/THANKS @@ -3,6 +3,10 @@ Contributors since the last release: Rob Browning Stefan Jahn +Sponsors since the last release: + + The Linux Developers Group + For fixes or providing information which led to a fix: Martin Baulig diff --git a/guile-config/ChangeLog b/guile-config/ChangeLog index 607d01322..6f1ef4a50 100644 --- a/guile-config/ChangeLog +++ b/guile-config/ChangeLog @@ -1,3 +1,8 @@ +2002-03-12 Rob Browning + + * guile-config.in (build-link): don't output -L/usr/lib. + (build-compile): don't output -I/usr/include. + 2002-03-03 Neil Jerram * guile.m4 (GUILE_PROGS): In docstring, change `are' to `is'. diff --git a/ice-9/ChangeLog b/ice-9/ChangeLog index 4aea4cab3..1a1947770 100644 --- a/ice-9/ChangeLog +++ b/ice-9/ChangeLog @@ -1,3 +1,8 @@ +2002-03-12 Rob Browning + + * syncase.scm: fix bad let. + (gensym): fix failure on non-threaded + 2002-03-05 Thien-Thi Nguyen * ftw.scm: New file. From b7798e1067c0f6aa69fe6322c6874f0e5e437d74 Mon Sep 17 00:00:00 2001 From: Dirk Herrmann Date: Wed, 13 Mar 2002 21:53:46 +0000 Subject: [PATCH 078/131] * eval.c (SCM_CEVAL): Got rid of the last reference to t.lloc. The next step will be to remove the union 't' and simplify the code of SCM_CEVAL that way. --- libguile/ChangeLog | 6 ++++++ libguile/eval.c | 19 +++++++++++-------- 2 files changed, 17 insertions(+), 8 deletions(-) diff --git a/libguile/ChangeLog b/libguile/ChangeLog index 2adb13d62..8e4d0eb8b 100644 --- a/libguile/ChangeLog +++ b/libguile/ChangeLog @@ -1,3 +1,9 @@ +2002-03-13 Dirk Herrmann + + * eval.c (SCM_CEVAL): Got rid of the last reference to t.lloc. + The next step will be to remove the union 't' and simplify the + code of SCM_CEVAL that way. + 2002-03-12 Neil Jerram * iselect.c (collisionp, gnfds, greadfds, gwritefds, gexceptfds, diff --git a/libguile/eval.c b/libguile/eval.c index 7869ecc23..a99358d2b 100644 --- a/libguile/eval.c +++ b/libguile/eval.c @@ -2688,6 +2688,7 @@ dispatch: return SCM_APPLY (proc, t.arg1, SCM_EOL); } + default: goto badfun; } @@ -2734,19 +2735,21 @@ dispatch: #endif break; #endif /* ifdef MEMOIZE_LOCALS */ - + case scm_tcs_cons_nimcar: orig_sym = SCM_CAR (x); if (SCM_SYMBOLP (orig_sym)) { #ifdef USE_THREADS - t.lloc = scm_lookupcar1 (x, env, 1); - if (t.lloc == NULL) - { - /* we have lost the race, start again. */ - goto dispatch; - } - proc = *t.lloc; + { + SCM *location = scm_lookupcar1 (x, env, 1); + if (location == NULL) + { + /* we have lost the race, start again. */ + goto dispatch; + } + proc = *location; + } #else proc = *scm_lookupcar (x, env, 1); #endif From 6f627b2b1efe0bc8346866b47c2fa7d0c331b645 Mon Sep 17 00:00:00 2001 From: Thien-Thi Nguyen Date: Thu, 14 Mar 2002 02:02:29 +0000 Subject: [PATCH 079/131] (guile_toc.html): Look for guile.texi in $(srcdir). --- doc/ref/Makefile.am | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/ref/Makefile.am b/doc/ref/Makefile.am index 42760453c..8459b4b16 100644 --- a/doc/ref/Makefile.am +++ b/doc/ref/Makefile.am @@ -54,7 +54,7 @@ htmldir = $(prefix)/html/guile-$(VERSION) html_DATA = guile_toc.html $(shell ls guile_*.html 2>/dev/null) guile_toc.html: guile.texi $(guile_TEXINFOS) - $(TEXI2HTML) -split_chapter guile.texi + $(TEXI2HTML) -split_chapter $(srcdir)/guile.texi endif From 13b6820484b246ddc82883888c8ae6edc847aa34 Mon Sep 17 00:00:00 2001 From: Thien-Thi Nguyen Date: Thu, 14 Mar 2002 02:03:10 +0000 Subject: [PATCH 080/131] *** empty log message *** --- doc/ref/ChangeLog | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/doc/ref/ChangeLog b/doc/ref/ChangeLog index fbbb86d10..56d00ac7e 100644 --- a/doc/ref/ChangeLog +++ b/doc/ref/ChangeLog @@ -1,3 +1,7 @@ +2002-03-13 Thien-Thi Nguyen + + * Makefile.am (guile_toc.html): Look for guile.texi in $(srcdir). + 2002-03-12 Neil Jerram * scheme-compound.texi, scheme-data.texi, new-docstrings.texi: From 9bc6fb0a7d91ae9a6c57cedb76022043db413ba5 Mon Sep 17 00:00:00 2001 From: Thien-Thi Nguyen Date: Thu, 14 Mar 2002 03:19:30 +0000 Subject: [PATCH 081/131] Update copyright. Rewrite to internalize error handling. Add commentary. --- libguile/guile-snarf.in | 109 ++++++++++++++++++++++++++++++++++------ 1 file changed, 94 insertions(+), 15 deletions(-) diff --git a/libguile/guile-snarf.in b/libguile/guile-snarf.in index 3d708dbf3..4d830f8cd 100644 --- a/libguile/guile-snarf.in +++ b/libguile/guile-snarf.in @@ -1,34 +1,113 @@ #!/bin/sh -# Extract the initialization actions for builtin things. +# Extract the initialization actions from source files. +# +# Copyright (C) 1996, 97, 98, 99, 2000, 2001, 2002 Free Software Foundation, Inc. # -# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001 Free Software Foundation, Inc. -# # 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 # the Free Software Foundation, Inc., 59 Temple Place, Suite 330, # Boston, MA 02111-1307 USA +# Commentary: + +# Usage: guile-snarf [--compat=1.4] [-o OUTFILE] INFILE [CPP-OPTIONS ...] +# +# Process INFILE using the C pre-processor and some other programs. +# Write output to a file, named OUTFILE if specified, or STEM.x if +# INFILE looks like STEM.c and no OUTFILE is specified. Ignore +# lines from the input matching grep(1) regular expression: +# +# ^#include ".*OUTFILE" +# +# If there are errors during processing, delete OUTFILE and exit with +# non-zero status. +# +# Optional arg "--compat=1.4" means emulate guile-1.4 guile-snarf. +# This option is easily misunderstood -- see Guile reference manual. +# +# If env var CPP is set, use its value instead of the C pre-processor +# determined at Guile configure-time: "@CPP@". + +# Code: + +## funcs + +modern_snarf () # writes stdout +{ +${cpp} -DSCM_MAGIC_SNARF_INITS "$@" > ${temp} && cpp_ok_p=true +grep "^ *\^ *\^" ${temp} | sed -e "s/^ *\^ *\^//" +} + +compat_mode_clean_xxx () # modifies $1 +{ +filename=$1 +cp $filename ${temp} +sed -e 's/SCM_CONST_LONG/SCM_GLOBAL_VCELL_INIT/g' \ + -e 's/SCM_GLOBAL_VCELL_INIT/SCM_GLOBAL_VARIABLE_INIT/g' \ + -e 's/SCM_GLOBAL_VCELL/SCM_GLOBAL_VARIABLE/g' \ + -e 's/SCM_VCELL_INIT/SCM_VARIABLE_INIT/g' \ + -e 's/SCM_VCELL/SCM_VARIABLE/g' \ + < ${temp} \ + > $filename +} + +## main + +# process command line +if [ x"$1" = x--help ] ; then + @AWK@ '/^#.Commentary:/,/^#.Code:/' $0 | grep -v Code: \ + | sed -e 1,2d -e 's/^. *//g' + exit 0 +fi +if [ x"$1" = x--compat=1.4 ] + then compat_mode_p=true ; shift + else compat_mode_p=false +fi +if [ x"$1" = x-o ] + then outfile=$2 ; shift ; shift ; infile=$1 ; shift + else infile=$1 ; shift ; outfile=`basename $infile .c`.x +fi + +[ x"$infile" = x ] && { echo $0: No input file ; exit 1 ; } +[ ! -f "$infile" ] && { echo $0: No such file: $infile ; exit 1 ; } + +# set vars and handler -- handle CPP override +cpp_ok_p=false temp="/tmp/snarf.$$" -trap "rm -f $temp" 0 1 2 15 +if [ x"$CPP" = x ] ; then cpp="@CPP@" ; else cpp="$CPP" ; fi +self_blind_regexp='^#include ".*'`basename $outfile`'"' +clean_infile=$infile.clean.c # temp file in same dir as infile + # so that #include "foo" works + # (e.g., see libguile/eval.c). + # use .c to satisfy cpp heuristics. +trap "rm -f $temp $clean_infile" 0 1 2 15 -## Let the user override the preprocessor autoconf found. -test -n "${CPP+set}" || CPP="@CPP@" +# clean input file +grep -v "$self_blind_regexp" $infile > $clean_infile +$compat_mode_p && compat_mode_clean_xxx $clean_infile -## We must use a temporary file here, instead of a pipe, because we -## need to know if CPP exits with a non-zero status. -${CPP} -DSCM_MAGIC_SNARF_INITS "$@" > ${temp} || exit $? -< ${temp} grep "^ *\^ *\^" | sed -e "s/^ *\^ *\^//" +# do the snarfing -- output something extra for needy cpp programs (AIX) +{ echo "/* source: $infile */" ; + echo "/* cpp-options: $@ */" ; + modern_snarf "$@" $clean_infile ; +} > $outfile -## Apparently, AIX's preprocessor is unhappy if you try to #include an -## empty file. -echo +# zonk outfile if errors occurred +if $cpp_ok_p ; then + exit 0 +else + rm -f $outfile + exit 1 +fi + +# guile-snarf ends here From e9c3d3f96a25cda22cdb43df167d16fd3db3548d Mon Sep 17 00:00:00 2001 From: Thien-Thi Nguyen Date: Thu, 14 Mar 2002 03:21:30 +0000 Subject: [PATCH 082/131] (libpath.h): Use @top_srcdir_absoulte@. (snarfcppopts): New var. (.c.x): Use $(snarfcppopts). Rework guile-snarf usage. (.c.doc): Use $(snarfcppopts). --- libguile/Makefile.am | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/libguile/Makefile.am b/libguile/Makefile.am index 3946801b5..4d18ebcbd 100644 --- a/libguile/Makefile.am +++ b/libguile/Makefile.am @@ -164,8 +164,7 @@ libpath.h: $(srcdir)/Makefile.in $(top_builddir)/config.status @echo '#define SCM_SITE_DIR "$(pkgdatadir)/site"' >> libpath.tmp @echo '#define SCM_BUILD_INFO { \' >> libpath.tmp @echo ' { "srcdir", "'"`cd @srcdir@; pwd`"'" }, \' >> libpath.tmp - @echo ' { "top_srcdir", "'"`cd @top_srcdir@; pwd`"'" }, \' \ - >> libpath.tmp + @echo ' { "top_srcdir", "top_srcdir_absolute@" }, \' >> libpath.tmp @echo ' { "prefix", "@prefix@" }, \' >> libpath.tmp @echo ' { "exec_prefix", "@exec_prefix@" }, \' >> libpath.tmp @echo ' { "bindir", "@bindir@" }, \' >> libpath.tmp @@ -192,13 +191,14 @@ libpath.h: $(srcdir)/Makefile.in $(top_builddir)/config.status @mv libpath.tmp libpath.h +snarfcppopts = $(DEFS) $(INCLUDES) $(CPPFLAGS) $(CFLAGS) + SUFFIXES = .x .doc .c.x: - ./guile-snarf $(DEFS) $(INCLUDES) $(CPPFLAGS) $(CFLAGS) $< > $@ \ - || { rm $@; false; } + ./guile-snarf $< $(snarfcppopts) .c.doc: -(test -n "${AWK+set}" || AWK="@AWK@"; ${AWK} -f ./guile-func-name-check $<) - (./guile-snarf-docs $(DEFS) $(INCLUDES) $(CPPFLAGS) $(CFLAGS) $< | \ + (./guile-snarf-docs $(snarfcppopts) $< | \ ./guile_filter_doc_snarfage$(EXEEXT) --filter-snarfage) > $@ || { rm $@; false; } $(DOT_X_FILES) $(EXTRA_DOT_DOC_FILES): snarf.h guile-snarf.in From d5e1d82d1cedd5db482f84075d6dd8d5ab2c6144 Mon Sep 17 00:00:00 2001 From: Thien-Thi Nguyen Date: Thu, 14 Mar 2002 03:27:51 +0000 Subject: [PATCH 083/131] (How guile-snarf works): Mention "--compat=1.4", and new processing steps. Update usage example, makefile frag. (guile-1.4 guile-snarf): New subsubsection under "Init Snarfing with guile-snarf". --- doc/ref/tools.texi | 114 ++++++++++++++++++++++++++++++++++++++++----- 1 file changed, 102 insertions(+), 12 deletions(-) diff --git a/doc/ref/tools.texi b/doc/ref/tools.texi index 18448bfd8..6664a987e 100644 --- a/doc/ref/tools.texi +++ b/doc/ref/tools.texi @@ -62,6 +62,7 @@ generate a file of calls to @code{scm_c_define_gsubr} which you can @menu * How guile-snarf works:: Using @code{guile-snarf}, with example. * Macros guile-snarf recognizes:: How to mark up code for @code{guile-snarf}. +* guile-1.4 guile-snarf:: The old way, and how handle it. @end menu @c --------------------------------------------------------------------------- @@ -70,11 +71,30 @@ generate a file of calls to @code{scm_c_define_gsubr} which you can @cindex guile-snarf invocation @cindex guile-snarf example -Usage: @code{guile-snarf} [CPP-OPTIONS ...] SOURCE.c +Usage: guile-snarf [--compat=1.4] [-o OUTFILE] INFILE [CPP-OPTIONS ...] -@code{guile-snarf} uses cpp to process SOURCE.c, writing C language -initialization calls to standard output, based on special (some would say -magic) cpp macros found in the input (@pxref{Macros guile-snarf recognizes}). +What @code{guile-snarf} does: + +Process INFILE using the C pre-processor and some other programs. +Write output to a file, named OUTFILE if specified, or STEM.x if +INFILE looks like STEM.c and no OUTFILE is specified. Ignore +lines from the input matching grep(1) regular expression: + +@example + ^#include ".*OUTFILE" +@end example + +If there are errors during processing, delete OUTFILE and exit with +non-zero status. + +Optional arg "--compat=1.4" means emulate guile-1.4 guile-snarf. +This option is not fully tested (@pxref{guile-1.4 guile-snarf}). + +If env var CPP is set, use its value instead of the C pre-processor +determined at Guile configure-time: "@CPP@". + +@xref{Macros guile-snarf recognizes}, for a list of the special (some would +say magic) cpp macros you can use. For example, here is how you might define a new subr called @code{clear-image}, implemented by the C function @code{clear_image}: @@ -116,7 +136,7 @@ Assuming the text above lives in a file named @file{image-type.c}, you will need to execute the following command to prepare this file for compilation: @example -guile-snarf image-type.c > image-type.x +guile-snarf image-type.c @end example This scans @file{image-type.c} for @code{SCM_DEFINE} @@ -136,22 +156,23 @@ can place the information near the function definition itself, so it is less likely to become incorrect or out-of-date. If you have many files that @code{guile-snarf} must process, you should -consider using a rule like the following in your Makefile: +consider using a fragment like the following in your Makefile: @example +snarfcppopts = $(DEFS) $(INCLUDES) $(CPPFLAGS) $(CFLAGS) .SUFFIXES: .x .c.x: - guile-snarf $(DEFS) $(INCLUDES) $(CPPFLAGS) $(CFLAGS) $< > $@@ + guile-snarf -o $@ $< $(snarfcppopts) @end example This tells make to run @code{guile-snarf} to produce each needed @file{.x} file from the corresponding @file{.c} file. -@code{guile-snarf} passes all its command-line arguments directly to the -C preprocessor, which it uses to extract the information it needs from -the source code. this means you can pass normal compilation flags to -@code{guile-snarf} to define preprocessor symbols, add header file -directories, and so on. +Aside from the required argument INFILE, @code{guile-snarf} passes its +command-line arguments directly to the C preprocessor, which it uses to +extract the information it needs from the source code. this means you can pass +normal compilation flags to @code{guile-snarf} to define preprocessor symbols, +add header file directories, and so on. @c --------------------------------------------------------------------------- @node Macros guile-snarf recognizes @@ -217,6 +238,75 @@ Also, it's a good idea to define @var{FUNC_NAME} immediately after using @xref{Subrs}, for details on argument passing and how to write C functions. +@xref{guile-1.4 guile-snarf}, if you have code that relies on the guile-snarf +shipped with guile-1.4 (guile-snarf shipped with guile-1.6 is different). + +@c --------------------------------------------------------------------------- +@node guile-1.4 guile-snarf +@subsubsection guile-1.4 guile-snarf +@cindex guile-1.4 guile-snarf +@cindex guile-snarf, guile-1.4 + +The @code{guile-snarf} included with guile-1.4 differs in behavior and usage +from that included with guile-1.6 and later. This page explains the four +kinds of modifications code written with guile-1.4 guile-snarf in mind need to +undergo, in order to be completely compatible with guile-1.6 init snarfing +practice; and explains how to use @code{guile-snarf --compat=1.4}. + +@itemize + +@item Some of the recognized macro names have changed. + +Specifically, you need to rename: + +@itemize +@item SCM_VCELL to SCM_VARIABLE +@item SCM_GLOBAL_VCELL to SCM_GLOBAL_VARIABLE +@item SCM_VCELL_INIT to SCM_VARIABLE_INIT +@item SCM_GLOBAL_VCELL_INIT to SCM_GLOBAL_VARIABLE_INIT +@end itemize + +@item The macro SCM_CONST_LONG is no longer recognized. + +Proabably you can use SCM_GLOBAL_VARIABLE_INIT where you would have +formerly used SCM_CONST_LONG. [fixme: needs verification] + +@item guile-snarf is no longer usable in a pipe. + +With guile-1.4 guile-snarf you had capture its output to a file, check +the exit value of the guile-snarf process, and delete the file if that +value was false. These operations are now handled internally to +guile-snarf, providing you either specify the output file explicitly, or +use an input file name that ends in @code{.c} (in which case the output +filename is computed from the input filename by replacing @code{.c} with +@code{.x}). + +@end itemize + +If you have code that uses the old snarf macros (for example, +SCM_VCELL), but have installed the new guile-snarf, you can arrange for +the old macros to be still recognized by using the @code{--compat=1.4} +option. With this option, old macros are translated to their new +variants on input to the modern snarfing process. This means the .x +files produced will make use of @code{scm_c_define_gsubr} and friends, +which are ready to be compiled against the new libguile. + +Thus, @code{--compat=1.4} does not provide @emph{full} emulation, only +input emulation. (The thinking is: If you have a new guile-snarf +installed, probably you have a new libguile installed, too, and would +prefer to get your old code to work with the new libguile.) + +The makefile fragment to use would look something like: + +@example +.c.x: + guile-snarf --compat=1.4 -o $@ $< +@end example + +After you've done a global search and replace on SCM_VCELL and friends, +you can remove @code{--compat=1.4} altogether (@pxref{How guile-snarf +works}). + @c --------------------------------------------------------------------------- @node Doc Snarfing @subsection Doc Snarfing From 2287fb53d4760e161ec65b0097219cbab4d0a929 Mon Sep 17 00:00:00 2001 From: Thien-Thi Nguyen Date: Thu, 14 Mar 2002 03:28:39 +0000 Subject: [PATCH 084/131] *** empty log message *** --- doc/ref/ChangeLog | 6 ++++++ libguile/ChangeLog | 12 ++++++++++++ 2 files changed, 18 insertions(+) diff --git a/doc/ref/ChangeLog b/doc/ref/ChangeLog index 56d00ac7e..bc58cf4c8 100644 --- a/doc/ref/ChangeLog +++ b/doc/ref/ChangeLog @@ -2,6 +2,12 @@ * Makefile.am (guile_toc.html): Look for guile.texi in $(srcdir). + * tools.texi (How guile-snarf works): Mention "--compat=1.4", and + new processing steps. Update usage example, makefile frag. + + (guile-1.4 guile-snarf): New subsubsection under + "Init Snarfing with guile-snarf". + 2002-03-12 Neil Jerram * scheme-compound.texi, scheme-data.texi, new-docstrings.texi: diff --git a/libguile/ChangeLog b/libguile/ChangeLog index 8e4d0eb8b..327ecca84 100644 --- a/libguile/ChangeLog +++ b/libguile/ChangeLog @@ -1,3 +1,15 @@ +2002-03-13 Thien-Thi Nguyen + + * guile-snarf.in: Update copyright. + Rewrite to internalize error handling. + Add "--compat=1.4" handling. + Add commentary. + + * Makefile.am (libpath.h): Use @top_srcdir_absolute@. + (snarfcppopts): New var. + (.c.x): Use $(snarfcppopts). Rework guile-snarf usage. + (.c.doc): Use $(snarfcppopts). + 2002-03-13 Dirk Herrmann * eval.c (SCM_CEVAL): Got rid of the last reference to t.lloc. From a6b844c224b65f99300aa0f516fadbef50e7c8aa Mon Sep 17 00:00:00 2001 From: Thien-Thi Nguyen Date: Thu, 14 Mar 2002 03:47:43 +0000 Subject: [PATCH 085/131] Retire inclusion guard macro SCM_MAGIC_SNARFER. --- libguile/alist.c | 2 -- libguile/arbiters.c | 2 -- libguile/async.c | 2 -- libguile/backtrace.c | 2 -- libguile/boolean.c | 2 -- libguile/chars.c | 2 -- libguile/continuations.c | 2 -- libguile/debug-malloc.c | 2 -- libguile/debug.c | 2 -- libguile/deprecation.c | 2 -- libguile/dynl.c | 2 -- libguile/dynwind.c | 2 -- libguile/environments.c | 2 -- libguile/eq.c | 2 -- libguile/error.c | 2 -- libguile/eval.c | 2 -- libguile/evalext.c | 2 -- libguile/extensions.c | 2 -- libguile/feature.c | 2 -- libguile/filesys.c | 2 -- libguile/fluids.c | 2 -- libguile/fports.c | 2 -- libguile/gc.c | 2 -- libguile/goops.c | 2 -- libguile/gsubr.c | 2 -- libguile/guardians.c | 2 -- libguile/hash.c | 2 -- libguile/hashtab.c | 2 -- libguile/hooks.c | 2 -- libguile/ioext.c | 2 -- libguile/iselect.c | 2 -- libguile/keywords.c | 2 -- libguile/lang.c | 2 -- libguile/list.c | 2 -- libguile/load.c | 2 -- libguile/macros.c | 2 -- libguile/modules.c | 2 -- libguile/net_db.c | 2 -- libguile/numbers.c | 2 -- libguile/objects.c | 2 -- libguile/objprop.c | 2 -- libguile/options.c | 2 -- libguile/pairs.c | 2 -- libguile/ports.c | 2 -- libguile/posix.c | 2 -- libguile/print.c | 2 -- libguile/procprop.c | 2 -- libguile/procs.c | 2 -- libguile/properties.c | 2 -- libguile/ramap.c | 2 -- libguile/random.c | 2 -- libguile/rdelim.c | 2 -- libguile/read.c | 2 -- libguile/regex-posix.c | 2 -- libguile/root.c | 2 -- libguile/rw.c | 2 -- libguile/scmsigs.c | 2 -- libguile/script.c | 2 -- libguile/simpos.c | 2 -- libguile/socket.c | 2 -- libguile/sort.c | 2 -- libguile/srcprop.c | 2 -- libguile/stackchk.c | 2 -- libguile/stacks.c | 2 -- libguile/stime.c | 2 -- libguile/strings.c | 2 -- libguile/strop.c | 2 -- libguile/strorder.c | 2 -- libguile/strports.c | 2 -- libguile/struct.c | 2 -- libguile/symbols.c | 2 -- libguile/threads.c | 2 -- libguile/throw.c | 2 -- libguile/unif.c | 2 -- libguile/values.c | 2 -- libguile/variable.c | 2 -- libguile/vectors.c | 2 -- libguile/version.c | 2 -- libguile/vports.c | 2 -- libguile/weaks.c | 2 -- 80 files changed, 160 deletions(-) diff --git a/libguile/alist.c b/libguile/alist.c index 07bd64356..3ffed4e63 100644 --- a/libguile/alist.c +++ b/libguile/alist.c @@ -395,9 +395,7 @@ SCM_DEFINE (scm_assoc_remove_x, "assoc-remove!", 2, 0, 0, void scm_init_alist () { -#ifndef SCM_MAGIC_SNARFER #include "libguile/alist.x" -#endif } diff --git a/libguile/arbiters.c b/libguile/arbiters.c index a6d17ca80..103b71581 100644 --- a/libguile/arbiters.c +++ b/libguile/arbiters.c @@ -129,9 +129,7 @@ scm_init_arbiters () scm_tc16_arbiter = scm_make_smob_type ("arbiter", 0); scm_set_smob_mark (scm_tc16_arbiter, scm_markcdr); scm_set_smob_print (scm_tc16_arbiter, arbiter_print); -#ifndef SCM_MAGIC_SNARFER #include "libguile/arbiters.x" -#endif } /* diff --git a/libguile/async.c b/libguile/async.c index e3b7d33f3..118a0d0e6 100644 --- a/libguile/async.c +++ b/libguile/async.c @@ -462,9 +462,7 @@ scm_init_async () tc16_async = scm_make_smob_type ("async", 0); scm_set_smob_mark (tc16_async, async_mark); -#ifndef SCM_MAGIC_SNARFER #include "libguile/async.x" -#endif } /* diff --git a/libguile/backtrace.c b/libguile/backtrace.c index feed5a12f..01ef26bbf 100644 --- a/libguile/backtrace.c +++ b/libguile/backtrace.c @@ -773,9 +773,7 @@ scm_init_backtrace () SCM f = scm_make_fluid (); scm_the_last_stack_fluid_var = scm_c_define ("the-last-stack", f); -#ifndef SCM_MAGIC_SNARFER #include "libguile/backtrace.x" -#endif } /* diff --git a/libguile/boolean.c b/libguile/boolean.c index 402fce55d..a3e37fc4e 100644 --- a/libguile/boolean.c +++ b/libguile/boolean.c @@ -74,9 +74,7 @@ SCM_DEFINE (scm_boolean_p, "boolean?", 1, 0, 0, void scm_init_boolean () { -#ifndef SCM_MAGIC_SNARFER #include "libguile/boolean.x" -#endif } diff --git a/libguile/chars.c b/libguile/chars.c index 469514715..cbc2cb5e8 100644 --- a/libguile/chars.c +++ b/libguile/chars.c @@ -404,9 +404,7 @@ int scm_n_charnames = sizeof (scm_charnames) / sizeof (char *); void scm_init_chars () { -#ifndef SCM_MAGIC_SNARFER #include "libguile/chars.x" -#endif } diff --git a/libguile/continuations.c b/libguile/continuations.c index efc96de28..0cf76a32a 100644 --- a/libguile/continuations.c +++ b/libguile/continuations.c @@ -312,9 +312,7 @@ scm_init_continuations () scm_set_smob_free (scm_tc16_continuation, continuation_free); scm_set_smob_print (scm_tc16_continuation, continuation_print); scm_set_smob_apply (scm_tc16_continuation, continuation_apply, 0, 0, 1); -#ifndef SCM_MAGIC_SNARFER #include "libguile/continuations.x" -#endif } /* diff --git a/libguile/debug-malloc.c b/libguile/debug-malloc.c index e85423dd1..ae524e7d9 100644 --- a/libguile/debug-malloc.c +++ b/libguile/debug-malloc.c @@ -261,8 +261,6 @@ scm_debug_malloc_prehistory () void scm_init_debug_malloc () { -#ifndef SCM_MAGIC_SNARFER #include "libguile/debug-malloc.x" -#endif } diff --git a/libguile/debug.c b/libguile/debug.c index 11f34cd2c..c4078f5a4 100644 --- a/libguile/debug.c +++ b/libguile/debug.c @@ -594,9 +594,7 @@ scm_init_debug () #endif scm_add_feature ("debug-extensions"); -#ifndef SCM_MAGIC_SNARFER #include "libguile/debug.x" -#endif } /* diff --git a/libguile/deprecation.c b/libguile/deprecation.c index 55a82aa4f..fa22e49a2 100644 --- a/libguile/deprecation.c +++ b/libguile/deprecation.c @@ -185,9 +185,7 @@ scm_init_deprecation () atexit (print_deprecation_summary); } #endif -#ifndef SCM_MAGIC_SNARFER #include "libguile/deprecation.x" -#endif } /* diff --git a/libguile/dynl.c b/libguile/dynl.c index c3861cf71..1f8c3ca70 100644 --- a/libguile/dynl.c +++ b/libguile/dynl.c @@ -413,9 +413,7 @@ scm_init_dynamic_linking () scm_set_smob_mark (scm_tc16_dynamic_obj, dynl_obj_mark); scm_set_smob_print (scm_tc16_dynamic_obj, dynl_obj_print); sysdep_dynl_init (); -#ifndef SCM_MAGIC_SNARFER #include "libguile/dynl.x" -#endif } /* diff --git a/libguile/dynwind.c b/libguile/dynwind.c index 5970dc455..7f3566ffd 100644 --- a/libguile/dynwind.c +++ b/libguile/dynwind.c @@ -282,9 +282,7 @@ scm_init_dynwind () { tc16_guards = scm_make_smob_type ("guards", 0); scm_set_smob_print (tc16_guards, guards_print); -#ifndef SCM_MAGIC_SNARFER #include "libguile/dynwind.x" -#endif } /* diff --git a/libguile/environments.c b/libguile/environments.c index 10ce8c8ca..f083b9399 100644 --- a/libguile/environments.c +++ b/libguile/environments.c @@ -2348,9 +2348,7 @@ scm_environments_prehistory () void scm_init_environments () { -#ifndef SCM_MAGIC_SNARFER #include "libguile/environments.x" -#endif } diff --git a/libguile/eq.c b/libguile/eq.c index 515d786b1..b159f2433 100644 --- a/libguile/eq.c +++ b/libguile/eq.c @@ -202,9 +202,7 @@ SCM_DEFINE1 (scm_equal_p, "equal?", scm_tc7_rpsubr, void scm_init_eq () { -#ifndef SCM_MAGIC_SNARFER #include "libguile/eq.x" -#endif } diff --git a/libguile/error.c b/libguile/error.c index e17231f88..9308205a6 100644 --- a/libguile/error.c +++ b/libguile/error.c @@ -306,9 +306,7 @@ void scm_init_error () { #include "libguile/cpp_err_symbols.c" -#ifndef SCM_MAGIC_SNARFER #include "libguile/error.x" -#endif } diff --git a/libguile/eval.c b/libguile/eval.c index a99358d2b..a682a5535 100644 --- a/libguile/eval.c +++ b/libguile/eval.c @@ -4285,9 +4285,7 @@ scm_init_eval () /* acros */ /* end of acros */ -#ifndef SCM_MAGIC_SNARFER #include "libguile/eval.x" -#endif scm_add_feature ("delay"); } diff --git a/libguile/evalext.c b/libguile/evalext.c index e7c95aec1..4b64eaa0f 100644 --- a/libguile/evalext.c +++ b/libguile/evalext.c @@ -147,9 +147,7 @@ void scm_init_evalext () { scm_make_synt (scm_s_set_x, scm_makmmacro, scm_m_generalized_set_x); -#ifndef SCM_MAGIC_SNARFER #include "libguile/evalext.x" -#endif } /* diff --git a/libguile/extensions.c b/libguile/extensions.c index 83bcee2a1..7fd311cce 100644 --- a/libguile/extensions.c +++ b/libguile/extensions.c @@ -163,9 +163,7 @@ void scm_init_extensions () { registered_extensions = NULL; -#ifndef SCM_MAGIC_SNARFER #include "libguile/extensions.x" -#endif } /* diff --git a/libguile/feature.c b/libguile/feature.c index 5748fd30b..8e71676c2 100644 --- a/libguile/feature.c +++ b/libguile/feature.c @@ -126,9 +126,7 @@ scm_init_feature() scm_c_define ("char-code-limit", SCM_MAKINUM (SCM_CHAR_CODE_LIMIT)); -#ifndef SCM_MAGIC_SNARFER #include "libguile/feature.x" -#endif } /* diff --git a/libguile/filesys.c b/libguile/filesys.c index 15593b4e8..15ea034f6 100644 --- a/libguile/filesys.c +++ b/libguile/filesys.c @@ -1621,9 +1621,7 @@ scm_init_filesys () scm_c_define ("FD_CLOEXEC", scm_long2num (FD_CLOEXEC)); #endif -#ifndef SCM_MAGIC_SNARFER #include "libguile/filesys.x" -#endif } /* diff --git a/libguile/fluids.c b/libguile/fluids.c index 7901e2231..267918249 100644 --- a/libguile/fluids.c +++ b/libguile/fluids.c @@ -262,9 +262,7 @@ scm_init_fluids () { scm_tc16_fluid = scm_make_smob_type ("fluid", 0); scm_set_smob_print (scm_tc16_fluid, fluid_print); -#ifndef SCM_MAGIC_SNARFER #include "libguile/fluids.x" -#endif } /* diff --git a/libguile/fports.c b/libguile/fports.c index 55f4782a3..7ee538eb5 100644 --- a/libguile/fports.c +++ b/libguile/fports.c @@ -867,9 +867,7 @@ scm_init_fports () scm_c_define ("_IOLBF", SCM_MAKINUM (_IOLBF)); scm_c_define ("_IONBF", SCM_MAKINUM (_IONBF)); -#ifndef SCM_MAGIC_SNARFER #include "libguile/fports.x" -#endif } /* diff --git a/libguile/gc.c b/libguile/gc.c index a96e9df9c..fd7a0562e 100644 --- a/libguile/gc.c +++ b/libguile/gc.c @@ -2866,9 +2866,7 @@ scm_init_gc () scm_c_hook_add (&scm_after_gc_c_hook, mark_gc_async, NULL, 0); -#ifndef SCM_MAGIC_SNARFER #include "libguile/gc.x" -#endif } #endif /*MARK_DEPENDENCIES*/ diff --git a/libguile/goops.c b/libguile/goops.c index fde237149..560421e58 100644 --- a/libguile/goops.c +++ b/libguile/goops.c @@ -2674,9 +2674,7 @@ scm_init_goops_builtins (void) goops_rstate = scm_c_make_rstate ("GOOPS", 5); -#ifndef SCM_MAGIC_SNARFER #include "libguile/goops.x" -#endif list_of_no_method = scm_permanent_object (scm_list_1 (sym_no_method)); diff --git a/libguile/gsubr.c b/libguile/gsubr.c index 03d16809d..b8b15462f 100644 --- a/libguile/gsubr.c +++ b/libguile/gsubr.c @@ -288,9 +288,7 @@ scm_init_gsubr() scm_c_define_gsubr ("gsubr-2-1-l", 2, 1, 1, gsubr_21l); /* example */ #endif -#ifndef SCM_MAGIC_SNARFER #include "libguile/gsubr.x" -#endif } /* diff --git a/libguile/guardians.c b/libguile/guardians.c index 88a6a4593..b69d0f5e9 100644 --- a/libguile/guardians.c +++ b/libguile/guardians.c @@ -630,9 +630,7 @@ scm_init_guardians () greedily_guarded_whash = scm_permanent_object (scm_make_doubly_weak_hash_table (SCM_MAKINUM (31))); -#ifndef SCM_MAGIC_SNARFER #include "libguile/guardians.x" -#endif } /* diff --git a/libguile/hash.c b/libguile/hash.c index 3b8fcbc33..f3fba4e3b 100644 --- a/libguile/hash.c +++ b/libguile/hash.c @@ -271,9 +271,7 @@ SCM_DEFINE (scm_hash, "hash", 2, 0, 0, void scm_init_hash () { -#ifndef SCM_MAGIC_SNARFER #include "libguile/hash.x" -#endif } diff --git a/libguile/hashtab.c b/libguile/hashtab.c index a6e2908a2..5cf8c7e6b 100644 --- a/libguile/hashtab.c +++ b/libguile/hashtab.c @@ -562,9 +562,7 @@ scm_internal_hash_fold (SCM (*fn) (), void *closure, SCM init, SCM table) void scm_init_hashtab () { -#ifndef SCM_MAGIC_SNARFER #include "libguile/hashtab.x" -#endif } /* diff --git a/libguile/hooks.c b/libguile/hooks.c index 02bd96d56..bada6164e 100644 --- a/libguile/hooks.c +++ b/libguile/hooks.c @@ -322,9 +322,7 @@ scm_init_hooks () scm_tc16_hook = scm_make_smob_type ("hook", 0); scm_set_smob_mark (scm_tc16_hook, scm_markcdr); scm_set_smob_print (scm_tc16_hook, hook_print); -#ifndef SCM_MAGIC_SNARFER #include "libguile/hooks.x" -#endif } /* diff --git a/libguile/ioext.c b/libguile/ioext.c index 6d57cd3ee..124332366 100644 --- a/libguile/ioext.c +++ b/libguile/ioext.c @@ -318,9 +318,7 @@ scm_init_ioext () { scm_add_feature ("i/o-extensions"); -#ifndef SCM_MAGIC_SNARFER #include "libguile/ioext.x" -#endif } diff --git a/libguile/iselect.c b/libguile/iselect.c index 215258001..59d2b795a 100644 --- a/libguile/iselect.c +++ b/libguile/iselect.c @@ -620,9 +620,7 @@ scm_init_iselect () timeout0.tv_usec = 0; #endif init_bc (0x80, 0, 0); -#ifndef SCM_MAGIC_SNARFER #include "libguile/iselect.x" -#endif } #endif /* GUILE_ISELECT */ diff --git a/libguile/keywords.c b/libguile/keywords.c index 05a50676f..5b10100de 100644 --- a/libguile/keywords.c +++ b/libguile/keywords.c @@ -138,9 +138,7 @@ scm_init_keywords () scm_set_smob_print (scm_tc16_keyword, keyword_print); scm_keyword_obarray = scm_c_make_hash_table (256); -#ifndef SCM_MAGIC_SNARFER #include "libguile/keywords.x" -#endif } diff --git a/libguile/lang.c b/libguile/lang.c index 463cbeb5c..4fbcbf47f 100644 --- a/libguile/lang.c +++ b/libguile/lang.c @@ -155,9 +155,7 @@ void scm_init_lang () { #if 0 -#ifndef SCM_MAGIC_SNARFER #include "libguile/lang.x" -#endif scm_make_synt ("nil-while", scm_makacro, scm_m_while); #endif diff --git a/libguile/list.c b/libguile/list.c index 7b0161cdf..fd815c7a6 100644 --- a/libguile/list.c +++ b/libguile/list.c @@ -835,9 +835,7 @@ SCM_DEFINE (scm_delete1_x, "delete1!", 2, 0, 0, void scm_init_list () { -#ifndef SCM_MAGIC_SNARFER #include "libguile/list.x" -#endif } /* diff --git a/libguile/load.c b/libguile/load.c index 83b85fef6..f3511231f 100644 --- a/libguile/load.c +++ b/libguile/load.c @@ -503,9 +503,7 @@ scm_init_load () init_build_info (); -#ifndef SCM_MAGIC_SNARFER #include "libguile/load.x" -#endif } /* diff --git a/libguile/macros.c b/libguile/macros.c index aac969fdb..d53e94931 100644 --- a/libguile/macros.c +++ b/libguile/macros.c @@ -230,9 +230,7 @@ scm_init_macros () scm_tc16_macro = scm_make_smob_type ("macro", 0); scm_set_smob_mark (scm_tc16_macro, scm_markcdr); scm_set_smob_print (scm_tc16_macro, macro_print); -#ifndef SCM_MAGIC_SNARFER #include "libguile/macros.x" -#endif } /* diff --git a/libguile/modules.c b/libguile/modules.c index 25776a026..9c6d72621 100644 --- a/libguile/modules.c +++ b/libguile/modules.c @@ -610,9 +610,7 @@ scm_modules_prehistory () void scm_init_modules () { -#ifndef SCM_MAGIC_SNARFER #include "libguile/modules.x" -#endif module_make_local_var_x_var = scm_c_define ("module-make-local-var!", SCM_UNDEFINED); scm_tc16_eval_closure = scm_make_smob_type ("eval-closure", 0); diff --git a/libguile/net_db.c b/libguile/net_db.c index fd00a0497..ecb075c8b 100644 --- a/libguile/net_db.c +++ b/libguile/net_db.c @@ -446,9 +446,7 @@ void scm_init_net_db () { scm_add_feature ("net-db"); -#ifndef SCM_MAGIC_SNARFER #include "libguile/net_db.x" -#endif } /* diff --git a/libguile/numbers.c b/libguile/numbers.c index baecf0210..c7eb1f16e 100644 --- a/libguile/numbers.c +++ b/libguile/numbers.c @@ -4616,9 +4616,7 @@ scm_init_numbers () check_sanity (); #endif -#ifndef SCM_MAGIC_SNARFER #include "libguile/numbers.x" -#endif } /* diff --git a/libguile/objects.c b/libguile/objects.c index aca2e55d0..22fa968cb 100644 --- a/libguile/objects.c +++ b/libguile/objects.c @@ -518,9 +518,7 @@ scm_init_objects () SCM_SET_CLASS_DESTRUCTOR (et, scm_struct_free_entity); scm_c_define ("", et); -#ifndef SCM_MAGIC_SNARFER #include "libguile/objects.x" -#endif } /* diff --git a/libguile/objprop.c b/libguile/objprop.c index aa3883165..246adcb73 100644 --- a/libguile/objprop.c +++ b/libguile/objprop.c @@ -114,9 +114,7 @@ void scm_init_objprop () { scm_object_whash = scm_make_weak_key_hash_table (SCM_MAKINUM (511)); -#ifndef SCM_MAGIC_SNARFER #include "libguile/objprop.x" -#endif } diff --git a/libguile/options.c b/libguile/options.c index 731e62f79..75103e639 100644 --- a/libguile/options.c +++ b/libguile/options.c @@ -294,9 +294,7 @@ scm_init_options () { scm_gc_register_root (&protected_objects); -#ifndef SCM_MAGIC_SNARFER #include "libguile/options.x" -#endif } /* diff --git a/libguile/pairs.c b/libguile/pairs.c index bc4831480..0b66ee5ca 100644 --- a/libguile/pairs.c +++ b/libguile/pairs.c @@ -175,9 +175,7 @@ scm_init_pairs () for (subnr = 0; cxrs [subnr]; subnr++) scm_c_define_subr (cxrs [subnr], scm_tc7_cxr, NULL); -#ifndef SCM_MAGIC_SNARFER #include "libguile/pairs.x" -#endif } diff --git a/libguile/ports.c b/libguile/ports.c index 4acf1fdd6..1720cae01 100644 --- a/libguile/ports.c +++ b/libguile/ports.c @@ -1569,9 +1569,7 @@ scm_init_ports () scm_tc16_void_port = scm_make_port_type ("void", fill_input_void_port, write_void_port); -#ifndef SCM_MAGIC_SNARFER #include "libguile/ports.x" -#endif } /* diff --git a/libguile/posix.c b/libguile/posix.c index 6e3caa587..ab84e5cef 100644 --- a/libguile/posix.c +++ b/libguile/posix.c @@ -1730,9 +1730,7 @@ scm_init_posix () #endif #include "libguile/cpp_sig_symbols.c" -#ifndef SCM_MAGIC_SNARFER #include "libguile/posix.x" -#endif } /* diff --git a/libguile/print.c b/libguile/print.c index d972c3d4e..cb80e073e 100644 --- a/libguile/print.c +++ b/libguile/print.c @@ -1122,9 +1122,7 @@ scm_init_print () scm_set_smob_mark (scm_tc16_port_with_ps, scm_markcdr); scm_set_smob_print (scm_tc16_port_with_ps, port_with_ps_print); -#ifndef SCM_MAGIC_SNARFER #include "libguile/print.x" -#endif } /* diff --git a/libguile/procprop.c b/libguile/procprop.c index e6136527d..099691ca4 100644 --- a/libguile/procprop.c +++ b/libguile/procprop.c @@ -246,9 +246,7 @@ SCM_DEFINE (scm_set_procedure_property_x, "set-procedure-property!", 3, 0, 0, void scm_init_procprop () { -#ifndef SCM_MAGIC_SNARFER #include "libguile/procprop.x" -#endif } diff --git a/libguile/procs.c b/libguile/procs.c index dae2e104e..690f88a14 100644 --- a/libguile/procs.c +++ b/libguile/procs.c @@ -381,9 +381,7 @@ scm_init_subr_table () void scm_init_procs () { -#ifndef SCM_MAGIC_SNARFER #include "libguile/procs.x" -#endif } /* diff --git a/libguile/properties.c b/libguile/properties.c index 2b829fcad..c70df6560 100644 --- a/libguile/properties.c +++ b/libguile/properties.c @@ -148,9 +148,7 @@ void scm_init_properties () { scm_properties_whash = scm_make_weak_key_hash_table (SCM_MAKINUM (511)); -#ifndef SCM_MAGIC_SNARFER #include "libguile/properties.x" -#endif } diff --git a/libguile/ramap.c b/libguile/ramap.c index 9cc642f0b..e2389451f 100644 --- a/libguile/ramap.c +++ b/libguile/ramap.c @@ -2060,9 +2060,7 @@ scm_init_ramap () init_raprocs (ra_asubrs); scm_c_define_subr (s_array_equal_p, scm_tc7_rpsubr, scm_array_equal_p); scm_smobs[SCM_TC2SMOBNUM (scm_tc16_array)].equalp = scm_raequal; -#ifndef SCM_MAGIC_SNARFER #include "libguile/ramap.x" -#endif scm_add_feature (s_scm_array_for_each); } diff --git a/libguile/random.c b/libguile/random.c index 2db583bb1..319d2a0c6 100644 --- a/libguile/random.c +++ b/libguile/random.c @@ -590,9 +590,7 @@ scm_init_random () for (i = m >> 1; i < m; ++i) scm_masktab[i] = m - 1; -#ifndef SCM_MAGIC_SNARFER #include "libguile/random.x" -#endif /* Check that the assumptions about bits per bignum digit are correct. */ #if SIZEOF_INT == 4 diff --git a/libguile/rdelim.c b/libguile/rdelim.c index caa4eac47..b0e34e4f4 100644 --- a/libguile/rdelim.c +++ b/libguile/rdelim.c @@ -283,9 +283,7 @@ SCM_DEFINE (scm_write_line, "write-line", 1, 1, 0, SCM scm_init_rdelim_builtins (void) { -#ifndef SCM_MAGIC_SNARFER #include "libguile/rdelim.x" -#endif return SCM_UNSPECIFIED; } diff --git a/libguile/read.c b/libguile/read.c index 33a7e37f0..5ac971977 100644 --- a/libguile/read.c +++ b/libguile/read.c @@ -846,9 +846,7 @@ scm_init_read () SCM_VARIABLE_LOC (scm_c_define ("read-hash-procedures", SCM_EOL)); scm_init_opts (scm_read_options, scm_read_opts, SCM_N_READ_OPTIONS); -#ifndef SCM_MAGIC_SNARFER #include "libguile/read.x" -#endif } /* diff --git a/libguile/regex-posix.c b/libguile/regex-posix.c index 3eef85454..eb28ebe4b 100644 --- a/libguile/regex-posix.c +++ b/libguile/regex-posix.c @@ -308,9 +308,7 @@ scm_init_regex_posix () scm_c_define ("regexp/notbol", scm_long2num (REG_NOTBOL)); scm_c_define ("regexp/noteol", scm_long2num (REG_NOTEOL)); -#ifndef SCM_MAGIC_SNARFER #include "libguile/regex-posix.x" -#endif scm_add_feature ("regex"); } diff --git a/libguile/root.c b/libguile/root.c index 389c2247b..f26843ea3 100644 --- a/libguile/root.c +++ b/libguile/root.c @@ -385,9 +385,7 @@ scm_init_root () scm_set_smob_mark (scm_tc16_root, root_mark); scm_set_smob_print (scm_tc16_root, root_print); -#ifndef SCM_MAGIC_SNARFER #include "libguile/root.x" -#endif } /* diff --git a/libguile/rw.c b/libguile/rw.c index e8e83c806..39a0617f5 100644 --- a/libguile/rw.c +++ b/libguile/rw.c @@ -275,9 +275,7 @@ SCM_DEFINE (scm_write_string_partial, "write-string/partial", 1, 3, 0, SCM scm_init_rw_builtins () { -#ifndef SCM_MAGIC_SNARFER #include "libguile/rw.x" -#endif return SCM_UNSPECIFIED; } diff --git a/libguile/scmsigs.c b/libguile/scmsigs.c index da1f93bfe..cdb44e049 100644 --- a/libguile/scmsigs.c +++ b/libguile/scmsigs.c @@ -618,9 +618,7 @@ scm_init_scmsigs () scm_c_define ("ITIMER_PROF", SCM_MAKINUM (ITIMER_PROF)); #endif /* defined(HAVE_SETITIMER) || defined(HAVE_GETITIMER) */ -#ifndef SCM_MAGIC_SNARFER #include "libguile/scmsigs.x" -#endif } diff --git a/libguile/script.c b/libguile/script.c index b782dbce7..58d48fab4 100644 --- a/libguile/script.c +++ b/libguile/script.c @@ -699,9 +699,7 @@ scm_shell (int argc, char **argv) void scm_init_script () { -#ifndef SCM_MAGIC_SNARFER #include "libguile/script.x" -#endif } /* diff --git a/libguile/simpos.c b/libguile/simpos.c index 30b95eb8a..5dc7fff13 100644 --- a/libguile/simpos.c +++ b/libguile/simpos.c @@ -132,9 +132,7 @@ SCM_DEFINE (scm_primitive_exit, "primitive-exit", 0, 1, 0, void scm_init_simpos () { -#ifndef SCM_MAGIC_SNARFER #include "libguile/simpos.x" -#endif } diff --git a/libguile/socket.c b/libguile/socket.c index 10c064242..804172e5e 100644 --- a/libguile/socket.c +++ b/libguile/socket.c @@ -1396,9 +1396,7 @@ scm_init_socket () scm_add_feature ("socket"); -#ifndef SCM_MAGIC_SNARFER #include "libguile/socket.x" -#endif } diff --git a/libguile/sort.c b/libguile/sort.c index 7a3b61ab8..ac0eaf5a2 100644 --- a/libguile/sort.c +++ b/libguile/sort.c @@ -956,9 +956,7 @@ SCM_DEFINE (scm_sort_list, "sort-list", 2, 0, 0, void scm_init_sort () { -#ifndef SCM_MAGIC_SNARFER #include "libguile/sort.x" -#endif scm_add_feature ("sort"); } diff --git a/libguile/srcprop.c b/libguile/srcprop.c index e909991a5..bc8a582ab 100644 --- a/libguile/srcprop.c +++ b/libguile/srcprop.c @@ -339,9 +339,7 @@ scm_init_srcprop () scm_source_whash = scm_make_weak_key_hash_table (SCM_MAKINUM (2047)); scm_c_define ("source-whash", scm_source_whash); -#ifndef SCM_MAGIC_SNARFER #include "libguile/srcprop.x" -#endif } void diff --git a/libguile/stackchk.c b/libguile/stackchk.c index da3ebe7f9..6d3107836 100644 --- a/libguile/stackchk.c +++ b/libguile/stackchk.c @@ -101,9 +101,7 @@ scm_stack_report () void scm_init_stackchk () { -#ifndef SCM_MAGIC_SNARFER #include "libguile/stackchk.x" -#endif } /* diff --git a/libguile/stacks.c b/libguile/stacks.c index 508b2e28d..a2a397985 100644 --- a/libguile/stacks.c +++ b/libguile/stacks.c @@ -781,9 +781,7 @@ scm_init_stacks () scm_cons (stack_layout, SCM_EOL))); scm_set_struct_vtable_name_x (scm_stack_type, scm_str2symbol ("stack")); -#ifndef SCM_MAGIC_SNARFER #include "libguile/stacks.x" -#endif } /* diff --git a/libguile/stime.c b/libguile/stime.c index 09a22f64c..6b04e7e88 100644 --- a/libguile/stime.c +++ b/libguile/stime.c @@ -717,9 +717,7 @@ scm_init_stime() if (!scm_my_base) scm_my_base = mytime(); scm_add_feature ("current-time"); -#ifndef SCM_MAGIC_SNARFER #include "libguile/stime.x" -#endif } diff --git a/libguile/strings.c b/libguile/strings.c index d8580b7eb..8cd9815a5 100644 --- a/libguile/strings.c +++ b/libguile/strings.c @@ -408,9 +408,7 @@ scm_init_strings () { scm_nullstr = scm_allocate_string (0); -#ifndef SCM_MAGIC_SNARFER #include "libguile/strings.x" -#endif } diff --git a/libguile/strop.c b/libguile/strop.c index d0696add5..bf2ede036 100644 --- a/libguile/strop.c +++ b/libguile/strop.c @@ -530,9 +530,7 @@ SCM_DEFINE (scm_string_ci_to_symbol, "string-ci->symbol", 1, 0, 0, void scm_init_strop () { -#ifndef SCM_MAGIC_SNARFER #include "libguile/strop.x" -#endif } /* diff --git a/libguile/strorder.c b/libguile/strorder.c index 8c7737abf..faebcf039 100644 --- a/libguile/strorder.c +++ b/libguile/strorder.c @@ -292,9 +292,7 @@ SCM_DEFINE1 (scm_string_ci_geq_p, "string-ci>=?", scm_tc7_rpsubr, void scm_init_strorder () { -#ifndef SCM_MAGIC_SNARFER #include "libguile/strorder.x" -#endif } diff --git a/libguile/strports.c b/libguile/strports.c index 0a75a4068..0d00047fc 100644 --- a/libguile/strports.c +++ b/libguile/strports.c @@ -493,9 +493,7 @@ scm_init_strports () { scm_tc16_strport = scm_make_stptob (); -#ifndef SCM_MAGIC_SNARFER #include "libguile/strports.x" -#endif } diff --git a/libguile/struct.c b/libguile/struct.c index 075388e42..c92beabb9 100644 --- a/libguile/struct.c +++ b/libguile/struct.c @@ -820,9 +820,7 @@ scm_init_struct () scm_c_define ("vtable-index-printer", SCM_MAKINUM (scm_vtable_index_printer)); scm_c_define ("vtable-offset-user", SCM_MAKINUM (scm_vtable_offset_user)); -#ifndef SCM_MAGIC_SNARFER #include "libguile/struct.x" -#endif } /* diff --git a/libguile/symbols.c b/libguile/symbols.c index 57ead5cab..780575228 100644 --- a/libguile/symbols.c +++ b/libguile/symbols.c @@ -417,9 +417,7 @@ void scm_init_symbols () { gensym_counter = 0; -#ifndef SCM_MAGIC_SNARFER #include "libguile/symbols.x" -#endif } /* diff --git a/libguile/threads.c b/libguile/threads.c index c8a09941d..9c984f4e7 100644 --- a/libguile/threads.c +++ b/libguile/threads.c @@ -141,9 +141,7 @@ scm_init_threads (SCM_STACKITEM *i) scm_tc16_mutex = scm_make_smob_type ("mutex", sizeof (coop_m)); scm_tc16_condvar = scm_make_smob_type ("condition-variable", sizeof (coop_c)); -#ifndef SCM_MAGIC_SNARFER #include "libguile/threads.x" -#endif /* Initialize implementation specific details of the threads support */ scm_threads_init (i); } diff --git a/libguile/throw.c b/libguile/throw.c index 91f07f61a..68c18726e 100644 --- a/libguile/throw.c +++ b/libguile/throw.c @@ -697,9 +697,7 @@ scm_init_throw () tc16_lazy_catch = scm_make_smob_type ("lazy-catch", 0); scm_set_smob_print (tc16_lazy_catch, lazy_catch_print); -#ifndef SCM_MAGIC_SNARFER #include "libguile/throw.x" -#endif } /* diff --git a/libguile/unif.c b/libguile/unif.c index b900df50e..ce0cf2706 100644 --- a/libguile/unif.c +++ b/libguile/unif.c @@ -2605,9 +2605,7 @@ scm_init_unif () scm_set_smob_print (scm_tc16_array, scm_raprin1); scm_set_smob_equalp (scm_tc16_array, scm_array_equal_p); scm_add_feature ("array"); -#ifndef SCM_MAGIC_SNARFER #include "libguile/unif.x" -#endif } /* diff --git a/libguile/values.c b/libguile/values.c index a11b0041d..b8b1c8c84 100644 --- a/libguile/values.c +++ b/libguile/values.c @@ -106,9 +106,7 @@ scm_init_values (void) scm_add_feature ("values"); -#ifndef SCM_MAGIC_SNARFER #include "libguile/values.x" -#endif } /* diff --git a/libguile/variable.c b/libguile/variable.c index b2710c113..0369a2834 100644 --- a/libguile/variable.c +++ b/libguile/variable.c @@ -146,9 +146,7 @@ SCM_DEFINE (scm_variable_bound_p, "variable-bound?", 1, 0, 0, void scm_init_variable () { -#ifndef SCM_MAGIC_SNARFER #include "libguile/variable.x" -#endif } /* diff --git a/libguile/vectors.c b/libguile/vectors.c index bdc943760..7a6e64a17 100644 --- a/libguile/vectors.c +++ b/libguile/vectors.c @@ -339,9 +339,7 @@ scm_init_vectors () { scm_nullvect = scm_c_make_vector (0, SCM_UNDEFINED); -#ifndef SCM_MAGIC_SNARFER #include "libguile/vectors.x" -#endif } diff --git a/libguile/version.c b/libguile/version.c index 1a5773d31..b3126545f 100644 --- a/libguile/version.c +++ b/libguile/version.c @@ -129,9 +129,7 @@ SCM_DEFINE (scm_version, "version", 0, 0, 0, void scm_init_version () { -#ifndef SCM_MAGIC_SNARFER #include "libguile/version.x" -#endif } /* diff --git a/libguile/vports.c b/libguile/vports.c index 2cf94feae..69855331e 100644 --- a/libguile/vports.c +++ b/libguile/vports.c @@ -219,9 +219,7 @@ scm_init_vports () { scm_tc16_sfport = scm_make_sfptob (); -#ifndef SCM_MAGIC_SNARFER #include "libguile/vports.x" -#endif } /* diff --git a/libguile/weaks.c b/libguile/weaks.c index a5b194eca..535b4482e 100644 --- a/libguile/weaks.c +++ b/libguile/weaks.c @@ -364,9 +364,7 @@ scm_weaks_prehistory () void scm_init_weaks () { -#ifndef SCM_MAGIC_SNARFER #include "libguile/weaks.x" -#endif } From 822250a42c27b6a3276ba81f7ad2c22eea808623 Mon Sep 17 00:00:00 2001 From: Thien-Thi Nguyen Date: Thu, 14 Mar 2002 03:50:01 +0000 Subject: [PATCH 086/131] *** empty log message *** --- libguile/ChangeLog | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/libguile/ChangeLog b/libguile/ChangeLog index 327ecca84..b355a188b 100644 --- a/libguile/ChangeLog +++ b/libguile/ChangeLog @@ -10,6 +10,21 @@ (.c.x): Use $(snarfcppopts). Rework guile-snarf usage. (.c.doc): Use $(snarfcppopts). + * alist.c, arbiters.c, async.c, backtrace.c, boolean.c, chars.c, + continuations.c, debug-malloc.c, debug.c, deprecation.c, dynl.c, + dynwind.c, environments.c, eq.c, error.c, eval.c, evalext.c, + extensions.c, feature.c, filesys.c, fluids.c, fports.c, gc.c, + goops.c, gsubr.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, rdelim.c, read.c, regex-posix.c, + root.c, rw.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, threads.c, throw.c, + unif.c, values.c, variable.c, vectors.c, version.c, vports.c, + weaks.c: Retire inclusion guard macro SCM_MAGIC_SNARFER. + 2002-03-13 Dirk Herrmann * eval.c (SCM_CEVAL): Got rid of the last reference to t.lloc. From a2448fb14441896bfc10b181773ce4332d3d34fc Mon Sep 17 00:00:00 2001 From: Thien-Thi Nguyen Date: Thu, 14 Mar 2002 04:04:32 +0000 Subject: [PATCH 087/131] Typofix. --- doc/ref/tools.texi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/ref/tools.texi b/doc/ref/tools.texi index 6664a987e..acb2ad96c 100644 --- a/doc/ref/tools.texi +++ b/doc/ref/tools.texi @@ -91,7 +91,7 @@ Optional arg "--compat=1.4" means emulate guile-1.4 guile-snarf. This option is not fully tested (@pxref{guile-1.4 guile-snarf}). If env var CPP is set, use its value instead of the C pre-processor -determined at Guile configure-time: "@CPP@". +determined at Guile configure-time. @xref{Macros guile-snarf recognizes}, for a list of the special (some would say magic) cpp macros you can use. From 645f5e0ec1030aa2e6c3c965f681eabd58179c23 Mon Sep 17 00:00:00 2001 From: Thien-Thi Nguyen Date: Thu, 14 Mar 2002 04:07:16 +0000 Subject: [PATCH 088/131] Retire inclusion guard macro SCM_MAGIC_SNARFER. --- srfi/srfi-13.c | 2 - srfi/srfi-14.c | 16 +++--- srfi/srfi-4.c | 150 ++++++++++++++++++++++++------------------------- 3 files changed, 81 insertions(+), 87 deletions(-) diff --git a/srfi/srfi-13.c b/srfi/srfi-13.c index 38d53fece..70aed6a9e 100644 --- a/srfi/srfi-13.c +++ b/srfi/srfi-13.c @@ -3037,9 +3037,7 @@ scm_init_srfi_13 (void) scm_c_init_srfi_14 (); /* Install the string primitives. */ -#ifndef SCM_MAGIC_SNARFER #include "srfi/srfi-13.x" -#endif } /* End of srfi-13.c. */ diff --git a/srfi/srfi-14.c b/srfi/srfi-14.c index e16f2337f..cb34182f2 100644 --- a/srfi/srfi-14.c +++ b/srfi/srfi-14.c @@ -1,17 +1,17 @@ /* srfi-14.c --- SRFI-14 procedures for Guile * * Copyright (C) 2001 Free Software Foundation, Inc. - * + * * 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 * the Free Software Foundation, Inc., 59 Temple Place, Suite 330, @@ -98,14 +98,14 @@ static SCM make_char_set (const char * func_name) { long * p; - + p = scm_gc_malloc (BYTES_PER_CHARSET, "character-set"); memset (p, 0, BYTES_PER_CHARSET); SCM_RETURN_NEWSMOB (scm_tc16_charset, p); } -SCM_DEFINE (scm_char_set_p, "char-set?", 1, 0, 0, +SCM_DEFINE (scm_char_set_p, "char-set?", 1, 0, 0, (SCM obj), "Return @code{#t} if @var{obj} is a character set, @code{#f}\n" "otherwise.") @@ -167,7 +167,7 @@ SCM_DEFINE (scm_char_set_leq, "char-set<=", 0, 0, 1, if (prev_data) { int k; - + for (k = 0; k < LONGS_PER_CHARSET; k++) { if ((prev_data[k] & csi_data[k]) != prev_data[k]) @@ -196,7 +196,7 @@ SCM_DEFINE (scm_char_set_hash, "char-set-hash", 1, 1, 0, int k; SCM_VALIDATE_SMOB (1, cs, charset); - + if (SCM_UNBNDP (bound)) bnd = default_bnd; else @@ -1447,9 +1447,7 @@ scm_init_srfi_14 (void) scm_c_init_srfi_14 (); /* Install the charset primitives. */ -#ifndef SCM_MAGIC_SNARFER #include "srfi/srfi-14.x" -#endif } /* End of srfi-14.c. */ diff --git a/srfi/srfi-4.c b/srfi/srfi-4.c index c059707d0..1643ae9fd 100644 --- a/srfi/srfi-4.c +++ b/srfi/srfi-4.c @@ -1,17 +1,17 @@ /* srfi-4.c --- Homogeneous numeric vector datatypes. * * Copyright (C) 2001 Free Software Foundation, Inc. - * + * * 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 * the Free Software Foundation, Inc., 59 Temple Place, Suite 330, @@ -364,7 +364,7 @@ static SCM make_uvec (const char * func_name, int type, int len) { void * p; - + p = scm_gc_malloc (len * uvec_sizes[type], "uvec"); SCM_RETURN_NEWSMOB3 (scm_tc16_uvec, type, len, p); } @@ -375,7 +375,7 @@ make_uvec (const char * func_name, int type, int len) /* ================================================================ */ -SCM_DEFINE (scm_u8vector_p, "u8vector?", 1, 0, 0, +SCM_DEFINE (scm_u8vector_p, "u8vector?", 1, 0, 0, (SCM obj), "Return @code{#t} if @var{obj} is a vector of type u8,\n" "@code{#f} otherwise.") @@ -387,7 +387,7 @@ SCM_DEFINE (scm_u8vector_p, "u8vector?", 1, 0, 0, #undef FUNC_NAME -SCM_DEFINE (scm_make_u8vector, "make-u8vector", 1, 1, 0, +SCM_DEFINE (scm_make_u8vector, "make-u8vector", 1, 1, 0, (SCM n, SCM fill), "Create a newly allocated homogeneous numeric vector which can\n" "hold @var{len} elements. If @var{fill} is given, it is used to\n" @@ -420,7 +420,7 @@ SCM_DEFINE (scm_make_u8vector, "make-u8vector", 1, 1, 0, #undef FUNC_NAME -SCM_DEFINE (scm_u8vector, "u8vector", 0, 0, 1, +SCM_DEFINE (scm_u8vector, "u8vector", 0, 0, 1, (SCM l), "Create a newly allocated homogeneous numeric vector containing\n" "all argument values.") @@ -432,7 +432,7 @@ SCM_DEFINE (scm_u8vector, "u8vector", 0, 0, 1, #undef FUNC_NAME -SCM_DEFINE (scm_u8vector_length, "u8vector-length", 1, 0, 0, +SCM_DEFINE (scm_u8vector_length, "u8vector-length", 1, 0, 0, (SCM uvec), "Return the number of elements in the homogeneous numeric vector\n" "@var{uvec}.") @@ -446,7 +446,7 @@ SCM_DEFINE (scm_u8vector_length, "u8vector-length", 1, 0, 0, #undef FUNC_NAME -SCM_DEFINE (scm_u8vector_ref, "u8vector-ref", 2, 0, 0, +SCM_DEFINE (scm_u8vector_ref, "u8vector-ref", 2, 0, 0, (SCM uvec, SCM index), "Return the element at @var{index} in the homogeneous numeric\n" "vector @var{uvec}.") @@ -467,7 +467,7 @@ SCM_DEFINE (scm_u8vector_ref, "u8vector-ref", 2, 0, 0, #undef FUNC_NAME -SCM_DEFINE (scm_u8vector_set_x, "u8vector-set!", 3, 0, 0, +SCM_DEFINE (scm_u8vector_set_x, "u8vector-set!", 3, 0, 0, (SCM uvec, SCM index, SCM value), "Set the element at @var{index} in the homogeneous numeric\n" "vector @var{uvec} to @var{value}. The return value is not\n" @@ -497,7 +497,7 @@ SCM_DEFINE (scm_u8vector_set_x, "u8vector-set!", 3, 0, 0, #undef FUNC_NAME -SCM_DEFINE (scm_u8vector_to_list, "u8vector->list", 1, 0, 0, +SCM_DEFINE (scm_u8vector_to_list, "u8vector->list", 1, 0, 0, (SCM uvec), "Convert the homogeneous numeric vector @var{uvec} to a list.") #define FUNC_NAME s_scm_u8vector_to_list @@ -561,7 +561,7 @@ SCM_DEFINE (scm_list_to_u8vector, "list->u8vector", 1, 0, 0, /* ================================================================ */ -SCM_DEFINE (scm_s8vector_p, "s8vector?", 1, 0, 0, +SCM_DEFINE (scm_s8vector_p, "s8vector?", 1, 0, 0, (SCM obj), "Return @code{#t} if @var{obj} is a vector of type s8,\n" "@code{#f} otherwise.") @@ -573,7 +573,7 @@ SCM_DEFINE (scm_s8vector_p, "s8vector?", 1, 0, 0, #undef FUNC_NAME -SCM_DEFINE (scm_make_s8vector, "make-s8vector", 1, 1, 0, +SCM_DEFINE (scm_make_s8vector, "make-s8vector", 1, 1, 0, (SCM n, SCM fill), "Create a newly allocated homogeneous numeric vector which can\n" "hold @var{len} elements. If @var{fill} is given, it is used to\n" @@ -606,7 +606,7 @@ SCM_DEFINE (scm_make_s8vector, "make-s8vector", 1, 1, 0, #undef FUNC_NAME -SCM_DEFINE (scm_s8vector, "s8vector", 0, 0, 1, +SCM_DEFINE (scm_s8vector, "s8vector", 0, 0, 1, (SCM l), "Create a newly allocated homogeneous numeric vector containing\n" "all argument values.") @@ -618,7 +618,7 @@ SCM_DEFINE (scm_s8vector, "s8vector", 0, 0, 1, #undef FUNC_NAME -SCM_DEFINE (scm_s8vector_length, "s8vector-length", 1, 0, 0, +SCM_DEFINE (scm_s8vector_length, "s8vector-length", 1, 0, 0, (SCM uvec), "Return the number of elements in the homogeneous numeric vector\n" "@var{uvec}.") @@ -632,7 +632,7 @@ SCM_DEFINE (scm_s8vector_length, "s8vector-length", 1, 0, 0, #undef FUNC_NAME -SCM_DEFINE (scm_s8vector_ref, "s8vector-ref", 2, 0, 0, +SCM_DEFINE (scm_s8vector_ref, "s8vector-ref", 2, 0, 0, (SCM uvec, SCM index), "Return the element at @var{index} in the homogeneous numeric\n" "vector @var{uvec}.") @@ -653,7 +653,7 @@ SCM_DEFINE (scm_s8vector_ref, "s8vector-ref", 2, 0, 0, #undef FUNC_NAME -SCM_DEFINE (scm_s8vector_set_x, "s8vector-set!", 3, 0, 0, +SCM_DEFINE (scm_s8vector_set_x, "s8vector-set!", 3, 0, 0, (SCM uvec, SCM index, SCM value), "Set the element at @var{index} in the homogeneous numeric\n" "vector @var{uvec} to @var{value}. The return value is not\n" @@ -683,7 +683,7 @@ SCM_DEFINE (scm_s8vector_set_x, "s8vector-set!", 3, 0, 0, #undef FUNC_NAME -SCM_DEFINE (scm_s8vector_to_list, "s8vector->list", 1, 0, 0, +SCM_DEFINE (scm_s8vector_to_list, "s8vector->list", 1, 0, 0, (SCM uvec), "Convert the homogeneous numeric vector @var{uvec} to a list.") #define FUNC_NAME s_scm_s8vector_to_list @@ -749,7 +749,7 @@ SCM_DEFINE (scm_list_to_s8vector, "list->s8vector", 1, 0, 0, /* ================================================================ */ -SCM_DEFINE (scm_u16vector_p, "u16vector?", 1, 0, 0, +SCM_DEFINE (scm_u16vector_p, "u16vector?", 1, 0, 0, (SCM obj), "Return @code{#t} if @var{obj} is a vector of type u16,\n" "@code{#f} otherwise.") @@ -761,7 +761,7 @@ SCM_DEFINE (scm_u16vector_p, "u16vector?", 1, 0, 0, #undef FUNC_NAME -SCM_DEFINE (scm_make_u16vector, "make-u16vector", 1, 1, 0, +SCM_DEFINE (scm_make_u16vector, "make-u16vector", 1, 1, 0, (SCM n, SCM fill), "Create a newly allocated homogeneous numeric vector which can\n" "hold @var{len} elements. If @var{fill} is given, it is used to\n" @@ -789,7 +789,7 @@ SCM_DEFINE (scm_make_u16vector, "make-u16vector", 1, 1, 0, #undef FUNC_NAME -SCM_DEFINE (scm_u16vector, "u16vector", 0, 0, 1, +SCM_DEFINE (scm_u16vector, "u16vector", 0, 0, 1, (SCM l), "Create a newly allocated homogeneous numeric vector containing\n" "all argument values.") @@ -801,7 +801,7 @@ SCM_DEFINE (scm_u16vector, "u16vector", 0, 0, 1, #undef FUNC_NAME -SCM_DEFINE (scm_u16vector_length, "u16vector-length", 1, 0, 0, +SCM_DEFINE (scm_u16vector_length, "u16vector-length", 1, 0, 0, (SCM uvec), "Return the number of elements in the homogeneous numeric vector\n" "@var{uvec}.") @@ -815,7 +815,7 @@ SCM_DEFINE (scm_u16vector_length, "u16vector-length", 1, 0, 0, #undef FUNC_NAME -SCM_DEFINE (scm_u16vector_ref, "u16vector-ref", 2, 0, 0, +SCM_DEFINE (scm_u16vector_ref, "u16vector-ref", 2, 0, 0, (SCM uvec, SCM index), "Return the element at @var{index} in the homogeneous numeric\n" "vector @var{uvec}.") @@ -836,7 +836,7 @@ SCM_DEFINE (scm_u16vector_ref, "u16vector-ref", 2, 0, 0, #undef FUNC_NAME -SCM_DEFINE (scm_u16vector_set_x, "u16vector-set!", 3, 0, 0, +SCM_DEFINE (scm_u16vector_set_x, "u16vector-set!", 3, 0, 0, (SCM uvec, SCM index, SCM value), "Set the element at @var{index} in the homogeneous numeric\n" "vector @var{uvec} to @var{value}. The return value is not\n" @@ -862,7 +862,7 @@ SCM_DEFINE (scm_u16vector_set_x, "u16vector-set!", 3, 0, 0, #undef FUNC_NAME -SCM_DEFINE (scm_u16vector_to_list, "u16vector->list", 1, 0, 0, +SCM_DEFINE (scm_u16vector_to_list, "u16vector->list", 1, 0, 0, (SCM uvec), "Convert the homogeneous numeric vector @var{uvec} to a list.") #define FUNC_NAME s_scm_u16vector_to_list @@ -919,7 +919,7 @@ SCM_DEFINE (scm_list_to_u16vector, "list->u16vector", 1, 0, 0, /* ================================================================ */ -SCM_DEFINE (scm_s16vector_p, "s16vector?", 1, 0, 0, +SCM_DEFINE (scm_s16vector_p, "s16vector?", 1, 0, 0, (SCM obj), "Return @code{#t} if @var{obj} is a vector of type s16,\n" "@code{#f} otherwise.") @@ -931,7 +931,7 @@ SCM_DEFINE (scm_s16vector_p, "s16vector?", 1, 0, 0, #undef FUNC_NAME -SCM_DEFINE (scm_make_s16vector, "make-s16vector", 1, 1, 0, +SCM_DEFINE (scm_make_s16vector, "make-s16vector", 1, 1, 0, (SCM n, SCM fill), "Create a newly allocated homogeneous numeric vector which can\n" "hold @var{len} elements. If @var{fill} is given, it is used to\n" @@ -959,7 +959,7 @@ SCM_DEFINE (scm_make_s16vector, "make-s16vector", 1, 1, 0, #undef FUNC_NAME -SCM_DEFINE (scm_s16vector, "s16vector", 0, 0, 1, +SCM_DEFINE (scm_s16vector, "s16vector", 0, 0, 1, (SCM l), "Create a newly allocated homogeneous numeric vector containing\n" "all argument values.") @@ -971,7 +971,7 @@ SCM_DEFINE (scm_s16vector, "s16vector", 0, 0, 1, #undef FUNC_NAME -SCM_DEFINE (scm_s16vector_length, "s16vector-length", 1, 0, 0, +SCM_DEFINE (scm_s16vector_length, "s16vector-length", 1, 0, 0, (SCM uvec), "Return the number of elements in the homogeneous numeric vector\n" "@var{uvec}.") @@ -985,7 +985,7 @@ SCM_DEFINE (scm_s16vector_length, "s16vector-length", 1, 0, 0, #undef FUNC_NAME -SCM_DEFINE (scm_s16vector_ref, "s16vector-ref", 2, 0, 0, +SCM_DEFINE (scm_s16vector_ref, "s16vector-ref", 2, 0, 0, (SCM uvec, SCM index), "Return the element at @var{index} in the homogeneous numeric\n" "vector @var{uvec}.") @@ -1006,7 +1006,7 @@ SCM_DEFINE (scm_s16vector_ref, "s16vector-ref", 2, 0, 0, #undef FUNC_NAME -SCM_DEFINE (scm_s16vector_set_x, "s16vector-set!", 3, 0, 0, +SCM_DEFINE (scm_s16vector_set_x, "s16vector-set!", 3, 0, 0, (SCM uvec, SCM index, SCM value), "Set the element at @var{index} in the homogeneous numeric\n" "vector @var{uvec} to @var{value}. The return value is not\n" @@ -1032,7 +1032,7 @@ SCM_DEFINE (scm_s16vector_set_x, "s16vector-set!", 3, 0, 0, #undef FUNC_NAME -SCM_DEFINE (scm_s16vector_to_list, "s16vector->list", 1, 0, 0, +SCM_DEFINE (scm_s16vector_to_list, "s16vector->list", 1, 0, 0, (SCM uvec), "Convert the homogeneous numeric vector @var{uvec} to a list.") #define FUNC_NAME s_scm_s16vector_to_list @@ -1092,7 +1092,7 @@ SCM_DEFINE (scm_list_to_s16vector, "list->s16vector", 1, 0, 0, /* ================================================================ */ -SCM_DEFINE (scm_u32vector_p, "u32vector?", 1, 0, 0, +SCM_DEFINE (scm_u32vector_p, "u32vector?", 1, 0, 0, (SCM obj), "Return @code{#t} if @var{obj} is a vector of type u32,\n" "@code{#f} otherwise.") @@ -1104,7 +1104,7 @@ SCM_DEFINE (scm_u32vector_p, "u32vector?", 1, 0, 0, #undef FUNC_NAME -SCM_DEFINE (scm_make_u32vector, "make-u32vector", 1, 1, 0, +SCM_DEFINE (scm_make_u32vector, "make-u32vector", 1, 1, 0, (SCM n, SCM fill), "Create a newly allocated homogeneous numeric vector which can\n" "hold @var{len} elements. If @var{fill} is given, it is used to\n" @@ -1132,7 +1132,7 @@ SCM_DEFINE (scm_make_u32vector, "make-u32vector", 1, 1, 0, #undef FUNC_NAME -SCM_DEFINE (scm_u32vector, "u32vector", 0, 0, 1, +SCM_DEFINE (scm_u32vector, "u32vector", 0, 0, 1, (SCM l), "Create a newly allocated homogeneous numeric vector containing\n" "all argument values.") @@ -1144,7 +1144,7 @@ SCM_DEFINE (scm_u32vector, "u32vector", 0, 0, 1, #undef FUNC_NAME -SCM_DEFINE (scm_u32vector_length, "u32vector-length", 1, 0, 0, +SCM_DEFINE (scm_u32vector_length, "u32vector-length", 1, 0, 0, (SCM uvec), "Return the number of elements in the homogeneous numeric vector\n" "@var{uvec}.") @@ -1158,7 +1158,7 @@ SCM_DEFINE (scm_u32vector_length, "u32vector-length", 1, 0, 0, #undef FUNC_NAME -SCM_DEFINE (scm_u32vector_ref, "u32vector-ref", 2, 0, 0, +SCM_DEFINE (scm_u32vector_ref, "u32vector-ref", 2, 0, 0, (SCM uvec, SCM index), "Return the element at @var{index} in the homogeneous numeric\n" "vector @var{uvec}.") @@ -1179,7 +1179,7 @@ SCM_DEFINE (scm_u32vector_ref, "u32vector-ref", 2, 0, 0, #undef FUNC_NAME -SCM_DEFINE (scm_u32vector_set_x, "u32vector-set!", 3, 0, 0, +SCM_DEFINE (scm_u32vector_set_x, "u32vector-set!", 3, 0, 0, (SCM uvec, SCM index, SCM value), "Set the element at @var{index} in the homogeneous numeric\n" "vector @var{uvec} to @var{value}. The return value is not\n" @@ -1205,7 +1205,7 @@ SCM_DEFINE (scm_u32vector_set_x, "u32vector-set!", 3, 0, 0, #undef FUNC_NAME -SCM_DEFINE (scm_u32vector_to_list, "u32vector->list", 1, 0, 0, +SCM_DEFINE (scm_u32vector_to_list, "u32vector->list", 1, 0, 0, (SCM uvec), "Convert the homogeneous numeric vector @var{uvec} to a list.") #define FUNC_NAME s_scm_u32vector_to_list @@ -1263,7 +1263,7 @@ SCM_DEFINE (scm_list_to_u32vector, "list->u32vector", 1, 0, 0, /* ================================================================ */ -SCM_DEFINE (scm_s32vector_p, "s32vector?", 1, 0, 0, +SCM_DEFINE (scm_s32vector_p, "s32vector?", 1, 0, 0, (SCM obj), "Return @code{#t} if @var{obj} is a vector of type s32,\n" "@code{#f} otherwise.") @@ -1275,7 +1275,7 @@ SCM_DEFINE (scm_s32vector_p, "s32vector?", 1, 0, 0, #undef FUNC_NAME -SCM_DEFINE (scm_make_s32vector, "make-s32vector", 1, 1, 0, +SCM_DEFINE (scm_make_s32vector, "make-s32vector", 1, 1, 0, (SCM n, SCM fill), "Create a newly allocated homogeneous numeric vector which can\n" "hold @var{len} elements. If @var{fill} is given, it is used to\n" @@ -1303,7 +1303,7 @@ SCM_DEFINE (scm_make_s32vector, "make-s32vector", 1, 1, 0, #undef FUNC_NAME -SCM_DEFINE (scm_s32vector, "s32vector", 0, 0, 1, +SCM_DEFINE (scm_s32vector, "s32vector", 0, 0, 1, (SCM l), "Create a newly allocated homogeneous numeric vector containing\n" "all argument values.") @@ -1315,7 +1315,7 @@ SCM_DEFINE (scm_s32vector, "s32vector", 0, 0, 1, #undef FUNC_NAME -SCM_DEFINE (scm_s32vector_length, "s32vector-length", 1, 0, 0, +SCM_DEFINE (scm_s32vector_length, "s32vector-length", 1, 0, 0, (SCM uvec), "Return the number of elements in the homogeneous numeric vector\n" "@var{uvec}.") @@ -1329,7 +1329,7 @@ SCM_DEFINE (scm_s32vector_length, "s32vector-length", 1, 0, 0, #undef FUNC_NAME -SCM_DEFINE (scm_s32vector_ref, "s32vector-ref", 2, 0, 0, +SCM_DEFINE (scm_s32vector_ref, "s32vector-ref", 2, 0, 0, (SCM uvec, SCM index), "Return the element at @var{index} in the homogeneous numeric\n" "vector @var{uvec}.") @@ -1350,7 +1350,7 @@ SCM_DEFINE (scm_s32vector_ref, "s32vector-ref", 2, 0, 0, #undef FUNC_NAME -SCM_DEFINE (scm_s32vector_set_x, "s32vector-set!", 3, 0, 0, +SCM_DEFINE (scm_s32vector_set_x, "s32vector-set!", 3, 0, 0, (SCM uvec, SCM index, SCM value), "Set the element at @var{index} in the homogeneous numeric\n" "vector @var{uvec} to @var{value}. The return value is not\n" @@ -1376,7 +1376,7 @@ SCM_DEFINE (scm_s32vector_set_x, "s32vector-set!", 3, 0, 0, #undef FUNC_NAME -SCM_DEFINE (scm_s32vector_to_list, "s32vector->list", 1, 0, 0, +SCM_DEFINE (scm_s32vector_to_list, "s32vector->list", 1, 0, 0, (SCM uvec), "Convert the homogeneous numeric vector @var{uvec} to a list.") #define FUNC_NAME s_scm_s32vector_to_list @@ -1436,7 +1436,7 @@ SCM_DEFINE (scm_list_to_s32vector, "list->s32vector", 1, 0, 0, /* ================================================================ */ -SCM_DEFINE (scm_u64vector_p, "u64vector?", 1, 0, 0, +SCM_DEFINE (scm_u64vector_p, "u64vector?", 1, 0, 0, (SCM obj), "Return @code{#t} if @var{obj} is a vector of type u64,\n" "@code{#f} otherwise.") @@ -1448,7 +1448,7 @@ SCM_DEFINE (scm_u64vector_p, "u64vector?", 1, 0, 0, #undef FUNC_NAME -SCM_DEFINE (scm_make_u64vector, "make-u64vector", 1, 1, 0, +SCM_DEFINE (scm_make_u64vector, "make-u64vector", 1, 1, 0, (SCM n, SCM fill), "Create a newly allocated homogeneous numeric vector which can\n" "hold @var{len} elements. If @var{fill} is given, it is used to\n" @@ -1476,7 +1476,7 @@ SCM_DEFINE (scm_make_u64vector, "make-u64vector", 1, 1, 0, #undef FUNC_NAME -SCM_DEFINE (scm_u64vector, "u64vector", 0, 0, 1, +SCM_DEFINE (scm_u64vector, "u64vector", 0, 0, 1, (SCM l), "Create a newly allocated homogeneous numeric vector containing\n" "all argument values.") @@ -1488,7 +1488,7 @@ SCM_DEFINE (scm_u64vector, "u64vector", 0, 0, 1, #undef FUNC_NAME -SCM_DEFINE (scm_u64vector_length, "u64vector-length", 1, 0, 0, +SCM_DEFINE (scm_u64vector_length, "u64vector-length", 1, 0, 0, (SCM uvec), "Return the number of elements in the homogeneous numeric vector\n" "@var{uvec}.") @@ -1502,7 +1502,7 @@ SCM_DEFINE (scm_u64vector_length, "u64vector-length", 1, 0, 0, #undef FUNC_NAME -SCM_DEFINE (scm_u64vector_ref, "u64vector-ref", 2, 0, 0, +SCM_DEFINE (scm_u64vector_ref, "u64vector-ref", 2, 0, 0, (SCM uvec, SCM index), "Return the element at @var{index} in the homogeneous numeric\n" "vector @var{uvec}.") @@ -1523,7 +1523,7 @@ SCM_DEFINE (scm_u64vector_ref, "u64vector-ref", 2, 0, 0, #undef FUNC_NAME -SCM_DEFINE (scm_u64vector_set_x, "u64vector-set!", 3, 0, 0, +SCM_DEFINE (scm_u64vector_set_x, "u64vector-set!", 3, 0, 0, (SCM uvec, SCM index, SCM value), "Set the element at @var{index} in the homogeneous numeric\n" "vector @var{uvec} to @var{value}. The return value is not\n" @@ -1549,7 +1549,7 @@ SCM_DEFINE (scm_u64vector_set_x, "u64vector-set!", 3, 0, 0, #undef FUNC_NAME -SCM_DEFINE (scm_u64vector_to_list, "u64vector->list", 1, 0, 0, +SCM_DEFINE (scm_u64vector_to_list, "u64vector->list", 1, 0, 0, (SCM uvec), "Convert the homogeneous numeric vector @var{uvec} to a list.") #define FUNC_NAME s_scm_u64vector_to_list @@ -1607,7 +1607,7 @@ SCM_DEFINE (scm_list_to_u64vector, "list->u64vector", 1, 0, 0, /* ================================================================ */ -SCM_DEFINE (scm_s64vector_p, "s64vector?", 1, 0, 0, +SCM_DEFINE (scm_s64vector_p, "s64vector?", 1, 0, 0, (SCM obj), "Return @code{#t} if @var{obj} is a vector of type s64,\n" "@code{#f} otherwise.") @@ -1619,7 +1619,7 @@ SCM_DEFINE (scm_s64vector_p, "s64vector?", 1, 0, 0, #undef FUNC_NAME -SCM_DEFINE (scm_make_s64vector, "make-s64vector", 1, 1, 0, +SCM_DEFINE (scm_make_s64vector, "make-s64vector", 1, 1, 0, (SCM n, SCM fill), "Create a newly allocated homogeneous numeric vector which can\n" "hold @var{len} elements. If @var{fill} is given, it is used to\n" @@ -1647,7 +1647,7 @@ SCM_DEFINE (scm_make_s64vector, "make-s64vector", 1, 1, 0, #undef FUNC_NAME -SCM_DEFINE (scm_s64vector, "s64vector", 0, 0, 1, +SCM_DEFINE (scm_s64vector, "s64vector", 0, 0, 1, (SCM l), "Create a newly allocated homogeneous numeric vector containing\n" "all argument values.") @@ -1659,7 +1659,7 @@ SCM_DEFINE (scm_s64vector, "s64vector", 0, 0, 1, #undef FUNC_NAME -SCM_DEFINE (scm_s64vector_length, "s64vector-length", 1, 0, 0, +SCM_DEFINE (scm_s64vector_length, "s64vector-length", 1, 0, 0, (SCM uvec), "Return the number of elements in the homogeneous numeric vector\n" "@var{uvec}.") @@ -1673,7 +1673,7 @@ SCM_DEFINE (scm_s64vector_length, "s64vector-length", 1, 0, 0, #undef FUNC_NAME -SCM_DEFINE (scm_s64vector_ref, "s64vector-ref", 2, 0, 0, +SCM_DEFINE (scm_s64vector_ref, "s64vector-ref", 2, 0, 0, (SCM uvec, SCM index), "Return the element at @var{index} in the homogeneous numeric\n" "vector @var{uvec}.") @@ -1694,7 +1694,7 @@ SCM_DEFINE (scm_s64vector_ref, "s64vector-ref", 2, 0, 0, #undef FUNC_NAME -SCM_DEFINE (scm_s64vector_set_x, "s64vector-set!", 3, 0, 0, +SCM_DEFINE (scm_s64vector_set_x, "s64vector-set!", 3, 0, 0, (SCM uvec, SCM index, SCM value), "Set the element at @var{index} in the homogeneous numeric\n" "vector @var{uvec} to @var{value}. The return value is not\n" @@ -1720,7 +1720,7 @@ SCM_DEFINE (scm_s64vector_set_x, "s64vector-set!", 3, 0, 0, #undef FUNC_NAME -SCM_DEFINE (scm_s64vector_to_list, "s64vector->list", 1, 0, 0, +SCM_DEFINE (scm_s64vector_to_list, "s64vector->list", 1, 0, 0, (SCM uvec), "Convert the homogeneous numeric vector @var{uvec} to a list.") #define FUNC_NAME s_scm_s64vector_to_list @@ -1780,7 +1780,7 @@ SCM_DEFINE (scm_list_to_s64vector, "list->s64vector", 1, 0, 0, /* ================================================================ */ -SCM_DEFINE (scm_f32vector_p, "f32vector?", 1, 0, 0, +SCM_DEFINE (scm_f32vector_p, "f32vector?", 1, 0, 0, (SCM obj), "Return @code{#t} if @var{obj} is a vector of type f32,\n" "@code{#f} otherwise.") @@ -1792,7 +1792,7 @@ SCM_DEFINE (scm_f32vector_p, "f32vector?", 1, 0, 0, #undef FUNC_NAME -SCM_DEFINE (scm_make_f32vector, "make-f32vector", 1, 1, 0, +SCM_DEFINE (scm_make_f32vector, "make-f32vector", 1, 1, 0, (SCM n, SCM fill), "Create a newly allocated homogeneous numeric vector which can\n" "hold @var{len} elements. If @var{fill} is given, it is used to\n" @@ -1829,7 +1829,7 @@ SCM_DEFINE (scm_make_f32vector, "make-f32vector", 1, 1, 0, #undef FUNC_NAME -SCM_DEFINE (scm_f32vector, "f32vector", 0, 0, 1, +SCM_DEFINE (scm_f32vector, "f32vector", 0, 0, 1, (SCM l), "Create a newly allocated homogeneous numeric vector containing\n" "all argument values.") @@ -1841,7 +1841,7 @@ SCM_DEFINE (scm_f32vector, "f32vector", 0, 0, 1, #undef FUNC_NAME -SCM_DEFINE (scm_f32vector_length, "f32vector-length", 1, 0, 0, +SCM_DEFINE (scm_f32vector_length, "f32vector-length", 1, 0, 0, (SCM uvec), "Return the number of elements in the homogeneous numeric vector\n" "@var{uvec}.") @@ -1855,7 +1855,7 @@ SCM_DEFINE (scm_f32vector_length, "f32vector-length", 1, 0, 0, #undef FUNC_NAME -SCM_DEFINE (scm_f32vector_ref, "f32vector-ref", 2, 0, 0, +SCM_DEFINE (scm_f32vector_ref, "f32vector-ref", 2, 0, 0, (SCM uvec, SCM index), "Return the element at @var{index} in the homogeneous numeric\n" "vector @var{uvec}.") @@ -1876,7 +1876,7 @@ SCM_DEFINE (scm_f32vector_ref, "f32vector-ref", 2, 0, 0, #undef FUNC_NAME -SCM_DEFINE (scm_f32vector_set_x, "f32vector-set!", 3, 0, 0, +SCM_DEFINE (scm_f32vector_set_x, "f32vector-set!", 3, 0, 0, (SCM uvec, SCM index, SCM value), "Set the element at @var{index} in the homogeneous numeric\n" "vector @var{uvec} to @var{value}. The return value is not\n" @@ -1910,7 +1910,7 @@ SCM_DEFINE (scm_f32vector_set_x, "f32vector-set!", 3, 0, 0, #undef FUNC_NAME -SCM_DEFINE (scm_f32vector_to_list, "f32vector->list", 1, 0, 0, +SCM_DEFINE (scm_f32vector_to_list, "f32vector->list", 1, 0, 0, (SCM uvec), "Convert the homogeneous numeric vector @var{uvec} to a list.") #define FUNC_NAME s_scm_f32vector_to_list @@ -1976,7 +1976,7 @@ SCM_DEFINE (scm_list_to_f32vector, "list->f32vector", 1, 0, 0, /* ================================================================ */ -SCM_DEFINE (scm_f64vector_p, "f64vector?", 1, 0, 0, +SCM_DEFINE (scm_f64vector_p, "f64vector?", 1, 0, 0, (SCM obj), "Return @code{#t} if @var{obj} is a vector of type f64,\n" "@code{#f} otherwise.") @@ -1988,7 +1988,7 @@ SCM_DEFINE (scm_f64vector_p, "f64vector?", 1, 0, 0, #undef FUNC_NAME -SCM_DEFINE (scm_make_f64vector, "make-f64vector", 1, 1, 0, +SCM_DEFINE (scm_make_f64vector, "make-f64vector", 1, 1, 0, (SCM n, SCM fill), "Create a newly allocated homogeneous numeric vector which can\n" "hold @var{len} elements. If @var{fill} is given, it is used to\n" @@ -2016,7 +2016,7 @@ SCM_DEFINE (scm_make_f64vector, "make-f64vector", 1, 1, 0, #undef FUNC_NAME -SCM_DEFINE (scm_f64vector, "f64vector", 0, 0, 1, +SCM_DEFINE (scm_f64vector, "f64vector", 0, 0, 1, (SCM l), "Create a newly allocated homogeneous numeric vector containing\n" "all argument values.") @@ -2028,7 +2028,7 @@ SCM_DEFINE (scm_f64vector, "f64vector", 0, 0, 1, #undef FUNC_NAME -SCM_DEFINE (scm_f64vector_length, "f64vector-length", 1, 0, 0, +SCM_DEFINE (scm_f64vector_length, "f64vector-length", 1, 0, 0, (SCM uvec), "Return the number of elements in the homogeneous numeric vector\n" "@var{uvec}.") @@ -2042,7 +2042,7 @@ SCM_DEFINE (scm_f64vector_length, "f64vector-length", 1, 0, 0, #undef FUNC_NAME -SCM_DEFINE (scm_f64vector_ref, "f64vector-ref", 2, 0, 0, +SCM_DEFINE (scm_f64vector_ref, "f64vector-ref", 2, 0, 0, (SCM uvec, SCM index), "Return the element at @var{index} in the homogeneous numeric\n" "vector @var{uvec}.") @@ -2063,7 +2063,7 @@ SCM_DEFINE (scm_f64vector_ref, "f64vector-ref", 2, 0, 0, #undef FUNC_NAME -SCM_DEFINE (scm_f64vector_set_x, "f64vector-set!", 3, 0, 0, +SCM_DEFINE (scm_f64vector_set_x, "f64vector-set!", 3, 0, 0, (SCM uvec, SCM index, SCM value), "Set the element at @var{index} in the homogeneous numeric\n" "vector @var{uvec} to @var{value}. The return value is not\n" @@ -2089,7 +2089,7 @@ SCM_DEFINE (scm_f64vector_set_x, "f64vector-set!", 3, 0, 0, #undef FUNC_NAME -SCM_DEFINE (scm_f64vector_to_list, "f64vector->list", 1, 0, 0, +SCM_DEFINE (scm_f64vector_to_list, "f64vector->list", 1, 0, 0, (SCM uvec), "Convert the homogeneous numeric vector @var{uvec} to a list.") #define FUNC_NAME s_scm_f64vector_to_list @@ -2149,9 +2149,7 @@ scm_init_srfi_4 (void) scm_tc16_uvec = scm_make_smob_type ("uvec", 0); scm_set_smob_free (scm_tc16_uvec, uvec_free); scm_set_smob_print (scm_tc16_uvec, uvec_print); -#ifndef SCM_MAGIC_SNARFER #include "srfi/srfi-4.x" -#endif } /* End of srfi-4.c. */ From 2cd7ecb938c16f02b1055f6007e8eb0facb1dc48 Mon Sep 17 00:00:00 2001 From: Thien-Thi Nguyen Date: Thu, 14 Mar 2002 04:08:23 +0000 Subject: [PATCH 089/131] *** empty log message *** --- srfi/ChangeLog | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/srfi/ChangeLog b/srfi/ChangeLog index ed187389a..36e54a756 100644 --- a/srfi/ChangeLog +++ b/srfi/ChangeLog @@ -1,3 +1,8 @@ +2002-03-13 Thien-Thi Nguyen + + * srfi-13.c, srfi-14.c, srfi-4.c: + Retire inclusion guard macro SCM_MAGIC_SNARFER. + 2002-03-11 Marius Vollmer * srfi-13.c (string_titlecase_x): Treat characters as unsigned so From 49569f63895e3a1e235a373349a74f05c2a8147f Mon Sep 17 00:00:00 2001 From: Thien-Thi Nguyen Date: Thu, 14 Mar 2002 04:11:28 +0000 Subject: [PATCH 090/131] (snarfcppopts): New var. (.c.x): Use $(snarfcppopts). Rework guile-snarf usage. --- srfi/Makefile.am | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/srfi/Makefile.am b/srfi/Makefile.am index a23077a27..d8d612753 100644 --- a/srfi/Makefile.am +++ b/srfi/Makefile.am @@ -3,17 +3,17 @@ ## Copyright (C) 2001 Free Software Foundation, Inc. ## ## This file is part of GUILE. -## +## ## GUILE 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. -## +## ## GUILE 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 GUILE; see the file COPYING. If not, write ## to the Free Software Foundation, Inc., 59 Temple Place, Suite @@ -66,9 +66,10 @@ GUILE_SNARF = ../libguile/guile-snarf MKDEP = gcc -M -MG $(DEFS) $(INCLUDES) $(CPPFLAGS) $(CFLAGS) +snarfcppopts = $(DEFS) $(INCLUDES) $(CPPFLAGS) $(CFLAGS) + SUFFIXES = .x .c.x: - $(GUILE_SNARF) $(DEFS) $(INCLUDES) $(CPPFLAGS) $(CFLAGS) $< > $@ \ - || { rm $@; false; } + $(GUILE_SNARF) $< $(snarfcppopts) CLEANFILES = *.x From ffaf65cdd060a2a3fe823d00e744210a00211967 Mon Sep 17 00:00:00 2001 From: Thien-Thi Nguyen Date: Thu, 14 Mar 2002 04:12:16 +0000 Subject: [PATCH 091/131] *** empty log message *** --- srfi/ChangeLog | 3 +++ 1 file changed, 3 insertions(+) diff --git a/srfi/ChangeLog b/srfi/ChangeLog index 36e54a756..c3f8779b8 100644 --- a/srfi/ChangeLog +++ b/srfi/ChangeLog @@ -3,6 +3,9 @@ * srfi-13.c, srfi-14.c, srfi-4.c: Retire inclusion guard macro SCM_MAGIC_SNARFER. + * Makefile.am (snarfcppopts): New var. + (.c.x): Use $(snarfcppopts). Rework guile-snarf usage. + 2002-03-11 Marius Vollmer * srfi-13.c (string_titlecase_x): Treat characters as unsigned so From dff98306223ad8f434e1713795b0b376f5ae1708 Mon Sep 17 00:00:00 2001 From: Dirk Herrmann Date: Thu, 14 Mar 2002 06:45:56 +0000 Subject: [PATCH 092/131] * eval.c (SCM_CEVAL), srcprop.h (SRCBRKP): Eliminated union 't'. * eval.c (SCM_CEVAL): Exlined call to EVALCAR. --- libguile/ChangeLog | 6 + libguile/eval.c | 272 ++++++++++++++++++++++----------------------- libguile/srcprop.h | 6 +- 3 files changed, 139 insertions(+), 145 deletions(-) diff --git a/libguile/ChangeLog b/libguile/ChangeLog index b355a188b..4589238d6 100644 --- a/libguile/ChangeLog +++ b/libguile/ChangeLog @@ -1,3 +1,9 @@ +2002-03-14 Dirk Herrmann + + * eval.c (SCM_CEVAL), srcprop.h (SRCBRKP): Eliminated union 't'. + + * eval.c (SCM_CEVAL): Exlined call to EVALCAR. + 2002-03-13 Thien-Thi Nguyen * guile-snarf.in: Update copyright. diff --git a/libguile/eval.c b/libguile/eval.c index a682a5535..a14653f91 100644 --- a/libguile/eval.c +++ b/libguile/eval.c @@ -1890,12 +1890,7 @@ scm_deval (SCM x, SCM env) SCM SCM_CEVAL (SCM x, SCM env) { - union - { - SCM *lloc; - SCM arg1; - } t; - SCM proc, arg2, orig_sym; + SCM proc, arg1, arg2, orig_sym; #ifdef DEVAL scm_t_debug_frame debug; scm_t_debug_info *debug_info_end; @@ -1961,14 +1956,14 @@ start: SCM tail = SCM_BOOL(SCM_TAILRECP (debug)); SCM_SET_TAILREC (debug); if (SCM_CHEAPTRAPS_P) - t.arg1 = scm_make_debugobj (&debug); + arg1 = scm_make_debugobj (&debug); else { int first; SCM val = scm_make_continuation (&first); if (first) - t.arg1 = val; + arg1 = val; else { x = val; @@ -1983,7 +1978,7 @@ start: SCM_TRAPS_P = 0; scm_call_4 (SCM_ENTER_FRAME_HDLR, scm_sym_enter_frame, - t.arg1, + arg1, tail, scm_unmemocopy (x, env)); SCM_TRAPS_P = 1; @@ -2130,12 +2125,12 @@ dispatch: } else { - t.arg1 = EVALCAR (clause, env); - if (!SCM_FALSEP (t.arg1) && !SCM_NILP (t.arg1)) + arg1 = EVALCAR (clause, env); + if (!SCM_FALSEP (arg1) && !SCM_NILP (arg1)) { x = SCM_CDR (clause); if (SCM_NULLP (x)) - RETURN (t.arg1); + RETURN (arg1); else if (!SCM_EQ_P (SCM_CAR (x), scm_sym_arrow)) { PREP_APPLY (SCM_UNDEFINED, SCM_EOL); @@ -2146,7 +2141,7 @@ dispatch: proc = SCM_CDR (x); proc = EVALCAR (proc, env); SCM_ASRTGO (!SCM_IMP (proc), badfun); - PREP_APPLY (proc, scm_list_1 (t.arg1)); + PREP_APPLY (proc, scm_list_1 (arg1)); ENTER_APPLY; if (SCM_CLOSUREP(proc) && scm_badformalsp (proc, 1)) goto umwrongnumargs; @@ -2362,36 +2357,36 @@ dispatch: if (SCM_CLOSUREP (proc)) { PREP_APPLY (proc, SCM_EOL); - t.arg1 = SCM_CDDR (x); - t.arg1 = EVALCAR (t.arg1, env); + arg1 = SCM_CDDR (x); + arg1 = EVALCAR (arg1, env); apply_closure: /* Go here to tail-call a closure. PROC is the closure - and T.ARG1 is the list of arguments. Do not forget to - call PREP_APPLY. */ + and ARG1 is the list of arguments. Do not forget to + call PREP_APPLY. */ { SCM formals = SCM_CLOSURE_FORMALS (proc); #ifdef DEVAL - debug.info->a.args = t.arg1; + debug.info->a.args = arg1; #endif #ifndef SCM_RECKLESS - if (scm_badargsp (formals, t.arg1)) + if (scm_badargsp (formals, arg1)) goto wrongnumargs; #endif ENTER_APPLY; /* Copy argument list */ - if (SCM_NULL_OR_NIL_P (t.arg1)) + if (SCM_NULL_OR_NIL_P (arg1)) env = EXTEND_ENV (formals, SCM_EOL, SCM_ENV (proc)); else { - SCM args = scm_list_1 (SCM_CAR (t.arg1)); + SCM args = scm_list_1 (SCM_CAR (arg1)); SCM tail = args; - t.arg1 = SCM_CDR (t.arg1); - while (!SCM_NULL_OR_NIL_P (t.arg1)) + arg1 = SCM_CDR (arg1); + while (!SCM_NULL_OR_NIL_P (arg1)) { - SCM new_tail = scm_list_1 (SCM_CAR (t.arg1)); + SCM new_tail = scm_list_1 (SCM_CAR (arg1)); SCM_SETCDR (tail, new_tail); tail = new_tail; - t.arg1 = SCM_CDR (t.arg1); + arg1 = SCM_CDR (arg1); } env = EXTEND_ENV (formals, args, SCM_ENV (proc)); } @@ -2413,14 +2408,14 @@ dispatch: SCM val = scm_make_continuation (&first); if (first) - t.arg1 = val; + arg1 = val; else RETURN (val); } proc = SCM_CDR (x); proc = scm_eval_car (proc, env); SCM_ASRTGO (SCM_NIMP (proc), badfun); - PREP_APPLY (proc, scm_list_1 (t.arg1)); + PREP_APPLY (proc, scm_list_1 (arg1)); ENTER_APPLY; if (SCM_CLOSUREP(proc) && scm_badformalsp (proc, 1)) goto umwrongnumargs; @@ -2432,19 +2427,19 @@ dispatch: case (SCM_ISYMNUM (SCM_IM_DISPATCH)): { /* If not done yet, evaluate the operand forms. The result is a - * list of arguments stored in t.arg1, which is used to perform the + * list of arguments stored in arg1, which is used to perform the * function dispatch. */ SCM operand_forms = SCM_CADR (x); PREP_APPLY (SCM_UNDEFINED, SCM_EOL); if (SCM_ILOCP (operand_forms)) - t.arg1 = *scm_ilookup (operand_forms, env); + arg1 = *scm_ilookup (operand_forms, env); else if (SCM_VARIABLEP (operand_forms)) - t.arg1 = SCM_VARIABLE_REF (operand_forms); + arg1 = SCM_VARIABLE_REF (operand_forms); else if (!SCM_CONSP (operand_forms)) - t.arg1 = *scm_lookupcar (SCM_CDR (x), env, 1); + arg1 = *scm_lookupcar (SCM_CDR (x), env, 1); else { - SCM tail = t.arg1 = scm_list_1 (EVALCAR (operand_forms, env)); + SCM tail = arg1 = scm_list_1 (EVALCAR (operand_forms, env)); operand_forms = SCM_CDR (operand_forms); while (!SCM_NULLP (operand_forms)) { @@ -2459,7 +2454,7 @@ dispatch: /* The type dispatch code is duplicated below * (c.f. objects.c:scm_mcache_compute_cmethod) since that * cuts down execution time for type dispatch to 50%. */ - type_dispatch: /* inputs: x, t.arg1 */ + type_dispatch: /* inputs: x, arg1 */ /* Type dispatch means to determine from the types of the function * arguments (i. e. the 'signature' of the call), which method from * a generic function is to be called. This process of selecting @@ -2514,7 +2509,7 @@ dispatch: * method in the method cache. */ unsigned long int hashset = SCM_INUM (tmp); unsigned long int counter = specializers + 1; - SCM tmp_arg = t.arg1; + SCM tmp_arg = arg1; hash_value = 0; while (!SCM_NULLP (tmp_arg) && counter != 0) { @@ -2553,7 +2548,7 @@ dispatch: SCM z; do { - SCM args = t.arg1; /* list of arguments */ + SCM args = arg1; /* list of arguments */ z = SCM_VELTS (method_cache)[hash_value]; while (!SCM_NULLP (args)) { @@ -2572,12 +2567,12 @@ dispatch: } while (hash_value != cache_end_pos); /* No appropriate method was found in the cache. */ - z = scm_memoize_method (x, t.arg1); + z = scm_memoize_method (x, arg1); - apply_cmethod: /* inputs: z, t.arg1 */ + apply_cmethod: /* inputs: z, arg1 */ { SCM formals = SCM_CMETHOD_FORMALS (z); - env = EXTEND_ENV (formals, t.arg1, SCM_CMETHOD_ENV (z)); + env = EXTEND_ENV (formals, arg1, SCM_CMETHOD_ENV (z)); x = SCM_CMETHOD_BODY (z); goto nontoplevel_begin; } @@ -2675,17 +2670,17 @@ dispatch: x = EVALCAR (proc, env); proc = SCM_CDR (proc); proc = EVALCAR (proc, env); - t.arg1 = SCM_APPLY (x, SCM_EOL, SCM_EOL); - if (SCM_VALUESP (t.arg1)) - t.arg1 = scm_struct_ref (t.arg1, SCM_INUM0); + arg1 = SCM_APPLY (x, SCM_EOL, SCM_EOL); + if (SCM_VALUESP (arg1)) + arg1 = scm_struct_ref (arg1, SCM_INUM0); else - t.arg1 = scm_list_1 (t.arg1); + arg1 = scm_list_1 (arg1); if (SCM_CLOSUREP (proc)) { - PREP_APPLY (proc, t.arg1); + PREP_APPLY (proc, arg1); goto apply_closure; } - return SCM_APPLY (proc, t.arg1, SCM_EOL); + return SCM_APPLY (proc, arg1, SCM_EOL); } @@ -2770,7 +2765,7 @@ dispatch: application frames can be deleted from the backtrace. */ SCM_SET_MACROEXP (debug); #endif - t.arg1 = SCM_APPLY (SCM_MACRO_CODE (proc), x, + arg1 = SCM_APPLY (SCM_MACRO_CODE (proc), x, scm_cons (env, scm_listofnull)); #ifdef DEVAL @@ -2779,14 +2774,14 @@ dispatch: switch (SCM_MACRO_TYPE (proc)) { case 2: - if (scm_ilength (t.arg1) <= 0) - t.arg1 = scm_list_2 (SCM_IM_BEGIN, t.arg1); + if (scm_ilength (arg1) <= 0) + arg1 = scm_list_2 (SCM_IM_BEGIN, arg1); #ifdef DEVAL if (!SCM_CLOSUREP (SCM_MACRO_CODE (proc))) { SCM_DEFER_INTS; - SCM_SETCAR (x, SCM_CAR (t.arg1)); - SCM_SETCDR (x, SCM_CDR (t.arg1)); + SCM_SETCAR (x, SCM_CAR (arg1)); + SCM_SETCDR (x, SCM_CDR (arg1)); SCM_ALLOW_INTS; goto dispatch; } @@ -2796,15 +2791,15 @@ dispatch: SCM_CDR (x)); #endif SCM_DEFER_INTS; - SCM_SETCAR (x, SCM_CAR (t.arg1)); - SCM_SETCDR (x, SCM_CDR (t.arg1)); + SCM_SETCAR (x, SCM_CAR (arg1)); + SCM_SETCDR (x, SCM_CDR (arg1)); SCM_ALLOW_INTS; goto loopnoap; case 1: - if (SCM_NIMP (x = t.arg1)) + if (SCM_NIMP (x = arg1)) goto loopnoap; case 0: - RETURN (t.arg1); + RETURN (arg1); } } } @@ -2818,17 +2813,17 @@ dispatch: if (SCM_CLOSUREP (proc)) { arg2 = SCM_CLOSURE_FORMALS (proc); - t.arg1 = SCM_CDR (x); + arg1 = SCM_CDR (x); while (!SCM_NULLP (arg2)) { if (!SCM_CONSP (arg2)) goto evapply; - if (SCM_IMP (t.arg1)) + if (SCM_IMP (arg1)) goto umwrongnumargs; arg2 = SCM_CDR (arg2); - t.arg1 = SCM_CDR (t.arg1); + arg1 = SCM_CDR (arg1); } - if (!SCM_NULLP (t.arg1)) + if (!SCM_NULLP (arg1)) goto umwrongnumargs; } else if (SCM_MACROP (proc)) @@ -2859,11 +2854,11 @@ evapply: goto badfun; RETURN (SCM_SMOB_APPLY_0 (proc)); case scm_tc7_cclo: - t.arg1 = proc; + arg1 = proc; proc = SCM_CCLO_SUBR (proc); #ifdef DEVAL debug.info->a.proc = proc; - debug.info->a.args = scm_list_1 (t.arg1); + debug.info->a.args = scm_list_1 (arg1); #endif goto evap1; case scm_tc7_pws: @@ -2883,20 +2878,20 @@ evapply: if (SCM_OBJ_CLASS_FLAGS (proc) & SCM_CLASSF_PURE_GENERIC) { x = SCM_ENTITY_PROCEDURE (proc); - t.arg1 = SCM_EOL; + arg1 = SCM_EOL; goto type_dispatch; } else if (!SCM_I_OPERATORP (proc)) goto badfun; else { - t.arg1 = proc; + arg1 = proc; proc = (SCM_I_ENTITYP (proc) ? SCM_ENTITY_PROCEDURE (proc) : SCM_OPERATOR_PROCEDURE (proc)); #ifdef DEVAL debug.info->a.proc = proc; - debug.info->a.args = scm_list_1 (t.arg1); + debug.info->a.args = scm_list_1 (arg1); #endif if (SCM_NIMP (proc)) goto evap1; @@ -2922,22 +2917,15 @@ evapply: /* must handle macros by here */ x = SCM_CDR (x); #ifdef SCM_CAUTIOUS - if (SCM_IMP (x)) - goto wrongnumargs; - else if (SCM_CONSP (x)) - { - if (SCM_IMP (SCM_CAR (x))) - t.arg1 = SCM_EVALIM (SCM_CAR (x), env); - else - t.arg1 = EVALCELLCAR (x, env); - } + if (SCM_CONSP (x)) + arg1 = EVALCAR (x, env); else goto wrongnumargs; #else - t.arg1 = EVALCAR (x, env); + arg1 = EVALCAR (x, env); #endif #ifdef DEVAL - debug.info->a.args = scm_list_1 (t.arg1); + debug.info->a.args = scm_list_1 (arg1); #endif x = SCM_CDR (x); if (SCM_NULLP (x)) @@ -2945,30 +2933,30 @@ evapply: ENTER_APPLY; evap1: switch (SCM_TYP7 (proc)) - { /* have one argument in t.arg1 */ + { /* have one argument in arg1 */ case scm_tc7_subr_2o: - RETURN (SCM_SUBRF (proc) (t.arg1, SCM_UNDEFINED)); + RETURN (SCM_SUBRF (proc) (arg1, SCM_UNDEFINED)); case scm_tc7_subr_1: case scm_tc7_subr_1o: - RETURN (SCM_SUBRF (proc) (t.arg1)); + RETURN (SCM_SUBRF (proc) (arg1)); case scm_tc7_cxr: if (SCM_SUBRF (proc)) { - if (SCM_INUMP (t.arg1)) + if (SCM_INUMP (arg1)) { - RETURN (scm_make_real (SCM_DSUBRF (proc) ((double) SCM_INUM (t.arg1)))); + RETURN (scm_make_real (SCM_DSUBRF (proc) ((double) SCM_INUM (arg1)))); } - else if (SCM_REALP (t.arg1)) + else if (SCM_REALP (arg1)) { - RETURN (scm_make_real (SCM_DSUBRF (proc) (SCM_REAL_VALUE (t.arg1)))); + RETURN (scm_make_real (SCM_DSUBRF (proc) (SCM_REAL_VALUE (arg1)))); } #ifdef SCM_BIGDIG - else if (SCM_BIGP (t.arg1)) + else if (SCM_BIGP (arg1)) { - RETURN (scm_make_real (SCM_DSUBRF (proc) (scm_i_big2dbl (t.arg1)))); + RETURN (scm_make_real (SCM_DSUBRF (proc) (scm_i_big2dbl (arg1)))); } #endif - SCM_WTA_DISPATCH_1 (*SCM_SUBR_GENERIC (proc), t.arg1, + SCM_WTA_DISPATCH_1 (*SCM_SUBR_GENERIC (proc), arg1, SCM_ARG1, SCM_SYMBOL_CHARS (SCM_SNAME (proc))); } proc = SCM_SNAME (proc); @@ -2976,32 +2964,32 @@ evapply: char *chrs = SCM_SYMBOL_CHARS (proc) + SCM_SYMBOL_LENGTH (proc) - 1; while ('c' != *--chrs) { - SCM_ASSERT (SCM_CONSP (t.arg1), - t.arg1, SCM_ARG1, SCM_SYMBOL_CHARS (proc)); - t.arg1 = ('a' == *chrs) ? SCM_CAR (t.arg1) : SCM_CDR (t.arg1); + SCM_ASSERT (SCM_CONSP (arg1), + arg1, SCM_ARG1, SCM_SYMBOL_CHARS (proc)); + arg1 = ('a' == *chrs) ? SCM_CAR (arg1) : SCM_CDR (arg1); } - RETURN (t.arg1); + RETURN (arg1); } case scm_tc7_rpsubr: RETURN (SCM_BOOL_T); case scm_tc7_asubr: - RETURN (SCM_SUBRF (proc) (t.arg1, SCM_UNDEFINED)); + RETURN (SCM_SUBRF (proc) (arg1, SCM_UNDEFINED)); case scm_tc7_lsubr: #ifdef DEVAL RETURN (SCM_SUBRF (proc) (debug.info->a.args)); #else - RETURN (SCM_SUBRF (proc) (scm_list_1 (t.arg1))); + RETURN (SCM_SUBRF (proc) (scm_list_1 (arg1))); #endif case scm_tc7_smob: if (!SCM_SMOB_APPLICABLE_P (proc)) goto badfun; - RETURN (SCM_SMOB_APPLY_1 (proc, t.arg1)); + RETURN (SCM_SMOB_APPLY_1 (proc, arg1)); case scm_tc7_cclo: - arg2 = t.arg1; - t.arg1 = proc; + arg2 = arg1; + arg1 = proc; proc = SCM_CCLO_SUBR (proc); #ifdef DEVAL - debug.info->a.args = scm_cons (t.arg1, debug.info->a.args); + debug.info->a.args = scm_cons (arg1, debug.info->a.args); debug.info->a.proc = proc; #endif goto evap2; @@ -3020,7 +3008,7 @@ evapply: #ifdef DEVAL env = EXTEND_ENV (SCM_CLOSURE_FORMALS (proc), debug.info->a.args, SCM_ENV (proc)); #else - env = EXTEND_ENV (SCM_CLOSURE_FORMALS (proc), scm_list_1 (t.arg1), SCM_ENV (proc)); + env = EXTEND_ENV (SCM_CLOSURE_FORMALS (proc), scm_list_1 (arg1), SCM_ENV (proc)); #endif goto nontoplevel_begin; case scm_tcs_struct: @@ -3028,9 +3016,9 @@ evapply: { x = SCM_ENTITY_PROCEDURE (proc); #ifdef DEVAL - t.arg1 = debug.info->a.args; + arg1 = debug.info->a.args; #else - t.arg1 = scm_list_1 (t.arg1); + arg1 = scm_list_1 (arg1); #endif goto type_dispatch; } @@ -3038,13 +3026,13 @@ evapply: goto badfun; else { - arg2 = t.arg1; - t.arg1 = proc; + arg2 = arg1; + arg1 = proc; proc = (SCM_I_ENTITYP (proc) ? SCM_ENTITY_PROCEDURE (proc) : SCM_OPERATOR_PROCEDURE (proc)); #ifdef DEVAL - debug.info->a.args = scm_cons (t.arg1, debug.info->a.args); + debug.info->a.args = scm_cons (arg1, debug.info->a.args); debug.info->a.proc = proc; #endif if (SCM_NIMP (proc)) @@ -3078,7 +3066,7 @@ evapply: #endif { /* have two or more arguments */ #ifdef DEVAL - debug.info->a.args = scm_list_2 (t.arg1, arg2); + debug.info->a.args = scm_list_2 (arg1, arg2); #endif x = SCM_CDR (x); if (SCM_NULLP (x)) { @@ -3088,22 +3076,22 @@ evapply: { /* have two arguments */ case scm_tc7_subr_2: case scm_tc7_subr_2o: - RETURN (SCM_SUBRF (proc) (t.arg1, arg2)); + RETURN (SCM_SUBRF (proc) (arg1, arg2)); case scm_tc7_lsubr: #ifdef DEVAL RETURN (SCM_SUBRF (proc) (debug.info->a.args)); #else - RETURN (SCM_SUBRF (proc) (scm_list_2 (t.arg1, arg2))); + RETURN (SCM_SUBRF (proc) (scm_list_2 (arg1, arg2))); #endif case scm_tc7_lsubr_2: - RETURN (SCM_SUBRF (proc) (t.arg1, arg2, SCM_EOL)); + RETURN (SCM_SUBRF (proc) (arg1, arg2, SCM_EOL)); case scm_tc7_rpsubr: case scm_tc7_asubr: - RETURN (SCM_SUBRF (proc) (t.arg1, arg2)); + RETURN (SCM_SUBRF (proc) (arg1, arg2)); case scm_tc7_smob: if (!SCM_SMOB_APPLICABLE_P (proc)) goto badfun; - RETURN (SCM_SMOB_APPLY_2 (proc, t.arg1, arg2)); + RETURN (SCM_SMOB_APPLY_2 (proc, arg1, arg2)); cclon: case scm_tc7_cclo: #ifdef DEVAL @@ -3112,7 +3100,7 @@ evapply: SCM_EOL)); #else RETURN (SCM_APPLY (SCM_CCLO_SUBR (proc), - scm_cons2 (proc, t.arg1, + scm_cons2 (proc, arg1, scm_cons (arg2, scm_eval_args (x, env, @@ -3124,9 +3112,9 @@ evapply: { x = SCM_ENTITY_PROCEDURE (proc); #ifdef DEVAL - t.arg1 = debug.info->a.args; + arg1 = debug.info->a.args; #else - t.arg1 = scm_list_2 (t.arg1, arg2); + arg1 = scm_list_2 (arg1, arg2); #endif goto type_dispatch; } @@ -3145,7 +3133,7 @@ evapply: RETURN (SCM_APPLY (SCM_I_ENTITYP (proc) ? SCM_ENTITY_PROCEDURE (proc) : SCM_OPERATOR_PROCEDURE (proc), - scm_cons2 (proc, t.arg1, + scm_cons2 (proc, arg1, scm_cons (arg2, scm_eval_args (x, env, @@ -3178,7 +3166,7 @@ evapply: SCM_ENV (proc)); #else env = EXTEND_ENV (SCM_CLOSURE_FORMALS (proc), - scm_list_2 (t.arg1, arg2), SCM_ENV (proc)); + scm_list_2 (arg1, arg2), SCM_ENV (proc)); #endif x = SCM_CLOSURE_BODY (proc); goto nontoplevel_begin; @@ -3189,7 +3177,7 @@ evapply: goto wrongnumargs; #endif #ifdef DEVAL - debug.info->a.args = scm_cons2 (t.arg1, arg2, + debug.info->a.args = scm_cons2 (arg1, arg2, deval_args (x, env, proc, SCM_CDRLOC (SCM_CDR (debug.info->a.args)))); #endif ENTER_APPLY; @@ -3199,49 +3187,49 @@ evapply: #ifdef DEVAL case scm_tc7_subr_3: SCM_ASRTGO (SCM_NULLP (SCM_CDR (x)), wrongnumargs); - RETURN (SCM_SUBRF (proc) (t.arg1, arg2, + RETURN (SCM_SUBRF (proc) (arg1, arg2, SCM_CADDR (debug.info->a.args))); case scm_tc7_asubr: #ifdef BUILTIN_RPASUBR - t.arg1 = SCM_SUBRF(proc)(t.arg1, arg2); + arg1 = SCM_SUBRF(proc)(arg1, arg2); arg2 = SCM_CDDR (debug.info->a.args); do { - t.arg1 = SCM_SUBRF(proc)(t.arg1, SCM_CAR (arg2)); + arg1 = SCM_SUBRF(proc)(arg1, SCM_CAR (arg2)); arg2 = SCM_CDR (arg2); } while (SCM_NIMP (arg2)); - RETURN (t.arg1); + RETURN (arg1); #endif /* BUILTIN_RPASUBR */ case scm_tc7_rpsubr: #ifdef BUILTIN_RPASUBR - if (SCM_FALSEP (SCM_SUBRF (proc) (t.arg1, arg2))) + if (SCM_FALSEP (SCM_SUBRF (proc) (arg1, arg2))) RETURN (SCM_BOOL_F); - t.arg1 = SCM_CDDR (debug.info->a.args); + arg1 = SCM_CDDR (debug.info->a.args); do { - if (SCM_FALSEP (SCM_SUBRF (proc) (arg2, SCM_CAR (t.arg1)))) + if (SCM_FALSEP (SCM_SUBRF (proc) (arg2, SCM_CAR (arg1)))) RETURN (SCM_BOOL_F); - arg2 = SCM_CAR (t.arg1); - t.arg1 = SCM_CDR (t.arg1); + arg2 = SCM_CAR (arg1); + arg1 = SCM_CDR (arg1); } - while (SCM_NIMP (t.arg1)); + while (SCM_NIMP (arg1)); RETURN (SCM_BOOL_T); #else /* BUILTIN_RPASUBR */ - RETURN (SCM_APPLY (proc, t.arg1, + RETURN (SCM_APPLY (proc, arg1, scm_acons (arg2, SCM_CDDR (debug.info->a.args), SCM_EOL))); #endif /* BUILTIN_RPASUBR */ case scm_tc7_lsubr_2: - RETURN (SCM_SUBRF (proc) (t.arg1, arg2, + RETURN (SCM_SUBRF (proc) (arg1, arg2, SCM_CDDR (debug.info->a.args))); case scm_tc7_lsubr: RETURN (SCM_SUBRF (proc) (debug.info->a.args)); case scm_tc7_smob: if (!SCM_SMOB_APPLICABLE_P (proc)) goto badfun; - RETURN (SCM_SMOB_APPLY_3 (proc, t.arg1, arg2, + RETURN (SCM_SMOB_APPLY_3 (proc, arg1, arg2, SCM_CDDR (debug.info->a.args))); case scm_tc7_cclo: goto cclon; @@ -3262,48 +3250,48 @@ evapply: #else /* DEVAL */ case scm_tc7_subr_3: SCM_ASRTGO (SCM_NULLP (SCM_CDR (x)), wrongnumargs); - RETURN (SCM_SUBRF (proc) (t.arg1, arg2, EVALCAR (x, env))); + RETURN (SCM_SUBRF (proc) (arg1, arg2, EVALCAR (x, env))); case scm_tc7_asubr: #ifdef BUILTIN_RPASUBR - t.arg1 = SCM_SUBRF (proc) (t.arg1, arg2); + arg1 = SCM_SUBRF (proc) (arg1, arg2); do { - t.arg1 = SCM_SUBRF(proc)(t.arg1, EVALCAR(x, env)); + arg1 = SCM_SUBRF(proc)(arg1, EVALCAR(x, env)); x = SCM_CDR(x); } while (SCM_NIMP (x)); - RETURN (t.arg1); + RETURN (arg1); #endif /* BUILTIN_RPASUBR */ case scm_tc7_rpsubr: #ifdef BUILTIN_RPASUBR - if (SCM_FALSEP (SCM_SUBRF (proc) (t.arg1, arg2))) + if (SCM_FALSEP (SCM_SUBRF (proc) (arg1, arg2))) RETURN (SCM_BOOL_F); do { - t.arg1 = EVALCAR (x, env); - if (SCM_FALSEP (SCM_SUBRF (proc) (arg2, t.arg1))) + arg1 = EVALCAR (x, env); + if (SCM_FALSEP (SCM_SUBRF (proc) (arg2, arg1))) RETURN (SCM_BOOL_F); - arg2 = t.arg1; + arg2 = arg1; x = SCM_CDR (x); } while (SCM_NIMP (x)); RETURN (SCM_BOOL_T); #else /* BUILTIN_RPASUBR */ - RETURN (SCM_APPLY (proc, t.arg1, + RETURN (SCM_APPLY (proc, arg1, scm_acons (arg2, scm_eval_args (x, env, proc), SCM_EOL))); #endif /* BUILTIN_RPASUBR */ case scm_tc7_lsubr_2: - RETURN (SCM_SUBRF (proc) (t.arg1, arg2, scm_eval_args (x, env, proc))); + RETURN (SCM_SUBRF (proc) (arg1, arg2, scm_eval_args (x, env, proc))); case scm_tc7_lsubr: - RETURN (SCM_SUBRF (proc) (scm_cons2 (t.arg1, + RETURN (SCM_SUBRF (proc) (scm_cons2 (arg1, arg2, scm_eval_args (x, env, proc)))); case scm_tc7_smob: if (!SCM_SMOB_APPLICABLE_P (proc)) goto badfun; - RETURN (SCM_SMOB_APPLY_3 (proc, t.arg1, arg2, + RETURN (SCM_SMOB_APPLY_3 (proc, arg1, arg2, scm_eval_args (x, env, proc))); case scm_tc7_cclo: goto cclon; @@ -3325,7 +3313,7 @@ evapply: SCM_SET_ARGSREADY (debug); #endif env = EXTEND_ENV (SCM_CLOSURE_FORMALS (proc), - scm_cons2 (t.arg1, + scm_cons2 (arg1, arg2, scm_eval_args (x, env, proc)), SCM_ENV (proc)); @@ -3336,9 +3324,9 @@ evapply: if (SCM_OBJ_CLASS_FLAGS (proc) & SCM_CLASSF_PURE_GENERIC) { #ifdef DEVAL - t.arg1 = debug.info->a.args; + arg1 = debug.info->a.args; #else - t.arg1 = scm_cons2 (t.arg1, arg2, scm_eval_args (x, env, proc)); + arg1 = scm_cons2 (arg1, arg2, scm_eval_args (x, env, proc)); #endif x = SCM_ENTITY_PROCEDURE (proc); goto type_dispatch; @@ -3365,14 +3353,14 @@ exit: { SCM_CLEAR_TRACED_FRAME (debug); if (SCM_CHEAPTRAPS_P) - t.arg1 = scm_make_debugobj (&debug); + arg1 = scm_make_debugobj (&debug); else { int first; SCM val = scm_make_continuation (&first); if (first) - t.arg1 = val; + arg1 = val; else { proc = val; @@ -3380,7 +3368,7 @@ exit: } } SCM_TRAPS_P = 0; - scm_call_3 (SCM_EXIT_FRAME_HDLR, scm_sym_exit_frame, t.arg1, proc); + scm_call_3 (SCM_EXIT_FRAME_HDLR, scm_sym_exit_frame, arg1, proc); SCM_TRAPS_P = 1; } ret: diff --git a/libguile/srcprop.h b/libguile/srcprop.h index 89f72e5ab..2f92b0621 100644 --- a/libguile/srcprop.h +++ b/libguile/srcprop.h @@ -115,9 +115,9 @@ typedef struct scm_t_srcprops_chunk #define SETSRCPROPLINE(p,l) SETSRCPROPPOS (p, l, SRCPROPCOL (p)) #define SETSRCPROPCOL(p,c) SETSRCPROPPOS (p, SRCPROPLINE (p), c) -#define SRCBRKP(x) (!SCM_IMP (t.arg1 = scm_whash_lookup (scm_source_whash, (x)))\ - && SRCPROPSP (t.arg1)\ - && SRCPROPBRK (t.arg1)) +#define SRCBRKP(x) (!SCM_IMP (arg1 = scm_whash_lookup (scm_source_whash, (x)))\ + && SRCPROPSP (arg1)\ + && SRCPROPBRK (arg1)) #define PROCTRACEP(x) (!SCM_FALSEP (scm_procedure_property (x, scm_sym_trace))) From 6a9a7bf27ae712f6567e6cecd7f510e5fe0da666 Mon Sep 17 00:00:00 2001 From: Thien-Thi Nguyen Date: Thu, 14 Mar 2002 07:55:34 +0000 Subject: [PATCH 093/131] (snarfcppopts): New var. (.c.x): Use $(snarfcppopts). Rework guile-snarf usage. --- guile-readline/Makefile.am | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/guile-readline/Makefile.am b/guile-readline/Makefile.am index c8cb59eff..73c098f93 100644 --- a/guile-readline/Makefile.am +++ b/guile-readline/Makefile.am @@ -45,10 +45,10 @@ pkginclude_HEADERS = readline.h ice9dir = $(datadir)/guile/$(VERSION)/ice-9 ice9_DATA = readline.scm +snarfcppopts = $(DEFS) $(INCLUDES) $(CPPFLAGS) $(CFLAGS) SUFFIXES = .x .c.x: - $(GUILE_SNARF) $(DEFS) $(INCLUDES) $(CPPFLAGS) $(CFLAGS) $< > $@ \ - || { rm $@; false; } + $(GUILE_SNARF) $< $(snarfcppopts) EXTRA_DIST = $(ice9_DATA) LIBGUILEREADLINE-VERSION ETAGS_ARGS = $(ice9_DATA) From 7199029717898ba779be2b117566c1cf4e33138c Mon Sep 17 00:00:00 2001 From: Thien-Thi Nguyen Date: Thu, 14 Mar 2002 07:57:42 +0000 Subject: [PATCH 094/131] *** empty log message *** --- guile-readline/ChangeLog | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/guile-readline/ChangeLog b/guile-readline/ChangeLog index 5e6503db0..0a47dc4b2 100644 --- a/guile-readline/ChangeLog +++ b/guile-readline/ChangeLog @@ -1,3 +1,8 @@ +2002-03-13 Thien-Thi Nguyen + + * Makefile.am (snarfcppopts): New var. + (.c.x): Use $(snarfcppopts). Rework guile-snarf usage. + 2002-02-27 Stefan Jahn * Makefile.am (EXTRA_DIST): Added the `LIBGUILEREADLINE-VERSION' From d3bd0027d434ad461bfe5970c992445ef6fbb9dc Mon Sep 17 00:00:00 2001 From: Marius Vollmer Date: Thu, 14 Mar 2002 22:21:53 +0000 Subject: [PATCH 095/131] (modern_snarf): Remove everything following and including "^:^" from the output. --- libguile/guile-snarf.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libguile/guile-snarf.in b/libguile/guile-snarf.in index 4d830f8cd..2d4c2dc97 100644 --- a/libguile/guile-snarf.in +++ b/libguile/guile-snarf.in @@ -45,7 +45,7 @@ modern_snarf () # writes stdout { ${cpp} -DSCM_MAGIC_SNARF_INITS "$@" > ${temp} && cpp_ok_p=true -grep "^ *\^ *\^" ${temp} | sed -e "s/^ *\^ *\^//" +grep "^ *\^ *\^" ${temp} | sed -e "s/^ *\^ *\^//" -e "s/\^\ *:\ *\^.*/;/" } compat_mode_clean_xxx () # modifies $1 From 09e804ff6ff3ec464e6ecf9797c1ec5cfc646bfa Mon Sep 17 00:00:00 2001 From: Marius Vollmer Date: Thu, 14 Mar 2002 22:23:43 +0000 Subject: [PATCH 096/131] (SCM_SNARF_INIT): Add "^:^" after code so that guile-snarf can remove trailing non-init code. --- libguile/snarf.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libguile/snarf.h b/libguile/snarf.h index 4e9448484..ac12f2bb9 100644 --- a/libguile/snarf.h +++ b/libguile/snarf.h @@ -75,7 +75,7 @@ #ifdef SCM_MAGIC_SNARF_INITS # define SCM_SNARF_HERE(X) -# define SCM_SNARF_INIT(X) ^^ X +# define SCM_SNARF_INIT(X) ^^ X ^:^ # define SCM_SNARF_DOCS(TYPE, CNAME, FNAME, ARGLIST, REQ, OPT, VAR, DOCSTRING) #else # ifdef SCM_MAGIC_SNARF_DOCS From 3b3cc7811592f7945b8f95101d83302c58826b0f Mon Sep 17 00:00:00 2001 From: Marius Vollmer Date: Thu, 14 Mar 2002 22:23:56 +0000 Subject: [PATCH 097/131] *** empty log message *** --- libguile/ChangeLog | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/libguile/ChangeLog b/libguile/ChangeLog index 4589238d6..c6a048a2d 100644 --- a/libguile/ChangeLog +++ b/libguile/ChangeLog @@ -1,3 +1,11 @@ +2002-03-14 Marius Vollmer + + * snarf.h (SCM_SNARF_INIT): Add "^:^" after code so that + guile-snarf can remove trailing non-init code. + + * guile-snarf.in (modern_snarf): Remove everything following and + including "^:^" from the output. + 2002-03-14 Dirk Herrmann * eval.c (SCM_CEVAL), srcprop.h (SRCBRKP): Eliminated union 't'. From a08b0d00584a86ff8ada530cd0996e5f3ac2b4c5 Mon Sep 17 00:00:00 2001 From: Marius Vollmer Date: Thu, 14 Mar 2002 22:25:31 +0000 Subject: [PATCH 098/131] (singp): Use SCM_REALP instead of SCM_SLOPPY_REALP. --- libguile/unif.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libguile/unif.c b/libguile/unif.c index ce0cf2706..761fbc101 100644 --- a/libguile/unif.c +++ b/libguile/unif.c @@ -146,7 +146,7 @@ scm_uniform_element_size (SCM obj) static int singp (SCM obj) { - if (!SCM_SLOPPY_REALP (obj)) + if (!SCM_REALP (obj)) return 0; else { From 500b0d5b727b2473fb68f3676bbbef047a7965cc Mon Sep 17 00:00:00 2001 From: Marius Vollmer Date: Thu, 14 Mar 2002 22:25:57 +0000 Subject: [PATCH 099/131] *** empty log message *** --- libguile/ChangeLog | 2 ++ 1 file changed, 2 insertions(+) diff --git a/libguile/ChangeLog b/libguile/ChangeLog index c6a048a2d..7606c53ac 100644 --- a/libguile/ChangeLog +++ b/libguile/ChangeLog @@ -1,5 +1,7 @@ 2002-03-14 Marius Vollmer + * unif.c (singp): Use SCM_REALP instead of SCM_SLOPPY_REALP. + * snarf.h (SCM_SNARF_INIT): Add "^:^" after code so that guile-snarf can remove trailing non-init code. From 3939e9df35e397a4a8f969275a9ad031e95d9cad Mon Sep 17 00:00:00 2001 From: Neil Jerram Date: Fri, 15 Mar 2002 09:40:57 +0000 Subject: [PATCH 100/131] Change 3 instances of @var to @code in docstrings. --- libguile/ChangeLog | 6 ++++++ libguile/debug.c | 2 +- libguile/eval.c | 2 +- libguile/read.c | 2 +- 4 files changed, 9 insertions(+), 3 deletions(-) diff --git a/libguile/ChangeLog b/libguile/ChangeLog index 7606c53ac..738e23e86 100644 --- a/libguile/ChangeLog +++ b/libguile/ChangeLog @@ -1,3 +1,9 @@ +2002-03-15 Neil Jerram + + * debug.c (scm_debug_options), eval.c + (scm_eval_options_interface), read.c (scm_read_options): Change + incorrect @var in docstring to @code. + 2002-03-14 Marius Vollmer * unif.c (singp): Use SCM_REALP instead of SCM_SLOPPY_REALP. diff --git a/libguile/debug.c b/libguile/debug.c index c4078f5a4..a7e2e9932 100644 --- a/libguile/debug.c +++ b/libguile/debug.c @@ -76,7 +76,7 @@ SCM_DEFINE (scm_debug_options, "debug-options-interface", 0, 1, 0, (SCM setting), "Option interface for the debug options. Instead of using\n" "this procedure directly, use the procedures @code{debug-enable},\n" - "@code{debug-disable}, @code{debug-set!} and @var{debug-options}.") + "@code{debug-disable}, @code{debug-set!} and @code{debug-options}.") #define FUNC_NAME s_scm_debug_options { SCM ans; diff --git a/libguile/eval.c b/libguile/eval.c index a14653f91..523f7adb5 100644 --- a/libguile/eval.c +++ b/libguile/eval.c @@ -1779,7 +1779,7 @@ SCM_DEFINE (scm_eval_options_interface, "eval-options-interface", 0, 1, 0, (SCM setting), "Option interface for the evaluation options. Instead of using\n" "this procedure directly, use the procedures @code{eval-enable},\n" - "@code{eval-disable}, @code{eval-set!} and @var{eval-options}.") + "@code{eval-disable}, @code{eval-set!} and @code{eval-options}.") #define FUNC_NAME s_scm_eval_options_interface { SCM ans; diff --git a/libguile/read.c b/libguile/read.c index 5ac971977..36a9fff2d 100644 --- a/libguile/read.c +++ b/libguile/read.c @@ -79,7 +79,7 @@ SCM_DEFINE (scm_read_options, "read-options-interface", 0, 1, 0, (SCM setting), "Option interface for the read options. Instead of using\n" "this procedure directly, use the procedures @code{read-enable},\n" - "@code{read-disable}, @code{read-set!} and @var{read-options}.") + "@code{read-disable}, @code{read-set!} and @code{read-options}.") #define FUNC_NAME s_scm_read_options { SCM ans = scm_options (setting, From bb2c02f2374f85621aebb3bc016c53232ab80b20 Mon Sep 17 00:00:00 2001 From: Neil Jerram Date: Fri, 15 Mar 2002 10:37:40 +0000 Subject: [PATCH 101/131] Small docstring fixes. --- libguile/ChangeLog | 19 +++++++++++++++++++ libguile/backtrace.c | 2 +- libguile/filesys.c | 6 +++--- libguile/goops.c | 2 +- libguile/macros.c | 21 +++++++-------------- libguile/numbers.c | 6 +++--- libguile/ports.c | 2 +- libguile/posix.c | 8 ++++---- libguile/socket.c | 2 +- libguile/strings.c | 2 +- 10 files changed, 41 insertions(+), 29 deletions(-) diff --git a/libguile/ChangeLog b/libguile/ChangeLog index 738e23e86..f8f0924af 100644 --- a/libguile/ChangeLog +++ b/libguile/ChangeLog @@ -1,5 +1,24 @@ 2002-03-15 Neil Jerram + Docstring fixes: + + * strings.c (scm_string_p): Change unnecessary `iff' to `if'. + + * ports.c (scm_sys_make_void_port): Use `@file'. + + * numbers.c (scm_number_p, scm_real_p): Use `otherwise' rather + than `else'. + + * macros.c (scm_makmacro): Don't say that the form replaces its + source, because it doesn't. + (scm_makmmacro): Clarify difference between this and scm_makmacro. + + * backtrace.c (scm_display_error), filesys.c (scm_umask, + scm_select, scm_basename), goops.c (scm_method_generic_function), + numbers.c (scm_integer_length), posix.c (scm_getgroups, scm_execl, + scm_setlocale, scm_flock), socket.c (scm_shutdown): Correct + spelling mistakes. + * debug.c (scm_debug_options), eval.c (scm_eval_options_interface), read.c (scm_read_options): Change incorrect @var in docstring to @code. diff --git a/libguile/backtrace.c b/libguile/backtrace.c index 01ef26bbf..568e2b9f3 100644 --- a/libguile/backtrace.c +++ b/libguile/backtrace.c @@ -259,7 +259,7 @@ SCM_DEFINE (scm_display_error, "display-error", 6, 0, 0, (SCM stack, SCM port, SCM subr, SCM message, SCM args, SCM rest), "Display an error message to the output port @var{port}.\n" "@var{stack} is the saved stack for the error, @var{subr} is\n" - "the name of the procedure in which the error occured and\n" + "the name of the procedure in which the error occurred and\n" "@var{message} is the actual error message, which may contain\n" "formatting instructions. These will format the arguments in\n" "the list @var{args} accordingly. @var{rest} is currently\n" diff --git a/libguile/filesys.c b/libguile/filesys.c index 15ea034f6..fa7e75427 100644 --- a/libguile/filesys.c +++ b/libguile/filesys.c @@ -281,7 +281,7 @@ SCM_DEFINE (scm_chmod, "chmod", 2, 0, 0, SCM_DEFINE (scm_umask, "umask", 0, 1, 0, (SCM mode), - "If @var{mode} is omitted, retuns a decimal number representing the current\n" + "If @var{mode} is omitted, returns a decimal number representing the current\n" "file creation mask. Otherwise the file creation mask is set to\n" "@var{mode} and the previous value is returned.\n\n" "E.g., @code{(umask #o022)} sets the mask to octal 22, decimal 18.") @@ -1106,7 +1106,7 @@ retrieve_select_type (SELECT_TYPE *set, SCM ports_ready, SCM list_or_vec) SCM_DEFINE (scm_select, "select", 3, 2, 0, (SCM reads, SCM writes, SCM excepts, SCM secs, SCM usecs), "This procedure has a variety of uses: waiting for the ability\n" - "to provide input, accept output, or the existance of\n" + "to provide input, accept output, or the existence of\n" "exceptional conditions on a collection of ports or file\n" "descriptors, or waiting for a timeout to occur.\n" "It also returns if interrupted by a signal.\n\n" @@ -1499,7 +1499,7 @@ SCM_DEFINE (scm_basename, "basename", 1, 1, 0, (SCM filename, SCM suffix), "Return the base name of the file name @var{filename}. The\n" "base name is the file name without any directory components.\n" - "If @var{suffix} is privided, and is equal to the end of\n" + "If @var{suffix} is provided, and is equal to the end of\n" "@var{basename}, it is removed also.") #define FUNC_NAME s_scm_basename { diff --git a/libguile/goops.c b/libguile/goops.c index 560421e58..03acdb516 100644 --- a/libguile/goops.c +++ b/libguile/goops.c @@ -913,7 +913,7 @@ SCM_DEFINE (scm_generic_function_methods, "generic-function-methods", 1, 0, 0, SCM_DEFINE (scm_method_generic_function, "method-generic-function", 1, 0, 0, (SCM obj), - "Return the generic function fot the method @var{obj}.") + "Return the generic function for the method @var{obj}.") #define FUNC_NAME s_scm_method_generic_function { SCM_VALIDATE_METHOD (1, obj); diff --git a/libguile/macros.c b/libguile/macros.c index d53e94931..590010a0e 100644 --- a/libguile/macros.c +++ b/libguile/macros.c @@ -115,9 +115,7 @@ SCM_DEFINE (scm_makmacro, "procedure->macro", 1, 0, 0, "Return a @dfn{macro} which, when a symbol defined to this value\n" "appears as the first symbol in an expression, evaluates the\n" "result of applying @var{code} to the expression and the\n" - "environment. The value returned from @var{code} which has been\n" - "passed to @code{procedure->memoizing-macro} replaces the form\n" - "passed to @var{code}. For example:\n" + "environment. For example:\n" "\n" "@lisp\n" "(define trace\n" @@ -137,17 +135,12 @@ SCM_DEFINE (scm_makmmacro, "procedure->memoizing-macro", 1, 0, 0, (SCM code), "Return a @dfn{macro} which, when a symbol defined to this value\n" "appears as the first symbol in an expression, evaluates the\n" - "result of applying @var{proc} to the expression and the\n" - "environment. The value returned from @var{proc} which has been\n" - "passed to @code{procedure->memoizing-macro} replaces the form\n" - "passed to @var{proc}. For example:\n" - "\n" - "@lisp\n" - "(define trace\n" - " (procedure->macro\n" - " (lambda (x env) `(set! ,(cadr x) (tracef ,(cadr x) ',(cadr x))))))\n\n" - "(trace @i{foo}) @equiv{} (set! @i{foo} (tracef @i{foo} '@i{foo})).\n" - "@end lisp") + "result of applying @var{code} to the expression and the\n" + "environment.\n\n" + "@code{procedure->memoizing-macro} is the same as\n" + "@code{procedure->macro}, except that the expression returned by\n" + "@var{code} replaces the original macro expression in the memoized\n" + "form of the containing code.") #define FUNC_NAME s_scm_makmmacro { SCM_VALIDATE_PROC (1,code); diff --git a/libguile/numbers.c b/libguile/numbers.c index c7eb1f16e..453dace45 100644 --- a/libguile/numbers.c +++ b/libguile/numbers.c @@ -1332,7 +1332,7 @@ static const char scm_ilentab[] = { SCM_DEFINE (scm_integer_length, "integer-length", 1, 0, 0, (SCM n), - "Return the number of bits neccessary to represent @var{n}.\n" + "Return the number of bits necessary to represent @var{n}.\n" "\n" "@lisp\n" "(integer-length #b10101010)\n" @@ -2887,7 +2887,7 @@ SCM_REGISTER_PROC (s_number_p, "number?", 1, 0, 0, scm_number_p); SCM_DEFINE (scm_number_p, "complex?", 1, 0, 0, (SCM x), "Return @code{#t} if @var{x} is a complex number, @code{#f}\n" - "else. Note that the sets of real, rational and integer\n" + "otherwise. Note that the sets of real, rational and integer\n" "values form subsets of the set of complex numbers, i. e. the\n" "predicate will also be fulfilled if @var{x} is a real,\n" "rational or integer number.") @@ -2907,7 +2907,7 @@ SCM_REGISTER_PROC (s_real_p, "real?", 1, 0, 0, scm_real_p); SCM_DEFINE (scm_real_p, "rational?", 1, 0, 0, (SCM x), "Return @code{#t} if @var{x} is a rational number, @code{#f}\n" - "else. Note that the set of integer values forms a subset of\n" + "otherwise. Note that the set of integer values forms a subset of\n" "the set of rational numbers, i. e. the predicate will also be\n" "fulfilled if @var{x} is an integer number. Real numbers\n" "will also satisfy this predicate, because of their limited\n" diff --git a/libguile/ports.c b/libguile/ports.c index 1720cae01..fe9fcc6d6 100644 --- a/libguile/ports.c +++ b/libguile/ports.c @@ -1546,7 +1546,7 @@ scm_void_port (char *mode_str) SCM_DEFINE (scm_sys_make_void_port, "%make-void-port", 1, 0, 0, (SCM mode), "Create and return a new void port. A void port acts like\n" - "/dev/null. The @var{mode} argument\n" + "@file{/dev/null}. The @var{mode} argument\n" "specifies the input/output modes for this port: see the\n" "documentation for @code{open-file} in @ref{File Ports}.") #define FUNC_NAME s_scm_sys_make_void_port diff --git a/libguile/posix.c b/libguile/posix.c index ab84e5cef..49e432dc4 100644 --- a/libguile/posix.c +++ b/libguile/posix.c @@ -219,7 +219,7 @@ SCM_DEFINE (scm_pipe, "pipe", 0, 0, 0, SCM_DEFINE (scm_getgroups, "getgroups", 0, 0, 0, (), "Return a vector of integers representing the current\n" - "supplimentary group IDs.") + "supplementary group IDs.") #define FUNC_NAME s_scm_getgroups { SCM ans; @@ -864,7 +864,7 @@ SCM_DEFINE (scm_execl, "execl", 1, 0, 1, (SCM filename, SCM args), "Executes the file named by @var{path} as a new process image.\n" "The remaining arguments are supplied to the process; from a C program\n" - "they are accessable as the @code{argv} argument to @code{main}.\n" + "they are accessible as the @code{argv} argument to @code{main}.\n" "Conventionally the first @var{arg} is the same as @var{path}.\n" "All arguments must be strings.\n\n" "If @var{arg} is missing, @var{path} is executed with a null\n" @@ -1213,7 +1213,7 @@ SCM_DEFINE (scm_setlocale, "setlocale", 1, 1, 0, "Otherwise the specified locale category is set to the string\n" "@var{locale} and the new value is returned as a\n" "system-dependent string. If @var{locale} is an empty string,\n" - "the locale will be set using envirionment variables.") + "the locale will be set using environment variables.") #define FUNC_NAME s_scm_setlocale { char *clocale; @@ -1586,7 +1586,7 @@ SCM_DEFINE (scm_flock, "flock", 2, 0, 0, "it to one of the other operations.\n" "@end table\n" "The return value is not specified. @var{file} may be an open\n" - "file descriptor or an open file descriptior port.") + "file descriptor or an open file descriptor port.") #define FUNC_NAME s_scm_flock { int coperation, fdes; diff --git a/libguile/socket.c b/libguile/socket.c index 804172e5e..86b61aca1 100644 --- a/libguile/socket.c +++ b/libguile/socket.c @@ -655,7 +655,7 @@ SCM_DEFINE (scm_setsockopt, "setsockopt", 4, 0, 0, SCM_DEFINE (scm_shutdown, "shutdown", 2, 0, 0, (SCM sock, SCM how), "Sockets can be closed simply by using @code{close-port}. The\n" - "@code{shutdown} procedure allows reception or tranmission on a\n" + "@code{shutdown} procedure allows reception or transmission on a\n" "connection to be shut down individually, according to the parameter\n" "@var{how}:\n\n" "@table @asis\n" diff --git a/libguile/strings.c b/libguile/strings.c index 8cd9815a5..4f5b48b18 100644 --- a/libguile/strings.c +++ b/libguile/strings.c @@ -58,7 +58,7 @@ SCM_DEFINE (scm_string_p, "string?", 1, 0, 0, (SCM obj), - "Return @code{#t} iff @var{obj} is a string, else @code{#f}.") + "Return @code{#t} if @var{obj} is a string, else @code{#f}.") #define FUNC_NAME s_scm_string_p { return SCM_BOOL (SCM_STRINGP (obj)); From 77b26c9397437a0088df189581c2a48250466bb6 Mon Sep 17 00:00:00 2001 From: Thien-Thi Nguyen Date: Fri, 15 Mar 2002 14:00:02 +0000 Subject: [PATCH 102/131] Remove "--compat=1.4" support. Add "-d" and "-D" support. (deprecated_list): New var. (compat_mode_clean_xxx): Delete. (grep_deprecated): New func. ("main"): If "-d" or "-D", call `grep_deprecated'. --- libguile/guile-snarf.in | 52 +++++++++++++++++++++++++++-------------- 1 file changed, 34 insertions(+), 18 deletions(-) diff --git a/libguile/guile-snarf.in b/libguile/guile-snarf.in index 2d4c2dc97..38b8da780 100644 --- a/libguile/guile-snarf.in +++ b/libguile/guile-snarf.in @@ -20,7 +20,7 @@ # Commentary: -# Usage: guile-snarf [--compat=1.4] [-o OUTFILE] INFILE [CPP-OPTIONS ...] +# Usage: guile-snarf [-d | -D] [-o OUTFILE] INFILE [CPP-OPTIONS ...] # # Process INFILE using the C pre-processor and some other programs. # Write output to a file, named OUTFILE if specified, or STEM.x if @@ -32,14 +32,25 @@ # If there are errors during processing, delete OUTFILE and exit with # non-zero status. # -# Optional arg "--compat=1.4" means emulate guile-1.4 guile-snarf. -# This option is easily misunderstood -- see Guile reference manual. +# Optional arg "-d" means grep INFILE for deprecated macros and +# issue a warning if any are found. Alternatively, "-D" means +# do the same thing but signal error and exit w/ non-zero status. # # If env var CPP is set, use its value instead of the C pre-processor # determined at Guile configure-time: "@CPP@". # Code: +## config + +deprecated_list=" + SCM_CONST_LONG + SCM_VCELL + SCM_VCELL_INIT + SCM_GLOBAL_VCELL + SCM_GLOBAL_VCELL_INIT +" + ## funcs modern_snarf () # writes stdout @@ -48,17 +59,20 @@ ${cpp} -DSCM_MAGIC_SNARF_INITS "$@" > ${temp} && cpp_ok_p=true grep "^ *\^ *\^" ${temp} | sed -e "s/^ *\^ *\^//" -e "s/\^\ *:\ *\^.*/;/" } -compat_mode_clean_xxx () # modifies $1 +grep_deprecated () # $1 is the filename { -filename=$1 -cp $filename ${temp} -sed -e 's/SCM_CONST_LONG/SCM_GLOBAL_VCELL_INIT/g' \ - -e 's/SCM_GLOBAL_VCELL_INIT/SCM_GLOBAL_VARIABLE_INIT/g' \ - -e 's/SCM_GLOBAL_VCELL/SCM_GLOBAL_VARIABLE/g' \ - -e 's/SCM_VCELL_INIT/SCM_VARIABLE_INIT/g' \ - -e 's/SCM_VCELL/SCM_VARIABLE/g' \ - < ${temp} \ - > $filename +regexp="(^greetings!spooks!hows!life)" +for dep in `echo $deprecated_list` ; do + regexp="(^${dep}[^_A-Z])|${regexp}" +done +echo $regexp +egrep -n ${regexp} $1 /dev/null > ${temp} +if [ -s ${temp} ] ; then + if $grep_dep_exit_p ; then hey=ERROR ; else hey=WARNING ; fi + echo $0: $hey: deprecated macros found: + sed -e 's/.clean.c:/:/g' ${temp} + $grep_dep_exit_p && exit 1 +fi } ## main @@ -69,10 +83,10 @@ if [ x"$1" = x--help ] ; then | sed -e 1,2d -e 's/^. *//g' exit 0 fi -if [ x"$1" = x--compat=1.4 ] - then compat_mode_p=true ; shift - else compat_mode_p=false -fi +case x"$1" in x-d) grep_dep_p=true ; grep_dep_exit_p=false ; shift ;; + x-D) grep_dep_p=true ; grep_dep_exit_p=true ; shift ;; + *) grep_dep_p=false ;; +esac if [ x"$1" = x-o ] then outfile=$2 ; shift ; shift ; infile=$1 ; shift else infile=$1 ; shift ; outfile=`basename $infile .c`.x @@ -94,7 +108,9 @@ trap "rm -f $temp $clean_infile" 0 1 2 15 # clean input file grep -v "$self_blind_regexp" $infile > $clean_infile -$compat_mode_p && compat_mode_clean_xxx $clean_infile + +# grep deprecated +$grep_dep_p && grep_deprecated $clean_infile # do the snarfing -- output something extra for needy cpp programs (AIX) { echo "/* source: $infile */" ; From a6d344d3475e5e2731ef62bac34626b875273d79 Mon Sep 17 00:00:00 2001 From: Thien-Thi Nguyen Date: Fri, 15 Mar 2002 14:02:18 +0000 Subject: [PATCH 103/131] *** empty log message *** --- libguile/ChangeLog | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/libguile/ChangeLog b/libguile/ChangeLog index f8f0924af..61a468b5b 100644 --- a/libguile/ChangeLog +++ b/libguile/ChangeLog @@ -1,7 +1,17 @@ +2002-03-15 Thien-Thi Nguyen + + * guile-snarf.in: Remove "--compat=1.4" support. + Add "-d" and "-D" support. + + (deprecated_list): New var. + (compat_mode_clean_xxx): Delete. + (grep_deprecated): New func. + ("main"): If "-d" or "-D", call `grep_deprecated'. + 2002-03-15 Neil Jerram Docstring fixes: - + * strings.c (scm_string_p): Change unnecessary `iff' to `if'. * ports.c (scm_sys_make_void_port): Use `@file'. From 198586ed746e9a0288a443cb1c0b335e244461b9 Mon Sep 17 00:00:00 2001 From: Neil Jerram Date: Fri, 15 Mar 2002 14:03:53 +0000 Subject: [PATCH 104/131] Manual updates. --- doc/maint/ChangeLog | 4 + doc/maint/guile.texi | 764 ++------------------------------- doc/ref/ChangeLog | 14 + doc/ref/guile.texi | 31 +- doc/ref/new-docstrings.texi | 4 +- doc/ref/scheme-data.texi | 6 +- doc/ref/scheme-debug.texi | 2 +- doc/ref/scheme-io.texi | 2 +- doc/ref/scheme-memory.texi | 4 +- doc/ref/scheme-procedures.texi | 4 +- doc/ref/scheme-utility.texi | 158 +++++-- doc/ref/scripts.texi | 1 + 12 files changed, 194 insertions(+), 800 deletions(-) diff --git a/doc/maint/ChangeLog b/doc/maint/ChangeLog index 013a5377d..a01af41b7 100644 --- a/doc/maint/ChangeLog +++ b/doc/maint/ChangeLog @@ -1,3 +1,7 @@ +2002-03-15 Neil Jerram + + * guile.texi: Replaced by regenerated libguile version. + 2002-03-12 Neil Jerram * guile.texi: Replaced by regenerated libguile version. diff --git a/doc/maint/guile.texi b/doc/maint/guile.texi index 516591987..ed7576b51 100644 --- a/doc/maint/guile.texi +++ b/doc/maint/guile.texi @@ -1,6 +1,5 @@ acons -@c snarfed from alist.c:59 @deffn {Scheme Procedure} acons key value alist @deffnx {C Function} scm_acons (key, value, alist) Add a new key-value pair to @var{alist}. A new pair is @@ -10,7 +9,6 @@ function is @emph{not} destructive; @var{alist} is not modified. @end deffn sloppy-assq -@c snarfed from alist.c:73 @deffn {Scheme Procedure} sloppy-assq key alist @deffnx {C Function} scm_sloppy_assq (key, alist) Behaves like @code{assq} but does not do any error checking. @@ -18,7 +16,6 @@ Recommended only for use in Guile internals. @end deffn sloppy-assv -@c snarfed from alist.c:91 @deffn {Scheme Procedure} sloppy-assv key alist @deffnx {C Function} scm_sloppy_assv (key, alist) Behaves like @code{assv} but does not do any error checking. @@ -26,7 +23,6 @@ Recommended only for use in Guile internals. @end deffn sloppy-assoc -@c snarfed from alist.c:109 @deffn {Scheme Procedure} sloppy-assoc key alist @deffnx {C Function} scm_sloppy_assoc (key, alist) Behaves like @code{assoc} but does not do any error checking. @@ -34,7 +30,6 @@ Recommended only for use in Guile internals. @end deffn assq -@c snarfed from alist.c:136 @deffn {Scheme Procedure} assq key alist @deffnx {Scheme Procedure} assv key alist @deffnx {Scheme Procedure} assoc key alist @@ -49,21 +44,18 @@ return the entire alist entry found (i.e. both the key and the value). @end deffn assv -@c snarfed from alist.c:157 @deffn {Scheme Procedure} assv key alist @deffnx {C Function} scm_assv (key, alist) Behaves like @code{assq} but uses @code{eqv?} for key comparison. @end deffn assoc -@c snarfed from alist.c:178 @deffn {Scheme Procedure} assoc key alist @deffnx {C Function} scm_assoc (key, alist) Behaves like @code{assq} but uses @code{equal?} for key comparison. @end deffn assq-ref -@c snarfed from alist.c:222 @deffn {Scheme Procedure} assq-ref alist key @deffnx {Scheme Procedure} assv-ref alist key @deffnx {Scheme Procedure} assoc-ref alist key @@ -81,21 +73,18 @@ where @var{associator} is one of @code{assq}, @code{assv} or @code{assoc}. @end deffn assv-ref -@c snarfed from alist.c:239 @deffn {Scheme Procedure} assv-ref alist key @deffnx {C Function} scm_assv_ref (alist, key) Behaves like @code{assq-ref} but uses @code{eqv?} for key comparison. @end deffn assoc-ref -@c snarfed from alist.c:256 @deffn {Scheme Procedure} assoc-ref alist key @deffnx {C Function} scm_assoc_ref (alist, key) Behaves like @code{assq-ref} but uses @code{equal?} for key comparison. @end deffn assq-set! -@c snarfed from alist.c:285 @deffn {Scheme Procedure} assq-set! alist key val @deffnx {Scheme Procedure} assv-set! alist key value @deffnx {Scheme Procedure} assoc-set! alist key value @@ -111,21 +100,18 @@ association list. @end deffn assv-set! -@c snarfed from alist.c:303 @deffn {Scheme Procedure} assv-set! alist key val @deffnx {C Function} scm_assv_set_x (alist, key, val) Behaves like @code{assq-set!} but uses @code{eqv?} for key comparison. @end deffn assoc-set! -@c snarfed from alist.c:321 @deffn {Scheme Procedure} assoc-set! alist key val @deffnx {C Function} scm_assoc_set_x (alist, key, val) Behaves like @code{assq-set!} but uses @code{equal?} for key comparison. @end deffn assq-remove! -@c snarfed from alist.c:345 @deffn {Scheme Procedure} assq-remove! alist key @deffnx {Scheme Procedure} assv-remove! alist key @deffnx {Scheme Procedure} assoc-remove! alist key @@ -135,21 +121,18 @@ the resulting alist. @end deffn assv-remove! -@c snarfed from alist.c:361 @deffn {Scheme Procedure} assv-remove! alist key @deffnx {C Function} scm_assv_remove_x (alist, key) Behaves like @code{assq-remove!} but uses @code{eqv?} for key comparison. @end deffn assoc-remove! -@c snarfed from alist.c:377 @deffn {Scheme Procedure} assoc-remove! alist key @deffnx {C Function} scm_assoc_remove_x (alist, key) Behaves like @code{assq-remove!} but uses @code{equal?} for key comparison. @end deffn make-arbiter -@c snarfed from arbiters.c:82 @deffn {Scheme Procedure} make-arbiter name @deffnx {C Function} scm_make_arbiter (name) Return an object of type arbiter and name @var{name}. Its @@ -158,7 +141,6 @@ process synchronization. @end deffn try-arbiter -@c snarfed from arbiters.c:92 @deffn {Scheme Procedure} try-arbiter arb @deffnx {C Function} scm_try_arbiter (arb) Return @code{#t} and lock the arbiter @var{arb} if the arbiter @@ -166,7 +148,6 @@ was unlocked. Otherwise, return @code{#f}. @end deffn release-arbiter -@c snarfed from arbiters.c:113 @deffn {Scheme Procedure} release-arbiter arb @deffnx {C Function} scm_release_arbiter (arb) Return @code{#t} and unlock the arbiter @var{arb} if the @@ -174,14 +155,12 @@ arbiter was locked. Otherwise, return @code{#f}. @end deffn async -@c snarfed from async.c:289 @deffn {Scheme Procedure} async thunk @deffnx {C Function} scm_async (thunk) Create a new async for the procedure @var{thunk}. @end deffn system-async -@c snarfed from async.c:299 @deffn {Scheme Procedure} system-async thunk @deffnx {C Function} scm_system_async (thunk) Create a new async for the procedure @var{thunk}. Also @@ -189,28 +168,24 @@ add it to the system's list of active async objects. @end deffn async-mark -@c snarfed from async.c:310 @deffn {Scheme Procedure} async-mark a @deffnx {C Function} scm_async_mark (a) Mark the async @var{a} for future execution. @end deffn system-async-mark -@c snarfed from async.c:326 @deffn {Scheme Procedure} system-async-mark a @deffnx {C Function} scm_system_async_mark (a) Mark the async @var{a} for future execution. @end deffn run-asyncs -@c snarfed from async.c:351 @deffn {Scheme Procedure} run-asyncs list_of_a @deffnx {C Function} scm_run_asyncs (list_of_a) Execute all thunks from the asyncs of the list @var{list_of_a}. @end deffn noop -@c snarfed from async.c:385 @deffn {Scheme Procedure} noop . args @deffnx {C Function} scm_noop (args) Do nothing. When called without arguments, return @code{#f}, @@ -218,26 +193,23 @@ otherwise return the first argument. @end deffn unmask-signals -@c snarfed from async.c:437 @deffn {Scheme Procedure} unmask-signals @deffnx {C Function} scm_unmask_signals () Unmask signals. The returned value is not specified. @end deffn mask-signals -@c snarfed from async.c:448 @deffn {Scheme Procedure} mask-signals @deffnx {C Function} scm_mask_signals () Mask signals. The returned value is not specified. @end deffn display-error -@c snarfed from backtrace.c:266 @deffn {Scheme Procedure} display-error stack port subr message args rest @deffnx {C Function} scm_display_error (stack, port, subr, message, args, rest) Display an error message to the output port @var{port}. @var{stack} is the saved stack for the error, @var{subr} is -the name of the procedure in which the error occured and +the name of the procedure in which the error occurred and @var{message} is the actual error message, which may contain formatting instructions. These will format the arguments in the list @var{args} accordingly. @var{rest} is currently @@ -245,7 +217,6 @@ ignored. @end deffn display-application -@c snarfed from backtrace.c:402 @deffn {Scheme Procedure} display-application frame [port [indent]] @deffnx {C Function} scm_display_application (frame, port, indent) Display a procedure application @var{frame} to the output port @@ -254,7 +225,6 @@ output. @end deffn display-backtrace -@c snarfed from backtrace.c:713 @deffn {Scheme Procedure} display-backtrace stack port [first [depth]] @deffnx {C Function} scm_display_backtrace (stack, port, first, depth) Display a backtrace to the output port @var{port}. @var{stack} @@ -265,7 +235,6 @@ which means that default values will be used. @end deffn backtrace -@c snarfed from backtrace.c:736 @deffn {Scheme Procedure} backtrace @deffnx {C Function} scm_backtrace () Display a backtrace of the stack saved by the last error @@ -273,97 +242,83 @@ to the current output port. @end deffn not -@c snarfed from boolean.c:55 @deffn {Scheme Procedure} not x @deffnx {C Function} scm_not (x) Return @code{#t} iff @var{x} is @code{#f}, else return @code{#f}. @end deffn boolean? -@c snarfed from boolean.c:65 @deffn {Scheme Procedure} boolean? obj @deffnx {C Function} scm_boolean_p (obj) Return @code{#t} iff @var{obj} is either @code{#t} or @code{#f}. @end deffn char? -@c snarfed from chars.c:54 @deffn {Scheme Procedure} char? x @deffnx {C Function} scm_char_p (x) Return @code{#t} iff @var{x} is a character, else @code{#f}. @end deffn char=? -@c snarfed from chars.c:63 @deffn {Scheme Procedure} char=? x y Return @code{#t} iff @var{x} is the same character as @var{y}, else @code{#f}. @end deffn char? -@c snarfed from chars.c:100 @deffn {Scheme Procedure} char>? x y Return @code{#t} iff @var{x} is greater than @var{y} in the ASCII sequence, else @code{#f}. @end deffn char>=? -@c snarfed from chars.c:112 @deffn {Scheme Procedure} char>=? x y Return @code{#t} iff @var{x} is greater than or equal to @var{y} in the ASCII sequence, else @code{#f}. @end deffn char-ci=? -@c snarfed from chars.c:124 @deffn {Scheme Procedure} char-ci=? x y Return @code{#t} iff @var{x} is the same character as @var{y} ignoring case, else @code{#f}. @end deffn char-ci? -@c snarfed from chars.c:160 @deffn {Scheme Procedure} char-ci>? x y Return @code{#t} iff @var{x} is greater than @var{y} in the ASCII sequence ignoring case, else @code{#f}. @end deffn char-ci>=? -@c snarfed from chars.c:172 @deffn {Scheme Procedure} char-ci>=? x y Return @code{#t} iff @var{x} is greater than or equal to @var{y} in the ASCII sequence ignoring case, else @code{#f}. @end deffn char-alphabetic? -@c snarfed from chars.c:185 @deffn {Scheme Procedure} char-alphabetic? chr @deffnx {C Function} scm_char_alphabetic_p (chr) Return @code{#t} iff @var{chr} is alphabetic, else @code{#f}. @@ -371,7 +326,6 @@ Alphabetic means the same thing as the isalpha C library function. @end deffn char-numeric? -@c snarfed from chars.c:196 @deffn {Scheme Procedure} char-numeric? chr @deffnx {C Function} scm_char_numeric_p (chr) Return @code{#t} iff @var{chr} is numeric, else @code{#f}. @@ -379,7 +333,6 @@ Numeric means the same thing as the isdigit C library function. @end deffn char-whitespace? -@c snarfed from chars.c:207 @deffn {Scheme Procedure} char-whitespace? chr @deffnx {C Function} scm_char_whitespace_p (chr) Return @code{#t} iff @var{chr} is whitespace, else @code{#f}. @@ -387,7 +340,6 @@ Whitespace means the same thing as the isspace C library function. @end deffn char-upper-case? -@c snarfed from chars.c:220 @deffn {Scheme Procedure} char-upper-case? chr @deffnx {C Function} scm_char_upper_case_p (chr) Return @code{#t} iff @var{chr} is uppercase, else @code{#f}. @@ -395,7 +347,6 @@ Uppercase means the same thing as the isupper C library function. @end deffn char-lower-case? -@c snarfed from chars.c:232 @deffn {Scheme Procedure} char-lower-case? chr @deffnx {C Function} scm_char_lower_case_p (chr) Return @code{#t} iff @var{chr} is lowercase, else @code{#f}. @@ -403,7 +354,6 @@ Lowercase means the same thing as the islower C library function. @end deffn char-is-both? -@c snarfed from chars.c:246 @deffn {Scheme Procedure} char-is-both? chr @deffnx {C Function} scm_char_is_both_p (chr) Return @code{#t} iff @var{chr} is either uppercase or lowercase, else @code{#f}. @@ -412,7 +362,6 @@ C library functions. @end deffn char->integer -@c snarfed from chars.c:260 @deffn {Scheme Procedure} char->integer chr @deffnx {C Function} scm_char_to_integer (chr) Return the number corresponding to ordinal position of @var{chr} in the @@ -420,86 +369,74 @@ ASCII sequence. @end deffn integer->char -@c snarfed from chars.c:272 @deffn {Scheme Procedure} integer->char n @deffnx {C Function} scm_integer_to_char (n) Return the character at position @var{n} in the ASCII sequence. @end deffn char-upcase -@c snarfed from chars.c:283 @deffn {Scheme Procedure} char-upcase chr @deffnx {C Function} scm_char_upcase (chr) Return the uppercase character version of @var{chr}. @end deffn char-downcase -@c snarfed from chars.c:294 @deffn {Scheme Procedure} char-downcase chr @deffnx {C Function} scm_char_downcase (chr) Return the lowercase character version of @var{chr}. @end deffn debug-options-interface -@c snarfed from debug.c:79 @deffn {Scheme Procedure} debug-options-interface [setting] @deffnx {C Function} scm_debug_options (setting) Option interface for the debug options. Instead of using this procedure directly, use the procedures @code{debug-enable}, -@code{debug-disable}, @code{debug-set!} and @var{debug-options}. +@code{debug-disable}, @code{debug-set!} and @code{debug-options}. @end deffn with-traps -@c snarfed from debug.c:127 @deffn {Scheme Procedure} with-traps thunk @deffnx {C Function} scm_with_traps (thunk) Call @var{thunk} with traps enabled. @end deffn memoized? -@c snarfed from debug.c:169 @deffn {Scheme Procedure} memoized? obj @deffnx {C Function} scm_memoized_p (obj) Return @code{#t} if @var{obj} is memoized. @end deffn unmemoize -@c snarfed from debug.c:333 @deffn {Scheme Procedure} unmemoize m @deffnx {C Function} scm_unmemoize (m) Unmemoize the memoized expression @var{m}, @end deffn memoized-environment -@c snarfed from debug.c:343 @deffn {Scheme Procedure} memoized-environment m @deffnx {C Function} scm_memoized_environment (m) Return the environment of the memoized expression @var{m}. @end deffn procedure-name -@c snarfed from debug.c:353 @deffn {Scheme Procedure} procedure-name proc @deffnx {C Function} scm_procedure_name (proc) Return the name of the procedure @var{proc} @end deffn procedure-source -@c snarfed from debug.c:379 @deffn {Scheme Procedure} procedure-source proc @deffnx {C Function} scm_procedure_source (proc) Return the source of the procedure @var{proc}. @end deffn procedure-environment -@c snarfed from debug.c:412 @deffn {Scheme Procedure} procedure-environment proc @deffnx {C Function} scm_procedure_environment (proc) Return the environment of the procedure @var{proc}. @end deffn local-eval -@c snarfed from debug.c:444 @deffn {Scheme Procedure} local-eval exp [env] @deffnx {C Function} scm_local_eval (exp, env) Evaluate @var{exp} in its environment. If @var{env} is supplied, @@ -509,14 +446,12 @@ is implicit). @end deffn debug-object? -@c snarfed from debug.c:531 @deffn {Scheme Procedure} debug-object? obj @deffnx {C Function} scm_debug_object_p (obj) Return @code{#t} if @var{obj} is a debug object. @end deffn dynamic-link -@c snarfed from dynl.c:266 @deffn {Scheme Procedure} dynamic-link filename @deffnx {C Function} scm_dynamic_link (filename) Open the dynamic library called @var{filename}. A library @@ -526,7 +461,6 @@ functions. @end deffn dynamic-object? -@c snarfed from dynl.c:281 @deffn {Scheme Procedure} dynamic-object? obj @deffnx {C Function} scm_dynamic_object_p (obj) Return @code{#t} if @var{obj} is a dynamic library handle, or @code{#f} @@ -534,7 +468,6 @@ otherwise. @end deffn dynamic-unlink -@c snarfed from dynl.c:294 @deffn {Scheme Procedure} dynamic-unlink dobj @deffnx {C Function} scm_dynamic_unlink (dobj) Unlink the indicated object file from the application. The @@ -544,7 +477,6 @@ called on @var{dobj}, its content is no longer accessible. @end deffn dynamic-func -@c snarfed from dynl.c:321 @deffn {Scheme Procedure} dynamic-func name dobj @deffnx {C Function} scm_dynamic_func (name, dobj) Search the dynamic object @var{dobj} for the C function @@ -559,7 +491,6 @@ needed or not and will add it when necessary. @end deffn dynamic-call -@c snarfed from dynl.c:360 @deffn {Scheme Procedure} dynamic-call func dobj @deffnx {C Function} scm_dynamic_call (func, dobj) Call the C function indicated by @var{func} and @var{dobj}. @@ -577,7 +508,6 @@ Interrupts are deferred while the C function is executing (with @end deffn dynamic-args-call -@c snarfed from dynl.c:388 @deffn {Scheme Procedure} dynamic-args-call func dobj args @deffnx {C Function} scm_dynamic_args_call (func, dobj, args) Call the C function indicated by @var{func} and @var{dobj}, @@ -596,7 +526,6 @@ converted to a Scheme number and returned from the call to @end deffn dynamic-wind -@c snarfed from dynwind.c:119 @deffn {Scheme Procedure} dynamic-wind in_guard thunk out_guard @deffnx {C Function} scm_dynamic_wind (in_guard, thunk, out_guard) All three arguments must be 0-argument procedures. @@ -650,7 +579,6 @@ a-cont @end deffn environment? -@c snarfed from environments.c:129 @deffn {Scheme Procedure} environment? obj @deffnx {C Function} scm_environment_p (obj) Return @code{#t} if @var{obj} is an environment, or @code{#f} @@ -658,7 +586,6 @@ otherwise. @end deffn environment-bound? -@c snarfed from environments.c:140 @deffn {Scheme Procedure} environment-bound? env sym @deffnx {C Function} scm_environment_bound_p (env, sym) Return @code{#t} if @var{sym} is bound in @var{env}, or @@ -666,7 +593,6 @@ Return @code{#t} if @var{sym} is bound in @var{env}, or @end deffn environment-ref -@c snarfed from environments.c:155 @deffn {Scheme Procedure} environment-ref env sym @deffnx {C Function} scm_environment_ref (env, sym) Return the value of the location bound to @var{sym} in @@ -675,7 +601,6 @@ Return the value of the location bound to @var{sym} in @end deffn environment-fold -@c snarfed from environments.c:225 @deffn {Scheme Procedure} environment-fold env proc init @deffnx {C Function} scm_environment_fold (env, proc, init) Iterate over all the bindings in @var{env}, accumulating some @@ -712,7 +637,6 @@ using environment-fold: @end deffn environment-define -@c snarfed from environments.c:260 @deffn {Scheme Procedure} environment-define env sym val @deffnx {C Function} scm_environment_define (env, sym, val) Bind @var{sym} to a new location containing @var{val} in @@ -725,7 +649,6 @@ immutable, signal an @code{environment:immutable-binding} error. @end deffn environment-undefine -@c snarfed from environments.c:286 @deffn {Scheme Procedure} environment-undefine env sym @deffnx {C Function} scm_environment_undefine (env, sym) Remove any binding for @var{sym} from @var{env}. If @var{sym} @@ -736,7 +659,6 @@ immutable, signal an @code{environment:immutable-binding} error. @end deffn environment-set! -@c snarfed from environments.c:314 @deffn {Scheme Procedure} environment-set! env sym val @deffnx {C Function} scm_environment_set_x (env, sym, val) If @var{env} binds @var{sym} to some location, change that @@ -749,7 +671,6 @@ to an immutable location, signal an @end deffn environment-cell -@c snarfed from environments.c:349 @deffn {Scheme Procedure} environment-cell env sym for_write @deffnx {C Function} scm_environment_cell (env, sym, for_write) Return the value cell which @var{env} binds to @var{sym}, or @@ -767,7 +688,6 @@ re-bound to a new value cell, or becomes undefined. @end deffn environment-observe -@c snarfed from environments.c:401 @deffn {Scheme Procedure} environment-observe env proc @deffnx {C Function} scm_environment_observe (env, proc) Whenever @var{env}'s bindings change, apply @var{proc} to @@ -779,7 +699,6 @@ token is unspecified. @end deffn environment-observe-weak -@c snarfed from environments.c:418 @deffn {Scheme Procedure} environment-observe-weak env proc @deffnx {C Function} scm_environment_observe_weak (env, proc) This function is the same as environment-observe, except that @@ -791,7 +710,6 @@ list of observing procedures. @end deffn environment-unobserve -@c snarfed from environments.c:454 @deffn {Scheme Procedure} environment-unobserve token @deffnx {C Function} scm_environment_unobserve (token) Cancel the observation request which returned the value @@ -803,7 +721,6 @@ bindings change. @end deffn make-leaf-environment -@c snarfed from environments.c:1031 @deffn {Scheme Procedure} make-leaf-environment @deffnx {C Function} scm_make_leaf_environment () Create a new leaf environment, containing no bindings. @@ -812,7 +729,6 @@ will be mutable. @end deffn leaf-environment? -@c snarfed from environments.c:1054 @deffn {Scheme Procedure} leaf-environment? object @deffnx {C Function} scm_leaf_environment_p (object) Return @code{#t} if object is a leaf environment, or @code{#f} @@ -820,7 +736,6 @@ otherwise. @end deffn make-eval-environment -@c snarfed from environments.c:1419 @deffn {Scheme Procedure} make-eval-environment local imported @deffnx {C Function} scm_make_eval_environment (local, imported) Return a new environment object eval whose bindings are the @@ -847,7 +762,6 @@ In typical use, @var{local} will be a finite environment, and @end deffn eval-environment? -@c snarfed from environments.c:1456 @deffn {Scheme Procedure} eval-environment? object @deffnx {C Function} scm_eval_environment_p (object) Return @code{#t} if object is an eval environment, or @code{#f} @@ -855,35 +769,30 @@ otherwise. @end deffn eval-environment-local -@c snarfed from environments.c:1466 @deffn {Scheme Procedure} eval-environment-local env @deffnx {C Function} scm_eval_environment_local (env) Return the local environment of eval environment @var{env}. @end deffn eval-environment-set-local! -@c snarfed from environments.c:1478 @deffn {Scheme Procedure} eval-environment-set-local! env local @deffnx {C Function} scm_eval_environment_set_local_x (env, local) Change @var{env}'s local environment to @var{local}. @end deffn eval-environment-imported -@c snarfed from environments.c:1504 @deffn {Scheme Procedure} eval-environment-imported env @deffnx {C Function} scm_eval_environment_imported (env) Return the imported environment of eval environment @var{env}. @end deffn eval-environment-set-imported! -@c snarfed from environments.c:1516 @deffn {Scheme Procedure} eval-environment-set-imported! env imported @deffnx {C Function} scm_eval_environment_set_imported_x (env, imported) Change @var{env}'s imported environment to @var{imported}. @end deffn make-import-environment -@c snarfed from environments.c:1839 @deffn {Scheme Procedure} make-import-environment imports conflict_proc @deffnx {C Function} scm_make_import_environment (imports, conflict_proc) Return a new environment @var{imp} whose bindings are the union @@ -914,7 +823,6 @@ if one of its imported environments changes. @end deffn import-environment? -@c snarfed from environments.c:1868 @deffn {Scheme Procedure} import-environment? object @deffnx {C Function} scm_import_environment_p (object) Return @code{#t} if object is an import environment, or @@ -922,7 +830,6 @@ Return @code{#t} if object is an import environment, or @end deffn import-environment-imports -@c snarfed from environments.c:1879 @deffn {Scheme Procedure} import-environment-imports env @deffnx {C Function} scm_import_environment_imports (env) Return the list of environments imported by the import @@ -930,7 +837,6 @@ environment @var{env}. @end deffn import-environment-set-imports! -@c snarfed from environments.c:1892 @deffn {Scheme Procedure} import-environment-set-imports! env imports @deffnx {C Function} scm_import_environment_set_imports_x (env, imports) Change @var{env}'s list of imported environments to @@ -938,7 +844,6 @@ Change @var{env}'s list of imported environments to @end deffn make-export-environment -@c snarfed from environments.c:2159 @deffn {Scheme Procedure} make-export-environment private signature @deffnx {C Function} scm_make_export_environment (private, signature) Return a new environment @var{exp} containing only those @@ -988,7 +893,6 @@ if the bindings in private change. @end deffn export-environment? -@c snarfed from environments.c:2194 @deffn {Scheme Procedure} export-environment? object @deffnx {C Function} scm_export_environment_p (object) Return @code{#t} if object is an export environment, or @@ -996,35 +900,30 @@ Return @code{#t} if object is an export environment, or @end deffn export-environment-private -@c snarfed from environments.c:2204 @deffn {Scheme Procedure} export-environment-private env @deffnx {C Function} scm_export_environment_private (env) Return the private environment of export environment @var{env}. @end deffn export-environment-set-private! -@c snarfed from environments.c:2216 @deffn {Scheme Procedure} export-environment-set-private! env private @deffnx {C Function} scm_export_environment_set_private_x (env, private) Change the private environment of export environment @var{env}. @end deffn export-environment-signature -@c snarfed from environments.c:2238 @deffn {Scheme Procedure} export-environment-signature env @deffnx {C Function} scm_export_environment_signature (env) Return the signature of export environment @var{env}. @end deffn export-environment-set-signature! -@c snarfed from environments.c:2312 @deffn {Scheme Procedure} export-environment-set-signature! env signature @deffnx {C Function} scm_export_environment_set_signature_x (env, signature) Change the signature of export environment @var{env}. @end deffn eq? -@c snarfed from eq.c:62 @deffn {Scheme Procedure} eq? x y Return @code{#t} iff @var{x} references the same object as @var{y}. @code{eq?} is similar to @code{eqv?} except that in some cases it is @@ -1033,7 +932,6 @@ capable of discerning distinctions finer than those detectable by @end deffn eqv? -@c snarfed from eq.c:76 @deffn {Scheme Procedure} eqv? x y The @code{eqv?} procedure defines a useful equivalence relation on objects. Briefly, it returns @code{#t} if @var{x} and @var{y} should normally be @@ -1043,7 +941,6 @@ and inexact numbers. @end deffn equal? -@c snarfed from eq.c:125 @deffn {Scheme Procedure} equal? x y Return @code{#t} iff @var{x} and @var{y} are recursively @code{eqv?} equivalent. @code{equal?} recursively compares the contents of pairs, @@ -1054,7 +951,6 @@ terminate if its arguments are circular data structures. @end deffn scm-error -@c snarfed from error.c:117 @deffn {Scheme Procedure} scm-error key subr message args data @deffnx {C Function} scm_error_scm (key, subr, message, args, data) Raise an error with key @var{key}. @var{subr} can be a string @@ -1073,7 +969,6 @@ it will usually be @code{#f}. @end deffn strerror -@c snarfed from error.c:168 @deffn {Scheme Procedure} strerror err @deffnx {C Function} scm_strerror (err) Return the Unix error message corresponding to @var{err}, which @@ -1081,7 +976,6 @@ must be an integer value. @end deffn apply:nconc2last -@c snarfed from eval.c:3485 @deffn {Scheme Procedure} apply:nconc2last lst @deffnx {C Function} scm_nconc2last (lst) Given a list (@var{arg1} @dots{} @var{args}), this function @@ -1094,7 +988,6 @@ destroys its argument, so use with care. @end deffn force -@c snarfed from eval.c:4021 @deffn {Scheme Procedure} force x @deffnx {C Function} scm_force (x) If the promise @var{x} has not been computed yet, compute and @@ -1103,7 +996,6 @@ value. @end deffn promise? -@c snarfed from eval.c:4044 @deffn {Scheme Procedure} promise? obj @deffnx {C Function} scm_promise_p (obj) Return true if @var{obj} is a promise, i.e. a delayed computation @@ -1111,7 +1003,6 @@ Return true if @var{obj} is a promise, i.e. a delayed computation @end deffn cons-source -@c snarfed from eval.c:4056 @deffn {Scheme Procedure} cons-source xorig x y @deffnx {C Function} scm_cons_source (xorig, x, y) Create and return a new pair whose car and cdr are @var{x} and @var{y}. @@ -1120,7 +1011,6 @@ with the new pair. @end deffn copy-tree -@c snarfed from eval.c:4076 @deffn {Scheme Procedure} copy-tree obj @deffnx {C Function} scm_copy_tree (obj) Recursively copy the data tree that is bound to @var{obj}, and return a @@ -1131,7 +1021,6 @@ any other object. @end deffn primitive-eval -@c snarfed from eval.c:4169 @deffn {Scheme Procedure} primitive-eval exp @deffnx {C Function} scm_primitive_eval (exp) Evaluate @var{exp} in the top-level environment specified by @@ -1139,7 +1028,6 @@ the current module. @end deffn eval -@c snarfed from eval.c:4238 @deffn {Scheme Procedure} eval exp module @deffnx {C Function} scm_eval (exp, module) Evaluate @var{exp}, a list representing a Scheme expression, @@ -1150,36 +1038,31 @@ is reset to its previous value when @var{eval} returns. @end deffn eval-options-interface -@c snarfed from eval.c:1782 @deffn {Scheme Procedure} eval-options-interface [setting] @deffnx {C Function} scm_eval_options_interface (setting) Option interface for the evaluation options. Instead of using this procedure directly, use the procedures @code{eval-enable}, -@code{eval-disable}, @code{eval-set!} and @var{eval-options}. +@code{eval-disable}, @code{eval-set!} and @code{eval-options}. @end deffn evaluator-traps-interface -@c snarfed from eval.c:1799 @deffn {Scheme Procedure} evaluator-traps-interface [setting] @deffnx {C Function} scm_evaluator_traps (setting) Option interface for the evaluator trap options. @end deffn defined? -@c snarfed from evalext.c:75 @deffn {Scheme Procedure} defined? sym [env] @deffnx {C Function} scm_definedp (sym, env) Return @code{#t} if @var{sym} is defined in the lexical environment @var{env}. When @var{env} is not specified, look in the top-level environment as defined by the current module. @end deffn map-in-order -@c snarfed from evalext.c:144 @deffn {Scheme Procedure} map-in-order implemented by the C function "scm_map" @end deffn load-extension -@c snarfed from extensions.c:152 @deffn {Scheme Procedure} load-extension lib init @deffnx {C Function} scm_load_extension (lib, init) Load and initialize the extension designated by LIB and INIT. @@ -1219,7 +1102,6 @@ well. For example, @end deffn program-arguments -@c snarfed from feature.c:77 @deffn {Scheme Procedure} program-arguments @deffnx {Scheme Procedure} command-line @deffnx {C Function} scm_program_arguments () @@ -1230,7 +1112,6 @@ options like @code{-e} and @code{-l}. @end deffn make-fluid -@c snarfed from fluids.c:124 @deffn {Scheme Procedure} make-fluid @deffnx {C Function} scm_make_fluid () Return a newly created fluid. @@ -1243,7 +1124,6 @@ in its own dynamic root, you can use fluids for thread local storage. @end deffn fluid? -@c snarfed from fluids.c:137 @deffn {Scheme Procedure} fluid? obj @deffnx {C Function} scm_fluid_p (obj) Return @code{#t} iff @var{obj} is a fluid; otherwise, return @@ -1251,7 +1131,6 @@ Return @code{#t} iff @var{obj} is a fluid; otherwise, return @end deffn fluid-ref -@c snarfed from fluids.c:148 @deffn {Scheme Procedure} fluid-ref fluid @deffnx {C Function} scm_fluid_ref (fluid) Return the value associated with @var{fluid} in the current @@ -1260,14 +1139,12 @@ dynamic root. If @var{fluid} has not been set, then return @end deffn fluid-set! -@c snarfed from fluids.c:164 @deffn {Scheme Procedure} fluid-set! fluid value @deffnx {C Function} scm_fluid_set_x (fluid, value) Set the value associated with @var{fluid} in the current dynamic root. @end deffn with-fluids* -@c snarfed from fluids.c:223 @deffn {Scheme Procedure} with-fluids* fluids values thunk @deffnx {C Function} scm_with_fluids (fluids, values, thunk) Set @var{fluids} to @var{values} temporary, and call @var{thunk}. @@ -1277,7 +1154,6 @@ one after another. @var{thunk} must be a procedure with no argument. @end deffn setvbuf -@c snarfed from fports.c:156 @deffn {Scheme Procedure} setvbuf port mode [size] @deffnx {C Function} scm_setvbuf (port, mode, size) Set the buffering mode for @var{port}. @var{mode} can be: @@ -1293,14 +1169,12 @@ If @var{size} is omitted, a default size will be used. @end deffn file-port? -@c snarfed from fports.c:245 @deffn {Scheme Procedure} file-port? obj @deffnx {C Function} scm_file_port_p (obj) Determine whether @var{obj} is a port that is related to a file. @end deffn open-file -@c snarfed from fports.c:299 @deffn {Scheme Procedure} open-file filename mode @deffnx {C Function} scm_open_file (filename, mode) Open the file whose name is @var{filename}, and return a port @@ -1343,7 +1217,6 @@ requested, @code{open-file} throws an exception. @end deffn gc-stats -@c snarfed from gc.c:735 @deffn {Scheme Procedure} gc-stats @deffnx {C Function} scm_gc_stats () Return an association list of statistics about Guile's current @@ -1351,7 +1224,6 @@ use of storage. @end deffn object-address -@c snarfed from gc.c:832 @deffn {Scheme Procedure} object-address obj @deffnx {C Function} scm_object_address (obj) Return an integer that for the lifetime of @var{obj} is uniquely @@ -1359,7 +1231,6 @@ returned by this function for @var{obj} @end deffn gc -@c snarfed from gc.c:843 @deffn {Scheme Procedure} gc @deffnx {C Function} scm_gc () Scans all of SCM objects and reclaims for further use those that are @@ -1367,7 +1238,6 @@ no longer accessible. @end deffn %compute-slots -@c snarfed from goops.c:291 @deffn {Scheme Procedure} %compute-slots class @deffnx {C Function} scm_sys_compute_slots (class) Return a list consisting of the names of all slots belonging to @@ -1376,7 +1246,6 @@ its superclasses. @end deffn get-keyword -@c snarfed from goops.c:376 @deffn {Scheme Procedure} get-keyword key l default_value @deffnx {C Function} scm_get_keyword (key, l, default_value) Determine an associated value for the keyword @var{key} from @@ -1388,7 +1257,6 @@ If @var{l} does not hold a value for @var{key}, the value @end deffn %initialize-object -@c snarfed from goops.c:399 @deffn {Scheme Procedure} %initialize-object obj initargs @deffnx {C Function} scm_sys_initialize_object (obj, initargs) Initialize the object @var{obj} with the given arguments @@ -1396,147 +1264,126 @@ Initialize the object @var{obj} with the given arguments @end deffn %prep-layout! -@c snarfed from goops.c:479 @deffn {Scheme Procedure} %prep-layout! class @deffnx {C Function} scm_sys_prep_layout_x (class) @end deffn %inherit-magic! -@c snarfed from goops.c:556 @deffn {Scheme Procedure} %inherit-magic! class dsupers @deffnx {C Function} scm_sys_inherit_magic_x (class, dsupers) @end deffn instance? -@c snarfed from goops.c:799 @deffn {Scheme Procedure} instance? obj @deffnx {C Function} scm_instance_p (obj) Return @code{#t} if @var{obj} is an instance. @end deffn class-name -@c snarfed from goops.c:814 @deffn {Scheme Procedure} class-name obj @deffnx {C Function} scm_class_name (obj) Return the class name of @var{obj}. @end deffn class-direct-supers -@c snarfed from goops.c:824 @deffn {Scheme Procedure} class-direct-supers obj @deffnx {C Function} scm_class_direct_supers (obj) Return the direct superclasses of the class @var{obj}. @end deffn class-direct-slots -@c snarfed from goops.c:834 @deffn {Scheme Procedure} class-direct-slots obj @deffnx {C Function} scm_class_direct_slots (obj) Return the direct slots of the class @var{obj}. @end deffn class-direct-subclasses -@c snarfed from goops.c:844 @deffn {Scheme Procedure} class-direct-subclasses obj @deffnx {C Function} scm_class_direct_subclasses (obj) Return the direct subclasses of the class @var{obj}. @end deffn class-direct-methods -@c snarfed from goops.c:854 @deffn {Scheme Procedure} class-direct-methods obj @deffnx {C Function} scm_class_direct_methods (obj) Return the direct methods of the class @var{obj} @end deffn class-precedence-list -@c snarfed from goops.c:864 @deffn {Scheme Procedure} class-precedence-list obj @deffnx {C Function} scm_class_precedence_list (obj) Return the class precedence list of the class @var{obj}. @end deffn class-slots -@c snarfed from goops.c:874 @deffn {Scheme Procedure} class-slots obj @deffnx {C Function} scm_class_slots (obj) Return the slot list of the class @var{obj}. @end deffn class-environment -@c snarfed from goops.c:884 @deffn {Scheme Procedure} class-environment obj @deffnx {C Function} scm_class_environment (obj) Return the environment of the class @var{obj}. @end deffn generic-function-name -@c snarfed from goops.c:895 @deffn {Scheme Procedure} generic-function-name obj @deffnx {C Function} scm_generic_function_name (obj) Return the name of the generic function @var{obj}. @end deffn generic-function-methods -@c snarfed from goops.c:905 @deffn {Scheme Procedure} generic-function-methods obj @deffnx {C Function} scm_generic_function_methods (obj) Return the methods of the generic function @var{obj}. @end deffn method-generic-function -@c snarfed from goops.c:916 @deffn {Scheme Procedure} method-generic-function obj @deffnx {C Function} scm_method_generic_function (obj) -Return the generic function fot the method @var{obj}. +Return the generic function for the method @var{obj}. @end deffn method-specializers -@c snarfed from goops.c:926 @deffn {Scheme Procedure} method-specializers obj @deffnx {C Function} scm_method_specializers (obj) Return specializers of the method @var{obj}. @end deffn method-procedure -@c snarfed from goops.c:936 @deffn {Scheme Procedure} method-procedure obj @deffnx {C Function} scm_method_procedure (obj) Return the procedure of the method @var{obj}. @end deffn accessor-method-slot-definition -@c snarfed from goops.c:946 @deffn {Scheme Procedure} accessor-method-slot-definition obj @deffnx {C Function} scm_accessor_method_slot_definition (obj) Return the slot definition of the accessor @var{obj}. @end deffn %tag-body -@c snarfed from goops.c:956 @deffn {Scheme Procedure} %tag-body body @deffnx {C Function} scm_sys_tag_body (body) Internal GOOPS magic---don't use this function! @end deffn make-unbound -@c snarfed from goops.c:971 @deffn {Scheme Procedure} make-unbound @deffnx {C Function} scm_make_unbound () Return the unbound value. @end deffn unbound? -@c snarfed from goops.c:980 @deffn {Scheme Procedure} unbound? obj @deffnx {C Function} scm_unbound_p (obj) Return @code{#t} if @var{obj} is unbound. @end deffn assert-bound -@c snarfed from goops.c:990 @deffn {Scheme Procedure} assert-bound value obj @deffnx {C Function} scm_assert_bound (value, obj) Return @var{value} if it is bound, and invoke the @@ -1544,7 +1391,6 @@ Return @var{value} if it is bound, and invoke the @end deffn @@assert-bound-ref -@c snarfed from goops.c:1002 @deffn {Scheme Procedure} @@assert-bound-ref obj index @deffnx {C Function} scm_at_assert_bound_ref (obj, index) Like @code{assert-bound}, but use @var{index} for accessing @@ -1552,14 +1398,12 @@ the value from @var{obj}. @end deffn %fast-slot-ref -@c snarfed from goops.c:1014 @deffn {Scheme Procedure} %fast-slot-ref obj index @deffnx {C Function} scm_sys_fast_slot_ref (obj, index) Return the slot value with index @var{index} from @var{obj}. @end deffn %fast-slot-set! -@c snarfed from goops.c:1032 @deffn {Scheme Procedure} %fast-slot-set! obj index value @deffnx {C Function} scm_sys_fast_slot_set_x (obj, index, value) Set the slot with index @var{index} in @var{obj} to @@ -1567,35 +1411,30 @@ Set the slot with index @var{index} in @var{obj} to @end deffn slot-ref-using-class -@c snarfed from goops.c:1162 @deffn {Scheme Procedure} slot-ref-using-class class obj slot_name @deffnx {C Function} scm_slot_ref_using_class (class, obj, slot_name) @end deffn slot-set-using-class! -@c snarfed from goops.c:1181 @deffn {Scheme Procedure} slot-set-using-class! class obj slot_name value @deffnx {C Function} scm_slot_set_using_class_x (class, obj, slot_name, value) @end deffn slot-bound-using-class? -@c snarfed from goops.c:1195 @deffn {Scheme Procedure} slot-bound-using-class? class obj slot_name @deffnx {C Function} scm_slot_bound_using_class_p (class, obj, slot_name) @end deffn slot-exists-using-class? -@c snarfed from goops.c:1210 @deffn {Scheme Procedure} slot-exists-using-class? class obj slot_name @deffnx {C Function} scm_slot_exists_using_class_p (class, obj, slot_name) @end deffn slot-ref -@c snarfed from goops.c:1226 @deffn {Scheme Procedure} slot-ref obj slot_name @deffnx {C Function} scm_slot_ref (obj, slot_name) Return the value from @var{obj}'s slot with the name @@ -1603,14 +1442,12 @@ Return the value from @var{obj}'s slot with the name @end deffn slot-set! -@c snarfed from goops.c:1243 @deffn {Scheme Procedure} slot-set! obj slot_name value @deffnx {C Function} scm_slot_set_x (obj, slot_name, value) Set the slot named @var{slot_name} of @var{obj} to @var{value}. @end deffn slot-bound? -@c snarfed from goops.c:1260 @deffn {Scheme Procedure} slot-bound? obj slot_name @deffnx {C Function} scm_slot_bound_p (obj, slot_name) Return @code{#t} if the slot named @var{slot_name} of @var{obj} @@ -1618,14 +1455,12 @@ is bound. @end deffn slot-exists? -@c snarfed from goops.c:1278 @deffn {Scheme Procedure} slot-exists? obj slot_name @deffnx {C Function} scm_slots_exists_p (obj, slot_name) Return @code{#t} if @var{obj} has a slot named @var{slot_name}. @end deffn %allocate-instance -@c snarfed from goops.c:1317 @deffn {Scheme Procedure} %allocate-instance class initargs @deffnx {C Function} scm_sys_allocate_instance (class, initargs) Create a new instance of class @var{class} and initialize it @@ -1633,63 +1468,54 @@ from the arguments @var{initargs}. @end deffn %set-object-setter! -@c snarfed from goops.c:1387 @deffn {Scheme Procedure} %set-object-setter! obj setter @deffnx {C Function} scm_sys_set_object_setter_x (obj, setter) @end deffn %modify-instance -@c snarfed from goops.c:1412 @deffn {Scheme Procedure} %modify-instance old new @deffnx {C Function} scm_sys_modify_instance (old, new) @end deffn %modify-class -@c snarfed from goops.c:1438 @deffn {Scheme Procedure} %modify-class old new @deffnx {C Function} scm_sys_modify_class (old, new) @end deffn %invalidate-class -@c snarfed from goops.c:1462 @deffn {Scheme Procedure} %invalidate-class class @deffnx {C Function} scm_sys_invalidate_class (class) @end deffn %invalidate-method-cache! -@c snarfed from goops.c:1589 @deffn {Scheme Procedure} %invalidate-method-cache! gf @deffnx {C Function} scm_sys_invalidate_method_cache_x (gf) @end deffn generic-capability? -@c snarfed from goops.c:1615 @deffn {Scheme Procedure} generic-capability? proc @deffnx {C Function} scm_generic_capability_p (proc) @end deffn enable-primitive-generic! -@c snarfed from goops.c:1628 @deffn {Scheme Procedure} enable-primitive-generic! . subrs @deffnx {C Function} scm_enable_primitive_generic_x (subrs) @end deffn primitive-generic-generic -@c snarfed from goops.c:1649 @deffn {Scheme Procedure} primitive-generic-generic subr @deffnx {C Function} scm_primitive_generic_generic (subr) @end deffn make -@c snarfed from goops.c:2010 @deffn {Scheme Procedure} make . args @deffnx {C Function} scm_make (args) Make a new object. @var{args} must contain the class and @@ -1697,21 +1523,18 @@ all necessary initialization information. @end deffn find-method -@c snarfed from goops.c:2103 @deffn {Scheme Procedure} find-method . l @deffnx {C Function} scm_find_method (l) @end deffn %method-more-specific? -@c snarfed from goops.c:2123 @deffn {Scheme Procedure} %method-more-specific? m1 m2 targs @deffnx {C Function} scm_sys_method_more_specific_p (m1, m2, targs) @end deffn %goops-loaded -@c snarfed from goops.c:2648 @deffn {Scheme Procedure} %goops-loaded @deffnx {C Function} scm_sys_goops_loaded () Announce that GOOPS is loaded and perform initialization @@ -1719,7 +1542,6 @@ on the C level which depends on the loaded GOOPS modules. @end deffn make-guardian -@c snarfed from guardians.c:330 @deffn {Scheme Procedure} make-guardian [greedy_p] @deffnx {C Function} scm_make_guardian (greedy_p) Create a new guardian. @@ -1750,21 +1572,18 @@ paper still (mostly) accurately describes the interface). @end deffn guardian-destroyed? -@c snarfed from guardians.c:358 @deffn {Scheme Procedure} guardian-destroyed? guardian @deffnx {C Function} scm_guardian_destroyed_p (guardian) Return @code{#t} if @var{guardian} has been destroyed, otherwise @code{#f}. @end deffn guardian-greedy? -@c snarfed from guardians.c:376 @deffn {Scheme Procedure} guardian-greedy? guardian @deffnx {C Function} scm_guardian_greedy_p (guardian) Return @code{#t} if @var{guardian} is a greedy guardian, otherwise @code{#f}. @end deffn destroy-guardian! -@c snarfed from guardians.c:387 @deffn {Scheme Procedure} destroy-guardian! guardian @deffnx {C Function} scm_destroy_guardian_x (guardian) Destroys @var{guardian}, by making it impossible to put any more @@ -1773,7 +1592,6 @@ objects guarded by @var{guardian}. @end deffn hashq -@c snarfed from hash.c:200 @deffn {Scheme Procedure} hashq key size @deffnx {C Function} scm_hashq (key, size) Determine a hash value for @var{key} that is suitable for @@ -1789,7 +1607,6 @@ different values, since @code{foo} will be garbage collected. @end deffn hashv -@c snarfed from hash.c:236 @deffn {Scheme Procedure} hashv key size @deffnx {C Function} scm_hashv (key, size) Determine a hash value for @var{key} that is suitable for @@ -1805,7 +1622,6 @@ different values, since @code{foo} will be garbage collected. @end deffn hash -@c snarfed from hash.c:259 @deffn {Scheme Procedure} hash key size @deffnx {C Function} scm_hash (key, size) Determine a hash value for @var{key} that is suitable for @@ -1815,7 +1631,6 @@ integer in the range 0 to @var{size} - 1. @end deffn hashq-get-handle -@c snarfed from hashtab.c:173 @deffn {Scheme Procedure} hashq-get-handle table key @deffnx {C Function} scm_hashq_get_handle (table, key) This procedure returns the @code{(key . value)} pair from the @@ -1825,7 +1640,6 @@ Uses @code{eq?} for equality testing. @end deffn hashq-create-handle! -@c snarfed from hashtab.c:185 @deffn {Scheme Procedure} hashq-create-handle! table key init @deffnx {C Function} scm_hashq_create_handle_x (table, key, init) This function looks up @var{key} in @var{table} and returns its handle. @@ -1834,7 +1648,6 @@ associates @var{key} with @var{init}. @end deffn hashq-ref -@c snarfed from hashtab.c:198 @deffn {Scheme Procedure} hashq-ref table key [dflt] @deffnx {C Function} scm_hashq_ref (table, key, dflt) Look up @var{key} in the hash table @var{table}, and return the @@ -1844,7 +1657,6 @@ is supplied). Uses @code{eq?} for equality testing. @end deffn hashq-set! -@c snarfed from hashtab.c:212 @deffn {Scheme Procedure} hashq-set! table key val @deffnx {C Function} scm_hashq_set_x (table, key, val) Find the entry in @var{table} associated with @var{key}, and @@ -1852,7 +1664,6 @@ store @var{value} there. Uses @code{eq?} for equality testing. @end deffn hashq-remove! -@c snarfed from hashtab.c:224 @deffn {Scheme Procedure} hashq-remove! table key @deffnx {C Function} scm_hashq_remove_x (table, key) Remove @var{key} (and any value associated with it) from @@ -1860,7 +1671,6 @@ Remove @var{key} (and any value associated with it) from @end deffn hashv-get-handle -@c snarfed from hashtab.c:240 @deffn {Scheme Procedure} hashv-get-handle table key @deffnx {C Function} scm_hashv_get_handle (table, key) This procedure returns the @code{(key . value)} pair from the @@ -1870,7 +1680,6 @@ Uses @code{eqv?} for equality testing. @end deffn hashv-create-handle! -@c snarfed from hashtab.c:252 @deffn {Scheme Procedure} hashv-create-handle! table key init @deffnx {C Function} scm_hashv_create_handle_x (table, key, init) This function looks up @var{key} in @var{table} and returns its handle. @@ -1879,7 +1688,6 @@ associates @var{key} with @var{init}. @end deffn hashv-ref -@c snarfed from hashtab.c:266 @deffn {Scheme Procedure} hashv-ref table key [dflt] @deffnx {C Function} scm_hashv_ref (table, key, dflt) Look up @var{key} in the hash table @var{table}, and return the @@ -1889,7 +1697,6 @@ is supplied). Uses @code{eqv?} for equality testing. @end deffn hashv-set! -@c snarfed from hashtab.c:280 @deffn {Scheme Procedure} hashv-set! table key val @deffnx {C Function} scm_hashv_set_x (table, key, val) Find the entry in @var{table} associated with @var{key}, and @@ -1897,7 +1704,6 @@ store @var{value} there. Uses @code{eqv?} for equality testing. @end deffn hashv-remove! -@c snarfed from hashtab.c:291 @deffn {Scheme Procedure} hashv-remove! table key @deffnx {C Function} scm_hashv_remove_x (table, key) Remove @var{key} (and any value associated with it) from @@ -1905,7 +1711,6 @@ Remove @var{key} (and any value associated with it) from @end deffn hash-get-handle -@c snarfed from hashtab.c:306 @deffn {Scheme Procedure} hash-get-handle table key @deffnx {C Function} scm_hash_get_handle (table, key) This procedure returns the @code{(key . value)} pair from the @@ -1915,7 +1720,6 @@ Uses @code{equal?} for equality testing. @end deffn hash-create-handle! -@c snarfed from hashtab.c:318 @deffn {Scheme Procedure} hash-create-handle! table key init @deffnx {C Function} scm_hash_create_handle_x (table, key, init) This function looks up @var{key} in @var{table} and returns its handle. @@ -1924,7 +1728,6 @@ associates @var{key} with @var{init}. @end deffn hash-ref -@c snarfed from hashtab.c:331 @deffn {Scheme Procedure} hash-ref table key [dflt] @deffnx {C Function} scm_hash_ref (table, key, dflt) Look up @var{key} in the hash table @var{table}, and return the @@ -1934,7 +1737,6 @@ is supplied). Uses @code{equal?} for equality testing. @end deffn hash-set! -@c snarfed from hashtab.c:346 @deffn {Scheme Procedure} hash-set! table key val @deffnx {C Function} scm_hash_set_x (table, key, val) Find the entry in @var{table} associated with @var{key}, and @@ -1943,7 +1745,6 @@ testing. @end deffn hash-remove! -@c snarfed from hashtab.c:358 @deffn {Scheme Procedure} hash-remove! table key @deffnx {C Function} scm_hash_remove_x (table, key) Remove @var{key} (and any value associated with it) from @@ -1951,7 +1752,6 @@ Remove @var{key} (and any value associated with it) from @end deffn hashx-get-handle -@c snarfed from hashtab.c:422 @deffn {Scheme Procedure} hashx-get-handle hash assoc table key @deffnx {C Function} scm_hashx_get_handle (hash, assoc, table, key) This behaves the same way as the corresponding @@ -1963,7 +1763,6 @@ table size. @code{assoc} must be an associator function, like @end deffn hashx-create-handle! -@c snarfed from hashtab.c:441 @deffn {Scheme Procedure} hashx-create-handle! hash assoc table key init @deffnx {C Function} scm_hashx_create_handle_x (hash, assoc, table, key, init) This behaves the same way as the corresponding @@ -1975,7 +1774,6 @@ table size. @code{assoc} must be an associator function, like @end deffn hashx-ref -@c snarfed from hashtab.c:464 @deffn {Scheme Procedure} hashx-ref hash assoc table key [dflt] @deffnx {C Function} scm_hashx_ref (hash, assoc, table, key, dflt) This behaves the same way as the corresponding @code{ref} @@ -1990,7 +1788,6 @@ equivalent to @code{hashx-ref hashq assq table key}. @end deffn hashx-set! -@c snarfed from hashtab.c:490 @deffn {Scheme Procedure} hashx-set! hash assoc table key val @deffnx {C Function} scm_hashx_set_x (hash, assoc, table, key, val) This behaves the same way as the corresponding @code{set!} @@ -2005,7 +1802,6 @@ equivalent to @code{hashx-set! hashq assq table key}. @end deffn hash-fold -@c snarfed from hashtab.c:528 @deffn {Scheme Procedure} hash-fold proc init table @deffnx {C Function} scm_hash_fold (proc, init, table) An iterator over hash-table elements. @@ -2019,7 +1815,6 @@ table into an a-list of key-value pairs. @end deffn make-hook -@c snarfed from hooks.c:178 @deffn {Scheme Procedure} make-hook [n_args] @deffnx {C Function} scm_make_hook (n_args) Create a hook for storing procedure of arity @var{n_args}. @@ -2028,14 +1823,12 @@ object to be used with the other hook procedures. @end deffn hook? -@c snarfed from hooks.c:201 @deffn {Scheme Procedure} hook? x @deffnx {C Function} scm_hook_p (x) Return @code{#t} if @var{x} is a hook, @code{#f} otherwise. @end deffn hook-empty? -@c snarfed from hooks.c:212 @deffn {Scheme Procedure} hook-empty? hook @deffnx {C Function} scm_hook_empty_p (hook) Return @code{#t} if @var{hook} is an empty hook, @code{#f} @@ -2043,7 +1836,6 @@ otherwise. @end deffn add-hook! -@c snarfed from hooks.c:226 @deffn {Scheme Procedure} add-hook! hook proc [append_p] @deffnx {C Function} scm_add_hook_x (hook, proc, append_p) Add the procedure @var{proc} to the hook @var{hook}. The @@ -2053,7 +1845,6 @@ procedure is not specified. @end deffn remove-hook! -@c snarfed from hooks.c:253 @deffn {Scheme Procedure} remove-hook! hook proc @deffnx {C Function} scm_remove_hook_x (hook, proc) Remove the procedure @var{proc} from the hook @var{hook}. The @@ -2061,7 +1852,6 @@ return value of this procedure is not specified. @end deffn reset-hook! -@c snarfed from hooks.c:267 @deffn {Scheme Procedure} reset-hook! hook @deffnx {C Function} scm_reset_hook_x (hook) Remove all procedures from the hook @var{hook}. The return @@ -2069,7 +1859,6 @@ value of this procedure is not specified. @end deffn run-hook -@c snarfed from hooks.c:281 @deffn {Scheme Procedure} run-hook hook . args @deffnx {C Function} scm_run_hook (hook, args) Apply all procedures from the hook @var{hook} to the arguments @@ -2078,14 +1867,12 @@ last. The return value of this procedure is not specified. @end deffn hook->list -@c snarfed from hooks.c:308 @deffn {Scheme Procedure} hook->list hook @deffnx {C Function} scm_hook_to_list (hook) Convert the procedure list of @var{hook} to a list. @end deffn ftell -@c snarfed from ioext.c:73 @deffn {Scheme Procedure} ftell fd_port @deffnx {C Function} scm_ftell (fd_port) Return an integer representing the current position of @@ -2097,7 +1884,6 @@ Return an integer representing the current position of @end deffn redirect-port -@c snarfed from ioext.c:91 @deffn {Scheme Procedure} redirect-port old new @deffnx {C Function} scm_redirect_port (old, new) This procedure takes two ports and duplicates the underlying file @@ -2116,7 +1902,6 @@ revealed counts. @end deffn dup->fdes -@c snarfed from ioext.c:130 @deffn {Scheme Procedure} dup->fdes fd_or_port [fd] @deffnx {C Function} scm_dup_to_fdes (fd_or_port, fd) Return a new integer file descriptor referring to the open file @@ -2125,7 +1910,6 @@ file port or a file descriptor. @end deffn dup2 -@c snarfed from ioext.c:177 @deffn {Scheme Procedure} dup2 oldfd newfd @deffnx {C Function} scm_dup2 (oldfd, newfd) A simple wrapper for the @code{dup2} system call. @@ -2139,7 +1923,6 @@ The return value is unspecified. @end deffn fileno -@c snarfed from ioext.c:196 @deffn {Scheme Procedure} fileno port @deffnx {C Function} scm_fileno (port) Return the integer file descriptor underlying @var{port}. Does @@ -2147,7 +1930,6 @@ not change its revealed count. @end deffn isatty? -@c snarfed from ioext.c:216 @deffn {Scheme Procedure} isatty? port @deffnx {C Function} scm_isatty_p (port) Return @code{#t} if @var{port} is using a serial non--file @@ -2155,7 +1937,6 @@ device, otherwise @code{#f}. @end deffn fdopen -@c snarfed from ioext.c:238 @deffn {Scheme Procedure} fdopen fdes modes @deffnx {C Function} scm_fdopen (fdes, modes) Return a new port based on the file descriptor @var{fdes}. @@ -2165,7 +1946,6 @@ same as that accepted by @ref{File Ports, open-file}. @end deffn primitive-move->fdes -@c snarfed from ioext.c:262 @deffn {Scheme Procedure} primitive-move->fdes port fd @deffnx {C Function} scm_primitive_move_to_fdes (port, fd) Moves the underlying file descriptor for @var{port} to the integer @@ -2177,7 +1957,6 @@ required value or @code{#t} if it was moved. @end deffn fdes->ports -@c snarfed from ioext.c:296 @deffn {Scheme Procedure} fdes->ports fd @deffnx {C Function} scm_fdes_to_ports (fd) Return a list of existing ports which have @var{fdes} as an @@ -2186,14 +1965,12 @@ counts. @end deffn make-keyword-from-dash-symbol -@c snarfed from keywords.c:74 @deffn {Scheme Procedure} make-keyword-from-dash-symbol symbol @deffnx {C Function} scm_make_keyword_from_dash_symbol (symbol) Make a keyword object from a @var{symbol} that starts with a dash. @end deffn keyword? -@c snarfed from keywords.c:112 @deffn {Scheme Procedure} keyword? obj @deffnx {C Function} scm_keyword_p (obj) Return @code{#t} if the argument @var{obj} is a keyword, else @@ -2201,7 +1978,6 @@ Return @code{#t} if the argument @var{obj} is a keyword, else @end deffn keyword-dash-symbol -@c snarfed from keywords.c:123 @deffn {Scheme Procedure} keyword-dash-symbol keyword @deffnx {C Function} scm_keyword_dash_symbol (keyword) Return the dash symbol for @var{keyword}. @@ -2209,7 +1985,6 @@ This is the inverse of @code{make-keyword-from-dash-symbol}. @end deffn list -@c snarfed from list.c:127 @deffn {Scheme Procedure} list . objs @deffnx {C Function} scm_list (objs) Return a list containing @var{objs}, the arguments to @@ -2217,7 +1992,6 @@ Return a list containing @var{objs}, the arguments to @end deffn cons* -@c snarfed from list.c:142 @deffn {Scheme Procedure} cons* arg . rest @deffnx {C Function} scm_cons_star (arg, rest) Like @code{list}, but the last arg provides the tail of the @@ -2229,28 +2003,24 @@ Schemes and in Common LISP. @end deffn null? -@c snarfed from list.c:166 @deffn {Scheme Procedure} null? x @deffnx {C Function} scm_null_p (x) Return @code{#t} iff @var{x} is the empty list, else @code{#f}. @end deffn list? -@c snarfed from list.c:176 @deffn {Scheme Procedure} list? x @deffnx {C Function} scm_list_p (x) Return @code{#t} iff @var{x} is a proper list, else @code{#f}. @end deffn length -@c snarfed from list.c:217 @deffn {Scheme Procedure} length lst @deffnx {C Function} scm_length (lst) Return the number of elements in list @var{lst}. @end deffn append -@c snarfed from list.c:246 @deffn {Scheme Procedure} append . args @deffnx {C Function} scm_append (args) Return a list consisting of the elements the lists passed as @@ -2271,7 +2041,6 @@ if the last argument is not a proper list. @end deffn append! -@c snarfed from list.c:280 @deffn {Scheme Procedure} append! . lists @deffnx {C Function} scm_append_x (lists) A destructive version of @code{append} (@pxref{Pairs and @@ -2282,7 +2051,6 @@ the mutated list. @end deffn last-pair -@c snarfed from list.c:306 @deffn {Scheme Procedure} last-pair lst @deffnx {C Function} scm_last_pair (lst) Return a pointer to the last pair in @var{lst}, signalling an error if @@ -2290,7 +2058,6 @@ Return a pointer to the last pair in @var{lst}, signalling an error if @end deffn reverse -@c snarfed from list.c:336 @deffn {Scheme Procedure} reverse lst @deffnx {C Function} scm_reverse (lst) Return a new list that contains the elements of @var{lst} but @@ -2298,7 +2065,6 @@ in reverse order. @end deffn reverse! -@c snarfed from list.c:370 @deffn {Scheme Procedure} reverse! lst [new_tail] @deffnx {C Function} scm_reverse_x (lst, new_tail) A destructive version of @code{reverse} (@pxref{Pairs and Lists,,,r5rs, @@ -2315,27 +2081,23 @@ of the modified list is not lost, it is wise to save the return value of @end deffn list-ref -@c snarfed from list.c:396 @deffn {Scheme Procedure} list-ref list k @deffnx {C Function} scm_list_ref (list, k) Return the @var{k}th element from @var{list}. @end deffn list-set! -@c snarfed from list.c:420 @deffn {Scheme Procedure} list-set! list k val @deffnx {C Function} scm_list_set_x (list, k, val) Set the @var{k}th element of @var{list} to @var{val}. @end deffn list-cdr-ref -@c snarfed from list.c:443 @deffn {Scheme Procedure} list-cdr-ref implemented by the C function "scm_list_tail" @end deffn list-tail -@c snarfed from list.c:452 @deffn {Scheme Procedure} list-tail lst k @deffnx {Scheme Procedure} list-cdr-ref lst k @deffnx {C Function} scm_list_tail (lst, k) @@ -2348,14 +2110,12 @@ or returning the results of cdring @var{k} times down @var{lst}. @end deffn list-cdr-set! -@c snarfed from list.c:468 @deffn {Scheme Procedure} list-cdr-set! list k val @deffnx {C Function} scm_list_cdr_set_x (list, k, val) Set the @var{k}th cdr of @var{list} to @var{val}. @end deffn list-head -@c snarfed from list.c:497 @deffn {Scheme Procedure} list-head lst k @deffnx {C Function} scm_list_head (lst, k) Copy the first @var{k} elements from @var{lst} into a new list, and @@ -2363,14 +2123,12 @@ return it. @end deffn list-copy -@c snarfed from list.c:521 @deffn {Scheme Procedure} list-copy lst @deffnx {C Function} scm_list_copy (lst) Return a (newly-created) copy of @var{lst}. @end deffn memq -@c snarfed from list.c:575 @deffn {Scheme Procedure} memq x lst @deffnx {C Function} scm_memq (x, lst) Return the first sublist of @var{lst} whose car is @code{eq?} @@ -2382,7 +2140,6 @@ returned. @end deffn memv -@c snarfed from list.c:591 @deffn {Scheme Procedure} memv x lst @deffnx {C Function} scm_memv (x, lst) Return the first sublist of @var{lst} whose car is @code{eqv?} @@ -2394,7 +2151,6 @@ returned. @end deffn member -@c snarfed from list.c:612 @deffn {Scheme Procedure} member x lst @deffnx {C Function} scm_member (x, lst) Return the first sublist of @var{lst} whose car is @@ -2406,7 +2162,6 @@ empty list) is returned. @end deffn delq! -@c snarfed from list.c:637 @deffn {Scheme Procedure} delq! item lst @deffnx {Scheme Procedure} delv! item lst @deffnx {Scheme Procedure} delete! item lst @@ -2420,7 +2175,6 @@ destructive list functions, these functions cannot modify the binding of @end deffn delv! -@c snarfed from list.c:661 @deffn {Scheme Procedure} delv! item lst @deffnx {C Function} scm_delv_x (item, lst) Destructively remove all elements from @var{lst} that are @@ -2428,7 +2182,6 @@ Destructively remove all elements from @var{lst} that are @end deffn delete! -@c snarfed from list.c:686 @deffn {Scheme Procedure} delete! item lst @deffnx {C Function} scm_delete_x (item, lst) Destructively remove all elements from @var{lst} that are @@ -2436,7 +2189,6 @@ Destructively remove all elements from @var{lst} that are @end deffn delq -@c snarfed from list.c:715 @deffn {Scheme Procedure} delq item lst @deffnx {C Function} scm_delq (item, lst) Return a newly-created copy of @var{lst} with elements @@ -2446,7 +2198,6 @@ Return a newly-created copy of @var{lst} with elements @end deffn delv -@c snarfed from list.c:728 @deffn {Scheme Procedure} delv item lst @deffnx {C Function} scm_delv (item, lst) Return a newly-created copy of @var{lst} with elements @@ -2456,7 +2207,6 @@ Return a newly-created copy of @var{lst} with elements @end deffn delete -@c snarfed from list.c:741 @deffn {Scheme Procedure} delete item lst @deffnx {C Function} scm_delete (item, lst) Return a newly-created copy of @var{lst} with elements @@ -2466,7 +2216,6 @@ against @var{item} with @code{equal?}. @end deffn delq1! -@c snarfed from list.c:754 @deffn {Scheme Procedure} delq1! item lst @deffnx {C Function} scm_delq1_x (item, lst) Like @code{delq!}, but only deletes the first occurrence of @@ -2475,7 +2224,6 @@ Like @code{delq!}, but only deletes the first occurrence of @end deffn delv1! -@c snarfed from list.c:782 @deffn {Scheme Procedure} delv1! item lst @deffnx {C Function} scm_delv1_x (item, lst) Like @code{delv!}, but only deletes the first occurrence of @@ -2484,7 +2232,6 @@ Like @code{delv!}, but only deletes the first occurrence of @end deffn delete1! -@c snarfed from list.c:810 @deffn {Scheme Procedure} delete1! item lst @deffnx {C Function} scm_delete1_x (item, lst) Like @code{delete!}, but only deletes the first occurrence of @@ -2493,7 +2240,6 @@ Like @code{delete!}, but only deletes the first occurrence of @end deffn primitive-load -@c snarfed from load.c:111 @deffn {Scheme Procedure} primitive-load filename @deffnx {C Function} scm_primitive_load (filename) Load the file named @var{filename} and evaluate its contents in @@ -2506,7 +2252,6 @@ documentation for @code{%load-hook} later in this section. @end deffn %package-data-dir -@c snarfed from load.c:151 @deffn {Scheme Procedure} %package-data-dir @deffnx {C Function} scm_sys_package_data_dir () Return the name of the directory where Scheme packages, modules and @@ -2515,7 +2260,6 @@ libraries are kept. On most Unix systems, this will be @end deffn %library-dir -@c snarfed from load.c:163 @deffn {Scheme Procedure} %library-dir @deffnx {C Function} scm_sys_library_dir () Return the directory where the Guile Scheme library files are installed. @@ -2523,7 +2267,6 @@ E.g., may return "/usr/share/guile/1.3.5". @end deffn %site-dir -@c snarfed from load.c:175 @deffn {Scheme Procedure} %site-dir @deffnx {C Function} scm_sys_site_dir () Return the directory where the Guile site files are installed. @@ -2531,7 +2274,6 @@ E.g., may return "/usr/share/guile/site". @end deffn parse-path -@c snarfed from load.c:227 @deffn {Scheme Procedure} parse-path path [tail] @deffnx {C Function} scm_parse_path (path, tail) Parse @var{path}, which is expected to be a colon-separated @@ -2541,7 +2283,6 @@ is returned. @end deffn search-path -@c snarfed from load.c:277 @deffn {Scheme Procedure} search-path path filename [extensions] @deffnx {C Function} scm_search_path (path, filename, extensions) Search @var{path} for a directory containing a file named @@ -2554,7 +2295,6 @@ concatenated with each @var{extension}. @end deffn %search-load-path -@c snarfed from load.c:423 @deffn {Scheme Procedure} %search-load-path filename @deffnx {C Function} scm_sys_search_load_path (filename) Search @var{%load-path} for the file named @var{filename}, @@ -2567,7 +2307,6 @@ will try each extension automatically. @end deffn primitive-load-path -@c snarfed from load.c:444 @deffn {Scheme Procedure} primitive-load-path filename @deffnx {C Function} scm_primitive_load_path (filename) Search @var{%load-path} for the file named @var{filename} and @@ -2577,7 +2316,6 @@ an error is signalled. @end deffn procedure->syntax -@c snarfed from macros.c:104 @deffn {Scheme Procedure} procedure->syntax code @deffnx {C Function} scm_makacro (code) Return a @dfn{macro} which, when a symbol defined to this value @@ -2587,15 +2325,12 @@ environment. @end deffn procedure->macro -@c snarfed from macros.c:127 @deffn {Scheme Procedure} procedure->macro code @deffnx {C Function} scm_makmacro (code) Return a @dfn{macro} which, when a symbol defined to this value appears as the first symbol in an expression, evaluates the result of applying @var{code} to the expression and the -environment. The value returned from @var{code} which has been -passed to @code{procedure->memoizing-macro} replaces the form -passed to @var{code}. For example: +environment. For example: @lisp (define trace @@ -2607,27 +2342,20 @@ passed to @var{code}. For example: @end deffn procedure->memoizing-macro -@c snarfed from macros.c:150 @deffn {Scheme Procedure} procedure->memoizing-macro code @deffnx {C Function} scm_makmmacro (code) Return a @dfn{macro} which, when a symbol defined to this value appears as the first symbol in an expression, evaluates the -result of applying @var{proc} to the expression and the -environment. The value returned from @var{proc} which has been -passed to @code{procedure->memoizing-macro} replaces the form -passed to @var{proc}. For example: +result of applying @var{code} to the expression and the +environment. -@lisp -(define trace - (procedure->macro - (lambda (x env) `(set! ,(cadr x) (tracef ,(cadr x) ',(cadr x)))))) - -(trace @i{foo}) @equiv{} (set! @i{foo} (tracef @i{foo} '@i{foo})). -@end lisp +@code{procedure->memoizing-macro} is the same as +@code{procedure->macro}, except that the expression returned by +@var{code} replaces the original macro expression in the memoized +form of the containing code. @end deffn macro? -@c snarfed from macros.c:162 @deffn {Scheme Procedure} macro? obj @deffnx {C Function} scm_macro_p (obj) Return @code{#t} if @var{obj} is a regular macro, a memoizing macro or a @@ -2635,7 +2363,6 @@ syntax transformer. @end deffn macro-type -@c snarfed from macros.c:180 @deffn {Scheme Procedure} macro-type m @deffnx {C Function} scm_macro_type (m) Return one of the symbols @code{syntax}, @code{macro} or @@ -2646,28 +2373,24 @@ returned. @end deffn macro-name -@c snarfed from macros.c:198 @deffn {Scheme Procedure} macro-name m @deffnx {C Function} scm_macro_name (m) Return the name of the macro @var{m}. @end deffn macro-transformer -@c snarfed from macros.c:209 @deffn {Scheme Procedure} macro-transformer m @deffnx {C Function} scm_macro_transformer (m) Return the transformer of the macro @var{m}. @end deffn current-module -@c snarfed from modules.c:69 @deffn {Scheme Procedure} current-module @deffnx {C Function} scm_current_module () Return the current module. @end deffn set-current-module -@c snarfed from modules.c:81 @deffn {Scheme Procedure} set-current-module module @deffnx {C Function} scm_set_current_module (module) Set the current module to @var{module} and return @@ -2675,7 +2398,6 @@ the previous current module. @end deffn interaction-environment -@c snarfed from modules.c:104 @deffn {Scheme Procedure} interaction-environment @deffnx {C Function} scm_interaction_environment () Return a specifier for the environment that contains @@ -2686,35 +2408,30 @@ evaluate expressions dynamically typed by the user. @end deffn env-module -@c snarfed from modules.c:271 @deffn {Scheme Procedure} env-module env @deffnx {C Function} scm_env_module (env) Return the module of @var{ENV}, a lexical environment. @end deffn standard-eval-closure -@c snarfed from modules.c:348 @deffn {Scheme Procedure} standard-eval-closure module @deffnx {C Function} scm_standard_eval_closure (module) Return an eval closure for the module @var{module}. @end deffn standard-interface-eval-closure -@c snarfed from modules.c:359 @deffn {Scheme Procedure} standard-interface-eval-closure module @deffnx {C Function} scm_standard_interface_eval_closure (module) Return a interface eval closure for the module @var{module}. Such a closure does not allow new bindings to be added. @end deffn %get-pre-modules-obarray -@c snarfed from modules.c:582 @deffn {Scheme Procedure} %get-pre-modules-obarray @deffnx {C Function} scm_get_pre_modules_obarray () Return the obarray that is used for all new bindings before the module system is booted. The first call to @code{set-current-module} will boot the module system. @end deffn exact? -@c snarfed from numbers.c:101 @deffn {Scheme Procedure} exact? x @deffnx {C Function} scm_exact_p (x) Return @code{#t} if @var{x} is an exact number, @code{#f} @@ -2722,7 +2439,6 @@ otherwise. @end deffn odd? -@c snarfed from numbers.c:118 @deffn {Scheme Procedure} odd? n @deffnx {C Function} scm_odd_p (n) Return @code{#t} if @var{n} is an odd number, @code{#f} @@ -2730,7 +2446,6 @@ otherwise. @end deffn even? -@c snarfed from numbers.c:135 @deffn {Scheme Procedure} even? n @deffnx {C Function} scm_even_p (n) Return @code{#t} if @var{n} is an even number, @code{#f} @@ -2738,7 +2453,6 @@ otherwise. @end deffn logand -@c snarfed from numbers.c:748 @deffn {Scheme Procedure} logand n1 n2 Return the bitwise AND of the integer arguments. @@ -2750,7 +2464,6 @@ Return the bitwise AND of the integer arguments. @end deffn logior -@c snarfed from numbers.c:834 @deffn {Scheme Procedure} logior n1 n2 Return the bitwise OR of the integer arguments. @@ -2762,7 +2475,6 @@ Return the bitwise OR of the integer arguments. @end deffn logxor -@c snarfed from numbers.c:921 @deffn {Scheme Procedure} logxor n1 n2 Return the bitwise XOR of the integer arguments. A bit is set in the result if it is set in an odd number of arguments. @@ -2775,7 +2487,6 @@ set in the result if it is set in an odd number of arguments. @end deffn logtest -@c snarfed from numbers.c:990 @deffn {Scheme Procedure} logtest j k @deffnx {C Function} scm_logtest (j, k) @lisp @@ -2787,7 +2498,6 @@ set in the result if it is set in an odd number of arguments. @end deffn logbit? -@c snarfed from numbers.c:1047 @deffn {Scheme Procedure} logbit? index j @deffnx {C Function} scm_logbit_p (index, j) @lisp @@ -2802,7 +2512,6 @@ set in the result if it is set in an odd number of arguments. @end deffn lognot -@c snarfed from numbers.c:1096 @deffn {Scheme Procedure} lognot n @deffnx {C Function} scm_lognot (n) Return the integer which is the 2s-complement of the integer @@ -2817,7 +2526,6 @@ argument. @end deffn integer-expt -@c snarfed from numbers.c:1113 @deffn {Scheme Procedure} integer-expt n k @deffnx {C Function} scm_integer_expt (n, k) Return @var{n} raised to the non-negative integer exponent @@ -2832,7 +2540,6 @@ Return @var{n} raised to the non-negative integer exponent @end deffn ash -@c snarfed from numbers.c:1168 @deffn {Scheme Procedure} ash n cnt @deffnx {C Function} scm_ash (n, cnt) The function ash performs an arithmetic shift left by @var{cnt} @@ -2853,7 +2560,6 @@ Formally, the function returns an integer equivalent to @end deffn bit-extract -@c snarfed from numbers.c:1221 @deffn {Scheme Procedure} bit-extract n start end @deffnx {C Function} scm_bit_extract (n, start, end) Return the integer composed of the @var{start} (inclusive) @@ -2869,7 +2575,6 @@ through @var{end} (exclusive) bits of @var{n}. The @end deffn logcount -@c snarfed from numbers.c:1293 @deffn {Scheme Procedure} logcount n @deffnx {C Function} scm_logcount (n) Return the number of bits in integer @var{n}. If integer is @@ -2888,10 +2593,9 @@ representation are counted. If 0, 0 is returned. @end deffn integer-length -@c snarfed from numbers.c:1344 @deffn {Scheme Procedure} integer-length n @deffnx {C Function} scm_integer_length (n) -Return the number of bits neccessary to represent @var{n}. +Return the number of bits necessary to represent @var{n}. @lisp (integer-length #b10101010) @@ -2904,7 +2608,6 @@ Return the number of bits neccessary to represent @var{n}. @end deffn number->string -@c snarfed from numbers.c:2177 @deffn {Scheme Procedure} number->string n [radix] @deffnx {C Function} scm_number_to_string (n, radix) Return a string holding the external representation of the @@ -2913,7 +2616,6 @@ inexact, a radix of 10 will be used. @end deffn string->number -@c snarfed from numbers.c:2812 @deffn {Scheme Procedure} string->number string [radix] @deffnx {C Function} scm_string_to_number (string, radix) Return a number of the maximally precise representation @@ -2927,34 +2629,30 @@ syntactically valid notation for a number, then @end deffn number? -@c snarfed from numbers.c:2881 @deffn {Scheme Procedure} number? implemented by the C function "scm_number_p" @end deffn complex? -@c snarfed from numbers.c:2893 @deffn {Scheme Procedure} complex? x @deffnx {C Function} scm_number_p (x) Return @code{#t} if @var{x} is a complex number, @code{#f} -else. Note that the sets of real, rational and integer +otherwise. Note that the sets of real, rational and integer values form subsets of the set of complex numbers, i. e. the predicate will also be fulfilled if @var{x} is a real, rational or integer number. @end deffn real? -@c snarfed from numbers.c:2901 @deffn {Scheme Procedure} real? implemented by the C function "scm_real_p" @end deffn rational? -@c snarfed from numbers.c:2914 @deffn {Scheme Procedure} rational? x @deffnx {C Function} scm_real_p (x) Return @code{#t} if @var{x} is a rational number, @code{#f} -else. Note that the set of integer values forms a subset of +otherwise. Note that the set of integer values forms a subset of the set of rational numbers, i. e. the predicate will also be fulfilled if @var{x} is an integer number. Real numbers will also satisfy this predicate, because of their limited @@ -2962,7 +2660,6 @@ precision. @end deffn integer? -@c snarfed from numbers.c:2935 @deffn {Scheme Procedure} integer? x @deffnx {C Function} scm_integer_p (x) Return @code{#t} if @var{x} is an integer number, @code{#f} @@ -2970,7 +2667,6 @@ else. @end deffn inexact? -@c snarfed from numbers.c:2960 @deffn {Scheme Procedure} inexact? x @deffnx {C Function} scm_inexact_p (x) Return @code{#t} if @var{x} is an inexact number, @code{#f} @@ -2978,7 +2674,6 @@ else. @end deffn $expt -@c snarfed from numbers.c:4084 @deffn {Scheme Procedure} $expt x y @deffnx {C Function} scm_sys_expt (x, y) Return @var{x} raised to the power of @var{y}. This @@ -2986,7 +2681,6 @@ procedure does not accept complex arguments. @end deffn $atan2 -@c snarfed from numbers.c:4100 @deffn {Scheme Procedure} $atan2 x y @deffnx {C Function} scm_sys_atan2 (x, y) Return the arc tangent of the two arguments @var{x} and @@ -2997,7 +2691,6 @@ procedure does not accept complex arguments. @end deffn make-rectangular -@c snarfed from numbers.c:4113 @deffn {Scheme Procedure} make-rectangular real imaginary @deffnx {C Function} scm_make_rectangular (real, imaginary) Return a complex number constructed of the given @var{real} and @@ -3005,49 +2698,42 @@ Return a complex number constructed of the given @var{real} and @end deffn make-polar -@c snarfed from numbers.c:4126 @deffn {Scheme Procedure} make-polar x y @deffnx {C Function} scm_make_polar (x, y) Return the complex number @var{x} * e^(i * @var{y}). @end deffn inexact->exact -@c snarfed from numbers.c:4261 @deffn {Scheme Procedure} inexact->exact z @deffnx {C Function} scm_inexact_to_exact (z) Return an exact number that is numerically closest to @var{z}. @end deffn class-of -@c snarfed from objects.c:86 @deffn {Scheme Procedure} class-of x @deffnx {C Function} scm_class_of (x) Return the class of @var{x}. @end deffn entity? -@c snarfed from objects.c:360 @deffn {Scheme Procedure} entity? obj @deffnx {C Function} scm_entity_p (obj) Return @code{#t} if @var{obj} is an entity. @end deffn operator? -@c snarfed from objects.c:369 @deffn {Scheme Procedure} operator? obj @deffnx {C Function} scm_operator_p (obj) Return @code{#t} if @var{obj} is an operator. @end deffn valid-object-procedure? -@c snarfed from objects.c:385 @deffn {Scheme Procedure} valid-object-procedure? proc @deffnx {C Function} scm_valid_object_procedure_p (proc) Return @code{#t} iff @var{proc} is a procedure that can be used with @code{set-object-procedure}. It is always valid to use a closure constructed by @code{lambda}. @end deffn set-object-procedure! -@c snarfed from objects.c:407 @deffn {Scheme Procedure} set-object-procedure! obj proc @deffnx {C Function} scm_set_object_procedure_x (obj, proc) Set the object procedure of @var{obj} to @var{proc}. @@ -3055,7 +2741,6 @@ Set the object procedure of @var{obj} to @var{proc}. @end deffn make-class-object -@c snarfed from objects.c:467 @deffn {Scheme Procedure} make-class-object metaclass layout @deffnx {C Function} scm_make_class_object (metaclass, layout) Create a new class object of class @var{metaclass}, with the @@ -3063,7 +2748,6 @@ slot layout specified by @var{layout}. @end deffn make-subclass-object -@c snarfed from objects.c:482 @deffn {Scheme Procedure} make-subclass-object class layout @deffnx {C Function} scm_make_subclass_object (class, layout) Create a subclass object of @var{class}, with the slot layout @@ -3071,28 +2755,24 @@ specified by @var{layout}. @end deffn object-properties -@c snarfed from objprop.c:59 @deffn {Scheme Procedure} object-properties obj @deffnx {C Function} scm_object_properties (obj) Return @var{obj}'s property list. @end deffn set-object-properties! -@c snarfed from objprop.c:69 @deffn {Scheme Procedure} set-object-properties! obj alist @deffnx {C Function} scm_set_object_properties_x (obj, alist) Set @var{obj}'s property list to @var{alist}. @end deffn object-property -@c snarfed from objprop.c:80 @deffn {Scheme Procedure} object-property obj key @deffnx {C Function} scm_object_property (obj, key) Return the property of @var{obj} with name @var{key}. @end deffn set-object-property! -@c snarfed from objprop.c:92 @deffn {Scheme Procedure} set-object-property! obj key value @deffnx {C Function} scm_set_object_property_x (obj, key, value) In @var{obj}'s property list, set the property named @var{key} @@ -3100,7 +2780,6 @@ to @var{value}. @end deffn cons -@c snarfed from pairs.c:80 @deffn {Scheme Procedure} cons x y @deffnx {C Function} scm_cons (x, y) Return a newly allocated pair whose car is @var{x} and whose @@ -3109,7 +2788,6 @@ sense of @code{eq?}) from every previously existing object. @end deffn pair? -@c snarfed from pairs.c:98 @deffn {Scheme Procedure} pair? x @deffnx {C Function} scm_pair_p (x) Return @code{#t} if @var{x} is a pair; otherwise return @@ -3117,7 +2795,6 @@ Return @code{#t} if @var{x} is a pair; otherwise return @end deffn set-car! -@c snarfed from pairs.c:109 @deffn {Scheme Procedure} set-car! pair value @deffnx {C Function} scm_set_car_x (pair, value) Stores @var{value} in the car field of @var{pair}. The value returned @@ -3125,7 +2802,6 @@ by @code{set-car!} is unspecified. @end deffn set-cdr! -@c snarfed from pairs.c:122 @deffn {Scheme Procedure} set-cdr! pair value @deffnx {C Function} scm_set_cdr_x (pair, value) Stores @var{value} in the cdr field of @var{pair}. The value returned @@ -3133,7 +2809,6 @@ by @code{set-cdr!} is unspecified. @end deffn char-ready? -@c snarfed from ports.c:259 @deffn {Scheme Procedure} char-ready? [port] @deffnx {C Function} scm_char_ready_p (port) Return @code{#t} if a character is ready on input @var{port} @@ -3152,7 +2827,6 @@ interactive port that has no ready characters.} @end deffn drain-input -@c snarfed from ports.c:336 @deffn {Scheme Procedure} drain-input port @deffnx {C Function} scm_drain_input (port) This procedure clears a port's input buffers, similar @@ -3172,7 +2846,6 @@ for further input. @end deffn current-input-port -@c snarfed from ports.c:363 @deffn {Scheme Procedure} current-input-port @deffnx {C Function} scm_current_input_port () Return the current input port. This is the default port used @@ -3181,7 +2854,6 @@ returns the @dfn{standard input} in Unix and C terminology. @end deffn current-output-port -@c snarfed from ports.c:375 @deffn {Scheme Procedure} current-output-port @deffnx {C Function} scm_current_output_port () Return the current output port. This is the default port used @@ -3191,7 +2863,6 @@ Unix and C terminology. @end deffn current-error-port -@c snarfed from ports.c:385 @deffn {Scheme Procedure} current-error-port @deffnx {C Function} scm_current_error_port () Return the port to which errors and warnings should be sent (the @@ -3199,7 +2870,6 @@ Return the port to which errors and warnings should be sent (the @end deffn current-load-port -@c snarfed from ports.c:395 @deffn {Scheme Procedure} current-load-port @deffnx {C Function} scm_current_load_port () Return the current-load-port. @@ -3207,7 +2877,6 @@ The load port is used internally by @code{primitive-load}. @end deffn set-current-input-port -@c snarfed from ports.c:408 @deffn {Scheme Procedure} set-current-input-port port @deffnx {Scheme Procedure} set-current-output-port port @deffnx {Scheme Procedure} set-current-error-port port @@ -3218,28 +2887,24 @@ so that they use the supplied @var{port} for input or output. @end deffn set-current-output-port -@c snarfed from ports.c:421 @deffn {Scheme Procedure} set-current-output-port port @deffnx {C Function} scm_set_current_output_port (port) Set the current default output port to @var{port}. @end deffn set-current-error-port -@c snarfed from ports.c:435 @deffn {Scheme Procedure} set-current-error-port port @deffnx {C Function} scm_set_current_error_port (port) Set the current default error port to @var{port}. @end deffn port-revealed -@c snarfed from ports.c:578 @deffn {Scheme Procedure} port-revealed port @deffnx {C Function} scm_port_revealed (port) Return the revealed count for @var{port}. @end deffn set-port-revealed! -@c snarfed from ports.c:591 @deffn {Scheme Procedure} set-port-revealed! port rcount @deffnx {C Function} scm_set_port_revealed_x (port, rcount) Sets the revealed count for a port to a given value. @@ -3247,7 +2912,6 @@ The return value is unspecified. @end deffn port-mode -@c snarfed from ports.c:634 @deffn {Scheme Procedure} port-mode port @deffnx {C Function} scm_port_mode (port) Return the port modes associated with the open port @var{port}. @@ -3257,7 +2921,6 @@ used only during port creation are not retained. @end deffn close-port -@c snarfed from ports.c:671 @deffn {Scheme Procedure} close-port port @deffnx {C Function} scm_close_port (port) Close the specified port object. Return @code{#t} if it @@ -3269,7 +2932,6 @@ descriptors. @end deffn close-input-port -@c snarfed from ports.c:699 @deffn {Scheme Procedure} close-input-port port @deffnx {C Function} scm_close_input_port (port) Close the specified input port object. The routine has no effect if @@ -3281,7 +2943,6 @@ which can close file descriptors. @end deffn close-output-port -@c snarfed from ports.c:714 @deffn {Scheme Procedure} close-output-port port @deffnx {C Function} scm_close_output_port (port) Close the specified output port object. The routine has no effect if @@ -3293,7 +2954,6 @@ which can close file descriptors. @end deffn port-for-each -@c snarfed from ports.c:731 @deffn {Scheme Procedure} port-for-each proc @deffnx {C Function} scm_port_for_each (proc) Apply @var{proc} to each port in the Guile port table @@ -3305,7 +2965,6 @@ have no effect as far as @var{port-for-each} is concerned. @end deffn input-port? -@c snarfed from ports.c:772 @deffn {Scheme Procedure} input-port? x @deffnx {C Function} scm_input_port_p (x) Return @code{#t} if @var{x} is an input port, otherwise return @@ -3314,7 +2973,6 @@ Return @code{#t} if @var{x} is an input port, otherwise return @end deffn output-port? -@c snarfed from ports.c:783 @deffn {Scheme Procedure} output-port? x @deffnx {C Function} scm_output_port_p (x) Return @code{#t} if @var{x} is an output port, otherwise return @@ -3323,7 +2981,6 @@ Return @code{#t} if @var{x} is an output port, otherwise return @end deffn port? -@c snarfed from ports.c:795 @deffn {Scheme Procedure} port? x @deffnx {C Function} scm_port_p (x) Return a boolean indicating whether @var{x} is a port. @@ -3332,7 +2989,6 @@ Equivalent to @code{(or (input-port? @var{x}) (output-port? @end deffn port-closed? -@c snarfed from ports.c:805 @deffn {Scheme Procedure} port-closed? port @deffnx {C Function} scm_port_closed_p (port) Return @code{#t} if @var{port} is closed or @code{#f} if it is @@ -3340,7 +2996,6 @@ open. @end deffn eof-object? -@c snarfed from ports.c:816 @deffn {Scheme Procedure} eof-object? x @deffnx {C Function} scm_eof_object_p (x) Return @code{#t} if @var{x} is an end-of-file object; otherwise @@ -3348,7 +3003,6 @@ return @code{#f}. @end deffn force-output -@c snarfed from ports.c:830 @deffn {Scheme Procedure} force-output [port] @deffnx {C Function} scm_force_output (port) Flush the specified output port, or the current output port if @var{port} @@ -3361,7 +3015,6 @@ The return value is unspecified. @end deffn flush-all-ports -@c snarfed from ports.c:848 @deffn {Scheme Procedure} flush-all-ports @deffnx {C Function} scm_flush_all_ports () Equivalent to calling @code{force-output} on @@ -3369,7 +3022,6 @@ all open output ports. The return value is unspecified. @end deffn read-char -@c snarfed from ports.c:866 @deffn {Scheme Procedure} read-char [port] @deffnx {C Function} scm_read_char (port) Return the next character available from @var{port}, updating @@ -3378,7 +3030,6 @@ characters are available, the end-of-file object is returned. @end deffn peek-char -@c snarfed from ports.c:1192 @deffn {Scheme Procedure} peek-char [port] @deffnx {C Function} scm_peek_char (port) Return the next character available from @var{port}, @@ -3396,7 +3047,6 @@ to @code{read-char} would have hung.} @end deffn unread-char -@c snarfed from ports.c:1213 @deffn {Scheme Procedure} unread-char cobj [port] @deffnx {C Function} scm_unread_char (cobj, port) Place @var{char} in @var{port} so that it will be read by the @@ -3406,7 +3056,6 @@ not supplied, the current input port is used. @end deffn unread-string -@c snarfed from ports.c:1236 @deffn {Scheme Procedure} unread-string str port @deffnx {C Function} scm_unread_string (str, port) Place the string @var{str} in @var{port} so that its characters will be @@ -3416,7 +3065,6 @@ unread characters will be read again in last-in first-out order. If @end deffn seek -@c snarfed from ports.c:1275 @deffn {Scheme Procedure} seek fd_port offset whence @deffnx {C Function} scm_seek (fd_port, offset, whence) Sets the current position of @var{fd/port} to the integer @@ -3445,7 +3093,6 @@ that the current position of a port can be obtained using: @end deffn truncate-file -@c snarfed from ports.c:1330 @deffn {Scheme Procedure} truncate-file object [length] @deffnx {C Function} scm_truncate_file (object, length) Truncates the object referred to by @var{object} to at most @@ -3457,21 +3104,18 @@ position. The return value is unspecified. @end deffn port-line -@c snarfed from ports.c:1383 @deffn {Scheme Procedure} port-line port @deffnx {C Function} scm_port_line (port) Return the current line number for @var{port}. @end deffn set-port-line! -@c snarfed from ports.c:1394 @deffn {Scheme Procedure} set-port-line! port line @deffnx {C Function} scm_set_port_line_x (port, line) Set the current line number for @var{port} to @var{line}. @end deffn port-column -@c snarfed from ports.c:1415 @deffn {Scheme Procedure} port-column port @deffnx {Scheme Procedure} port-line port @deffnx {C Function} scm_port_column (port) @@ -3486,7 +3130,6 @@ what non-programmers will find most natural.) @end deffn set-port-column! -@c snarfed from ports.c:1428 @deffn {Scheme Procedure} set-port-column! port column @deffnx {Scheme Procedure} set-port-line! port line @deffnx {C Function} scm_set_port_column_x (port, column) @@ -3495,7 +3138,6 @@ current input port if none is specified. @end deffn port-filename -@c snarfed from ports.c:1443 @deffn {Scheme Procedure} port-filename port @deffnx {C Function} scm_port_filename (port) Return the filename associated with @var{port}. This function returns @@ -3504,7 +3146,6 @@ when called on the current input, output and error ports respectively. @end deffn set-port-filename! -@c snarfed from ports.c:1457 @deffn {Scheme Procedure} set-port-filename! port filename @deffnx {C Function} scm_set_port_filename_x (port, filename) Change the filename associated with @var{port}, using the current input @@ -3514,17 +3155,15 @@ source of data, but only the value that is returned by @end deffn %make-void-port -@c snarfed from ports.c:1551 @deffn {Scheme Procedure} %make-void-port mode @deffnx {C Function} scm_sys_make_void_port (mode) Create and return a new void port. A void port acts like -/dev/null. The @var{mode} argument +@file{/dev/null}. The @var{mode} argument specifies the input/output modes for this port: see the documentation for @code{open-file} in @ref{File Ports}. @end deffn print-options-interface -@c snarfed from print.c:142 @deffn {Scheme Procedure} print-options-interface [setting] @deffnx {C Function} scm_print_options (setting) Option interface for the print options. Instead of using @@ -3534,7 +3173,6 @@ and @code{print-options}. @end deffn simple-format -@c snarfed from print.c:921 @deffn {Scheme Procedure} simple-format destination message . args @deffnx {C Function} scm_simple_format (destination, message, args) Write @var{message} to @var{destination}, defaulting to @@ -3551,7 +3189,6 @@ containing the formatted text. Does not add a trailing newline. @end deffn newline -@c snarfed from print.c:1008 @deffn {Scheme Procedure} newline [port] @deffnx {C Function} scm_newline (port) Send a newline to @var{port}. @@ -3559,14 +3196,12 @@ If @var{port} is omitted, send to the current output port. @end deffn write-char -@c snarfed from print.c:1023 @deffn {Scheme Procedure} write-char chr [port] @deffnx {C Function} scm_write_char (chr, port) Send character @var{chr} to @var{port}. @end deffn port-with-print-state -@c snarfed from print.c:1077 @deffn {Scheme Procedure} port-with-print-state port pstate @deffnx {C Function} scm_port_with_print_state (port, pstate) Create a new port which behaves like @var{port}, but with an @@ -3574,7 +3209,6 @@ included print state @var{pstate}. @end deffn get-print-state -@c snarfed from print.c:1092 @deffn {Scheme Procedure} get-print-state port @deffnx {C Function} scm_get_print_state (port) Return the print state of the port @var{port}. If @var{port} @@ -3582,28 +3216,24 @@ has no associated print state, @code{#f} is returned. @end deffn procedure-properties -@c snarfed from procprop.c:176 @deffn {Scheme Procedure} procedure-properties proc @deffnx {C Function} scm_procedure_properties (proc) Return @var{obj}'s property list. @end deffn set-procedure-properties! -@c snarfed from procprop.c:189 @deffn {Scheme Procedure} set-procedure-properties! proc new_val @deffnx {C Function} scm_set_procedure_properties_x (proc, new_val) Set @var{obj}'s property list to @var{alist}. @end deffn procedure-property -@c snarfed from procprop.c:202 @deffn {Scheme Procedure} procedure-property p k @deffnx {C Function} scm_procedure_property (p, k) Return the property of @var{obj} with name @var{key}. @end deffn set-procedure-property! -@c snarfed from procprop.c:225 @deffn {Scheme Procedure} set-procedure-property! p k v @deffnx {C Function} scm_set_procedure_property_x (p, k, v) In @var{obj}'s property list, set the property named @var{key} to @@ -3611,28 +3241,24 @@ In @var{obj}'s property list, set the property named @var{key} to @end deffn procedure? -@c snarfed from procs.c:186 @deffn {Scheme Procedure} procedure? obj @deffnx {C Function} scm_procedure_p (obj) Return @code{#t} if @var{obj} is a procedure. @end deffn closure? -@c snarfed from procs.c:213 @deffn {Scheme Procedure} closure? obj @deffnx {C Function} scm_closure_p (obj) Return @code{#t} if @var{obj} is a closure. @end deffn thunk? -@c snarfed from procs.c:222 @deffn {Scheme Procedure} thunk? obj @deffnx {C Function} scm_thunk_p (obj) Return @code{#t} if @var{obj} is a thunk. @end deffn procedure-documentation -@c snarfed from procs.c:272 @deffn {Scheme Procedure} procedure-documentation proc @deffnx {C Function} scm_procedure_documentation (proc) Return the documentation string associated with @code{proc}. By @@ -3642,7 +3268,6 @@ documentation for that procedure. @end deffn procedure-with-setter? -@c snarfed from procs.c:308 @deffn {Scheme Procedure} procedure-with-setter? obj @deffnx {C Function} scm_procedure_with_setter_p (obj) Return @code{#t} if @var{obj} is a procedure with an @@ -3650,7 +3275,6 @@ associated setter procedure. @end deffn make-procedure-with-setter -@c snarfed from procs.c:318 @deffn {Scheme Procedure} make-procedure-with-setter procedure setter @deffnx {C Function} scm_make_procedure_with_setter (procedure, setter) Create a new procedure which behaves like @var{procedure}, but @@ -3658,7 +3282,6 @@ with the associated setter @var{setter}. @end deffn procedure -@c snarfed from procs.c:332 @deffn {Scheme Procedure} procedure proc @deffnx {C Function} scm_procedure (proc) Return the procedure of @var{proc}, which must be either a @@ -3666,7 +3289,6 @@ procedure with setter, or an operator struct. @end deffn primitive-make-property -@c snarfed from properties.c:64 @deffn {Scheme Procedure} primitive-make-property not_found_proc @deffnx {C Function} scm_primitive_make_property (not_found_proc) Create a @dfn{property token} that can be used with @@ -3676,7 +3298,6 @@ See @code{primitive-property-ref} for the significance of @end deffn primitive-property-ref -@c snarfed from properties.c:82 @deffn {Scheme Procedure} primitive-property-ref prop obj @deffnx {C Function} scm_primitive_property_ref (prop, obj) Return the property @var{prop} of @var{obj}. When no value @@ -3689,21 +3310,18 @@ default value of @var{prop}. @end deffn primitive-property-set! -@c snarfed from properties.c:113 @deffn {Scheme Procedure} primitive-property-set! prop obj val @deffnx {C Function} scm_primitive_property_set_x (prop, obj, val) Associate @var{code} with @var{prop} and @var{obj}. @end deffn primitive-property-del! -@c snarfed from properties.c:134 @deffn {Scheme Procedure} primitive-property-del! prop obj @deffnx {C Function} scm_primitive_property_del_x (prop, obj) Remove any value associated with @var{prop} and @var{obj}. @end deffn random -@c snarfed from random.c:376 @deffn {Scheme Procedure} random n [state] @deffnx {C Function} scm_random (n, state) Return a number in [0,N). @@ -3721,21 +3339,18 @@ as a side effect of the random operation. @end deffn copy-random-state -@c snarfed from random.c:399 @deffn {Scheme Procedure} copy-random-state [state] @deffnx {C Function} scm_copy_random_state (state) Return a copy of the random state @var{state}. @end deffn seed->random-state -@c snarfed from random.c:411 @deffn {Scheme Procedure} seed->random-state seed @deffnx {C Function} scm_seed_to_random_state (seed) Return a new random state using @var{seed}. @end deffn random:uniform -@c snarfed from random.c:425 @deffn {Scheme Procedure} random:uniform [state] @deffnx {C Function} scm_random_uniform (state) Return a uniformly distributed inexact real random number in @@ -3743,7 +3358,6 @@ Return a uniformly distributed inexact real random number in @end deffn random:normal -@c snarfed from random.c:440 @deffn {Scheme Procedure} random:normal [state] @deffnx {C Function} scm_random_normal (state) Return an inexact real in a normal distribution. The @@ -3753,7 +3367,6 @@ normal distribution with mean m and standard deviation d use @end deffn random:solid-sphere! -@c snarfed from random.c:496 @deffn {Scheme Procedure} random:solid-sphere! v [state] @deffnx {C Function} scm_random_solid_sphere_x (v, state) Fills vect with inexact real random numbers @@ -3765,7 +3378,6 @@ The sum of the squares of the numbers is returned. @end deffn random:hollow-sphere! -@c snarfed from random.c:519 @deffn {Scheme Procedure} random:hollow-sphere! v [state] @deffnx {C Function} scm_random_hollow_sphere_x (v, state) Fills vect with inexact real random numbers @@ -3777,7 +3389,6 @@ unit n-sphere. @end deffn random:normal-vector! -@c snarfed from random.c:537 @deffn {Scheme Procedure} random:normal-vector! v [state] @deffnx {C Function} scm_random_normal_vector_x (v, state) Fills vect with inexact real random numbers that are @@ -3786,7 +3397,6 @@ independent and standard normally distributed @end deffn random:exp -@c snarfed from random.c:562 @deffn {Scheme Procedure} random:exp [state] @deffnx {C Function} scm_random_exp (state) Return an inexact real in an exponential distribution with mean @@ -3795,7 +3405,6 @@ Return an inexact real in an exponential distribution with mean @end deffn %read-delimited! -@c snarfed from rdelim.c:78 @deffn {Scheme Procedure} %read-delimited! delims str gobble [port [start [end]]] @deffnx {C Function} scm_read_delimited_x (delims, str, gobble, port, start, end) Read characters from @var{port} into @var{str} until one of the @@ -3816,7 +3425,6 @@ a delimiter, this value is @code{#f}. @end deffn %read-line -@c snarfed from rdelim.c:222 @deffn {Scheme Procedure} %read-line [port] @deffnx {C Function} scm_read_line (port) Read a newline-terminated line from @var{port}, allocating storage as @@ -3828,7 +3436,6 @@ delimiter may be either a newline or the @var{eof-object}; if @end deffn write-line -@c snarfed from rdelim.c:275 @deffn {Scheme Procedure} write-line obj [port] @deffnx {C Function} scm_write_line (obj, port) Display @var{obj} and a newline character to @var{port}. If @@ -3841,16 +3448,14 @@ used. This function is equivalent to: @end deffn read-options-interface -@c snarfed from read.c:82 @deffn {Scheme Procedure} read-options-interface [setting] @deffnx {C Function} scm_read_options (setting) Option interface for the read options. Instead of using this procedure directly, use the procedures @code{read-enable}, -@code{read-disable}, @code{read-set!} and @var{read-options}. +@code{read-disable}, @code{read-set!} and @code{read-options}. @end deffn read -@c snarfed from read.c:102 @deffn {Scheme Procedure} read [port] @deffnx {C Function} scm_read (port) Read an s-expression from the input port @var{port}, or from @@ -3859,7 +3464,6 @@ Any whitespace before the next token is discarded. @end deffn read-hash-extend -@c snarfed from read.c:769 @deffn {Scheme Procedure} read-hash-extend chr proc @deffnx {C Function} scm_read_hash_extend (chr, proc) Install the procedure @var{proc} for reading expressions @@ -3870,7 +3474,6 @@ returned will be the return value of @code{read}. @end deffn call-with-dynamic-root -@c snarfed from root.c:352 @deffn {Scheme Procedure} call-with-dynamic-root thunk handler @deffnx {C Function} scm_call_with_dynamic_root (thunk, handler) Evaluate @code{(thunk)} in a new dynamic context, returning its value. @@ -3918,7 +3521,6 @@ be under a new dynamic root.) @end deffn dynamic-root -@c snarfed from root.c:365 @deffn {Scheme Procedure} dynamic-root @deffnx {C Function} scm_dynamic_root () Return an object representing the current dynamic root. @@ -3929,7 +3531,6 @@ in no way depend on this. @end deffn read-string!/partial -@c snarfed from rw.c:121 @deffn {Scheme Procedure} read-string!/partial str [port_or_fdes [start [end]]] @deffnx {C Function} scm_read_string_x_partial (str, port_or_fdes, start, end) Read characters from a port or file descriptor into a @@ -3972,7 +3573,6 @@ end-of-file check. @end deffn write-string/partial -@c snarfed from rw.c:215 @deffn {Scheme Procedure} write-string/partial str [port_or_fdes [start [end]]] @deffnx {C Function} scm_write_string_partial (str, port_or_fdes, start, end) Write characters from a string @var{str} to a port or file @@ -4019,7 +3619,6 @@ return 0 immediately if the request size is 0 bytes. @end deffn sigaction -@c snarfed from scmsigs.c:182 @deffn {Scheme Procedure} sigaction signum [handler [flags]] @deffnx {C Function} scm_sigaction (signum, handler, flags) Install or report the signal handler for a specified signal. @@ -4051,7 +3650,6 @@ structures. @end deffn restore-signals -@c snarfed from scmsigs.c:345 @deffn {Scheme Procedure} restore-signals @deffnx {C Function} scm_restore_signals () Return all signal handlers to the values they had before any call to @@ -4059,7 +3657,6 @@ Return all signal handlers to the values they had before any call to @end deffn alarm -@c snarfed from scmsigs.c:384 @deffn {Scheme Procedure} alarm i @deffnx {C Function} scm_alarm (i) Set a timer to raise a @code{SIGALRM} signal after the specified @@ -4074,7 +3671,6 @@ no previous alarm, the return value is zero. @end deffn setitimer -@c snarfed from scmsigs.c:414 @deffn {Scheme Procedure} setitimer which_timer interval_seconds interval_microseconds value_seconds value_microseconds @deffnx {C Function} scm_setitimer (which_timer, interval_seconds, interval_microseconds, value_seconds, value_microseconds) Set the timer specified by @var{which_timer} according to the given @@ -4095,7 +3691,6 @@ the seconds and microseconds of the timer @code{it_value}. @end deffn getitimer -@c snarfed from scmsigs.c:455 @deffn {Scheme Procedure} getitimer which_timer @deffnx {C Function} scm_getitimer (which_timer) Return information about the timer specified by @var{which_timer} @@ -4112,7 +3707,6 @@ the seconds and microseconds of the timer @code{it_value}. @end deffn pause -@c snarfed from scmsigs.c:482 @deffn {Scheme Procedure} pause @deffnx {C Function} scm_pause () Pause the current process (thread?) until a signal arrives whose @@ -4121,7 +3715,6 @@ handler procedure. The return value is unspecified. @end deffn sleep -@c snarfed from scmsigs.c:495 @deffn {Scheme Procedure} sleep i @deffnx {C Function} scm_sleep (i) Wait for the given number of seconds (an integer) or until a signal @@ -4130,7 +3723,6 @@ of seconds remaining otherwise. @end deffn usleep -@c snarfed from scmsigs.c:513 @deffn {Scheme Procedure} usleep i @deffnx {C Function} scm_usleep (i) Sleep for I microseconds. @code{usleep} is not available on @@ -4138,7 +3730,6 @@ all platforms. @end deffn raise -@c snarfed from scmsigs.c:542 @deffn {Scheme Procedure} raise sig @deffnx {C Function} scm_raise (sig) Sends a specified signal @var{sig} to the current process, where @@ -4146,7 +3737,6 @@ Sends a specified signal @var{sig} to the current process, where @end deffn system -@c snarfed from simpos.c:76 @deffn {Scheme Procedure} system [cmd] @deffnx {C Function} scm_system (cmd) Execute @var{cmd} using the operating system's "command @@ -4160,7 +3750,6 @@ indicating whether the command processor is available. @end deffn getenv -@c snarfed from simpos.c:103 @deffn {Scheme Procedure} getenv nam @deffnx {C Function} scm_getenv (nam) Looks up the string @var{name} in the current environment. The return @@ -4169,7 +3758,6 @@ found, in which case the string @code{VALUE} is returned. @end deffn primitive-exit -@c snarfed from simpos.c:118 @deffn {Scheme Procedure} primitive-exit [status] @deffnx {C Function} scm_primitive_exit (status) Terminate the current process without unwinding the Scheme stack. @@ -4178,7 +3766,6 @@ is @var{status} if supplied, otherwise zero. @end deffn restricted-vector-sort! -@c snarfed from sort.c:422 @deffn {Scheme Procedure} restricted-vector-sort! vec less startpos endpos @deffnx {C Function} scm_restricted_vector_sort_x (vec, less, startpos, endpos) Sort the vector @var{vec}, using @var{less} for comparing @@ -4188,7 +3775,6 @@ is not specified. @end deffn sorted? -@c snarfed from sort.c:453 @deffn {Scheme Procedure} sorted? items less @deffnx {C Function} scm_sorted_p (items, less) Return @code{#t} iff @var{items} is a list or a vector such that @@ -4197,7 +3783,6 @@ applied to all elements i - 1 and i @end deffn merge -@c snarfed from sort.c:526 @deffn {Scheme Procedure} merge alist blist less @deffnx {C Function} scm_merge (alist, blist, less) Merge two already sorted lists into one. @@ -4210,7 +3795,6 @@ Note: this does _not_ accept vectors. @end deffn merge! -@c snarfed from sort.c:639 @deffn {Scheme Procedure} merge! alist blist less @deffnx {C Function} scm_merge_x (alist, blist, less) Takes two lists @var{alist} and @var{blist} such that @@ -4223,7 +3807,6 @@ Note: this does _not_ accept vectors. @end deffn sort! -@c snarfed from sort.c:715 @deffn {Scheme Procedure} sort! items less @deffnx {C Function} scm_sort_x (items, less) Sort the sequence @var{items}, which may be a list or a @@ -4234,7 +3817,6 @@ This is not a stable sort. @end deffn sort -@c snarfed from sort.c:749 @deffn {Scheme Procedure} sort items less @deffnx {C Function} scm_sort (items, less) Sort the sequence @var{items}, which may be a list or a @@ -4243,7 +3825,6 @@ elements. This is not a stable sort. @end deffn stable-sort! -@c snarfed from sort.c:845 @deffn {Scheme Procedure} stable-sort! items less @deffnx {C Function} scm_stable_sort_x (items, less) Sort the sequence @var{items}, which may be a list or a @@ -4254,7 +3835,6 @@ This is a stable sort. @end deffn stable-sort -@c snarfed from sort.c:885 @deffn {Scheme Procedure} stable-sort items less @deffnx {C Function} scm_stable_sort (items, less) Sort the sequence @var{items}, which may be a list or a @@ -4263,7 +3843,6 @@ This is a stable sort. @end deffn sort-list! -@c snarfed from sort.c:931 @deffn {Scheme Procedure} sort-list! items less @deffnx {C Function} scm_sort_list_x (items, less) Sort the list @var{items}, using @var{less} for comparing the @@ -4273,7 +3852,6 @@ This is a stable sort. @end deffn sort-list -@c snarfed from sort.c:945 @deffn {Scheme Procedure} sort-list items less @deffnx {C Function} scm_sort_list (items, less) Sort the list @var{items}, using @var{less} for comparing the @@ -4281,14 +3859,12 @@ list elements. This is a stable sort. @end deffn source-properties -@c snarfed from srcprop.c:170 @deffn {Scheme Procedure} source-properties obj @deffnx {C Function} scm_source_properties (obj) Return the source property association list of @var{obj}. @end deffn set-source-properties! -@c snarfed from srcprop.c:193 @deffn {Scheme Procedure} set-source-properties! obj plist @deffnx {C Function} scm_set_source_properties_x (obj, plist) Install the association list @var{plist} as the source property @@ -4296,7 +3872,6 @@ list for @var{obj}. @end deffn source-property -@c snarfed from srcprop.c:213 @deffn {Scheme Procedure} source-property obj key @deffnx {C Function} scm_source_property (obj, key) Return the source property specified by @var{key} from @@ -4304,7 +3879,6 @@ Return the source property specified by @var{key} from @end deffn set-source-property! -@c snarfed from srcprop.c:246 @deffn {Scheme Procedure} set-source-property! obj key datum @deffnx {C Function} scm_set_source_property_x (obj, key, datum) Set the source property of object @var{obj}, which is specified by @@ -4312,14 +3886,12 @@ Set the source property of object @var{obj}, which is specified by @end deffn stack? -@c snarfed from stacks.c:411 @deffn {Scheme Procedure} stack? obj @deffnx {C Function} scm_stack_p (obj) Return @code{#t} if @var{obj} is a calling stack. @end deffn make-stack -@c snarfed from stacks.c:442 @deffn {Scheme Procedure} make-stack obj . args @deffnx {C Function} scm_make_stack (obj, args) Create a new stack. If @var{obj} is @code{#t}, the current @@ -4353,35 +3925,30 @@ taken as 0. @end deffn stack-id -@c snarfed from stacks.c:534 @deffn {Scheme Procedure} stack-id stack @deffnx {C Function} scm_stack_id (stack) Return the identifier given to @var{stack} by @code{start-stack}. @end deffn stack-ref -@c snarfed from stacks.c:575 @deffn {Scheme Procedure} stack-ref stack index @deffnx {C Function} scm_stack_ref (stack, index) Return the @var{index}'th frame from @var{stack}. @end deffn stack-length -@c snarfed from stacks.c:591 @deffn {Scheme Procedure} stack-length stack @deffnx {C Function} scm_stack_length (stack) Return the length of @var{stack}. @end deffn frame? -@c snarfed from stacks.c:604 @deffn {Scheme Procedure} frame? obj @deffnx {C Function} scm_frame_p (obj) Return @code{#t} if @var{obj} is a stack frame. @end deffn last-stack-frame -@c snarfed from stacks.c:615 @deffn {Scheme Procedure} last-stack-frame obj @deffnx {C Function} scm_last_stack_frame (obj) Return a stack which consists of a single frame, which is the @@ -4390,21 +3957,18 @@ debug object or a continuation. @end deffn frame-number -@c snarfed from stacks.c:657 @deffn {Scheme Procedure} frame-number frame @deffnx {C Function} scm_frame_number (frame) Return the frame number of @var{frame}. @end deffn frame-source -@c snarfed from stacks.c:667 @deffn {Scheme Procedure} frame-source frame @deffnx {C Function} scm_frame_source (frame) Return the source of @var{frame}. @end deffn frame-procedure -@c snarfed from stacks.c:678 @deffn {Scheme Procedure} frame-procedure frame @deffnx {C Function} scm_frame_procedure (frame) Return the procedure for @var{frame}, or @code{#f} if no @@ -4412,14 +3976,12 @@ procedure is associated with @var{frame}. @end deffn frame-arguments -@c snarfed from stacks.c:690 @deffn {Scheme Procedure} frame-arguments frame @deffnx {C Function} scm_frame_arguments (frame) Return the arguments of @var{frame}. @end deffn frame-previous -@c snarfed from stacks.c:701 @deffn {Scheme Procedure} frame-previous frame @deffnx {C Function} scm_frame_previous (frame) Return the previous frame of @var{frame}, or @code{#f} if @@ -4427,7 +3989,6 @@ Return the previous frame of @var{frame}, or @code{#f} if @end deffn frame-next -@c snarfed from stacks.c:717 @deffn {Scheme Procedure} frame-next frame @deffnx {C Function} scm_frame_next (frame) Return the next frame of @var{frame}, or @code{#f} if @@ -4435,35 +3996,30 @@ Return the next frame of @var{frame}, or @code{#f} if @end deffn frame-real? -@c snarfed from stacks.c:732 @deffn {Scheme Procedure} frame-real? frame @deffnx {C Function} scm_frame_real_p (frame) Return @code{#t} if @var{frame} is a real frame. @end deffn frame-procedure? -@c snarfed from stacks.c:742 @deffn {Scheme Procedure} frame-procedure? frame @deffnx {C Function} scm_frame_procedure_p (frame) Return @code{#t} if a procedure is associated with @var{frame}. @end deffn frame-evaluating-args? -@c snarfed from stacks.c:752 @deffn {Scheme Procedure} frame-evaluating-args? frame @deffnx {C Function} scm_frame_evaluating_args_p (frame) Return @code{#t} if @var{frame} contains evaluated arguments. @end deffn frame-overflow? -@c snarfed from stacks.c:762 @deffn {Scheme Procedure} frame-overflow? frame @deffnx {C Function} scm_frame_overflow_p (frame) Return @code{#t} if @var{frame} is an overflow frame. @end deffn get-internal-real-time -@c snarfed from stime.c:143 @deffn {Scheme Procedure} get-internal-real-time @deffnx {C Function} scm_get_internal_real_time () Return the number of time units since the interpreter was @@ -4471,7 +4027,6 @@ started. @end deffn times -@c snarfed from stime.c:188 @deffn {Scheme Procedure} times @deffnx {C Function} scm_times () Return an object with information about real and processor @@ -4498,7 +4053,6 @@ terminated child processes. @end deffn get-internal-run-time -@c snarfed from stime.c:220 @deffn {Scheme Procedure} get-internal-run-time @deffnx {C Function} scm_get_internal_run_time () Return the number of time units of processor time used by the @@ -4507,7 +4061,6 @@ included but subprocesses are not. @end deffn current-time -@c snarfed from stime.c:230 @deffn {Scheme Procedure} current-time @deffnx {C Function} scm_current_time () Return the number of seconds since 1970-01-01 00:00:00 UTC, @@ -4515,7 +4068,6 @@ excluding leap seconds. @end deffn gettimeofday -@c snarfed from stime.c:248 @deffn {Scheme Procedure} gettimeofday @deffnx {C Function} scm_gettimeofday () Return a pair containing the number of seconds and microseconds @@ -4525,7 +4077,6 @@ operating system. @end deffn localtime -@c snarfed from stime.c:347 @deffn {Scheme Procedure} localtime time [zone] @deffnx {C Function} scm_localtime (time, zone) Return an object representing the broken down components of @@ -4536,7 +4087,6 @@ optionally specified by @var{zone} (a string), otherwise the @end deffn gmtime -@c snarfed from stime.c:420 @deffn {Scheme Procedure} gmtime time @deffnx {C Function} scm_gmtime (time) Return an object representing the broken down components of @@ -4545,7 +4095,6 @@ Return an object representing the broken down components of @end deffn mktime -@c snarfed from stime.c:482 @deffn {Scheme Procedure} mktime sbd_time [zone] @deffnx {C Function} scm_mktime (sbd_time, zone) @var{bd-time} is an object representing broken down time and @code{zone} @@ -4559,7 +4108,6 @@ as @var{bd-time} but with normalized values. @end deffn tzset -@c snarfed from stime.c:556 @deffn {Scheme Procedure} tzset @deffnx {C Function} scm_tzset () Initialize the timezone from the TZ environment variable @@ -4569,7 +4117,6 @@ timezone. @end deffn strftime -@c snarfed from stime.c:573 @deffn {Scheme Procedure} strftime format stime @deffnx {C Function} scm_strftime (format, stime) Formats a time specification @var{time} using @var{template}. @var{time} @@ -4582,7 +4129,6 @@ is the formatted string. @end deffn strptime -@c snarfed from stime.c:670 @deffn {Scheme Procedure} strptime format string @deffnx {C Function} scm_strptime (format, string) Performs the reverse action to @code{strftime}, parsing @@ -4598,20 +4144,17 @@ which were used for the conversion. @end deffn string? -@c snarfed from strings.c:61 @deffn {Scheme Procedure} string? obj @deffnx {C Function} scm_string_p (obj) -Return @code{#t} iff @var{obj} is a string, else @code{#f}. +Return @code{#t} if @var{obj} is a string, else @code{#f}. @end deffn list->string -@c snarfed from strings.c:69 @deffn {Scheme Procedure} list->string implemented by the C function "scm_string" @end deffn string -@c snarfed from strings.c:75 @deffn {Scheme Procedure} string . chrs @deffnx {Scheme Procedure} list->string chrs @deffnx {C Function} scm_string (chrs) @@ -4620,7 +4163,6 @@ Return a newly allocated string composed of the arguments, @end deffn make-string -@c snarfed from strings.c:209 @deffn {Scheme Procedure} make-string k [chr] @deffnx {C Function} scm_make_string (k, chr) Return a newly allocated string of @@ -4630,14 +4172,12 @@ of the @var{string} are unspecified. @end deffn string-length -@c snarfed from strings.c:242 @deffn {Scheme Procedure} string-length string @deffnx {C Function} scm_string_length (string) Return the number of characters in @var{string}. @end deffn string-ref -@c snarfed from strings.c:253 @deffn {Scheme Procedure} string-ref str k @deffnx {C Function} scm_string_ref (str, k) Return character @var{k} of @var{str} using zero-origin @@ -4645,7 +4185,6 @@ indexing. @var{k} must be a valid index of @var{str}. @end deffn string-set! -@c snarfed from strings.c:270 @deffn {Scheme Procedure} string-set! str k chr @deffnx {C Function} scm_string_set_x (str, k, chr) Store @var{chr} in element @var{k} of @var{str} and return @@ -4654,7 +4193,6 @@ an unspecified value. @var{k} must be a valid index of @end deffn substring -@c snarfed from strings.c:289 @deffn {Scheme Procedure} substring str start [end] @deffnx {C Function} scm_substring (str, start, end) Return a newly allocated string formed from the characters @@ -4667,7 +4205,6 @@ exact integers satisfying: @end deffn string-append -@c snarfed from strings.c:315 @deffn {Scheme Procedure} string-append . args @deffnx {C Function} scm_string_append (args) Return a newly allocated string whose characters form the @@ -4675,7 +4212,6 @@ concatenation of the given strings, @var{args}. @end deffn string-index -@c snarfed from strop.c:138 @deffn {Scheme Procedure} string-index str chr [frm [to]] @deffnx {C Function} scm_string_index (str, chr, frm, to) Return the index of the first occurrence of @var{chr} in @@ -4697,7 +4233,6 @@ procedure essentially implements the @code{index} or @end deffn string-rindex -@c snarfed from strop.c:168 @deffn {Scheme Procedure} string-rindex str chr [frm [to]] @deffnx {C Function} scm_string_rindex (str, chr, frm, to) Like @code{string-index}, but search from the right of the @@ -4718,7 +4253,6 @@ the C library. @end deffn substring-move! -@c snarfed from strop.c:188 @deffn {Scheme Procedure} substring-move! str1 start1 end1 str2 start2 @deffnx {C Function} scm_substring_move_x (str1, start1, end1, str2, start2) Copy the substring of @var{str1} bounded by @var{start1} and @var{end1} @@ -4727,7 +4261,6 @@ into @var{str2} beginning at position @var{start2}. @end deffn substring-fill! -@c snarfed from strop.c:224 @deffn {Scheme Procedure} substring-fill! str start end fill @deffnx {C Function} scm_substring_fill_x (str, start, end, fill) Change every character in @var{str} between @var{start} and @@ -4742,7 +4275,6 @@ y @end deffn string-null? -@c snarfed from strop.c:249 @deffn {Scheme Procedure} string-null? str @deffnx {C Function} scm_string_null_p (str) Return @code{#t} if @var{str}'s length is zero, and @@ -4755,7 +4287,6 @@ y @result{} "foo" @end deffn string->list -@c snarfed from strop.c:263 @deffn {Scheme Procedure} string->list str @deffnx {C Function} scm_string_to_list (str) Return a newly allocated list of the characters that make up @@ -4765,14 +4296,12 @@ concerned. @end deffn string-copy -@c snarfed from strop.c:292 @deffn {Scheme Procedure} string-copy str @deffnx {C Function} scm_string_copy (str) Return a newly allocated copy of the given @var{string}. @end deffn string-fill! -@c snarfed from strop.c:305 @deffn {Scheme Procedure} string-fill! str chr @deffnx {C Function} scm_string_fill_x (str, chr) Store @var{char} in every element of the given @var{string} and @@ -4780,7 +4309,6 @@ return an unspecified value. @end deffn string-upcase! -@c snarfed from strop.c:340 @deffn {Scheme Procedure} string-upcase! str @deffnx {C Function} scm_string_upcase_x (str) Destructively upcase every character in @var{str} and return @@ -4793,7 +4321,6 @@ y @result{} "ARRDEFG" @end deffn string-upcase -@c snarfed from strop.c:353 @deffn {Scheme Procedure} string-upcase str @deffnx {C Function} scm_string_upcase (str) Return a freshly allocated string containing the characters of @@ -4801,7 +4328,6 @@ Return a freshly allocated string containing the characters of @end deffn string-downcase! -@c snarfed from strop.c:385 @deffn {Scheme Procedure} string-downcase! str @deffnx {C Function} scm_string_downcase_x (str) Destructively downcase every character in @var{str} and return @@ -4814,7 +4340,6 @@ y @result{} "arrdefg" @end deffn string-downcase -@c snarfed from strop.c:398 @deffn {Scheme Procedure} string-downcase str @deffnx {C Function} scm_string_downcase (str) Return a freshly allocation string containing the characters in @@ -4822,7 +4347,6 @@ Return a freshly allocation string containing the characters in @end deffn string-capitalize! -@c snarfed from strop.c:443 @deffn {Scheme Procedure} string-capitalize! str @deffnx {C Function} scm_string_capitalize_x (str) Upcase the first character of every word in @var{str} @@ -4836,7 +4360,6 @@ y @result{} "Hello World" @end deffn string-capitalize -@c snarfed from strop.c:457 @deffn {Scheme Procedure} string-capitalize str @deffnx {C Function} scm_string_capitalize (str) Return a freshly allocated string with the characters in @@ -4845,7 +4368,6 @@ capitalized. @end deffn string-split -@c snarfed from strop.c:486 @deffn {Scheme Procedure} string-split str chr @deffnx {C Function} scm_string_split (str, chr) Split the string @var{str} into the a list of the substrings delimited @@ -4869,7 +4391,6 @@ result list. @end deffn string-ci->symbol -@c snarfed from strop.c:521 @deffn {Scheme Procedure} string-ci->symbol str @deffnx {C Function} scm_string_ci_to_symbol (str) Return the symbol whose name is @var{str}. @var{str} is @@ -4878,7 +4399,6 @@ is currently reading symbols case-insensitively. @end deffn string=? -@c snarfed from strorder.c:62 @deffn {Scheme Procedure} string=? s1 s2 Lexicographic equality predicate; return @code{#t} if the two strings are the same length and contain the same characters in @@ -4891,7 +4411,6 @@ characters. @end deffn string-ci=? -@c snarfed from strorder.c:97 @deffn {Scheme Procedure} string-ci=? s1 s2 Case-insensitive string equality predicate; return @code{#t} if the two strings are the same length and their component @@ -4900,35 +4419,30 @@ return @code{#f}. @end deffn string? -@c snarfed from strorder.c:182 @deffn {Scheme Procedure} string>? s1 s2 Lexicographic ordering predicate; return @code{#t} if @var{s1} is lexicographically greater than @var{s2}. @end deffn string>=? -@c snarfed from strorder.c:196 @deffn {Scheme Procedure} string>=? s1 s2 Lexicographic ordering predicate; return @code{#t} if @var{s1} is lexicographically greater than or equal to @var{s2}. @end deffn string-ci? -@c snarfed from strorder.c:265 @deffn {Scheme Procedure} string-ci>? s1 s2 Case insensitive lexicographic ordering predicate; return @code{#t} if @var{s1} is lexicographically greater than @@ -4952,7 +4464,6 @@ Case insensitive lexicographic ordering predicate; return @end deffn string-ci>=? -@c snarfed from strorder.c:280 @deffn {Scheme Procedure} string-ci>=? s1 s2 Case insensitive lexicographic ordering predicate; return @code{#t} if @var{s1} is lexicographically greater than or @@ -4960,7 +4471,6 @@ equal to @var{s2} regardless of case. @end deffn object->string -@c snarfed from strports.c:321 @deffn {Scheme Procedure} object->string obj [printer] @deffnx {C Function} scm_object_to_string (obj, printer) Return a Scheme string obtained by printing @var{obj}. @@ -4969,7 +4479,6 @@ argument @var{printer} (default: @code{write}). @end deffn call-with-output-string -@c snarfed from strports.c:345 @deffn {Scheme Procedure} call-with-output-string proc @deffnx {C Function} scm_call_with_output_string (proc) Calls the one-argument procedure @var{proc} with a newly created output @@ -4978,7 +4487,6 @@ written into the port is returned. @end deffn call-with-input-string -@c snarfed from strports.c:364 @deffn {Scheme Procedure} call-with-input-string string proc @deffnx {C Function} scm_call_with_input_string (string, proc) Calls the one-argument procedure @var{proc} with a newly @@ -4987,7 +4495,6 @@ read. The value yielded by the @var{proc} is returned. @end deffn open-input-string -@c snarfed from strports.c:377 @deffn {Scheme Procedure} open-input-string str @deffnx {C Function} scm_open_input_string (str) Take a string and return an input port that delivers characters @@ -4997,7 +4504,6 @@ by the garbage collector if it becomes inaccessible. @end deffn open-output-string -@c snarfed from strports.c:391 @deffn {Scheme Procedure} open-output-string @deffnx {C Function} scm_open_output_string () Return an output port that will accumulate characters for @@ -5008,7 +4514,6 @@ inaccessible. @end deffn get-output-string -@c snarfed from strports.c:408 @deffn {Scheme Procedure} get-output-string port @deffnx {C Function} scm_get_output_string (port) Given an output port created by @code{open-output-string}, @@ -5017,7 +4522,6 @@ output to the port so far. @end deffn eval-string -@c snarfed from strports.c:467 @deffn {Scheme Procedure} eval-string string @deffnx {C Function} scm_eval_string (string) Evaluate @var{string} as the text representation of a Scheme @@ -5027,7 +4531,6 @@ procedure @code{interaction-environment}. @end deffn make-struct-layout -@c snarfed from struct.c:77 @deffn {Scheme Procedure} make-struct-layout fields @deffnx {C Function} scm_make_struct_layout (fields) Return a new structure layout object. @@ -5043,7 +4546,6 @@ indicate that the field is a tail-array. @end deffn struct? -@c snarfed from struct.c:244 @deffn {Scheme Procedure} struct? x @deffnx {C Function} scm_struct_p (x) Return @code{#t} iff @var{x} is a structure object, else @@ -5051,14 +4553,12 @@ Return @code{#t} iff @var{x} is a structure object, else @end deffn struct-vtable? -@c snarfed from struct.c:253 @deffn {Scheme Procedure} struct-vtable? x @deffnx {C Function} scm_struct_vtable_p (x) Return @code{#t} iff @var{x} is a vtable structure. @end deffn make-struct -@c snarfed from struct.c:434 @deffn {Scheme Procedure} make-struct vtable tail_array_size . init @deffnx {C Function} scm_make_struct (vtable, tail_array_size, init) Create a new structure. @@ -5089,7 +4589,6 @@ For more information, see the documentation for @code{make-vtable-vtable}. @end deffn make-vtable-vtable -@c snarfed from struct.c:519 @deffn {Scheme Procedure} make-vtable-vtable user_fields tail_array_size . init @deffnx {C Function} scm_make_vtable_vtable (user_fields, tail_array_size, init) Return a new, self-describing vtable structure. @@ -5151,7 +4650,6 @@ ball @result{} # @end deffn struct-ref -@c snarfed from struct.c:560 @deffn {Scheme Procedure} struct-ref handle pos @deffnx {Scheme Procedure} struct-set! struct n value @deffnx {C Function} scm_struct_ref (handle, pos) @@ -5164,7 +4662,6 @@ integer value small enough to fit in one machine word. @end deffn struct-set! -@c snarfed from struct.c:638 @deffn {Scheme Procedure} struct-set! handle pos val @deffnx {C Function} scm_struct_set_x (handle, pos, val) Set the slot of the structure @var{handle} with index @var{pos} @@ -5173,35 +4670,30 @@ to. @end deffn struct-vtable -@c snarfed from struct.c:708 @deffn {Scheme Procedure} struct-vtable handle @deffnx {C Function} scm_struct_vtable (handle) Return the vtable structure that describes the type of @var{struct}. @end deffn struct-vtable-tag -@c snarfed from struct.c:719 @deffn {Scheme Procedure} struct-vtable-tag handle @deffnx {C Function} scm_struct_vtable_tag (handle) Return the vtable tag of the structure @var{handle}. @end deffn struct-vtable-name -@c snarfed from struct.c:758 @deffn {Scheme Procedure} struct-vtable-name vtable @deffnx {C Function} scm_struct_vtable_name (vtable) Return the name of the vtable @var{vtable}. @end deffn set-struct-vtable-name! -@c snarfed from struct.c:768 @deffn {Scheme Procedure} set-struct-vtable-name! vtable name @deffnx {C Function} scm_set_struct_vtable_name_x (vtable, name) Set the name of the vtable @var{vtable} to @var{name}. @end deffn symbol? -@c snarfed from symbols.c:164 @deffn {Scheme Procedure} symbol? obj @deffnx {C Function} scm_symbol_p (obj) Return @code{#t} if @var{obj} is a symbol, otherwise return @@ -5209,7 +4701,6 @@ Return @code{#t} if @var{obj} is a symbol, otherwise return @end deffn symbol-interned? -@c snarfed from symbols.c:174 @deffn {Scheme Procedure} symbol-interned? symbol @deffnx {C Function} scm_symbol_interned_p (symbol) Return @code{#t} if @var{symbol} is interned, otherwise return @@ -5217,14 +4708,12 @@ Return @code{#t} if @var{symbol} is interned, otherwise return @end deffn make-symbol -@c snarfed from symbols.c:186 @deffn {Scheme Procedure} make-symbol name @deffnx {C Function} scm_make_symbol (name) Return a new uninterned symbol with the name @var{name}. The returned symbol is guaranteed to be unique and future calls to @code{string->symbol} will not return it. @end deffn symbol->string -@c snarfed from symbols.c:222 @deffn {Scheme Procedure} symbol->string s @deffnx {C Function} scm_symbol_to_string (s) Return the name of @var{symbol} as a string. If the symbol was @@ -5253,7 +4742,6 @@ standard case is lower case: @end deffn string->symbol -@c snarfed from symbols.c:255 @deffn {Scheme Procedure} string->symbol string @deffnx {C Function} scm_string_to_symbol (string) Return the symbol whose name is @var{string}. This procedure @@ -5279,7 +4767,6 @@ standard case is lower case: @end deffn gensym -@c snarfed from symbols.c:277 @deffn {Scheme Procedure} gensym [prefix] @deffnx {C Function} scm_gensym (prefix) Create a new symbol with a name constructed from a prefix and @@ -5290,42 +4777,36 @@ resetting the counter. @end deffn symbol-hash -@c snarfed from symbols.c:309 @deffn {Scheme Procedure} symbol-hash symbol @deffnx {C Function} scm_symbol_hash (symbol) Return a hash value for @var{symbol}. @end deffn symbol-fref -@c snarfed from symbols.c:319 @deffn {Scheme Procedure} symbol-fref s @deffnx {C Function} scm_symbol_fref (s) Return the contents of @var{symbol}'s @dfn{function slot}. @end deffn symbol-pref -@c snarfed from symbols.c:330 @deffn {Scheme Procedure} symbol-pref s @deffnx {C Function} scm_symbol_pref (s) Return the @dfn{property list} currently associated with @var{symbol}. @end deffn symbol-fset! -@c snarfed from symbols.c:341 @deffn {Scheme Procedure} symbol-fset! s val @deffnx {C Function} scm_symbol_fset_x (s, val) Change the binding of @var{symbol}'s function slot. @end deffn symbol-pset! -@c snarfed from symbols.c:353 @deffn {Scheme Procedure} symbol-pset! s val @deffnx {C Function} scm_symbol_pset_x (s, val) Change the binding of @var{symbol}'s property slot. @end deffn catch -@c snarfed from throw.c:534 @deffn {Scheme Procedure} catch key thunk handler @deffnx {C Function} scm_catch (key, thunk, handler) Invoke @var{thunk} in the dynamic context of @var{handler} for @@ -5349,7 +4830,6 @@ match this call to @code{catch}. @end deffn lazy-catch -@c snarfed from throw.c:562 @deffn {Scheme Procedure} lazy-catch key thunk handler @deffnx {C Function} scm_lazy_catch (key, thunk, handler) This behaves exactly like @code{catch}, except that it does @@ -5359,7 +4839,6 @@ it must throw to another catch, or otherwise exit non-locally. @end deffn throw -@c snarfed from throw.c:595 @deffn {Scheme Procedure} throw key . args @deffnx {C Function} scm_throw (key, args) Invoke the catch form matching @var{key}, passing @var{args} to the @@ -5372,7 +4851,6 @@ If there is no handler at all, Guile prints an error and then exits. @end deffn values -@c snarfed from values.c:77 @deffn {Scheme Procedure} values . args @deffnx {C Function} scm_values (args) Delivers all of its arguments to its continuation. Except for @@ -5383,21 +4861,18 @@ were not created by @code{call-with-values} is unspecified. @end deffn make-variable -@c snarfed from variable.c:76 @deffn {Scheme Procedure} make-variable init @deffnx {C Function} scm_make_variable (init) Return a variable initialized to value @var{init}. @end deffn make-undefined-variable -@c snarfed from variable.c:86 @deffn {Scheme Procedure} make-undefined-variable @deffnx {C Function} scm_make_undefined_variable () Return a variable that is initially unbound. @end deffn variable? -@c snarfed from variable.c:97 @deffn {Scheme Procedure} variable? obj @deffnx {C Function} scm_variable_p (obj) Return @code{#t} iff @var{obj} is a variable object, else @@ -5405,7 +4880,6 @@ return @code{#f}. @end deffn variable-ref -@c snarfed from variable.c:109 @deffn {Scheme Procedure} variable-ref var @deffnx {C Function} scm_variable_ref (var) Dereference @var{var} and return its value. @@ -5414,7 +4888,6 @@ and @code{make-undefined-variable}. @end deffn variable-set! -@c snarfed from variable.c:125 @deffn {Scheme Procedure} variable-set! var val @deffnx {C Function} scm_variable_set_x (var, val) Set the value of the variable @var{var} to @var{val}. @@ -5423,7 +4896,6 @@ value. Return an unspecified value. @end deffn variable-bound? -@c snarfed from variable.c:137 @deffn {Scheme Procedure} variable-bound? var @deffnx {C Function} scm_variable_bound_p (var) Return @code{#t} iff @var{var} is bound to a value. @@ -5431,7 +4903,6 @@ Throws an error if @var{var} is not a variable object. @end deffn vector? -@c snarfed from vectors.c:59 @deffn {Scheme Procedure} vector? obj @deffnx {C Function} scm_vector_p (obj) Return @code{#t} if @var{obj} is a vector, otherwise return @@ -5439,13 +4910,11 @@ Return @code{#t} if @var{obj} is a vector, otherwise return @end deffn list->vector -@c snarfed from vectors.c:76 @deffn {Scheme Procedure} list->vector implemented by the C function "scm_vector" @end deffn vector -@c snarfed from vectors.c:93 @deffn {Scheme Procedure} vector . l @deffnx {Scheme Procedure} list->vector l @deffnx {C Function} scm_vector (l) @@ -5458,7 +4927,6 @@ given arguments. Analogous to @code{list}. @end deffn make-vector -@c snarfed from vectors.c:179 @deffn {Scheme Procedure} make-vector k [fill] @deffnx {C Function} scm_make_vector (k, fill) Return a newly allocated vector of @var{k} elements. If a @@ -5468,7 +4936,6 @@ unspecified. @end deffn vector->list -@c snarfed from vectors.c:233 @deffn {Scheme Procedure} vector->list v @deffnx {C Function} scm_vector_to_list (v) Return a newly allocated list composed of the elements of @var{v}. @@ -5480,7 +4947,6 @@ Return a newly allocated list composed of the elements of @var{v}. @end deffn vector-fill! -@c snarfed from vectors.c:250 @deffn {Scheme Procedure} vector-fill! v fill @deffnx {C Function} scm_vector_fill_x (v, fill) Store @var{fill} in every position of @var{vector}. The value @@ -5488,7 +4954,6 @@ returned by @code{vector-fill!} is unspecified. @end deffn vector-move-left! -@c snarfed from vectors.c:283 @deffn {Scheme Procedure} vector-move-left! vec1 start1 end1 vec2 start2 @deffnx {C Function} scm_vector_move_left_x (vec1, start1, end1, vec2, start2) Copy elements from @var{vec1}, positions @var{start1} to @var{end1}, @@ -5502,7 +4967,6 @@ same vector, @code{vector-move-left!} is usually appropriate when @end deffn vector-move-right! -@c snarfed from vectors.c:312 @deffn {Scheme Procedure} vector-move-right! vec1 start1 end1 vec2 start2 @deffnx {C Function} scm_vector_move_right_x (vec1, start1, end1, vec2, start2) Copy elements from @var{vec1}, positions @var{start1} to @var{end1}, @@ -5516,7 +4980,6 @@ same vector, @code{vector-move-right!} is usually appropriate when @end deffn major-version -@c snarfed from version.c:59 @deffn {Scheme Procedure} major-version @deffnx {C Function} scm_major_version () Return a string containing Guile's major version number. @@ -5524,7 +4987,6 @@ E.g., the 1 in "1.6.5". @end deffn minor-version -@c snarfed from version.c:72 @deffn {Scheme Procedure} minor-version @deffnx {C Function} scm_minor_version () Return a string containing Guile's minor version number. @@ -5532,7 +4994,6 @@ E.g., the 6 in "1.6.5". @end deffn micro-version -@c snarfed from version.c:85 @deffn {Scheme Procedure} micro-version @deffnx {C Function} scm_micro_version () Return a string containing Guile's micro version number. @@ -5540,7 +5001,6 @@ E.g., the 5 in "1.6.5". @end deffn version -@c snarfed from version.c:107 @deffn {Scheme Procedure} version @deffnx {Scheme Procedure} major-version @deffnx {Scheme Procedure} minor-version @@ -5558,7 +5018,6 @@ or micro version number, respectively. @end deffn make-soft-port -@c snarfed from vports.c:185 @deffn {Scheme Procedure} make-soft-port pv modes @deffnx {C Function} scm_make_soft_port (pv, modes) Return a port capable of receiving or delivering characters as @@ -5605,7 +5064,6 @@ For example: @end deffn make-weak-vector -@c snarfed from weaks.c:116 @deffn {Scheme Procedure} make-weak-vector size [fill] @deffnx {C Function} scm_make_weak_vector (size, fill) Return a weak vector with @var{size} elements. If the optional @@ -5615,13 +5073,11 @@ empty list. @end deffn list->weak-vector -@c snarfed from weaks.c:124 @deffn {Scheme Procedure} list->weak-vector implemented by the C function "scm_weak_vector" @end deffn weak-vector -@c snarfed from weaks.c:132 @deffn {Scheme Procedure} weak-vector . l @deffnx {Scheme Procedure} list->weak-vector l @deffnx {C Function} scm_weak_vector (l) @@ -5632,7 +5088,6 @@ the same way @code{list->vector} would. @end deffn weak-vector? -@c snarfed from weaks.c:160 @deffn {Scheme Procedure} weak-vector? obj @deffnx {C Function} scm_weak_vector_p (obj) Return @code{#t} if @var{obj} is a weak vector. Note that all @@ -5640,7 +5095,6 @@ weak hashes are also weak vectors. @end deffn make-weak-key-hash-table -@c snarfed from weaks.c:178 @deffn {Scheme Procedure} make-weak-key-hash-table size @deffnx {Scheme Procedure} make-weak-value-hash-table size @deffnx {Scheme Procedure} make-doubly-weak-hash-table size @@ -5654,7 +5108,6 @@ would modify regular hash tables. (@pxref{Hash Tables}) @end deffn make-weak-value-hash-table -@c snarfed from weaks.c:189 @deffn {Scheme Procedure} make-weak-value-hash-table size @deffnx {C Function} scm_make_weak_value_hash_table (size) Return a hash table with weak values with @var{size} buckets. @@ -5662,7 +5115,6 @@ Return a hash table with weak values with @var{size} buckets. @end deffn make-doubly-weak-hash-table -@c snarfed from weaks.c:200 @deffn {Scheme Procedure} make-doubly-weak-hash-table size @deffnx {C Function} scm_make_doubly_weak_hash_table (size) Return a hash table with weak keys and values with @var{size} @@ -5670,7 +5122,6 @@ buckets. (@pxref{Hash Tables}) @end deffn weak-key-hash-table? -@c snarfed from weaks.c:214 @deffn {Scheme Procedure} weak-key-hash-table? obj @deffnx {Scheme Procedure} weak-value-hash-table? obj @deffnx {Scheme Procedure} doubly-weak-hash-table? obj @@ -5681,21 +5132,18 @@ nor a weak value hash table. @end deffn weak-value-hash-table? -@c snarfed from weaks.c:224 @deffn {Scheme Procedure} weak-value-hash-table? obj @deffnx {C Function} scm_weak_value_hash_table_p (obj) Return @code{#t} if @var{obj} is a weak value hash table. @end deffn doubly-weak-hash-table? -@c snarfed from weaks.c:234 @deffn {Scheme Procedure} doubly-weak-hash-table? obj @deffnx {C Function} scm_doubly_weak_hash_table_p (obj) Return @code{#t} if @var{obj} is a doubly weak hash table. @end deffn regexp? -@c snarfed from regex-posix.c:137 @deffn {Scheme Procedure} regexp? obj @deffnx {C Function} scm_regexp_p (obj) Return @code{#t} if @var{obj} is a compiled regular expression, @@ -5703,7 +5151,6 @@ or @code{#f} otherwise. @end deffn make-regexp -@c snarfed from regex-posix.c:182 @deffn {Scheme Procedure} make-regexp pat . flags @deffnx {C Function} scm_make_regexp (pat, flags) Compile the regular expression described by @var{pat}, and @@ -5746,7 +5193,6 @@ one which comes last will override the earlier one. @end deffn regexp-exec -@c snarfed from regex-posix.c:243 @deffn {Scheme Procedure} regexp-exec rx str [start [flags]] @deffnx {C Function} scm_regexp_exec (rx, str, start, flags) Match the compiled regular expression @var{rx} against @@ -5771,7 +5217,6 @@ considered the end of a line. @end deffn array-fill! -@c snarfed from ramap.c:462 @deffn {Scheme Procedure} array-fill! ra fill @deffnx {C Function} scm_array_fill_x (ra, fill) Store @var{fill} in every element of @var{array}. The value returned @@ -5779,13 +5224,11 @@ is unspecified. @end deffn array-copy-in-order! -@c snarfed from ramap.c:827 @deffn {Scheme Procedure} array-copy-in-order! implemented by the C function "scm_array_copy_x" @end deffn array-copy! -@c snarfed from ramap.c:836 @deffn {Scheme Procedure} array-copy! src dst @deffnx {Scheme Procedure} array-copy-in-order! src dst @deffnx {C Function} scm_array_copy_x (src, dst) @@ -5796,13 +5239,11 @@ dimension. The order is unspecified. @end deffn array-map-in-order! -@c snarfed from ramap.c:1510 @deffn {Scheme Procedure} array-map-in-order! implemented by the C function "scm_array_map_x" @end deffn array-map! -@c snarfed from ramap.c:1521 @deffn {Scheme Procedure} array-map! ra0 proc . lra @deffnx {Scheme Procedure} array-map-in-order! ra0 proc . lra @deffnx {C Function} scm_array_map_x (ra0, proc, lra) @@ -5815,7 +5256,6 @@ unspecified. The order of application is unspecified. @end deffn array-for-each -@c snarfed from ramap.c:1668 @deffn {Scheme Procedure} array-for-each proc ra0 . lra @deffnx {C Function} scm_array_for_each (proc, ra0, lra) Apply @var{proc} to each tuple of elements of @var{array0} @dots{} @@ -5823,7 +5263,6 @@ in row-major order. The value returned is unspecified. @end deffn array-index-map! -@c snarfed from ramap.c:1696 @deffn {Scheme Procedure} array-index-map! ra proc @deffnx {C Function} scm_array_index_map_x (ra, proc) Apply @var{proc} to the indices of each element of @var{array} in @@ -5847,14 +5286,12 @@ Another example: @end deffn uniform-vector-length -@c snarfed from unif.c:250 @deffn {Scheme Procedure} uniform-vector-length v @deffnx {C Function} scm_uniform_vector_length (v) Return the number of elements in @var{uve}. @end deffn array? -@c snarfed from unif.c:284 @deffn {Scheme Procedure} array? v [prot] @deffnx {C Function} scm_array_p (v, prot) Return @code{#t} if the @var{obj} is an array, and @code{#f} if @@ -5863,7 +5300,6 @@ and is described elsewhere. @end deffn array-rank -@c snarfed from unif.c:355 @deffn {Scheme Procedure} array-rank ra @deffnx {C Function} scm_array_rank (ra) Return the number of dimensions of @var{obj}. If @var{obj} is @@ -5871,7 +5307,6 @@ not an array, @code{0} is returned. @end deffn array-dimensions -@c snarfed from unif.c:393 @deffn {Scheme Procedure} array-dimensions ra @deffnx {C Function} scm_array_dimensions (ra) @code{Array-dimensions} is similar to @code{array-shape} but replaces @@ -5882,28 +5317,24 @@ elements with a @code{0} minimum with one greater than the maximum. So: @end deffn shared-array-root -@c snarfed from unif.c:440 @deffn {Scheme Procedure} shared-array-root ra @deffnx {C Function} scm_shared_array_root (ra) Return the root vector of a shared array. @end deffn shared-array-offset -@c snarfed from unif.c:451 @deffn {Scheme Procedure} shared-array-offset ra @deffnx {C Function} scm_shared_array_offset (ra) Return the root vector index of the first element in the array. @end deffn shared-array-increments -@c snarfed from unif.c:462 @deffn {Scheme Procedure} shared-array-increments ra @deffnx {C Function} scm_shared_array_increments (ra) For each dimension, return the distance between elements in the root vector. @end deffn dimensions->uniform-array -@c snarfed from unif.c:581 @deffn {Scheme Procedure} dimensions->uniform-array dims prot [fill] @deffnx {Scheme Procedure} make-uniform-vector length prototype [fill] @deffnx {C Function} scm_dimensions_to_uniform_array (dims, prot, fill) @@ -5914,7 +5345,6 @@ fill the array, otherwise @var{prototype} is used. @end deffn make-shared-array -@c snarfed from unif.c:670 @deffn {Scheme Procedure} make-shared-array oldra mapfunc . dims @deffnx {C Function} scm_make_shared_array (oldra, mapfunc, dims) @code{make-shared-array} can be used to create shared subarrays of other @@ -5935,7 +5365,6 @@ it can be otherwise arbitrary. A simple example: @end deffn transpose-array -@c snarfed from unif.c:802 @deffn {Scheme Procedure} transpose-array ra . args @deffnx {C Function} scm_transpose_array (ra, args) Return an array sharing contents with @var{array}, but with @@ -5960,7 +5389,6 @@ have smaller rank than @var{array}. @end deffn enclose-array -@c snarfed from unif.c:911 @deffn {Scheme Procedure} enclose-array ra . axes @deffnx {C Function} scm_enclose_array (ra, axes) @var{dim0}, @var{dim1} @dots{} should be nonnegative integers less than @@ -5987,7 +5415,6 @@ examples: @end deffn array-in-bounds? -@c snarfed from unif.c:995 @deffn {Scheme Procedure} array-in-bounds? v . args @deffnx {C Function} scm_array_in_bounds_p (v, args) Return @code{#t} if its arguments would be acceptable to @@ -5995,13 +5422,11 @@ Return @code{#t} if its arguments would be acceptable to @end deffn array-ref -@c snarfed from unif.c:1074 @deffn {Scheme Procedure} array-ref implemented by the C function "scm_uniform_vector_ref" @end deffn uniform-vector-ref -@c snarfed from unif.c:1081 @deffn {Scheme Procedure} uniform-vector-ref v args @deffnx {Scheme Procedure} array-ref v . args @deffnx {C Function} scm_uniform_vector_ref (v, args) @@ -6010,13 +5435,11 @@ Return the element at the @code{(index1, index2)} element in @end deffn uniform-array-set1! -@c snarfed from unif.c:1250 @deffn {Scheme Procedure} uniform-array-set1! implemented by the C function "scm_array_set_x" @end deffn array-set! -@c snarfed from unif.c:1259 @deffn {Scheme Procedure} array-set! v obj . args @deffnx {Scheme Procedure} uniform-array-set1! v obj args @deffnx {C Function} scm_array_set_x (v, obj, args) @@ -6025,7 +5448,6 @@ Set the element at the @code{(index1, index2)} element in @var{array} to @end deffn array-contents -@c snarfed from unif.c:1374 @deffn {Scheme Procedure} array-contents ra [strict] @deffnx {C Function} scm_array_contents (ra, strict) If @var{array} may be @dfn{unrolled} into a one dimensional shared array @@ -6041,7 +5463,6 @@ memory. @end deffn uniform-array-read! -@c snarfed from unif.c:1488 @deffn {Scheme Procedure} uniform-array-read! ra [port_or_fd [start [end]]] @deffnx {Scheme Procedure} uniform-vector-read! uve [port-or-fdes] [start] [end] @deffnx {C Function} scm_uniform_array_read_x (ra, port_or_fd, start, end) @@ -6062,7 +5483,6 @@ returned by @code{(current-input-port)}. @end deffn uniform-array-write -@c snarfed from unif.c:1653 @deffn {Scheme Procedure} uniform-array-write v [port_or_fd [start [end]]] @deffnx {Scheme Procedure} uniform-vector-write uve [port-or-fdes] [start] [end] @deffnx {C Function} scm_uniform_array_write (v, port_or_fd, start, end) @@ -6080,7 +5500,6 @@ omitted, in which case it defaults to the value returned by @end deffn bit-count -@c snarfed from unif.c:1780 @deffn {Scheme Procedure} bit-count b bitvector @deffnx {C Function} scm_bit_count (b, bitvector) Return the number of occurrences of the boolean @var{b} in @@ -6088,7 +5507,6 @@ Return the number of occurrences of the boolean @var{b} in @end deffn bit-position -@c snarfed from unif.c:1819 @deffn {Scheme Procedure} bit-position item v k @deffnx {C Function} scm_bit_position (item, v, k) Return the minimum index of an occurrence of @var{bool} in @@ -6097,7 +5515,6 @@ within the specified range @code{#f} is returned. @end deffn bit-set*! -@c snarfed from unif.c:1887 @deffn {Scheme Procedure} bit-set*! v kv obj @deffnx {C Function} scm_bit_set_star_x (v, kv, obj) If uve is a bit-vector @var{bv} and uve must be of the same @@ -6112,7 +5529,6 @@ of @var{bv} corresponding to the indexes in uve are set to @end deffn bit-count* -@c snarfed from unif.c:1941 @deffn {Scheme Procedure} bit-count* v kv obj @deffnx {C Function} scm_bit_count_star (v, kv, obj) Return @@ -6123,14 +5539,12 @@ Return @end deffn bit-invert! -@c snarfed from unif.c:2005 @deffn {Scheme Procedure} bit-invert! v @deffnx {C Function} scm_bit_invert_x (v) Modify @var{bv} by replacing each element with its negation. @end deffn array->list -@c snarfed from unif.c:2084 @deffn {Scheme Procedure} array->list v @deffnx {C Function} scm_array_to_list (v) Return a list consisting of all the elements, in order, of @@ -6138,7 +5552,6 @@ Return a list consisting of all the elements, in order, of @end deffn list->uniform-array -@c snarfed from unif.c:2185 @deffn {Scheme Procedure} list->uniform-array ndim prot lst @deffnx {Scheme Procedure} list->uniform-vector prot lst @deffnx {C Function} scm_list_to_uniform_array (ndim, prot, lst) @@ -6149,7 +5562,6 @@ done. @end deffn array-prototype -@c snarfed from unif.c:2536 @deffn {Scheme Procedure} array-prototype ra @deffnx {C Function} scm_array_prototype (ra) Return an object that would produce an array of the same type @@ -6158,7 +5570,6 @@ as @var{array}, if used as the @var{prototype} for @end deffn chown -@c snarfed from filesys.c:214 @deffn {Scheme Procedure} chown object owner group @deffnx {C Function} scm_chown (object, owner, group) Change the ownership and group of the file referred to by @var{object} to @@ -6176,7 +5587,6 @@ as @code{-1}, then that ID is not changed. @end deffn chmod -@c snarfed from filesys.c:254 @deffn {Scheme Procedure} chmod object mode @deffnx {C Function} scm_chmod (object, mode) Changes the permissions of the file referred to by @var{obj}. @@ -6189,10 +5599,9 @@ The return value is unspecified. @end deffn umask -@c snarfed from filesys.c:287 @deffn {Scheme Procedure} umask [mode] @deffnx {C Function} scm_umask (mode) -If @var{mode} is omitted, retuns a decimal number representing the current +If @var{mode} is omitted, returns a decimal number representing the current file creation mask. Otherwise the file creation mask is set to @var{mode} and the previous value is returned. @@ -6200,7 +5609,6 @@ E.g., @code{(umask #o022)} sets the mask to octal 22, decimal 18. @end deffn open-fdes -@c snarfed from filesys.c:310 @deffn {Scheme Procedure} open-fdes path flags [mode] @deffnx {C Function} scm_open_fdes (path, flags, mode) Similar to @code{open} but return a file descriptor instead of @@ -6208,7 +5616,6 @@ a port. @end deffn open -@c snarfed from filesys.c:352 @deffn {Scheme Procedure} open path flags [mode] @deffnx {C Function} scm_open (path, flags, mode) Open the file named by @var{path} for reading and/or writing. @@ -6241,7 +5648,6 @@ for additional flags. @end deffn close -@c snarfed from filesys.c:390 @deffn {Scheme Procedure} close fd_or_port @deffnx {C Function} scm_close (fd_or_port) Similar to close-port (@pxref{Closing, close-port}), @@ -6252,7 +5658,6 @@ their revealed counts set to zero. @end deffn close-fdes -@c snarfed from filesys.c:418 @deffn {Scheme Procedure} close-fdes fd @deffnx {C Function} scm_close_fdes (fd) A simple wrapper for the @code{close} system call. @@ -6263,7 +5668,6 @@ The return value is unspecified. @end deffn stat -@c snarfed from filesys.c:621 @deffn {Scheme Procedure} stat object @deffnx {C Function} scm_stat (object) Return an object containing various information about the file @@ -6325,7 +5729,6 @@ An integer representing the access permission bits. @end deffn link -@c snarfed from filesys.c:684 @deffn {Scheme Procedure} link oldpath newpath @deffnx {C Function} scm_link (oldpath, newpath) Creates a new name @var{newpath} in the file system for the @@ -6335,7 +5738,6 @@ system. @end deffn rename-file -@c snarfed from filesys.c:705 @deffn {Scheme Procedure} rename-file oldname newname @deffnx {C Function} scm_rename (oldname, newname) Renames the file specified by @var{oldname} to @var{newname}. @@ -6343,14 +5745,12 @@ The return value is unspecified. @end deffn delete-file -@c snarfed from filesys.c:732 @deffn {Scheme Procedure} delete-file str @deffnx {C Function} scm_delete_file (str) Deletes (or "unlinks") the file specified by @var{path}. @end deffn mkdir -@c snarfed from filesys.c:750 @deffn {Scheme Procedure} mkdir path [mode] @deffnx {C Function} scm_mkdir (path, mode) Create a new directory named by @var{path}. If @var{mode} is omitted @@ -6360,7 +5760,6 @@ umask. Otherwise they are set to the decimal value specified with @end deffn rmdir -@c snarfed from filesys.c:778 @deffn {Scheme Procedure} rmdir path @deffnx {C Function} scm_rmdir (path) Remove the existing directory named by @var{path}. The directory must @@ -6368,7 +5767,6 @@ be empty for this to succeed. The return value is unspecified. @end deffn directory-stream? -@c snarfed from filesys.c:803 @deffn {Scheme Procedure} directory-stream? obj @deffnx {C Function} scm_directory_stream_p (obj) Return a boolean indicating whether @var{object} is a directory @@ -6376,7 +5774,6 @@ stream as returned by @code{opendir}. @end deffn opendir -@c snarfed from filesys.c:814 @deffn {Scheme Procedure} opendir dirname @deffnx {C Function} scm_opendir (dirname) Open the directory specified by @var{path} and return a directory @@ -6384,7 +5781,6 @@ stream. @end deffn readdir -@c snarfed from filesys.c:831 @deffn {Scheme Procedure} readdir port @deffnx {C Function} scm_readdir (port) Return (as a string) the next directory entry from the directory stream @@ -6393,7 +5789,6 @@ end of file object is returned. @end deffn rewinddir -@c snarfed from filesys.c:854 @deffn {Scheme Procedure} rewinddir port @deffnx {C Function} scm_rewinddir (port) Reset the directory port @var{stream} so that the next call to @@ -6401,7 +5796,6 @@ Reset the directory port @var{stream} so that the next call to @end deffn closedir -@c snarfed from filesys.c:871 @deffn {Scheme Procedure} closedir port @deffnx {C Function} scm_closedir (port) Close the directory stream @var{stream}. @@ -6409,7 +5803,6 @@ The return value is unspecified. @end deffn chdir -@c snarfed from filesys.c:921 @deffn {Scheme Procedure} chdir str @deffnx {C Function} scm_chdir (str) Change the current working directory to @var{path}. @@ -6417,18 +5810,16 @@ The return value is unspecified. @end deffn getcwd -@c snarfed from filesys.c:937 @deffn {Scheme Procedure} getcwd @deffnx {C Function} scm_getcwd () Return the name of the current working directory. @end deffn select -@c snarfed from filesys.c:1133 @deffn {Scheme Procedure} select reads writes excepts [secs [usecs]] @deffnx {C Function} scm_select (reads, writes, excepts, secs, usecs) This procedure has a variety of uses: waiting for the ability -to provide input, accept output, or the existance of +to provide input, accept output, or the existence of exceptional conditions on a collection of ports or file descriptors, or waiting for a timeout to occur. It also returns if interrupted by a signal. @@ -6459,7 +5850,6 @@ An additional @code{select!} interface is provided. @end deffn fcntl -@c snarfed from filesys.c:1279 @deffn {Scheme Procedure} fcntl object cmd [value] @deffnx {C Function} scm_fcntl (object, cmd, value) Apply @var{command} to the specified file descriptor or the underlying @@ -6490,7 +5880,6 @@ The value used to indicate the "close on exec" flag with @code{F_GETFL} or @end deffn fsync -@c snarfed from filesys.c:1316 @deffn {Scheme Procedure} fsync object @deffnx {C Function} scm_fsync (object) Copies any unwritten data for the specified output file descriptor to disk. @@ -6500,7 +5889,6 @@ The return value is unspecified. @end deffn symlink -@c snarfed from filesys.c:1343 @deffn {Scheme Procedure} symlink oldpath newpath @deffnx {C Function} scm_symlink (oldpath, newpath) Create a symbolic link named @var{path-to} with the value (i.e., pointing to) @@ -6508,7 +5896,6 @@ Create a symbolic link named @var{path-to} with the value (i.e., pointing to) @end deffn readlink -@c snarfed from filesys.c:1362 @deffn {Scheme Procedure} readlink path @deffnx {C Function} scm_readlink (path) Return the value of the symbolic link named by @var{path} (a @@ -6516,7 +5903,6 @@ string), i.e., the file that the link points to. @end deffn lstat -@c snarfed from filesys.c:1391 @deffn {Scheme Procedure} lstat str @deffnx {C Function} scm_lstat (str) Similar to @code{stat}, but does not follow symbolic links, i.e., @@ -6525,7 +5911,6 @@ file it points to. @var{path} must be a string. @end deffn copy-file -@c snarfed from filesys.c:1415 @deffn {Scheme Procedure} copy-file oldfile newfile @deffnx {C Function} scm_copy_file (oldfile, newfile) Copy the file specified by @var{path-from} to @var{path-to}. @@ -6533,7 +5918,6 @@ The return value is unspecified. @end deffn dirname -@c snarfed from filesys.c:1460 @deffn {Scheme Procedure} dirname filename @deffnx {C Function} scm_dirname (filename) Return the directory name component of the file name @@ -6542,17 +5926,15 @@ component, @code{.} is returned. @end deffn basename -@c snarfed from filesys.c:1503 @deffn {Scheme Procedure} basename filename [suffix] @deffnx {C Function} scm_basename (filename, suffix) Return the base name of the file name @var{filename}. The base name is the file name without any directory components. -If @var{suffix} is privided, and is equal to the end of +If @var{suffix} is provided, and is equal to the end of @var{basename}, it is removed also. @end deffn pipe -@c snarfed from posix.c:201 @deffn {Scheme Procedure} pipe @deffnx {C Function} scm_pipe () Return a newly created pipe: a pair of ports which are linked @@ -6571,15 +5953,13 @@ from the input port. @end deffn getgroups -@c snarfed from posix.c:222 @deffn {Scheme Procedure} getgroups @deffnx {C Function} scm_getgroups () Return a vector of integers representing the current -supplimentary group IDs. +supplementary group IDs. @end deffn getpw -@c snarfed from posix.c:253 @deffn {Scheme Procedure} getpw [user] @deffnx {C Function} scm_getpwuid (user) Look up an entry in the user database. @var{obj} can be an integer, @@ -6588,7 +5968,6 @@ or getpwent respectively. @end deffn setpw -@c snarfed from posix.c:306 @deffn {Scheme Procedure} setpw [arg] @deffnx {C Function} scm_setpwent (arg) If called with a true argument, initialize or reset the password data @@ -6597,7 +5976,6 @@ stream. Otherwise, close the stream. The @code{setpwent} and @end deffn getgr -@c snarfed from posix.c:325 @deffn {Scheme Procedure} getgr [name] @deffnx {C Function} scm_getgrgid (name) Look up an entry in the group database. @var{obj} can be an integer, @@ -6606,7 +5984,6 @@ or getgrent respectively. @end deffn setgr -@c snarfed from posix.c:365 @deffn {Scheme Procedure} setgr [arg] @deffnx {C Function} scm_setgrent (arg) If called with a true argument, initialize or reset the group data @@ -6615,7 +5992,6 @@ stream. Otherwise, close the stream. The @code{setgrent} and @end deffn kill -@c snarfed from posix.c:401 @deffn {Scheme Procedure} kill pid sig @deffnx {C Function} scm_kill (pid, sig) Sends a signal to the specified process or group of processes. @@ -6648,7 +6024,6 @@ Interrupt signal. @end deffn waitpid -@c snarfed from posix.c:454 @deffn {Scheme Procedure} waitpid pid [options] @deffnx {C Function} scm_waitpid (pid, options) This procedure collects status information from a child process which @@ -6695,7 +6070,6 @@ The integer status value. @end deffn status:exit-val -@c snarfed from posix.c:482 @deffn {Scheme Procedure} status:exit-val status @deffnx {C Function} scm_status_exit_val (status) Return the exit status value, as would be set if a process @@ -6704,7 +6078,6 @@ if any, otherwise @code{#f}. @end deffn status:term-sig -@c snarfed from posix.c:502 @deffn {Scheme Procedure} status:term-sig status @deffnx {C Function} scm_status_term_sig (status) Return the signal number which terminated the process, if any, @@ -6712,7 +6085,6 @@ otherwise @code{#f}. @end deffn status:stop-sig -@c snarfed from posix.c:520 @deffn {Scheme Procedure} status:stop-sig status @deffnx {C Function} scm_status_stop_sig (status) Return the signal number which stopped the process, if any, @@ -6720,7 +6092,6 @@ otherwise @code{#f}. @end deffn getppid -@c snarfed from posix.c:540 @deffn {Scheme Procedure} getppid @deffnx {C Function} scm_getppid () Return an integer representing the process ID of the parent @@ -6728,21 +6099,18 @@ process. @end deffn getuid -@c snarfed from posix.c:552 @deffn {Scheme Procedure} getuid @deffnx {C Function} scm_getuid () Return an integer representing the current real user ID. @end deffn getgid -@c snarfed from posix.c:563 @deffn {Scheme Procedure} getgid @deffnx {C Function} scm_getgid () Return an integer representing the current real group ID. @end deffn geteuid -@c snarfed from posix.c:577 @deffn {Scheme Procedure} geteuid @deffnx {C Function} scm_geteuid () Return an integer representing the current effective user ID. @@ -6752,7 +6120,6 @@ system supports effective IDs. @end deffn getegid -@c snarfed from posix.c:594 @deffn {Scheme Procedure} getegid @deffnx {C Function} scm_getegid () Return an integer representing the current effective group ID. @@ -6762,7 +6129,6 @@ system supports effective IDs. @end deffn setuid -@c snarfed from posix.c:610 @deffn {Scheme Procedure} setuid id @deffnx {C Function} scm_setuid (id) Sets both the real and effective user IDs to the integer @var{id}, provided @@ -6771,7 +6137,6 @@ The return value is unspecified. @end deffn setgid -@c snarfed from posix.c:624 @deffn {Scheme Procedure} setgid id @deffnx {C Function} scm_setgid (id) Sets both the real and effective group IDs to the integer @var{id}, provided @@ -6780,7 +6145,6 @@ The return value is unspecified. @end deffn seteuid -@c snarfed from posix.c:640 @deffn {Scheme Procedure} seteuid id @deffnx {C Function} scm_seteuid (id) Sets the effective user ID to the integer @var{id}, provided the process @@ -6791,7 +6155,6 @@ The return value is unspecified. @end deffn setegid -@c snarfed from posix.c:666 @deffn {Scheme Procedure} setegid id @deffnx {C Function} scm_setegid (id) Sets the effective group ID to the integer @var{id}, provided the process @@ -6802,7 +6165,6 @@ The return value is unspecified. @end deffn getpgrp -@c snarfed from posix.c:690 @deffn {Scheme Procedure} getpgrp @deffnx {C Function} scm_getpgrp () Return an integer representing the current process group ID. @@ -6810,7 +6172,6 @@ This is the POSIX definition, not BSD. @end deffn setpgid -@c snarfed from posix.c:708 @deffn {Scheme Procedure} setpgid pid pgid @deffnx {C Function} scm_setpgid (pid, pgid) Move the process @var{pid} into the process group @var{pgid}. @var{pid} or @@ -6821,7 +6182,6 @@ The return value is unspecified. @end deffn setsid -@c snarfed from posix.c:727 @deffn {Scheme Procedure} setsid @deffnx {C Function} scm_setsid () Creates a new session. The current process becomes the session leader @@ -6831,7 +6191,6 @@ The return value is an integer representing the new process group ID. @end deffn ttyname -@c snarfed from posix.c:742 @deffn {Scheme Procedure} ttyname port @deffnx {C Function} scm_ttyname (port) Return a string with the name of the serial terminal device @@ -6839,7 +6198,6 @@ underlying @var{port}. @end deffn ctermid -@c snarfed from posix.c:766 @deffn {Scheme Procedure} ctermid @deffnx {C Function} scm_ctermid () Return a string containing the file name of the controlling @@ -6847,7 +6205,6 @@ terminal for the current process. @end deffn tcgetpgrp -@c snarfed from posix.c:789 @deffn {Scheme Procedure} tcgetpgrp port @deffnx {C Function} scm_tcgetpgrp (port) Return the process group ID of the foreground process group @@ -6863,7 +6220,6 @@ foreground. @end deffn tcsetpgrp -@c snarfed from posix.c:813 @deffn {Scheme Procedure} tcsetpgrp port pgid @deffnx {C Function} scm_tcsetpgrp (port, pgid) Set the foreground process group ID for the terminal used by the file @@ -6874,12 +6230,11 @@ controlling terminal. The return value is unspecified. @end deffn execl -@c snarfed from posix.c:873 @deffn {Scheme Procedure} execl filename . args @deffnx {C Function} scm_execl (filename, args) Executes the file named by @var{path} as a new process image. The remaining arguments are supplied to the process; from a C program -they are accessable as the @code{argv} argument to @code{main}. +they are accessible as the @code{argv} argument to @code{main}. Conventionally the first @var{arg} is the same as @var{path}. All arguments must be strings. @@ -6891,7 +6246,6 @@ call, but we call it @code{execl} because of its Scheme calling interface. @end deffn execlp -@c snarfed from posix.c:893 @deffn {Scheme Procedure} execlp filename . args @deffnx {C Function} scm_execlp (filename, args) Similar to @code{execl}, however if @@ -6904,7 +6258,6 @@ call, but we call it @code{execlp} because of its Scheme calling interface. @end deffn execle -@c snarfed from posix.c:943 @deffn {Scheme Procedure} execle filename env . args @deffnx {C Function} scm_execle (filename, env, args) Similar to @code{execl}, but the environment of the new process is @@ -6916,7 +6269,6 @@ call, but we call it @code{execle} because of its Scheme calling interface. @end deffn primitive-fork -@c snarfed from posix.c:967 @deffn {Scheme Procedure} primitive-fork @deffnx {C Function} scm_fork () Creates a new "child" process by duplicating the current "parent" process. @@ -6928,7 +6280,6 @@ with the scsh fork. @end deffn uname -@c snarfed from posix.c:987 @deffn {Scheme Procedure} uname @deffnx {C Function} scm_uname () Return an object with some information about the computer @@ -6936,7 +6287,6 @@ system the program is running on. @end deffn environ -@c snarfed from posix.c:1017 @deffn {Scheme Procedure} environ [env] @deffnx {C Function} scm_environ (env) If @var{env} is omitted, return the current environment (in the @@ -6949,7 +6299,6 @@ then the return value is unspecified. @end deffn tmpnam -@c snarfed from posix.c:1055 @deffn {Scheme Procedure} tmpnam @deffnx {C Function} scm_tmpnam () Return a name in the file system that does not match any @@ -6960,7 +6309,6 @@ Care should be taken if opening the file, e.g., use the @end deffn mkstemp! -@c snarfed from posix.c:1081 @deffn {Scheme Procedure} mkstemp! tmpl @deffnx {C Function} scm_mkstemp (tmpl) Create a new unique file in the file system and returns a new @@ -6971,7 +6319,6 @@ place to return the name of the temporary file. @end deffn utime -@c snarfed from posix.c:1106 @deffn {Scheme Procedure} utime pathname [actime [modtime]] @deffnx {C Function} scm_utime (pathname, actime, modtime) @code{utime} sets the access and modification times for the @@ -6987,7 +6334,6 @@ modification time to the current time. @end deffn access? -@c snarfed from posix.c:1154 @deffn {Scheme Procedure} access? path how @deffnx {C Function} scm_access (path, how) Return @code{#t} if @var{path} corresponds to an existing file @@ -7016,14 +6362,12 @@ test for existence of the file. @end deffn getpid -@c snarfed from posix.c:1168 @deffn {Scheme Procedure} getpid @deffnx {C Function} scm_getpid () Return an integer representing the current process ID. @end deffn putenv -@c snarfed from posix.c:1185 @deffn {Scheme Procedure} putenv str @deffnx {C Function} scm_putenv (str) Modifies the environment of the current process, which is @@ -7040,7 +6384,6 @@ The return value is unspecified. @end deffn setlocale -@c snarfed from posix.c:1216 @deffn {Scheme Procedure} setlocale category [locale] @deffnx {C Function} scm_setlocale (category, locale) If @var{locale} is omitted, return the current value of the @@ -7051,11 +6394,10 @@ specified locale category as a system-dependent string. Otherwise the specified locale category is set to the string @var{locale} and the new value is returned as a system-dependent string. If @var{locale} is an empty string, -the locale will be set using envirionment variables. +the locale will be set using environment variables. @end deffn mknod -@c snarfed from posix.c:1256 @deffn {Scheme Procedure} mknod path type perms dev @deffnx {C Function} scm_mknod (path, type, perms, dev) Creates a new special file, such as a file corresponding to a device. @@ -7076,7 +6418,6 @@ The return value is unspecified. @end deffn nice -@c snarfed from posix.c:1302 @deffn {Scheme Procedure} nice incr @deffnx {C Function} scm_nice (incr) Increment the priority of the current process by @var{incr}. A higher @@ -7085,7 +6426,6 @@ The return value is unspecified. @end deffn sync -@c snarfed from posix.c:1317 @deffn {Scheme Procedure} sync @deffnx {C Function} scm_sync () Flush the operating system disk buffers. @@ -7093,7 +6433,6 @@ The return value is unspecified. @end deffn crypt -@c snarfed from posix.c:1330 @deffn {Scheme Procedure} crypt key salt @deffnx {C Function} scm_crypt (key, salt) Encrypt @var{key} using @var{salt} as the salt value to the @@ -7101,7 +6440,6 @@ crypt(3) library call. @end deffn chroot -@c snarfed from posix.c:1351 @deffn {Scheme Procedure} chroot path @deffnx {C Function} scm_chroot (path) Change the root directory to that specified in @var{path}. @@ -7112,7 +6450,6 @@ root directory. @end deffn getlogin -@c snarfed from posix.c:1383 @deffn {Scheme Procedure} getlogin @deffnx {C Function} scm_getlogin () Return a string containing the name of the user logged in on @@ -7121,7 +6458,6 @@ information cannot be obtained. @end deffn cuserid -@c snarfed from posix.c:1401 @deffn {Scheme Procedure} cuserid @deffnx {C Function} scm_cuserid () Return a string containing a user name associated with the @@ -7130,7 +6466,6 @@ information cannot be obtained. @end deffn getpriority -@c snarfed from posix.c:1426 @deffn {Scheme Procedure} getpriority which who @deffnx {C Function} scm_getpriority (which, who) Return the scheduling priority of the process, process group @@ -7146,7 +6481,6 @@ specified processes. @end deffn setpriority -@c snarfed from posix.c:1460 @deffn {Scheme Procedure} setpriority which who prio @deffnx {C Function} scm_setpriority (which, who, prio) Set the scheduling priority of the process, process group @@ -7165,7 +6499,6 @@ The return value is not specified. @end deffn getpass -@c snarfed from posix.c:1485 @deffn {Scheme Procedure} getpass prompt @deffnx {C Function} scm_getpass (prompt) Display @var{prompt} to the standard error output and read @@ -7178,7 +6511,6 @@ characters is disabled. @end deffn flock -@c snarfed from posix.c:1589 @deffn {Scheme Procedure} flock file operation @deffnx {C Function} scm_flock (file, operation) Apply or remove an advisory lock on an open file. @@ -7197,11 +6529,10 @@ Don't block when locking. May be specified by bitwise OR'ing it to one of the other operations. @end table The return value is not specified. @var{file} may be an open -file descriptor or an open file descriptior port. +file descriptor or an open file descriptor port. @end deffn sethostname -@c snarfed from posix.c:1615 @deffn {Scheme Procedure} sethostname name @deffnx {C Function} scm_sethostname (name) Set the host name of the current processor to @var{name}. May @@ -7210,14 +6541,12 @@ specified. @end deffn gethostname -@c snarfed from posix.c:1630 @deffn {Scheme Procedure} gethostname @deffnx {C Function} scm_gethostname () Return the host name of the current processor. @end deffn gethost -@c snarfed from net_db.c:153 @deffn {Scheme Procedure} gethost [host] @deffnx {Scheme Procedure} gethostbyname hostname @deffnx {Scheme Procedure} gethostbyaddr address @@ -7234,7 +6563,6 @@ Unusual conditions may result in errors thrown to the @end deffn getnet -@c snarfed from net_db.c:232 @deffn {Scheme Procedure} getnet [net] @deffnx {Scheme Procedure} getnetbyname net-name @deffnx {Scheme Procedure} getnetbyaddr net-number @@ -7247,7 +6575,6 @@ given. @end deffn getproto -@c snarfed from net_db.c:281 @deffn {Scheme Procedure} getproto [protocol] @deffnx {Scheme Procedure} getprotobyname name @deffnx {Scheme Procedure} getprotobynumber number @@ -7259,7 +6586,6 @@ argument. @code{getproto} will accept either type, behaving like @end deffn getserv -@c snarfed from net_db.c:347 @deffn {Scheme Procedure} getserv [name [protocol]] @deffnx {Scheme Procedure} getservbyname name protocol @deffnx {Scheme Procedure} getservbyport port protocol @@ -7275,7 +6601,6 @@ as its first argument; if given no arguments, it behaves like @end deffn sethost -@c snarfed from net_db.c:384 @deffn {Scheme Procedure} sethost [stayopen] @deffnx {C Function} scm_sethost (stayopen) If @var{stayopen} is omitted, this is equivalent to @code{endhostent}. @@ -7283,7 +6608,6 @@ Otherwise it is equivalent to @code{sethostent stayopen}. @end deffn setnet -@c snarfed from net_db.c:400 @deffn {Scheme Procedure} setnet [stayopen] @deffnx {C Function} scm_setnet (stayopen) If @var{stayopen} is omitted, this is equivalent to @code{endnetent}. @@ -7291,7 +6615,6 @@ Otherwise it is equivalent to @code{setnetent stayopen}. @end deffn setproto -@c snarfed from net_db.c:416 @deffn {Scheme Procedure} setproto [stayopen] @deffnx {C Function} scm_setproto (stayopen) If @var{stayopen} is omitted, this is equivalent to @code{endprotoent}. @@ -7299,7 +6622,6 @@ Otherwise it is equivalent to @code{setprotoent stayopen}. @end deffn setserv -@c snarfed from net_db.c:432 @deffn {Scheme Procedure} setserv [stayopen] @deffnx {C Function} scm_setserv (stayopen) If @var{stayopen} is omitted, this is equivalent to @code{endservent}. @@ -7307,7 +6629,6 @@ Otherwise it is equivalent to @code{setservent stayopen}. @end deffn htons -@c snarfed from socket.c:108 @deffn {Scheme Procedure} htons value @deffnx {C Function} scm_htons (value) Convert a 16 bit quantity from host to network byte ordering. @@ -7316,7 +6637,6 @@ and returned as a new integer. @end deffn ntohs -@c snarfed from socket.c:125 @deffn {Scheme Procedure} ntohs value @deffnx {C Function} scm_ntohs (value) Convert a 16 bit quantity from network to host byte ordering. @@ -7325,7 +6645,6 @@ and returned as a new integer. @end deffn htonl -@c snarfed from socket.c:142 @deffn {Scheme Procedure} htonl value @deffnx {C Function} scm_htonl (value) Convert a 32 bit quantity from host to network byte ordering. @@ -7334,7 +6653,6 @@ and returned as a new integer. @end deffn ntohl -@c snarfed from socket.c:155 @deffn {Scheme Procedure} ntohl value @deffnx {C Function} scm_ntohl (value) Convert a 32 bit quantity from network to host byte ordering. @@ -7343,7 +6661,6 @@ and returned as a new integer. @end deffn inet-aton -@c snarfed from socket.c:175 @deffn {Scheme Procedure} inet-aton address @deffnx {C Function} scm_inet_aton (address) Convert an IPv4 Internet address from printable string @@ -7355,7 +6672,6 @@ Convert an IPv4 Internet address from printable string @end deffn inet-ntoa -@c snarfed from socket.c:194 @deffn {Scheme Procedure} inet-ntoa inetid @deffnx {C Function} scm_inet_ntoa (inetid) Convert an IPv4 Internet address to a printable @@ -7367,7 +6683,6 @@ Convert an IPv4 Internet address to a printable @end deffn inet-netof -@c snarfed from socket.c:214 @deffn {Scheme Procedure} inet-netof address @deffnx {C Function} scm_inet_netof (address) Return the network number part of the given IPv4 @@ -7379,7 +6694,6 @@ Internet address. E.g., @end deffn inet-lnaof -@c snarfed from socket.c:232 @deffn {Scheme Procedure} inet-lnaof address @deffnx {C Function} scm_lnaof (address) Return the local-address-with-network part of the given @@ -7392,7 +6706,6 @@ E.g., @end deffn inet-makeaddr -@c snarfed from socket.c:250 @deffn {Scheme Procedure} inet-makeaddr net lna @deffnx {C Function} scm_inet_makeaddr (net, lna) Make an IPv4 Internet address by combining the network number @@ -7405,7 +6718,6 @@ Make an IPv4 Internet address by combining the network number @end deffn inet-pton -@c snarfed from socket.c:368 @deffn {Scheme Procedure} inet-pton family address @deffnx {C Function} scm_inet_pton (family, address) Convert a string containing a printable network address to @@ -7421,7 +6733,6 @@ the result is an integer with normal host byte ordering. @end deffn inet-ntop -@c snarfed from socket.c:403 @deffn {Scheme Procedure} inet-ntop family address @deffnx {C Function} scm_inet_ntop (family, address) Convert a network address into a printable string. @@ -7437,7 +6748,6 @@ ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff @end deffn socket -@c snarfed from socket.c:448 @deffn {Scheme Procedure} socket family style proto @deffnx {C Function} scm_socket (family, style, proto) Return a new socket port of the type specified by @var{family}, @@ -7456,7 +6766,6 @@ has been connected to another socket. @end deffn socketpair -@c snarfed from socket.c:470 @deffn {Scheme Procedure} socketpair family style proto @deffnx {C Function} scm_socketpair (family, style, proto) Return a pair of connected (but unnamed) socket ports of the @@ -7467,7 +6776,6 @@ family. Zero is likely to be the only meaningful value for @end deffn getsockopt -@c snarfed from socket.c:499 @deffn {Scheme Procedure} getsockopt sock level optname @deffnx {C Function} scm_getsockopt (sock, level, optname) Return the value of a particular socket option for the socket @@ -7482,7 +6790,6 @@ returns a pair of integers. @end deffn setsockopt -@c snarfed from socket.c:567 @deffn {Scheme Procedure} setsockopt sock level optname value @deffnx {C Function} scm_setsockopt (sock, level, optname, value) Set the value of a particular socket option for the socket @@ -7499,11 +6806,10 @@ The return value is unspecified. @end deffn shutdown -@c snarfed from socket.c:671 @deffn {Scheme Procedure} shutdown sock how @deffnx {C Function} scm_shutdown (sock, how) Sockets can be closed simply by using @code{close-port}. The -@code{shutdown} procedure allows reception or tranmission on a +@code{shutdown} procedure allows reception or transmission on a connection to be shut down individually, according to the parameter @var{how}: @@ -7522,7 +6828,6 @@ The return value is unspecified. @end deffn connect -@c snarfed from socket.c:815 @deffn {Scheme Procedure} connect sock fam address . args @deffnx {C Function} scm_connect (sock, fam, address, args) Initiate a connection from a socket using a specified address @@ -7549,7 +6854,6 @@ The return value is unspecified. @end deffn bind -@c snarfed from socket.c:875 @deffn {Scheme Procedure} bind sock fam address . args @deffnx {C Function} scm_bind (sock, fam, address, args) Assign an address to the socket port @var{sock}. @@ -7598,7 +6902,6 @@ The return value is unspecified. @end deffn listen -@c snarfed from socket.c:909 @deffn {Scheme Procedure} listen sock backlog @deffnx {C Function} scm_listen (sock, backlog) Enable @var{sock} to accept connection @@ -7612,7 +6915,6 @@ The return value is unspecified. @end deffn accept -@c snarfed from socket.c:1014 @deffn {Scheme Procedure} accept sock @deffnx {C Function} scm_accept (sock) Accept a connection on a bound, listening socket. @@ -7632,7 +6934,6 @@ connection and will continue to accept new requests. @end deffn getsockname -@c snarfed from socket.c:1041 @deffn {Scheme Procedure} getsockname sock @deffnx {C Function} scm_getsockname (sock) Return the address of @var{sock}, in the same form as the @@ -7641,7 +6942,6 @@ of a socket in the @code{AF_FILE} namespace cannot be read. @end deffn getpeername -@c snarfed from socket.c:1063 @deffn {Scheme Procedure} getpeername sock @deffnx {C Function} scm_getpeername (sock) Return the address that @var{sock} @@ -7651,7 +6951,6 @@ is connected to, in the same form as the object returned by @end deffn recv! -@c snarfed from socket.c:1098 @deffn {Scheme Procedure} recv! sock buf [flags] @deffnx {C Function} scm_recv (sock, buf, flags) Receive data from a socket port. @@ -7677,7 +6976,6 @@ any unread buffered port data is ignored. @end deffn send -@c snarfed from socket.c:1131 @deffn {Scheme Procedure} send sock message [flags] @deffnx {C Function} scm_send (sock, message, flags) Transmit the string @var{message} on a socket port @var{sock}. @@ -7696,7 +6994,6 @@ any unflushed buffered port data is ignored. @end deffn recvfrom! -@c snarfed from socket.c:1171 @deffn {Scheme Procedure} recvfrom! sock str [flags [start [end]]] @deffnx {C Function} scm_recvfrom (sock, str, flags, start, end) Return data from the socket port @var{sock} and also @@ -7725,7 +7022,6 @@ descriptor: any unread buffered port data is ignored. @end deffn sendto -@c snarfed from socket.c:1229 @deffn {Scheme Procedure} sendto sock message fam address . args_and_flags @deffnx {C Function} scm_sendto (sock, message, fam, address, args_and_flags) Transmit the string @var{message} on the socket port @@ -7749,61 +7045,51 @@ any unflushed buffered port data is ignored. @end deffn single-active-thread? -@c snarfed from threads.c:79 @deffn {Scheme Procedure} single-active-thread? implemented by the C function "scm_single_thread_p" @end deffn yield -@c snarfed from threads.c:85 @deffn {Scheme Procedure} yield implemented by the C function "scm_yield" @end deffn call-with-new-thread -@c snarfed from threads.c:90 @deffn {Scheme Procedure} call-with-new-thread implemented by the C function "scm_call_with_new_thread" @end deffn join-thread -@c snarfed from threads.c:104 @deffn {Scheme Procedure} join-thread implemented by the C function "scm_join_thread" @end deffn make-mutex -@c snarfed from threads.c:109 @deffn {Scheme Procedure} make-mutex implemented by the C function "scm_make_mutex" @end deffn lock-mutex -@c snarfed from threads.c:112 @deffn {Scheme Procedure} lock-mutex implemented by the C function "scm_lock_mutex" @end deffn unlock-mutex -@c snarfed from threads.c:117 @deffn {Scheme Procedure} unlock-mutex implemented by the C function "scm_unlock_mutex" @end deffn make-condition-variable -@c snarfed from threads.c:123 @deffn {Scheme Procedure} make-condition-variable implemented by the C function "scm_make_condition_variable" @end deffn wait-condition-variable -@c snarfed from threads.c:125 @deffn {Scheme Procedure} wait-condition-variable implemented by the C function "scm_wait_condition_variable" @end deffn signal-condition-variable -@c snarfed from threads.c:127 @deffn {Scheme Procedure} signal-condition-variable implemented by the C function "scm_signal_condition_variable" @end deffn diff --git a/doc/ref/ChangeLog b/doc/ref/ChangeLog index bc58cf4c8..f3302fdb2 100644 --- a/doc/ref/ChangeLog +++ b/doc/ref/ChangeLog @@ -1,3 +1,17 @@ +2002-03-15 Neil Jerram + + * scheme-utility.texi (Object Properties): Revamp documentation on + object properties. + + * scheme-memory.texi (Weak References): Update reference to Object + Properties node. + + * guile.texi: Add macros for describing version information. + + * scheme-data.texi, scheme-debug.texi, scheme-io.texi, + scheme-procedures.texi: Automatic updates from snarfed libguile + docstrings. + 2002-03-13 Thien-Thi Nguyen * Makefile.am (guile_toc.html): Look for guile.texi in $(srcdir). diff --git a/doc/ref/guile.texi b/doc/ref/guile.texi index d078c465b..58c9530c2 100644 --- a/doc/ref/guile.texi +++ b/doc/ref/guile.texi @@ -50,13 +50,40 @@ @include version.texi +@c Macros for describing version information. I've initially defined +@c all of these to expand to nothing, but they could perhaps be made to +@c expand to something like "New in Guile 45!" in future. + +@c vnew - indicates the Guile version in which item first appeared. +@macro vnew{VERSION} +@end macro + +@c vdeprecated - indicates that the item has been deprecated, and the +@c Guile version in which the deprecation started. +@macro vdeprecated{VERSION} +@end macro + +@c vgone - a way of tracking items that are no longer here. In this +@c case, VERSION is the last Guile version in which the item was present. +@macro vgone{WHAT, VERSION} +@end macro + +@c vchanged - indicates the Guile version in which item's behaviour +@c significantly changed. +@macro vchanged{VERSION} +@end macro + +@c vnote - catchall for any additional notes. +@macro vnote{NOTE} +@end macro + @c @iftex @c @cropmarks @c @end iftex @dircategory The Algorithmic Language Scheme @direntry -* Guile Reference: (guile). The Guile reference manual. +* Guile Reference: (guile). The Guile reference manual. @end direntry @setchapternewpage off @@ -94,7 +121,7 @@ by the Free Software Foundation. @sp 10 @comment The title is printed in a large font. @title Guile Reference Manual -@subtitle $Id: guile.texi,v 1.13 2002-03-08 21:23:36 ttn Exp $ +@subtitle $Id: guile.texi,v 1.14 2002-03-15 14:03:53 ossau Exp $ @subtitle For use with Guile @value{VERSION} @c AUTHORS diff --git a/doc/ref/new-docstrings.texi b/doc/ref/new-docstrings.texi index 169f4c20e..2180561a6 100644 --- a/doc/ref/new-docstrings.texi +++ b/doc/ref/new-docstrings.texi @@ -321,7 +321,7 @@ Change the signature of export environment @var{env}. @deffnx {C Function} scm_sys_compute_slots (class) Return a list consisting of the names of all slots belonging to class @var{class}, i. e. the slots of @var{class} and of all of -its super-classes. +its superclasses. @end deffn @deffn {Scheme Procedure} get-keyword key l default_value @@ -532,7 +532,7 @@ Return the direct slots of the class @var{obj}. @deffn {Scheme Procedure} class-direct-supers obj @deffnx {C Function} scm_class_direct_supers (obj) -Return the direct super-classes of the class @var{obj}. +Return the direct superclasses of the class @var{obj}. @end deffn @deffn {Scheme Procedure} class-name obj diff --git a/doc/ref/scheme-data.texi b/doc/ref/scheme-data.texi index 6404da80f..c9f54b246 100755 --- a/doc/ref/scheme-data.texi +++ b/doc/ref/scheme-data.texi @@ -339,7 +339,7 @@ if @var{obj} is an integer number or a rational number. @deffn {Scheme Procedure} rational? x @deffnx {C Function} scm_real_p (x) Return @code{#t} if @var{x} is a rational number, @code{#f} -else. Note that the set of integer values forms a subset of +otherwise. Note that the set of integer values forms a subset of the set of rational numbers, i. e. the predicate will also be fulfilled if @var{x} is an integer number. Real numbers will also satisfy this predicate, because of their limited @@ -379,7 +379,7 @@ properties of inexactness and limited precision as single real numbers. @deffn {Scheme Procedure} complex? x @deffnx {C Function} scm_number_p (x) Return @code{#t} if @var{x} is a complex number, @code{#f} -else. Note that the sets of real, rational and integer +otherwise. Note that the sets of real, rational and integer values form subsets of the set of complex numbers, i. e. the predicate will also be fulfilled if @var{x} is a real, rational or integer number. @@ -1443,7 +1443,7 @@ fulfills some specified property. @rnindex string? @deffn {Scheme Procedure} string? obj @deffnx {C Function} scm_string_p (obj) -Return @code{#t} iff @var{obj} is a string, else @code{#f}. +Return @code{#t} if @var{obj} is a string, else @code{#f}. @end deffn @deffn {Scheme Procedure} string-null? str diff --git a/doc/ref/scheme-debug.texi b/doc/ref/scheme-debug.texi index f939c03be..f3dde5a35 100644 --- a/doc/ref/scheme-debug.texi +++ b/doc/ref/scheme-debug.texi @@ -51,7 +51,7 @@ allocated. @deffnx {C Function} scm_debug_options (setting) Option interface for the debug options. Instead of using this procedure directly, use the procedures @code{debug-enable}, -@code{debug-disable}, @code{debug-set!} and @var{debug-options}. +@code{debug-disable}, @code{debug-set!} and @code{debug-options}. @end deffn @deffn {Scheme Procedure} with-traps thunk diff --git a/doc/ref/scheme-io.texi b/doc/ref/scheme-io.texi index ee29a1325..3df790051 100644 --- a/doc/ref/scheme-io.texi +++ b/doc/ref/scheme-io.texi @@ -890,7 +890,7 @@ always returns the end-of-file object when read from. @deffn {Scheme Procedure} %make-void-port mode @deffnx {C Function} scm_sys_make_void_port (mode) Create and return a new void port. A void port acts like -/dev/null. The @var{mode} argument +@file{/dev/null}. The @var{mode} argument specifies the input/output modes for this port: see the documentation for @code{open-file} in @ref{File Ports}. @end deffn diff --git a/doc/ref/scheme-memory.texi b/doc/ref/scheme-memory.texi index 9ffb9a341..af0088692 100644 --- a/doc/ref/scheme-memory.texi +++ b/doc/ref/scheme-memory.texi @@ -199,8 +199,8 @@ as soon as the value is no longer in use. Entries in a doubly weak hash disappear when either the key or the value are not used anywhere else anymore. -Property lists offer the same kind of functionality as weak key hashes -in many situations. (@pxref{Property Lists}) +Object properties offer the same kind of functionality as weak key +hashes in many situations. (@pxref{Object Properties}) Here's an example (a little bit strained perhaps, but one of the examples is actually used in Guile): diff --git a/doc/ref/scheme-procedures.texi b/doc/ref/scheme-procedures.texi index 00fe09efc..8ef23737e 100644 --- a/doc/ref/scheme-procedures.texi +++ b/doc/ref/scheme-procedures.texi @@ -738,9 +738,7 @@ environment. Return a @dfn{macro} which, when a symbol defined to this value appears as the first symbol in an expression, evaluates the result of applying @var{code} to the expression and the -environment. The value returned from @var{code} which has been -passed to @code{procedure->memoizing-macro} replaces the form -passed to @var{code}. For example: +environment. For example: @lisp (define trace diff --git a/doc/ref/scheme-utility.texi b/doc/ref/scheme-utility.texi index bcec4b881..cc1556c31 100644 --- a/doc/ref/scheme-utility.texi +++ b/doc/ref/scheme-utility.texi @@ -10,8 +10,7 @@ applications, they are collected in a @dfn{utility} chapter. @menu * Equality:: When are two values `the same'? -* Property Lists:: Managing meta-information about Scheme objects. -* Primitive Properties:: A modern interface to object properties. +* Object Properties:: A modern interface to object properties. * Sorting:: Sort utility procedures. * Copying:: Copying deep structures. * General Conversion:: Converting objects to strings. @@ -75,48 +74,78 @@ terminate if its arguments are circular data structures. @end deffn -@node Property Lists -@section Property Lists +@node Object Properties +@section Object Properties -Every object in the system can have a @dfn{property list} that may -be used for information about that object. For example, a -function may have a property list that includes information about -the source file in which it is defined. +It's often useful to associate a piece of additional information with a +Scheme object even though that object does not have a dedicated slot +available in which the additional information could be stored. Object +properties allow you to do just that. -Property lists are implemented as assq lists (@pxref{Association Lists}). +An object property is most commonly used to associate one kind of +additional information with each instance of a class of similar Scheme +objects. For example, all procedures have a `name' property, which +stores the name of the variable in which the procedure was stored by a +@code{define} expression, or @code{#f} if the procedure wasn't created +by that kind of expression. -Currently, property lists are implemented differently for procedures and -closures than for other kinds of objects. Therefore, when manipulating -a property list associated with a procedure object, use the -@code{procedure} functions; otherwise, use the @code{object} functions. +Guile's representation of an object property is a procedure-with-setter +(@pxref{Procedures with Setters}) that can be used with the generalized +form of @code{set!} (REFFIXME) to set and retrieve that property for any +Scheme object. So, setting a property looks like this: -@deffn {Scheme Procedure} object-properties obj -@deffnx {C Function} scm_object_properties (obj) -Return @var{obj}'s property list. +@lisp +(set! (my-property obj1) value-for-obj1) +(set! (my-property obj2) value-for-obj2) +@end lisp + +@noindent +And retrieving values of the same property looks like this: + +@lisp +(my-property obj1) +@result{} +value-for-obj1 + +(my-property obj2) +@result{} +value-for-obj2 +@end lisp + +To create an object property in the first place, use the +@code{make-object-property} procedure: + +@lisp +(define my-property (make-object-property)) +@end lisp + +@deffn {Scheme Procedure} make-object-property +Create and return an object property. An object property is a +procedure-with-setter that can be called in two ways. @code{(set! +(@var{property} @var{obj}) @var{val})} sets @var{obj}'s @var{property} +to @var{val}. @code{(@var{property} @var{obj})} returns the current +setting of @var{obj}'s @var{property}. @end deffn -@deffn {Scheme Procedure} set-object-properties! obj alist -@deffnx {C Function} scm_set_object_properties_x (obj, alist) -Set @var{obj}'s property list to @var{alist}. -@end deffn +A single object property created by @code{make-object-property} can +associate distinct property values with all Scheme values that are +distinguishable by @code{eq?} (including, for example, integers). -@deffn {Scheme Procedure} object-property obj key -@deffnx {C Function} scm_object_property (obj, key) -Return the property of @var{obj} with name @var{key}. -@end deffn +Internally, object properties are implemented using a weak key hash +table. This means that, as long as a Scheme value with property values +is protected from garbage collection, its property values are also +protected. When the Scheme value is collected, its entry in the +property table is removed and so the (ex-) property values are no longer +protected by the table. -@deffn {Scheme Procedure} set-object-property! obj key value -@deffnx {C Function} scm_set_object_property_x (obj, key, value) -In @var{obj}'s property list, set the property named @var{key} -to @var{value}. -@end deffn - -[Interface bug: there should be a second level of interface in which -the user provides a "property table" that is possibly private.] +@menu +* Property Primitives:: Low level property implementation. +* Old-fashioned Properties:: An older approach to properties. +@end menu -@node Primitive Properties -@section Primitive Properties +@node Property Primitives +@subsection Low Level Property Implementation. @deffn {Scheme Procedure} primitive-make-property not_found_proc @deffnx {C Function} scm_primitive_make_property (not_found_proc) @@ -148,6 +177,41 @@ Remove any value associated with @var{prop} and @var{obj}. @end deffn +@node Old-fashioned Properties +@subsection An Older Approach to Properties + +Traditionally, Lisp systems provide a different object property +interface to that provided by @code{make-object-property}, in which the +object property that is being set or retrieved is indicated by a symbol. + +Guile includes this older kind of interface as well, but it may well be +removed in a future release, as it is less powerful than +@code{make-object-property} and so increases the size of the Guile +library for no benefit. (And it is trivial to write a compatibility +layer in Scheme.) + +@deffn {Scheme Procedure} object-properties obj +@deffnx {C Function} scm_object_properties (obj) +Return @var{obj}'s property list. +@end deffn + +@deffn {Scheme Procedure} set-object-properties! obj alist +@deffnx {C Function} scm_set_object_properties_x (obj, alist) +Set @var{obj}'s property list to @var{alist}. +@end deffn + +@deffn {Scheme Procedure} object-property obj key +@deffnx {C Function} scm_object_property (obj, key) +Return the property of @var{obj} with name @var{key}. +@end deffn + +@deffn {Scheme Procedure} set-object-property! obj key value +@deffnx {C Function} scm_set_object_property_x (obj, key, value) +In @var{obj}'s property list, set the property named @var{key} +to @var{value}. +@end deffn + + @node Sorting @section Sorting @@ -349,13 +413,13 @@ arguments. When the procedures have been added, we can invoke them using @code{run-hook}. @lisp -(add-hook! hook (lambda (x y) - (display "Foo: ") - (display (+ x y)) +(add-hook! hook (lambda (x y) + (display "Foo: ") + (display (+ x y)) (newline))) -(add-hook! hook (lambda (x y) - (display "Bar: ") - (display (* x y)) +(add-hook! hook (lambda (x y) + (display "Bar: ") + (display (* x y)) (newline))) (run-hook hook 3 4) @print{} Bar: 12 @@ -367,14 +431,14 @@ added. This can be changed by providing the optional third argument on the second call to @code{add-hook!}. @lisp -(add-hook! hook (lambda (x y) - (display "Foo: ") - (display (+ x y)) +(add-hook! hook (lambda (x y) + (display "Foo: ") + (display (+ x y)) (newline))) -(add-hook! hook (lambda (x y) - (display "Bar: ") - (display (* x y)) - (newline)) +(add-hook! hook (lambda (x y) + (display "Bar: ") + (display (* x y)) + (newline)) #t) ; @r{<- Change here!} (run-hook hook 3 4) @print{} Foo: 7 diff --git a/doc/ref/scripts.texi b/doc/ref/scripts.texi index d8134deee..4a121e5fc 100644 --- a/doc/ref/scripts.texi +++ b/doc/ref/scripts.texi @@ -101,6 +101,7 @@ slow down execution. By default, the debugging evaluator is only used when entering an interactive session. When executing a script with @code{-s} or @code{-c}, the normal, faster evaluator is used by default. +@vnew{1.6} @item --no-debug Do not use the debugging evaluator, even when entering an interactive session. From b5bb4262ea823c72c6d18b6f32cfd5e13e03af7c Mon Sep 17 00:00:00 2001 From: Thien-Thi Nguyen Date: Fri, 15 Mar 2002 14:22:07 +0000 Subject: [PATCH 105/131] (guile-1.4 guile-snarf): Remove this node. (How guile-snarf works): Update usage and description to no longer mention "--compat=1.4" and instead "-d" and "-D". (Macros guile-snarf recognizes): Add list of deprecated macros and blurb. Add cindex for deprecated macros. --- doc/ref/tools.texi | 96 +++++++++++----------------------------------- 1 file changed, 22 insertions(+), 74 deletions(-) diff --git a/doc/ref/tools.texi b/doc/ref/tools.texi index acb2ad96c..e27cc0fc7 100644 --- a/doc/ref/tools.texi +++ b/doc/ref/tools.texi @@ -62,7 +62,6 @@ generate a file of calls to @code{scm_c_define_gsubr} which you can @menu * How guile-snarf works:: Using @code{guile-snarf}, with example. * Macros guile-snarf recognizes:: How to mark up code for @code{guile-snarf}. -* guile-1.4 guile-snarf:: The old way, and how handle it. @end menu @c --------------------------------------------------------------------------- @@ -71,7 +70,7 @@ generate a file of calls to @code{scm_c_define_gsubr} which you can @cindex guile-snarf invocation @cindex guile-snarf example -Usage: guile-snarf [--compat=1.4] [-o OUTFILE] INFILE [CPP-OPTIONS ...] +Usage: guile-snarf [-d | -D] [-o OUTFILE] INFILE [CPP-OPTIONS ...] What @code{guile-snarf} does: @@ -87,14 +86,15 @@ lines from the input matching grep(1) regular expression: If there are errors during processing, delete OUTFILE and exit with non-zero status. -Optional arg "--compat=1.4" means emulate guile-1.4 guile-snarf. -This option is not fully tested (@pxref{guile-1.4 guile-snarf}). +Optional arg "-d" means grep INFILE for deprecated macros and +issue a warning if any are found. Alternatively, "-D" means +do the same thing but signal error and exit with non-zero status. If env var CPP is set, use its value instead of the C pre-processor determined at Guile configure-time. @xref{Macros guile-snarf recognizes}, for a list of the special (some would -say magic) cpp macros you can use. +say magic) cpp macros you can use, including the list of deprecated macros. For example, here is how you might define a new subr called @code{clear-image}, implemented by the C function @code{clear_image}: @@ -178,6 +178,7 @@ add header file directories, and so on. @node Macros guile-snarf recognizes @subsubsection Macros guile-snarf recognizes @cindex guile-snarf recognized macros +@cindex guile-snarf deprecated macros Here are the macros you can use in your source code from which @code{guile-snarf} can construct initialization code: @@ -234,79 +235,26 @@ Also, it's a good idea to define @var{FUNC_NAME} immediately after using @code{SCM_DEFINE} (and similar), and then the function body, and then @code{#undef FUNC_NAME}. +Here is the list of deprecated macros: + +@c reminder: sync w/ libguile/guile-snarf.in var `deprecated_list' +@example + SCM_CONST_LONG + SCM_VCELL + SCM_VCELL_INIT + SCM_GLOBAL_VCELL + SCM_GLOBAL_VCELL_INIT +@end example + +Some versions of guile (and guile-snarf) will continue to recognize them but +at some point they will no longer work. You can pass either @code{-d} or +@code{-D} option to have guile-snarf warn or signal error, respectively, if +any of these are found in the input file. + @xref{How guile-snarf works}, and also libguile source, for examples. @xref{Subrs}, for details on argument passing and how to write C functions. -@xref{guile-1.4 guile-snarf}, if you have code that relies on the guile-snarf -shipped with guile-1.4 (guile-snarf shipped with guile-1.6 is different). - -@c --------------------------------------------------------------------------- -@node guile-1.4 guile-snarf -@subsubsection guile-1.4 guile-snarf -@cindex guile-1.4 guile-snarf -@cindex guile-snarf, guile-1.4 - -The @code{guile-snarf} included with guile-1.4 differs in behavior and usage -from that included with guile-1.6 and later. This page explains the four -kinds of modifications code written with guile-1.4 guile-snarf in mind need to -undergo, in order to be completely compatible with guile-1.6 init snarfing -practice; and explains how to use @code{guile-snarf --compat=1.4}. - -@itemize - -@item Some of the recognized macro names have changed. - -Specifically, you need to rename: - -@itemize -@item SCM_VCELL to SCM_VARIABLE -@item SCM_GLOBAL_VCELL to SCM_GLOBAL_VARIABLE -@item SCM_VCELL_INIT to SCM_VARIABLE_INIT -@item SCM_GLOBAL_VCELL_INIT to SCM_GLOBAL_VARIABLE_INIT -@end itemize - -@item The macro SCM_CONST_LONG is no longer recognized. - -Proabably you can use SCM_GLOBAL_VARIABLE_INIT where you would have -formerly used SCM_CONST_LONG. [fixme: needs verification] - -@item guile-snarf is no longer usable in a pipe. - -With guile-1.4 guile-snarf you had capture its output to a file, check -the exit value of the guile-snarf process, and delete the file if that -value was false. These operations are now handled internally to -guile-snarf, providing you either specify the output file explicitly, or -use an input file name that ends in @code{.c} (in which case the output -filename is computed from the input filename by replacing @code{.c} with -@code{.x}). - -@end itemize - -If you have code that uses the old snarf macros (for example, -SCM_VCELL), but have installed the new guile-snarf, you can arrange for -the old macros to be still recognized by using the @code{--compat=1.4} -option. With this option, old macros are translated to their new -variants on input to the modern snarfing process. This means the .x -files produced will make use of @code{scm_c_define_gsubr} and friends, -which are ready to be compiled against the new libguile. - -Thus, @code{--compat=1.4} does not provide @emph{full} emulation, only -input emulation. (The thinking is: If you have a new guile-snarf -installed, probably you have a new libguile installed, too, and would -prefer to get your old code to work with the new libguile.) - -The makefile fragment to use would look something like: - -@example -.c.x: - guile-snarf --compat=1.4 -o $@ $< -@end example - -After you've done a global search and replace on SCM_VCELL and friends, -you can remove @code{--compat=1.4} altogether (@pxref{How guile-snarf -works}). - @c --------------------------------------------------------------------------- @node Doc Snarfing @subsection Doc Snarfing From 34ad73ede827da651086cfde1c830c57c7ec0e72 Mon Sep 17 00:00:00 2001 From: Thien-Thi Nguyen Date: Fri, 15 Mar 2002 14:23:19 +0000 Subject: [PATCH 106/131] *** empty log message *** --- doc/ref/ChangeLog | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/doc/ref/ChangeLog b/doc/ref/ChangeLog index f3302fdb2..f3995099c 100644 --- a/doc/ref/ChangeLog +++ b/doc/ref/ChangeLog @@ -1,3 +1,11 @@ +2002-03-15 Thien-Thi Nguyen + + * tools.texi (guile-1.4 guile-snarf): Remove this node. + (How guile-snarf works): Update usage and description to + no longer mention "--compat=1.4" and instead "-d" and "-D". + (Macros guile-snarf recognizes): Add list of deprecated macros + and blurb. Add cindex for deprecated macros. + 2002-03-15 Neil Jerram * scheme-utility.texi (Object Properties): Revamp documentation on From b193d130d8cb56e459e07515c7fec0373d4d26e9 Mon Sep 17 00:00:00 2001 From: Thien-Thi Nguyen Date: Fri, 15 Mar 2002 14:25:54 +0000 Subject: [PATCH 107/131] Typofix. --- libguile/guile-snarf.in | 1 - 1 file changed, 1 deletion(-) diff --git a/libguile/guile-snarf.in b/libguile/guile-snarf.in index 38b8da780..8973a52a8 100644 --- a/libguile/guile-snarf.in +++ b/libguile/guile-snarf.in @@ -65,7 +65,6 @@ regexp="(^greetings!spooks!hows!life)" for dep in `echo $deprecated_list` ; do regexp="(^${dep}[^_A-Z])|${regexp}" done -echo $regexp egrep -n ${regexp} $1 /dev/null > ${temp} if [ -s ${temp} ] ; then if $grep_dep_exit_p ; then hey=ERROR ; else hey=WARNING ; fi From 387d418c555b23f4637bbc7e6ff0566435aae30d Mon Sep 17 00:00:00 2001 From: Neil Jerram Date: Sat, 16 Mar 2002 00:27:25 +0000 Subject: [PATCH 108/131] * Manual updates on hooks and features. * Fix scm_t_c_hookype_t corruption. --- doc/ref/ChangeLog | 7 ++ doc/ref/scheme-data.texi | 53 +++++++++ doc/ref/scheme-options.texi | 181 +++++++++++++++++++++++++++++++ doc/ref/scheme-utility.texi | 208 ++++++++++++++++++++++++++++++------ libguile/ChangeLog | 3 + libguile/fports.c | 2 +- libguile/hooks.c | 4 +- libguile/hooks.h | 8 +- 8 files changed, 429 insertions(+), 37 deletions(-) diff --git a/doc/ref/ChangeLog b/doc/ref/ChangeLog index f3995099c..3b250ac94 100644 --- a/doc/ref/ChangeLog +++ b/doc/ref/ChangeLog @@ -8,6 +8,13 @@ 2002-03-15 Neil Jerram + * scheme-utility.texi (Hooks): Reviewed and updated. + + * scheme-options.texi (Feature Tracking): New section. + + * scheme-data.texi (Arithmetic, Primitive Numerics): Add + description of corresponding C functions. + * scheme-utility.texi (Object Properties): Revamp documentation on object properties. diff --git a/doc/ref/scheme-data.texi b/doc/ref/scheme-data.texi index c9f54b246..1c46a7004 100755 --- a/doc/ref/scheme-data.texi +++ b/doc/ref/scheme-data.texi @@ -714,7 +714,11 @@ called with one argument @var{z1}, 1/@var{z1} is returned. @c begin (texi-doc-string "guile" "abs") @deffn {Scheme Procedure} abs x +@deffnx {C Function} scm_abs (x) Return the absolute value of @var{x}. + +@var{x} must be a number with zero imaginary part. To calculate the +magnitude of a complex number, use @code{magnitude} instead. @end deffn @c begin (texi-doc-string "guile" "max") @@ -747,6 +751,18 @@ Round the number @var{x} towards minus infinity. Round the number @var{x} towards infinity. @end deffn +For the @code{truncate} and @code{round} procedures, the Guile library +exports equivalent C functions, but taking and returning arguments of +type @code{double} rather than the usual @code{SCM}. + +@deftypefn {C Function} double scm_truncate (double x) +@deftypefnx {C Function} double scm_round (double x) +@end deftypefn + +For @code{floor} and @code{ceiling}, the equivalent C functions are +@code{floor} and @code{ceil} from the standard mathematics library +(which also take and return @code{double} arguments). + @node Scientific @subsection Scientific Functions @@ -955,6 +971,43 @@ Return the hyperbolic arccosine of @var{x}. Return the hyperbolic arctangent of @var{x}. @end deffn +For the hyperbolic arc-functions, the Guile library exports C functions +corresponding to these Scheme procedures, but taking and returning +arguments of type @code{double} rather than the usual @code{SCM}. + +@deftypefn {C Function} double scm_asinh (double x) +@deftypefnx {C Function} double scm_acosh (double x) +@deftypefnx {C Function} double scm_atanh (double x) +Return the hyperbolic arcsine, arccosine or arctangent of @var{x} +respectively. +@end deftypefn + +For all the other Scheme procedures above, except @code{expt} and +@code{atan2} (whose entries specifically mention an equivalent C +function), the equivalent C functions are those provided by the standard +mathematics library. The mapping is as follows. + +@multitable {xx} {Scheme Procedure} {C Function} +@item @tab Scheme Procedure @tab C Function + +@item @tab @code{$abs} @tab @code{fabs} +@item @tab @code{$sqrt} @tab @code{sqrt} +@item @tab @code{$sin} @tab @code{sin} +@item @tab @code{$cos} @tab @code{cos} +@item @tab @code{$tan} @tab @code{tan} +@item @tab @code{$asin} @tab @code{asin} +@item @tab @code{$acos} @tab @code{acos} +@item @tab @code{$atan} @tab @code{atan} +@item @tab @code{$exp} @tab @code{exp} +@item @tab @code{$log} @tab @code{log} +@item @tab @code{$sinh} @tab @code{sinh} +@item @tab @code{$cosh} @tab @code{cosh} +@item @tab @code{$tanh} @tab @code{tanh} +@end multitable + +@noindent +Naturally, these C functions expect and return @code{double} arguments. + @node Bitwise Operations @subsection Bitwise Operations diff --git a/doc/ref/scheme-options.texi b/doc/ref/scheme-options.texi index e2ab70429..e67429a64 100644 --- a/doc/ref/scheme-options.texi +++ b/doc/ref/scheme-options.texi @@ -23,6 +23,7 @@ configure @emph{reading}, @emph{printing}, @emph{debugging} or * Evaluator trap options:: * Examples of option use:: * Install Config:: Installation and configuration data. +* Feature Tracking:: Available features in the Guile process. @end menu @node General option interface @@ -431,6 +432,186 @@ libguile/libpath.h, which is completely generated, so deleting this file before a build guarantees up-to-date values for that build. @end defvar + +@node Feature Tracking +@section Feature Tracking + +Guile has a Scheme level variable @code{*features*} that keeps track to +some extent of the features that are available in a running Guile. +@code{*features*} is a list of symbols, for example @code{threads}, each +of which describes a feature of the running Guile process. + +@defvar *features* +A list of symbols describing available features of the Guile process. +@end defvar + +You shouldn't modify the @code{*features*} variable directly using +@code{set!}. Instead, see the procedures that are provided for this +purpose in the following subsection. + +@menu +* Feature Manipulation:: Checking for and advertising features. +* Common Feature Symbols:: Commonly available features. +@end menu + + +@node Feature Manipulation +@subsection Feature Manipulation + +To check whether a particular feature is available, use the +@code{provided?} procedure: + +@deffn {Scheme Procedure} provided? feature +@deffnx {Deprecated Scheme Procedure} feature? feature +Return @code{#t} if the specified @var{feature} is available, otherwise +@code{#f}. +@end deffn + +To advertise a feature from your own Scheme code, you can use the +@code{provide} procedure: + +@deffn {Scheme Procedure} provide feature +Add @var{feature} to the list of available features in this Guile +process. +@end deffn + +For C code, the equivalent function takes its feature name as a +@code{char *} argument for convenience: + +@deftypefn {C Function} void scm_add_feature (const char *str) +Add a symbol with name @var{str} to the list of available features in +this Guile process. +@end deftypefn + + +@node Common Feature Symbols +@subsection Common Feature Symbols + +In general, a particular feature may be available for one of two +reasons. Either because the Guile library was configured and compiled +with that feature enabled --- i.e. the feature is built into the library +on your system. Or because some C or Scheme code that was dynamically +loaded by Guile has added that feature to the list. + +In the first category, here are the features that the current version of +Guile may define (depending on how it is built), and what they mean. + +@table @code +@item array +Indicates support for arrays (@pxref{Arrays}). + +@item array-for-each +Indicates availability of @code{array-for-each} and other array mapping +procedures (@pxref{Array Mapping}). + +@item char-ready? +Indicates that the @code{char-ready?} function is available +(@pxref{Reading}). + +@item complex +Indicates support for complex numbers. + +@item current-time +Indicates availability of time-related functions: @code{times}, +@code{get-internal-run-time} and so on (@pxref{Time}). + +@item debug-extensions +Indicates that the debugging evaluator is available, together with the +options for controlling it. + +@item delay +Indicates support for promises (@pxref{Delayed Evaluation}). + +@item EIDs +Indicates that the @code{geteuid} and @code{getegid} really return +effective user and group IDs (@pxref{Processes}). + +@item inexact +Indicates support for inexact numbers. + +@item i/o-extensions +Indicates availability of the following extended I/O procedures: +@code{ftell}, @code{redirect-port}, @code{dup->fdes}, @code{dup2}, +@code{fileno}, @code{isatty?}, @code{fdopen}, +@code{primitive-move->fdes} and @code{fdes->ports} (@pxref{Ports and +File Descriptors}). + +@item net-db +Indicates availability of network database functions: +@code{scm_gethost}, @code{scm_getnet}, @code{scm_getproto}, +@code{scm_getserv}, @code{scm_sethost}, @code{scm_setnet}, @code{scm_setproto}, +@code{scm_setserv}, and their `byXXX' variants (@pxref{Network +Databases}). + +@item posix +Indicates support for POSIX functions: @code{pipe}, @code{getgroups}, +@code{kill}, @code{execl} and so on (@pxref{POSIX}). + +@item random +Indicates availability of random number generation functions: +@code{random}, @code{copy-random-state}, @code{random-uniform} and so on +(@pxref{Random}). + +@item reckless +Indicates that Guile was built with important checks omitted --- you +should never see this! + +@item regex +Indicates support for POSIX regular expressions using +@code{make-regexp}, @code{regexp-exec} and friends (@pxref{Regexp +Functions}). + +@item socket +Indicates availability of socket-related functions: @code{socket}, +@code{bind}, @code{connect} and so on (@pxref{Network Sockets and +Communication}). + +@item sort +Indicates availability of sorting and merging functions +(@pxref{Sorting}). + +@item system +Indicates that the @code{system} function is available +(@pxref{Processes}). + +@item threads +Indicates support for multithreading (@pxref{Threads}). + +@item values +Indicates support for multiple return values using @code{values} and +@code{call-with-values} (@pxref{Multiple Values}). +@end table + +Available features in the second category depend, by definition, on what +additional code your Guile process has loaded in. The following table +lists features that you might encounter for this reason. + +@table @code +@item defmacro +Indicates that the @code{defmacro} macro is available (@pxref{Macros}). + +@item describe +Indicates that the @code{(oop goops describe)} module has been loaded, +which provides a procedure for describing the contents of GOOPS +instances. + +@item readline +Indicates that Guile has loaded in Readline support, for command line +editing (@pxref{Readline Support}). + +@item record +Indicates support for record definition using @code{make-record-type} +and friends (@pxref{Records}). +@end table + +Although these tables may seem exhaustive, it is probably unwise in +practice to rely on them, as the correspondences between feature symbols +and available procedures/behaviour are not strictly defined. If you are +writing code that needs to check for the existence of some procedure, it +is probably safer to do so directly using the @code{defined?} procedure +than to test for the corresponding feature using @code{feature?}. + + @c Local Variables: @c TeX-master: "guile.texi" @c End: diff --git a/doc/ref/scheme-utility.texi b/doc/ref/scheme-utility.texi index cc1556c31..b1bb7dbd1 100644 --- a/doc/ref/scheme-utility.texi +++ b/doc/ref/scheme-utility.texi @@ -377,24 +377,38 @@ argument @var{printer} (default: @code{write}). @section Hooks @tpindex Hooks -@c FIXME::martin: Review me! +A hook is a list of procedures to be called at well defined points in +time. Typically, an application provides a hook @var{h} and promises +its users that it will call all of the procedures in @var{h} at a +defined point in the application's processing. By adding its own +procedure to @var{h}, an application user can tap into or even influence +the progress of the application. -A hook is basically a list of procedures to be called at well defined -points in time. Hooks are used internally for several debugging -facilities, but they can be used in user code, too. +Guile itself provides several such hooks for debugging and customization +purposes: these are listed in a subsection below. -Hooks are created with @code{make-hook}, then procedures can be added to -a hook with @code{add-hook!} or removed with @code{remove-hook!} or -@code{reset-hook!}. The procedures stored in a hook can be invoked with -@code{run-hook}. +When an application first creates a hook, it needs to know how many +arguments will be passed to the hook's procedures when the hook is run. +The chosen number of arguments (which may be none) is declared when the +hook is created, and all the procedures that are added to that hook must +be capable of accepting that number of arguments. + +A hook is created using @code{make-hook}. A procedure can be added to +or removed from a hook using @code{add-hook!} or @code{remove-hook!}, +and all of a hook's procedures can be removed together using +@code{reset-hook!}. When an application wants to run a hook, it does so +using @code{run-hook}. @menu -* Hook Examples:: Hook usage by example. +* Hook Example:: Hook usage by example. * Hook Reference:: Reference of all hook procedures. +* C Hooks:: Hooks for use from C code. +* Guile Hooks:: Hooks provided by Guile. @end menu -@node Hook Examples -@subsection Hook Examples + +@node Hook Example +@subsection Hook Usage by Example Hook usage is shown by some examples in this section. First, we will define a hook of arity 2 --- that is, the procedures stored in the hook @@ -409,8 +423,7 @@ hook Now we are ready to add some procedures to the newly created hook with @code{add-hook!}. In the following example, two procedures are added, which print different messages and do different things with their -arguments. When the procedures have been added, we can invoke them -using @code{run-hook}. +arguments. @lisp (add-hook! hook (lambda (x y) @@ -421,14 +434,23 @@ using @code{run-hook}. (display "Bar: ") (display (* x y)) (newline))) +@end lisp + +Once the procedures have been added, we can invoke the hook using +@code{run-hook}. + +@lisp (run-hook hook 3 4) @print{} Bar: 12 @print{} Foo: 7 @end lisp -Note that the procedures are called in reverse order than they were -added. This can be changed by providing the optional third argument -on the second call to @code{add-hook!}. +Note that the procedures are called in the reverse of the order with +which they were added. This is because the default behaviour of +@code{add-hook!} is to add its procedure to the @emph{front} of the +hook's procedure list. You can force @code{add-hook!} to add its +procedure to the @emph{end} of the list instead by providing a third +@code{#t} argument on the second call to @code{add-hook!}. @lisp (add-hook! hook (lambda (x y) @@ -439,30 +461,34 @@ on the second call to @code{add-hook!}. (display "Bar: ") (display (* x y)) (newline)) - #t) ; @r{<- Change here!} + #t) ; @r{<- Change here!} + (run-hook hook 3 4) @print{} Foo: 7 @print{} Bar: 12 @end lisp + @node Hook Reference @subsection Hook Reference -When a hook is created with @code{make-hook}, you can supply the arity -of the procedures which can be added to the hook. The arity defaults to -zero. All procedures of a hook must have the same arity, and when the -procedures are invoked using @code{run-hook}, the number of arguments -must match the arity of the procedures. +When you create a hook with @code{make-hook}, you must specify the arity +of the procedures which can be added to the hook. If the arity is not +given explicitly as an argument to @code{make-hook}, it defaults to +zero. All procedures of a given hook must have the same arity, and when +the procedures are invoked using @code{run-hook}, the number of +arguments passed must match the arity specified at hook creation time. The order in which procedures are added to a hook matters. If the third -parameter to @var{add-hook!} is omitted or is equal to @code{#f}, the +parameter to @code{add-hook!} is omitted or is equal to @code{#f}, the procedure is added in front of the procedures which might already be on that hook, otherwise the procedure is added at the end. The procedures -are always called from first to last when they are invoked via -@code{run-hook}. +are always called from the front to the end of the list when they are +invoked via @code{run-hook}. -When calling @code{hook->list}, the procedures in the resulting list are -in the same order as they would have been called by @code{run-hook}. +The ordering of the list of procedures returned by @code{hook->list} +matches the order in which those procedures would be called if the hook +was run using @code{run-hook}. @deffn {Scheme Procedure} make-hook [n_args] @deffnx {C Function} scm_make_hook (n_args) @@ -502,6 +528,11 @@ Remove all procedures from the hook @var{hook}. The return value of this procedure is not specified. @end deffn +@deffn {Scheme Procedure} hook->list hook +@deffnx {C Function} scm_hook_to_list (hook) +Convert the procedure list of @var{hook} to a list. +@end deffn + @deffn {Scheme Procedure} run-hook hook . args @deffnx {C Function} scm_run_hook (hook, args) Apply all procedures from the hook @var{hook} to the arguments @@ -509,11 +540,128 @@ Apply all procedures from the hook @var{hook} to the arguments last. The return value of this procedure is not specified. @end deffn -@deffn {Scheme Procedure} hook->list hook -@deffnx {C Function} scm_hook_to_list (hook) -Convert the procedure list of @var{hook} to a list. +If, in C code, you are certain that you have a hook object and well +formed argument list for that hook, you can also use +@code{scm_c_run_hook}, which is identical to @code{scm_run_hook} but +does no type checking. + +@deftypefn {C Function} void scm_c_run_hook (SCM hook, SCM args) +The same as @code{scm_run_hook} but without any type checking to confirm +that @var{hook} is actually a hook object and that @var{args} is a +well-formed list matching the arity of the hook. +@end deftypefn + + +@node C Hooks +@subsection Hooks For C Code. + +The hooks already described are intended to be populated by Scheme-level +procedures. In addition to this, the Guile library provides an +independent set of interfaces for the creation and manipulation of hooks +that are designed to be populated by functions implemented in C. + +The original motivation here was to provide a kind of hook that could +safely be invoked at various points during garbage collection. +Scheme-level hooks are unsuitable for this purpose as running them could +itself require memory allocation, which would then invoke garbage +collection recursively @dots{} However, it is also the case that these +hooks are easier to work with than the Scheme-level ones if you only +want to register C functions with them. So if that is mainly what your +code needs to do, you may prefer to use this interface. + +To create a C hook, you should allocate storage for a structure of type +@code{scm_t_c_hook} and then initialize it using @code{scm_c_hook_init}. + +@deffn {C Type} scm_t_c_hook +Data type for a C hook. The internals of this type should be treated as +opaque. @end deffn +@deffn {C Enum} scm_t_c_hook_type +Enumeration of possible hook types, which are: + +@table @code +@item SCM_C_HOOK_NORMAL +Type of hook for which all the registered functions will always be called. +@item SCM_C_HOOK_OR +Type of hook for which the sequence of registered functions will be +called only until one of them returns C true (a non-NULL pointer). +@item SCM_C_HOOK_AND +Type of hook for which the sequence of registered functions will be +called only until one of them returns C false (a NULL pointer). +@end table +@end deffn + +@deftypefn {C Function} void scm_c_hook_init (scm_t_c_hook *hook, void *hook_data, scm_t_c_hook_type type) +Initialize the C hook at memory pointed to by @var{hook}. @var{type} +should be one of the values of the @code{scm_t_c_hook_type} enumeration, +and controls how the hook functions will be called. @var{hook_data} is +a closure parameter that will be passed to all registered hook functions +when they are called. +@end deftypefn + +To add or remove a C function from a C hook, use @code{scm_c_hook_add} +or @code{scm_c_hook_remove}. A hook function must expect three +@code{void *} parameters which are, respectively: + +@table @var +@item hook_data +The hook closure data that was specified at the time the hook was +initialized by @code{scm_c_hook_init}. + +@item func_data +The function closure data that was specified at the time that that +function was registered with the hook by @code{scm_c_hook_add}. + +@item data +The call closure data specified by the @code{scm_c_hook_run} call that +runs the hook. +@end table + +@deffn {C Type} scm_t_c_hook_function +Function type for a C hook function: takes three @code{void *} +parameters and returns a @code{void *} result. +@end deffn + +@deftypefn {C Function} void scm_c_hook_add (scm_t_c_hook *hook, scm_t_c_hook_function func, void *func_data, int appendp) +Add function @var{func}, with function closure data @var{func_data}, to +the C hook @var{hook}. The new function is appended to the hook's list +of functions if @var{appendp} is non-zero, otherwise prepended. +@end deftypefn + +@deftypefn {C Function} void scm_c_hook_remove (scm_t_c_hook *hook, scm_t_c_hook_function func, void *func_data) +Remove function @var{func}, with function closure data @var{func_data}, +from the C hook @var{hook}. @code{scm_c_hook_remove} checks both +@var{func} and @var{func_data} so as to allow for the same @var{func} +being registered multiple times with different closure data. +@end deftypefn + +Finally, to invoke a C hook, call the @code{scm_c_hook_run} function +specifying the hook and the call closure data for this run: + +@deftypefn {C Function} void * scm_c_hook_run (scm_t_c_hook *hook, void *data) +Run the C hook @var{hook} will call closure data @var{data}. Subject to +the variations for hook types @code{SCM_C_HOOK_OR} and +@code{SCM_C_HOOK_AND}, @code{scm_c_hook_run} calls @var{hook}'s +registered functions in turn, passing them the hook's closure data, each +function's closure data, and the call closure data. + +@code{scm_c_hook_run}'s return value is the return value of the last +function to be called. +@end deftypefn + + +@node Guile Hooks +@subsection Hooks Provided by Guile + +@table @code +@item scm_before_gc_c_hook +@item scm_before_mark_c_hook +@item scm_before_sweep_c_hook +@item scm_after_sweep_c_hook +@item scm_after_gc_c_hook +@end table + @c Local Variables: @c TeX-master: "guile.texi" diff --git a/libguile/ChangeLog b/libguile/ChangeLog index 61a468b5b..f0ac8b320 100644 --- a/libguile/ChangeLog +++ b/libguile/ChangeLog @@ -10,6 +10,9 @@ 2002-03-15 Neil Jerram + * hooks.h: Change scm_t_c_hookype_t everywhere to + scm_t_c_hook_type. + Docstring fixes: * strings.c (scm_string_p): Change unnecessary `iff' to `if'. diff --git a/libguile/fports.c b/libguile/fports.c index 7ee538eb5..8424f2e2e 100644 --- a/libguile/fports.c +++ b/libguile/fports.c @@ -212,7 +212,7 @@ SCM_DEFINE (scm_setvbuf, "setvbuf", 2, 1, 0, #undef FUNC_NAME /* Move ports with the specified file descriptor to new descriptors, - * reseting the revealed count to 0. + * resetting the revealed count to 0. */ void diff --git a/libguile/hooks.c b/libguile/hooks.c index bada6164e..ade502e54 100644 --- a/libguile/hooks.c +++ b/libguile/hooks.c @@ -64,7 +64,7 @@ */ void -scm_c_hook_init (scm_t_c_hook *hook, void *hook_data, scm_t_c_hookype_t type) +scm_c_hook_init (scm_t_c_hook *hook, void *hook_data, scm_t_c_hook_type type) { hook->first = 0; hook->type = type; @@ -113,7 +113,7 @@ void * scm_c_hook_run (scm_t_c_hook *hook, void *data) { scm_t_c_hook_entry *entry = hook->first; - scm_t_c_hookype_t type = hook->type; + scm_t_c_hook_type type = hook->type; void *res = 0; while (entry) { diff --git a/libguile/hooks.h b/libguile/hooks.h index 48e4f8b16..6944624c2 100644 --- a/libguile/hooks.h +++ b/libguile/hooks.h @@ -57,11 +57,11 @@ * both may want to indicate success/failure and return a result. */ -typedef enum scm_t_c_hookype_t { +typedef enum scm_t_c_hook_type { SCM_C_HOOK_NORMAL, SCM_C_HOOK_OR, SCM_C_HOOK_AND -} scm_t_c_hookype_t; +} scm_t_c_hook_type; typedef void *(*scm_t_c_hook_function) (void *hook_data, void *func_data, @@ -75,13 +75,13 @@ typedef struct scm_t_c_hook_entry { typedef struct scm_t_c_hook { scm_t_c_hook_entry *first; - scm_t_c_hookype_t type; + scm_t_c_hook_type type; void *data; } scm_t_c_hook; SCM_API void scm_c_hook_init (scm_t_c_hook *hook, void *hook_data, - scm_t_c_hookype_t type); + scm_t_c_hook_type type); SCM_API void scm_c_hook_add (scm_t_c_hook *hook, scm_t_c_hook_function func, void *func_data, From c16da59f614478f1996e77289141679ea07a163c Mon Sep 17 00:00:00 2001 From: Neil Jerram Date: Sat, 16 Mar 2002 13:51:03 +0000 Subject: [PATCH 109/131] Manual updates. --- doc/ref/ChangeLog | 11 +++ doc/ref/deprecated.texi | 135 --------------------------------- doc/ref/guile.texi | 4 +- doc/ref/intro.texi | 3 - doc/ref/posix.texi | 14 +--- doc/ref/scheme-evaluation.texi | 3 + doc/ref/scheme-utility.texi | 89 ++++++++++++++++++---- doc/ref/scripts.texi | 2 +- 8 files changed, 97 insertions(+), 164 deletions(-) diff --git a/doc/ref/ChangeLog b/doc/ref/ChangeLog index 3b250ac94..e312ca50d 100644 --- a/doc/ref/ChangeLog +++ b/doc/ref/ChangeLog @@ -1,3 +1,14 @@ +2002-03-16 Neil Jerram + + * scheme-utility.texi (Hooks): Further updates. New material on + GC hooks. + + * scheme-evaluation.texi (Fly Evaluation): Note disappearance of + eval2 and read-and-eval!. + + * deprecated.texi (Deprecated): Remove docs about previously + deprecated items that have now been removed. + 2002-03-15 Thien-Thi Nguyen * tools.texi (guile-1.4 guile-snarf): Remove this node. diff --git a/doc/ref/deprecated.texi b/doc/ref/deprecated.texi index 3f423fe7f..8d335a936 100644 --- a/doc/ref/deprecated.texi +++ b/doc/ref/deprecated.texi @@ -1,138 +1,3 @@ @page @node Deprecated @chapter Deprecated - -@menu -* Shared And Read Only Strings:: -@end menu - - -@node Shared And Read Only Strings -@section Shared And Read Only Strings - -The procedures described in this section are deprecated because explicit -shared substrings are planned to disappear from Guile. - -Instead, all strings will be implemented using sharing internally, -combined with a copy-on-write strategy. Once internal string sharing -and copy-on-write have been implemented, it will be unnecessary to -preserve the concept of read only strings. - -@menu -* Shared Substrings:: Strings which share memory with each other. -* Read Only Strings:: Treating certain non-strings as strings. -@end menu - - -@node Shared Substrings -@subsection Shared Substrings - -Whenever you extract a substring using @code{substring}, the Scheme -interpreter allocates a new string and copies data from the old string. -This is expensive, but @code{substring} is so convenient for -manipulating text that programmers use it often. - -Guile Scheme provides the concept of the @dfn{shared substring} to -improve performance of many substring-related operations. A shared -substring is an object that mostly behaves just like an ordinary -substring, except that it actually shares storage space with its parent -string. - -@deffn {Scheme Procedure} make-shared-substring str [start [end]] -Return a shared substring of @var{str}. The arguments are the -same as for the @code{substring} function: the shared substring -returned includes all of the text from @var{str} between -indexes @var{start} (inclusive) and @var{end} (exclusive). If -@var{end} is omitted, it defaults to the end of @var{str}. The -shared substring returned by @code{make-shared-substring} -occupies the same storage space as @var{str}. -@end deffn - -Example: - -@example -(define foo "the quick brown fox") -(define bar (make-shared-substring some-string 4 9)) - -foo => "t h e q u i c k b r o w n f o x" -bar =========> |---------| -@end example - -The shared substring @var{bar} is not given its own storage space. -Instead, the Guile interpreter notes internally that @var{bar} points to -a portion of the memory allocated to @var{foo}. However, @var{bar} -behaves like an ordinary string in most respects: it may be used with -string primitives like @code{string-length}, @code{string-ref}, -@code{string=?}. Guile makes the necessary translation between indices -of @var{bar} and indices of @var{foo} automatically. - -@example -(string-length? bar) @result{} 5 ; bar only extends from indices 4 to 9 -(string-ref bar 3) @result{} #\c ; same as (string-ref foo 7) -(make-shared-substring bar 2) - @result{} "ick" ; can even make a shared substring! -@end example - -Because creating a shared substring does not require allocating new -storage from the heap, it is a very fast operation. However, because it -shares memory with its parent string, a change to the contents of the -parent string will implicitly change the contents of its shared -substrings. - -@example -(string-set! foo 7 #\r) -bar @result{} "quirk" -@end example - -Guile considers shared substrings to be immutable. This is because -programmers might not always be aware that a given string is really a -shared substring, and might innocently try to mutate it without -realizing that the change would affect its parent string. (We are -currently considering a "copy-on-write" strategy that would permit -modifying shared substrings without affecting the parent string.) - -In general, shared substrings are useful in circumstances where it is -important to divide a string into smaller portions, but you do not -expect to change the contents of any of the strings involved. - - -@node Read Only Strings -@subsection Read Only Strings - -In previous versions of Guile, there was the idea that some string-based -primitives such as @code{string-append} could equally accept symbols as -arguments. For example, one could write - -@lisp -(string-append '/home/ 'vigilia) -@end lisp - -@noindent -and get @code{"/home/vigilia"} as the result. The term @dfn{read only -string} was adopted to describe the argument type expected by such -primitives. - -This idea has now been removed. The predicate @code{read-only-string?} -still exists, but deprecated, and is equivalent to - -@lisp -(lambda (x) (or (string? x) (symbol? x))) -@end lisp - -@noindent -But no Guile primitives now use @code{read-only-string?} to validate -their arguments. - -String-based primitives such as @code{string-append} -now require strings: - -@lisp -(string-append '/home/ 'vigilia) -@result{} -ERROR: Wrong type argument (expecting STRINGP): /home/ -@end lisp - -@deffn {Scheme Procedure} read-only-string? obj -Return @code{#t} if @var{obj} is either a string or a symbol, -otherwise return @code{#f}. -@end deffn diff --git a/doc/ref/guile.texi b/doc/ref/guile.texi index 58c9530c2..4e131332d 100644 --- a/doc/ref/guile.texi +++ b/doc/ref/guile.texi @@ -83,7 +83,7 @@ @dircategory The Algorithmic Language Scheme @direntry -* Guile Reference: (guile). The Guile reference manual. +* Guile Reference: (guile). The Guile reference manual. @end direntry @setchapternewpage off @@ -121,7 +121,7 @@ by the Free Software Foundation. @sp 10 @comment The title is printed in a large font. @title Guile Reference Manual -@subtitle $Id: guile.texi,v 1.14 2002-03-15 14:03:53 ossau Exp $ +@subtitle $Id: guile.texi,v 1.15 2002-03-16 13:51:03 ossau Exp $ @subtitle For use with Guile @value{VERSION} @c AUTHORS diff --git a/doc/ref/intro.texi b/doc/ref/intro.texi index 6a120c284..6d373a7cc 100644 --- a/doc/ref/intro.texi +++ b/doc/ref/intro.texi @@ -1,6 +1,3 @@ -@c $Id: intro.texi,v 1.8 2002-01-08 08:29:00 ttn Exp $ - - @page @node What is Guile? @chapter What is Guile? diff --git a/doc/ref/posix.texi b/doc/ref/posix.texi index 62063e7ad..724015f68 100644 --- a/doc/ref/posix.texi +++ b/doc/ref/posix.texi @@ -280,6 +280,7 @@ The return value is unspecified. @end deffn @deffn {Scheme Procedure} unread-char char [port] +@deffnx {C Function} scm_unread_char (char, port) Place @var{char} in @var{port} so that it will be read by the next read operation. If called multiple times, the unread characters will be read again in last-in first-out order. If @var{port} is @@ -395,14 +396,7 @@ the port was opened, since modes such as "append" which are used only during port creation are not retained. @end deffn -@deffn {Scheme Procedure} close-all-ports-except . ports -[DEPRECATED] Close all open file ports used by the interpreter -except for those supplied as arguments. This procedure -was intended to be used before an exec call to close file descriptors -which are not needed in the new process. However it has the -undesirable side-effect of flushing buffers, so it's deprecated. -Use port-for-each instead. -@end deffn +@vgone{close-all-ports-except,1.6} @deffn {Scheme Procedure} port-for-each proc @deffnx {C Function} scm_port_for_each (proc) @@ -2239,7 +2233,7 @@ number. @deffnx {C Function} scm_getsockname (sock) Return the address of @var{sock}, in the same form as the object returned by @code{accept}. On many systems the address -of a socket in the @code{AF_FILE} name space cannot be read. +of a socket in the @code{AF_FILE} namespace cannot be read. @end deffn @deffn {Scheme Procedure} getpeername sock @@ -2247,7 +2241,7 @@ of a socket in the @code{AF_FILE} name space cannot be read. Return the address that @var{sock} is connected to, in the same form as the object returned by @code{accept}. On many systems the address of a socket in the -@code{AF_FILE} name space cannot be read. +@code{AF_FILE} namespace cannot be read. @end deffn @deffn {Scheme Procedure} recv! sock buf [flags] diff --git a/doc/ref/scheme-evaluation.texi b/doc/ref/scheme-evaluation.texi index fbfcd87a8..059e664be 100644 --- a/doc/ref/scheme-evaluation.texi +++ b/doc/ref/scheme-evaluation.texi @@ -235,6 +235,9 @@ Evaluate @var{exp} in the top-level environment specified by the current module. @end deffn +@vgone{eval2,1.6} +@vgone{read-and-eval!,1.6} + @node Loading @section Loading Scheme Code from File diff --git a/doc/ref/scheme-utility.texi b/doc/ref/scheme-utility.texi index b1bb7dbd1..f544ac0da 100644 --- a/doc/ref/scheme-utility.texi +++ b/doc/ref/scheme-utility.texi @@ -572,25 +572,28 @@ code needs to do, you may prefer to use this interface. To create a C hook, you should allocate storage for a structure of type @code{scm_t_c_hook} and then initialize it using @code{scm_c_hook_init}. -@deffn {C Type} scm_t_c_hook +@deftp {C Type} scm_t_c_hook Data type for a C hook. The internals of this type should be treated as opaque. -@end deffn +@end deftp -@deffn {C Enum} scm_t_c_hook_type +@deftp {C Enum} scm_t_c_hook_type Enumeration of possible hook types, which are: @table @code @item SCM_C_HOOK_NORMAL +@vindex SCM_C_HOOK_NORMAL Type of hook for which all the registered functions will always be called. @item SCM_C_HOOK_OR +@vindex SCM_C_HOOK_OR Type of hook for which the sequence of registered functions will be called only until one of them returns C true (a non-NULL pointer). @item SCM_C_HOOK_AND +@vindex SCM_C_HOOK_AND Type of hook for which the sequence of registered functions will be called only until one of them returns C false (a NULL pointer). @end table -@end deffn +@end deftp @deftypefn {C Function} void scm_c_hook_init (scm_t_c_hook *hook, void *hook_data, scm_t_c_hook_type type) Initialize the C hook at memory pointed to by @var{hook}. @var{type} @@ -618,10 +621,10 @@ The call closure data specified by the @code{scm_c_hook_run} call that runs the hook. @end table -@deffn {C Type} scm_t_c_hook_function +@deftp {C Type} scm_t_c_hook_function Function type for a C hook function: takes three @code{void *} parameters and returns a @code{void *} result. -@end deffn +@end deftp @deftypefn {C Function} void scm_c_hook_add (scm_t_c_hook *hook, scm_t_c_hook_function func, void *func_data, int appendp) Add function @var{func}, with function closure data @var{func_data}, to @@ -654,13 +657,73 @@ function to be called. @node Guile Hooks @subsection Hooks Provided by Guile -@table @code -@item scm_before_gc_c_hook -@item scm_before_mark_c_hook -@item scm_before_sweep_c_hook -@item scm_after_sweep_c_hook -@item scm_after_gc_c_hook -@end table +@menu +* GC Hooks:: Garbage collection hooks. +* REPL Hooks:: Hooks into the Guile REPL. +@end menu + + +@node GC Hooks +@subsubsection Hooks for Garbage Collection + +Whenever Guile performs a garbage collection, it calls the following +hooks in the order shown. + +@defvr {C Hook} scm_before_gc_c_hook +C hook called at the very start of a garbage collection, after setting +@code{scm_gc_running_p} to 1, but before entering the GC critical +section. + +If garbage collection is blocked because @code{scm_block_gc} is +non-zero, GC exits early soon after calling this hook, and no further +hooks will be called. +@end defvr + +@defvr {C Hook} scm_before_mark_c_hook +C hook called before beginning the mark phase of garbage collection, +after the GC thread has entered a critical section. +@end defvr + +@defvr {C Hook} scm_before_sweep_c_hook +C hook called before beginning the sweep phase of garbage collection. +This is the same as at the end of the mark phase, since nothing else +happens between marking and sweeping. +@end defvr + +@defvr {C Hook} scm_after_sweep_c_hook +C hook called after the end of the sweep phase of garbage collection, +but while the GC thread is still inside its critical section. +@end defvr + +@defvr {C Hook} scm_after_gc_c_hook +C hook called at the very end of a garbage collection, after the GC +thread has left its critical section. +@end defvr + +@defvr {Scheme Hook} after-gc-hook +@vindex scm_after_gc_hook +Scheme hook with arity 0. This hook is run asynchronously +(@pxref{Asyncs}) soon after the GC has completed and any other events +that were deferred during garbage collection have been processed. (Also +accessible from C with the name @code{scm_after_gc_hook}.) +@end defvr + +All the C hooks listed here have type @code{SCM_C_HOOK_NORMAL}, are +initialized with hook closure data NULL, are are invoked by +@code{scm_c_hook_run} with call closure data NULL. + +@cindex guardians, testing for GC'd objects +The Scheme hook @code{after-gc-hook} is particularly useful in +conjunction with guardians (@pxref{Guardians}). Typically, if you are +using a guardian, you want to call the guardian after garbage collection +to see if any of the objects added to the guardian have been collected. +By adding a thunk that performs this call to @code{after-gc-hook}, you +can ensure that your guardian is tested after every garbage collection +cycle. + + +@node REPL Hooks +@subsubsection Hooks into the Guile REPL @c Local Variables: diff --git a/doc/ref/scripts.texi b/doc/ref/scripts.texi index 4a121e5fc..10549dc12 100644 --- a/doc/ref/scripts.texi +++ b/doc/ref/scripts.texi @@ -101,7 +101,7 @@ slow down execution. By default, the debugging evaluator is only used when entering an interactive session. When executing a script with @code{-s} or @code{-c}, the normal, faster evaluator is used by default. -@vnew{1.6} +@vnew{1.8} @item --no-debug Do not use the debugging evaluator, even when entering an interactive session. From f29dc30246d852f8081970bd033b4a1fa694a886 Mon Sep 17 00:00:00 2001 From: Thien-Thi Nguyen Date: Mon, 18 Mar 2002 04:50:05 +0000 Subject: [PATCH 110/131] (2): Add link for collated snapshots. Stamp fixed. --- BUGS | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/BUGS b/BUGS index 230e0ad6b..e9235b567 100644 --- a/BUGS +++ b/BUGS @@ -45,13 +45,15 @@ the offending lines. bug 2 -- documentation mirroring not complete reported-by: lord@regexps.com / 2001-08 -fixed: not-yet +fixed: 2002-03-17 ttn sez: uncollated mirroring is already available: http://savannah.gnu.org/cgi-bin/viewcvs/guile/ http://mail.gnu.org/pipermail/guile-devel/ +collated snapshots: http://www.glug.org/snap/ (user initiative) + bug 3 -- design decisions not recorded reported-by: lord@regexps.com / 2001-08 From e050d4f8240ff1b123ccd5687633d5be241c445c Mon Sep 17 00:00:00 2001 From: Dirk Herrmann Date: Wed, 20 Mar 2002 23:53:13 +0000 Subject: [PATCH 111/131] * eval.c (SIDEVAL): Removed. (SCM_CEVAL): Minimized scope of variable orig_sym. Eliminated goto-labels cdrxnoap, cdrxbegin and nontoplevel_cdrxnoap. Changed argument checking order for set! to locals, variables and symbols. Improvements to control structure. Removed some uses of arg1 and arg2 as temporary variables. --- libguile/ChangeLog | 10 +++++ libguile/eval.c | 93 ++++++++++++++++++++++------------------------ 2 files changed, 55 insertions(+), 48 deletions(-) diff --git a/libguile/ChangeLog b/libguile/ChangeLog index f0ac8b320..3ee6ff728 100644 --- a/libguile/ChangeLog +++ b/libguile/ChangeLog @@ -1,3 +1,13 @@ +2002-03-20 Dirk Herrmann + + * eval.c (SIDEVAL): Removed. + + (SCM_CEVAL): Minimized scope of variable orig_sym. Eliminated + goto-labels cdrxnoap, cdrxbegin and nontoplevel_cdrxnoap. Changed + argument checking order for set! to locals, variables and symbols. + Improvements to control structure. Removed some uses of arg1 and + arg2 as temporary variables. + 2002-03-15 Thien-Thi Nguyen * guile-snarf.in: Remove "--compat=1.4" support. diff --git a/libguile/eval.c b/libguile/eval.c index 523f7adb5..f8a52afd0 100644 --- a/libguile/eval.c +++ b/libguile/eval.c @@ -123,10 +123,6 @@ char *alloca (); * Originally, it is defined to scm_ceval, but is redefined to * scm_deval during the second pass. * - * SIDEVAL corresponds to SCM_CEVAL, but is used in situations where - * only side effects of expressions matter. All immediates are - * ignored. - * * SCM_EVALIM is used when it is known that the expression is an * immediate. (This macro never calls an evaluator.) * @@ -150,8 +146,6 @@ char *alloca (); */ #define SCM_CEVAL scm_ceval -#define SIDEVAL(x, env) if (SCM_NIMP (x)) SCM_CEVAL((x), (env)) - #define EVALCELLCAR(x, env) (SCM_SYMBOLP (SCM_CAR (x)) \ ? *scm_lookupcar (x, env, 1) \ : SCM_CEVAL (SCM_CAR (x), env)) @@ -1890,7 +1884,7 @@ scm_deval (SCM x, SCM env) SCM SCM_CEVAL (SCM x, SCM env) { - SCM proc, arg1, arg2, orig_sym; + SCM proc, arg1, arg2; #ifdef DEVAL scm_t_debug_frame debug; scm_t_debug_info *debug_info_end; @@ -2009,15 +2003,11 @@ dispatch: goto carloop; case SCM_BIT8 (SCM_IM_BEGIN): - if (SCM_NULLP (SCM_CDR (x))) + x = SCM_CDR (x); + if (SCM_NULLP (x)) RETURN (SCM_UNSPECIFIED); - /* (currently unused) - cdrxnoap: */ PREP_APPLY (SCM_UNDEFINED, SCM_EOL); - /* (currently unused) - cdrxbegin: */ - x = SCM_CDR (x); begin: /* If we are on toplevel with a lookup closure, we need to sync @@ -2036,9 +2026,6 @@ dispatch: else goto nontoplevel_begin; - nontoplevel_cdrxnoap: - PREP_APPLY (SCM_UNDEFINED, SCM_EOL); - x = SCM_CDR (x); nontoplevel_begin: while (!SCM_NULLP (SCM_CDR (x))) { @@ -2254,8 +2241,9 @@ dispatch: while (!SCM_NULLP (init_forms)); env = EXTEND_ENV (SCM_CAR (x), init_values, env); } - x = SCM_CDR (x); - goto nontoplevel_cdrxnoap; + x = SCM_CDDR (x); + PREP_APPLY (SCM_UNDEFINED, SCM_EOL); + goto nontoplevel_begin; case SCM_BIT8 (SCM_IM_LETREC): @@ -2273,7 +2261,9 @@ dispatch: while (!SCM_NULLP (init_forms)); SCM_SETCDR (SCM_CAR (env), init_values); } - goto nontoplevel_cdrxnoap; + x = SCM_CDR (x); + PREP_APPLY (SCM_UNDEFINED, SCM_EOL); + goto nontoplevel_begin; case SCM_BIT8 (SCM_IM_LETSTAR): @@ -2294,7 +2284,9 @@ dispatch: while (!SCM_NULLP (bindings)); } } - goto nontoplevel_cdrxnoap; + x = SCM_CDR (x); + PREP_APPLY (SCM_UNDEFINED, SCM_EOL); + goto nontoplevel_begin; case SCM_BIT8 (SCM_IM_OR): @@ -2324,12 +2316,13 @@ dispatch: { SCM *location; SCM variable = SCM_CAR (x); +#ifdef MEMOIZE_LOCALS + if (SCM_ILOCP (variable)) + location = scm_ilookup (variable, env); + else +#endif if (SCM_VARIABLEP (variable)) location = SCM_VARIABLE_LOC (variable); -#ifdef MEMOIZE_LOCALS - else if (SCM_ILOCP (variable)) - location = scm_ilookup (variable, env); -#endif else /* (SCM_SYMBOLP (variable)) is known to be true */ location = scm_lookupcar (x, env, 1); x = SCM_CDR (x); @@ -2407,23 +2400,27 @@ dispatch: int first; SCM val = scm_make_continuation (&first); - if (first) - arg1 = val; - else + if (!first) RETURN (val); + else + { + arg1 = val; + proc = SCM_CDR (x); + proc = scm_eval_car (proc, env); + SCM_ASRTGO (SCM_NIMP (proc), badfun); + PREP_APPLY (proc, scm_list_1 (arg1)); + ENTER_APPLY; + if (SCM_CLOSUREP(proc) && scm_badformalsp (proc, 1)) + goto umwrongnumargs; + goto evap1; + } } - proc = SCM_CDR (x); - proc = scm_eval_car (proc, env); - SCM_ASRTGO (SCM_NIMP (proc), badfun); - PREP_APPLY (proc, scm_list_1 (arg1)); - ENTER_APPLY; - if (SCM_CLOSUREP(proc) && scm_badformalsp (proc, 1)) - goto umwrongnumargs; - goto evap1; + case (SCM_ISYMNUM (SCM_IM_DELAY)): RETURN (scm_makprom (scm_closure (SCM_CDR (x), env))); + case (SCM_ISYMNUM (SCM_IM_DISPATCH)): { /* If not done yet, evaluate the operand forms. The result is a @@ -2732,9 +2729,9 @@ dispatch: #endif /* ifdef MEMOIZE_LOCALS */ case scm_tcs_cons_nimcar: - orig_sym = SCM_CAR (x); - if (SCM_SYMBOLP (orig_sym)) + if (SCM_SYMBOLP (SCM_CAR (x))) { + SCM orig_sym = SCM_CAR (x); #ifdef USE_THREADS { SCM *location = scm_lookupcar1 (x, env, 1); @@ -2759,7 +2756,7 @@ dispatch: { SCM_SETCAR (x, orig_sym); /* Undo memoizing effect of lookupcar */ - handle_a_macro: + handle_a_macro: /* inputs: x, env, proc */ #ifdef DEVAL /* Set a flag during macro expansion so that macro application frames can be deleted from the backtrace. */ @@ -2812,18 +2809,18 @@ dispatch: #endif if (SCM_CLOSUREP (proc)) { - arg2 = SCM_CLOSURE_FORMALS (proc); - arg1 = SCM_CDR (x); - while (!SCM_NULLP (arg2)) + SCM formals = SCM_CLOSURE_FORMALS (proc); + SCM args = SCM_CDR (x); + while (!SCM_NULLP (formals)) { - if (!SCM_CONSP (arg2)) + if (!SCM_CONSP (formals)) goto evapply; - if (SCM_IMP (arg1)) + if (SCM_IMP (args)) goto umwrongnumargs; - arg2 = SCM_CDR (arg2); - arg1 = SCM_CDR (arg1); + formals = SCM_CDR (formals); + args = SCM_CDR (args); } - if (!SCM_NULLP (arg1)) + if (!SCM_NULLP (args)) goto umwrongnumargs; } else if (SCM_MACROP (proc)) @@ -2832,7 +2829,7 @@ dispatch: } -evapply: +evapply: /* inputs: x, proc */ PREP_APPLY (proc, SCM_EOL); if (SCM_NULLP (SCM_CDR (x))) { ENTER_APPLY; @@ -3358,7 +3355,7 @@ exit: { int first; SCM val = scm_make_continuation (&first); - + if (first) arg1 = val; else From 42030fb2757235458db8f78a5218581d8f1a94a8 Mon Sep 17 00:00:00 2001 From: Dirk Herrmann Date: Thu, 21 Mar 2002 00:36:03 +0000 Subject: [PATCH 112/131] * eval.c (SCM_CEVAL): Minimized scope of variable arg2. Eliminated redundant SCM_IMP check. Exlined call to EVALCAR. Re-enabled handing of rpsubrs and asubrs. --- libguile/ChangeLog | 6 + libguile/eval.c | 777 ++++++++++++++++++++++----------------------- 2 files changed, 384 insertions(+), 399 deletions(-) diff --git a/libguile/ChangeLog b/libguile/ChangeLog index 3ee6ff728..064f5ef6c 100644 --- a/libguile/ChangeLog +++ b/libguile/ChangeLog @@ -1,3 +1,9 @@ +2002-03-21 Dirk Herrmann + + * eval.c (SCM_CEVAL): Minimized scope of variable arg2. + Eliminated redundant SCM_IMP check. Exlined call to EVALCAR. + Re-enabled handing of rpsubrs and asubrs. + 2002-03-20 Dirk Herrmann * eval.c (SIDEVAL): Removed. diff --git a/libguile/eval.c b/libguile/eval.c index f8a52afd0..bd1059b87 100644 --- a/libguile/eval.c +++ b/libguile/eval.c @@ -1884,7 +1884,7 @@ scm_deval (SCM x, SCM env) SCM SCM_CEVAL (SCM x, SCM env) { - SCM proc, arg1, arg2; + SCM proc, arg1; #ifdef DEVAL scm_t_debug_frame debug; scm_t_debug_info *debug_info_end; @@ -2925,423 +2925,402 @@ evapply: /* inputs: x, proc */ debug.info->a.args = scm_list_1 (arg1); #endif x = SCM_CDR (x); - if (SCM_NULLP (x)) - { - ENTER_APPLY; - evap1: - switch (SCM_TYP7 (proc)) - { /* have one argument in arg1 */ - case scm_tc7_subr_2o: - RETURN (SCM_SUBRF (proc) (arg1, SCM_UNDEFINED)); - case scm_tc7_subr_1: - case scm_tc7_subr_1o: - RETURN (SCM_SUBRF (proc) (arg1)); - case scm_tc7_cxr: - if (SCM_SUBRF (proc)) - { - if (SCM_INUMP (arg1)) - { - RETURN (scm_make_real (SCM_DSUBRF (proc) ((double) SCM_INUM (arg1)))); - } - else if (SCM_REALP (arg1)) - { - RETURN (scm_make_real (SCM_DSUBRF (proc) (SCM_REAL_VALUE (arg1)))); - } -#ifdef SCM_BIGDIG - else if (SCM_BIGP (arg1)) - { - RETURN (scm_make_real (SCM_DSUBRF (proc) (scm_i_big2dbl (arg1)))); - } -#endif - SCM_WTA_DISPATCH_1 (*SCM_SUBR_GENERIC (proc), arg1, - SCM_ARG1, SCM_SYMBOL_CHARS (SCM_SNAME (proc))); - } - proc = SCM_SNAME (proc); - { - char *chrs = SCM_SYMBOL_CHARS (proc) + SCM_SYMBOL_LENGTH (proc) - 1; - while ('c' != *--chrs) + { + SCM arg2; + if (SCM_NULLP (x)) + { + ENTER_APPLY; + evap1: /* inputs: proc, arg1 */ + switch (SCM_TYP7 (proc)) + { /* have one argument in arg1 */ + case scm_tc7_subr_2o: + RETURN (SCM_SUBRF (proc) (arg1, SCM_UNDEFINED)); + case scm_tc7_subr_1: + case scm_tc7_subr_1o: + RETURN (SCM_SUBRF (proc) (arg1)); + case scm_tc7_cxr: + if (SCM_SUBRF (proc)) { - SCM_ASSERT (SCM_CONSP (arg1), - arg1, SCM_ARG1, SCM_SYMBOL_CHARS (proc)); - arg1 = ('a' == *chrs) ? SCM_CAR (arg1) : SCM_CDR (arg1); + if (SCM_INUMP (arg1)) + { + RETURN (scm_make_real (SCM_DSUBRF (proc) ((double) SCM_INUM (arg1)))); + } + else if (SCM_REALP (arg1)) + { + RETURN (scm_make_real (SCM_DSUBRF (proc) (SCM_REAL_VALUE (arg1)))); + } +#ifdef SCM_BIGDIG + else if (SCM_BIGP (arg1)) + { + RETURN (scm_make_real (SCM_DSUBRF (proc) (scm_i_big2dbl (arg1)))); + } +#endif + SCM_WTA_DISPATCH_1 (*SCM_SUBR_GENERIC (proc), arg1, + SCM_ARG1, SCM_SYMBOL_CHARS (SCM_SNAME (proc))); } - RETURN (arg1); - } - case scm_tc7_rpsubr: - RETURN (SCM_BOOL_T); - case scm_tc7_asubr: - RETURN (SCM_SUBRF (proc) (arg1, SCM_UNDEFINED)); - case scm_tc7_lsubr: -#ifdef DEVAL - RETURN (SCM_SUBRF (proc) (debug.info->a.args)); -#else - RETURN (SCM_SUBRF (proc) (scm_list_1 (arg1))); -#endif - case scm_tc7_smob: - if (!SCM_SMOB_APPLICABLE_P (proc)) - goto badfun; - RETURN (SCM_SMOB_APPLY_1 (proc, arg1)); - case scm_tc7_cclo: - arg2 = arg1; - arg1 = proc; - proc = SCM_CCLO_SUBR (proc); -#ifdef DEVAL - debug.info->a.args = scm_cons (arg1, debug.info->a.args); - debug.info->a.proc = proc; -#endif - goto evap2; - case scm_tc7_pws: - proc = SCM_PROCEDURE (proc); -#ifdef DEVAL - debug.info->a.proc = proc; -#endif - if (!SCM_CLOSUREP (proc)) - goto evap1; - if (scm_badformalsp (proc, 1)) - goto umwrongnumargs; - case scm_tcs_closures: - /* clos1: */ - x = SCM_CLOSURE_BODY (proc); -#ifdef DEVAL - env = EXTEND_ENV (SCM_CLOSURE_FORMALS (proc), debug.info->a.args, SCM_ENV (proc)); -#else - env = EXTEND_ENV (SCM_CLOSURE_FORMALS (proc), scm_list_1 (arg1), SCM_ENV (proc)); -#endif - goto nontoplevel_begin; - case scm_tcs_struct: - if (SCM_OBJ_CLASS_FLAGS (proc) & SCM_CLASSF_PURE_GENERIC) + proc = SCM_SNAME (proc); { - x = SCM_ENTITY_PROCEDURE (proc); -#ifdef DEVAL - arg1 = debug.info->a.args; -#else - arg1 = scm_list_1 (arg1); -#endif - goto type_dispatch; + char *chrs = SCM_SYMBOL_CHARS (proc) + SCM_SYMBOL_LENGTH (proc) - 1; + while ('c' != *--chrs) + { + SCM_ASSERT (SCM_CONSP (arg1), + arg1, SCM_ARG1, SCM_SYMBOL_CHARS (proc)); + arg1 = ('a' == *chrs) ? SCM_CAR (arg1) : SCM_CDR (arg1); + } + RETURN (arg1); } - else if (!SCM_I_OPERATORP (proc)) - goto badfun; - else - { - arg2 = arg1; - arg1 = proc; - proc = (SCM_I_ENTITYP (proc) - ? SCM_ENTITY_PROCEDURE (proc) - : SCM_OPERATOR_PROCEDURE (proc)); + case scm_tc7_rpsubr: + RETURN (SCM_BOOL_T); + case scm_tc7_asubr: + RETURN (SCM_SUBRF (proc) (arg1, SCM_UNDEFINED)); + case scm_tc7_lsubr: #ifdef DEVAL - debug.info->a.args = scm_cons (arg1, debug.info->a.args); - debug.info->a.proc = proc; -#endif - if (SCM_NIMP (proc)) - goto evap2; - else - goto badfun; - } - case scm_tc7_subr_2: - case scm_tc7_subr_0: - case scm_tc7_subr_3: - case scm_tc7_lsubr_2: - goto wrongnumargs; - default: - goto badfun; - } - } -#ifdef SCM_CAUTIOUS - if (SCM_IMP (x)) - goto wrongnumargs; - else if (SCM_CONSP (x)) - { - if (SCM_IMP (SCM_CAR (x))) - arg2 = SCM_EVALIM (SCM_CAR (x), env); - else - arg2 = EVALCELLCAR (x, env); - } - else - goto wrongnumargs; + RETURN (SCM_SUBRF (proc) (debug.info->a.args)); #else - arg2 = EVALCAR (x, env); + RETURN (SCM_SUBRF (proc) (scm_list_1 (arg1))); #endif - { /* have two or more arguments */ + case scm_tc7_smob: + if (!SCM_SMOB_APPLICABLE_P (proc)) + goto badfun; + RETURN (SCM_SMOB_APPLY_1 (proc, arg1)); + case scm_tc7_cclo: + arg2 = arg1; + arg1 = proc; + proc = SCM_CCLO_SUBR (proc); #ifdef DEVAL - debug.info->a.args = scm_list_2 (arg1, arg2); + debug.info->a.args = scm_cons (arg1, debug.info->a.args); + debug.info->a.proc = proc; #endif - x = SCM_CDR (x); - if (SCM_NULLP (x)) { - ENTER_APPLY; - evap2: - switch (SCM_TYP7 (proc)) - { /* have two arguments */ - case scm_tc7_subr_2: - case scm_tc7_subr_2o: - RETURN (SCM_SUBRF (proc) (arg1, arg2)); - case scm_tc7_lsubr: -#ifdef DEVAL - RETURN (SCM_SUBRF (proc) (debug.info->a.args)); -#else - RETURN (SCM_SUBRF (proc) (scm_list_2 (arg1, arg2))); -#endif - case scm_tc7_lsubr_2: - RETURN (SCM_SUBRF (proc) (arg1, arg2, SCM_EOL)); - case scm_tc7_rpsubr: - case scm_tc7_asubr: - RETURN (SCM_SUBRF (proc) (arg1, arg2)); - case scm_tc7_smob: - if (!SCM_SMOB_APPLICABLE_P (proc)) - goto badfun; - RETURN (SCM_SMOB_APPLY_2 (proc, arg1, arg2)); - cclon: - case scm_tc7_cclo: -#ifdef DEVAL - RETURN (SCM_APPLY (SCM_CCLO_SUBR (proc), - scm_cons (proc, debug.info->a.args), - SCM_EOL)); -#else - RETURN (SCM_APPLY (SCM_CCLO_SUBR (proc), - scm_cons2 (proc, arg1, - scm_cons (arg2, - scm_eval_args (x, - env, - proc))), - SCM_EOL)); -#endif - case scm_tcs_struct: - if (SCM_OBJ_CLASS_FLAGS (proc) & SCM_CLASSF_PURE_GENERIC) - { - x = SCM_ENTITY_PROCEDURE (proc); -#ifdef DEVAL - arg1 = debug.info->a.args; -#else - arg1 = scm_list_2 (arg1, arg2); -#endif - goto type_dispatch; - } - else if (!SCM_I_OPERATORP (proc)) - goto badfun; - else - { - operatorn: -#ifdef DEVAL - RETURN (SCM_APPLY (SCM_I_ENTITYP (proc) - ? SCM_ENTITY_PROCEDURE (proc) - : SCM_OPERATOR_PROCEDURE (proc), - scm_cons (proc, debug.info->a.args), - SCM_EOL)); -#else - RETURN (SCM_APPLY (SCM_I_ENTITYP (proc) - ? SCM_ENTITY_PROCEDURE (proc) - : SCM_OPERATOR_PROCEDURE (proc), - scm_cons2 (proc, arg1, - scm_cons (arg2, - scm_eval_args (x, - env, - proc))), - SCM_EOL)); -#endif - } - case scm_tc7_subr_0: - case scm_tc7_cxr: - case scm_tc7_subr_1o: - case scm_tc7_subr_1: - case scm_tc7_subr_3: - goto wrongnumargs; - default: - goto badfun; - case scm_tc7_pws: - proc = SCM_PROCEDURE (proc); -#ifdef DEVAL - debug.info->a.proc = proc; -#endif - if (!SCM_CLOSUREP (proc)) goto evap2; - if (scm_badformalsp (proc, 2)) + case scm_tc7_pws: + proc = SCM_PROCEDURE (proc); +#ifdef DEVAL + debug.info->a.proc = proc; +#endif + if (!SCM_CLOSUREP (proc)) + goto evap1; + if (scm_badformalsp (proc, 1)) + goto umwrongnumargs; + case scm_tcs_closures: + /* clos1: */ + x = SCM_CLOSURE_BODY (proc); +#ifdef DEVAL + env = EXTEND_ENV (SCM_CLOSURE_FORMALS (proc), debug.info->a.args, SCM_ENV (proc)); +#else + env = EXTEND_ENV (SCM_CLOSURE_FORMALS (proc), scm_list_1 (arg1), SCM_ENV (proc)); +#endif + goto nontoplevel_begin; + case scm_tcs_struct: + if (SCM_OBJ_CLASS_FLAGS (proc) & SCM_CLASSF_PURE_GENERIC) + { + x = SCM_ENTITY_PROCEDURE (proc); +#ifdef DEVAL + arg1 = debug.info->a.args; +#else + arg1 = scm_list_1 (arg1); +#endif + goto type_dispatch; + } + else if (!SCM_I_OPERATORP (proc)) + goto badfun; + else + { + arg2 = arg1; + arg1 = proc; + proc = (SCM_I_ENTITYP (proc) + ? SCM_ENTITY_PROCEDURE (proc) + : SCM_OPERATOR_PROCEDURE (proc)); +#ifdef DEVAL + debug.info->a.args = scm_cons (arg1, debug.info->a.args); + debug.info->a.proc = proc; +#endif + if (SCM_NIMP (proc)) + goto evap2; + else + goto badfun; + } + case scm_tc7_subr_2: + case scm_tc7_subr_0: + case scm_tc7_subr_3: + case scm_tc7_lsubr_2: + goto wrongnumargs; + default: + goto badfun; + } + } +#ifdef SCM_CAUTIOUS + if (SCM_CONSP (x)) + arg2 = EVALCAR (x, env); + else + goto wrongnumargs; +#else + arg2 = EVALCAR (x, env); +#endif + { /* have two or more arguments */ +#ifdef DEVAL + debug.info->a.args = scm_list_2 (arg1, arg2); +#endif + x = SCM_CDR (x); + if (SCM_NULLP (x)) { + ENTER_APPLY; + evap2: + switch (SCM_TYP7 (proc)) + { /* have two arguments */ + case scm_tc7_subr_2: + case scm_tc7_subr_2o: + RETURN (SCM_SUBRF (proc) (arg1, arg2)); + case scm_tc7_lsubr: +#ifdef DEVAL + RETURN (SCM_SUBRF (proc) (debug.info->a.args)); +#else + RETURN (SCM_SUBRF (proc) (scm_list_2 (arg1, arg2))); +#endif + case scm_tc7_lsubr_2: + RETURN (SCM_SUBRF (proc) (arg1, arg2, SCM_EOL)); + case scm_tc7_rpsubr: + case scm_tc7_asubr: + RETURN (SCM_SUBRF (proc) (arg1, arg2)); + case scm_tc7_smob: + if (!SCM_SMOB_APPLICABLE_P (proc)) + goto badfun; + RETURN (SCM_SMOB_APPLY_2 (proc, arg1, arg2)); + cclon: + case scm_tc7_cclo: +#ifdef DEVAL + RETURN (SCM_APPLY (SCM_CCLO_SUBR (proc), + scm_cons (proc, debug.info->a.args), + SCM_EOL)); +#else + RETURN (SCM_APPLY (SCM_CCLO_SUBR (proc), + scm_cons2 (proc, arg1, + scm_cons (arg2, + scm_eval_args (x, + env, + proc))), + SCM_EOL)); +#endif + case scm_tcs_struct: + if (SCM_OBJ_CLASS_FLAGS (proc) & SCM_CLASSF_PURE_GENERIC) + { + x = SCM_ENTITY_PROCEDURE (proc); +#ifdef DEVAL + arg1 = debug.info->a.args; +#else + arg1 = scm_list_2 (arg1, arg2); +#endif + goto type_dispatch; + } + else if (!SCM_I_OPERATORP (proc)) + goto badfun; + else + { + operatorn: +#ifdef DEVAL + RETURN (SCM_APPLY (SCM_I_ENTITYP (proc) + ? SCM_ENTITY_PROCEDURE (proc) + : SCM_OPERATOR_PROCEDURE (proc), + scm_cons (proc, debug.info->a.args), + SCM_EOL)); +#else + RETURN (SCM_APPLY (SCM_I_ENTITYP (proc) + ? SCM_ENTITY_PROCEDURE (proc) + : SCM_OPERATOR_PROCEDURE (proc), + scm_cons2 (proc, arg1, + scm_cons (arg2, + scm_eval_args (x, + env, + proc))), + SCM_EOL)); +#endif + } + case scm_tc7_subr_0: + case scm_tc7_cxr: + case scm_tc7_subr_1o: + case scm_tc7_subr_1: + case scm_tc7_subr_3: + goto wrongnumargs; + default: + goto badfun; + case scm_tc7_pws: + proc = SCM_PROCEDURE (proc); +#ifdef DEVAL + debug.info->a.proc = proc; +#endif + if (!SCM_CLOSUREP (proc)) + goto evap2; + if (scm_badformalsp (proc, 2)) + goto umwrongnumargs; + case scm_tcs_closures: + /* clos2: */ +#ifdef DEVAL + env = EXTEND_ENV (SCM_CLOSURE_FORMALS (proc), + debug.info->a.args, + SCM_ENV (proc)); +#else + env = EXTEND_ENV (SCM_CLOSURE_FORMALS (proc), + scm_list_2 (arg1, arg2), SCM_ENV (proc)); +#endif + x = SCM_CLOSURE_BODY (proc); + goto nontoplevel_begin; + } + } +#ifdef SCM_CAUTIOUS + if (!SCM_CONSP (x)) + goto wrongnumargs; +#endif +#ifdef DEVAL + debug.info->a.args = scm_cons2 (arg1, arg2, + deval_args (x, env, proc, + SCM_CDRLOC (SCM_CDR (debug.info->a.args)))); +#endif + ENTER_APPLY; + evap3: + switch (SCM_TYP7 (proc)) + { /* have 3 or more arguments */ +#ifdef DEVAL + case scm_tc7_subr_3: + SCM_ASRTGO (SCM_NULLP (SCM_CDR (x)), wrongnumargs); + RETURN (SCM_SUBRF (proc) (arg1, arg2, + SCM_CADDR (debug.info->a.args))); + case scm_tc7_asubr: + arg1 = SCM_SUBRF(proc)(arg1, arg2); + arg2 = SCM_CDDR (debug.info->a.args); + do + { + arg1 = SCM_SUBRF(proc)(arg1, SCM_CAR (arg2)); + arg2 = SCM_CDR (arg2); + } + while (SCM_NIMP (arg2)); + RETURN (arg1); + case scm_tc7_rpsubr: + if (SCM_FALSEP (SCM_SUBRF (proc) (arg1, arg2))) + RETURN (SCM_BOOL_F); + arg1 = SCM_CDDR (debug.info->a.args); + do + { + if (SCM_FALSEP (SCM_SUBRF (proc) (arg2, SCM_CAR (arg1)))) + RETURN (SCM_BOOL_F); + arg2 = SCM_CAR (arg1); + arg1 = SCM_CDR (arg1); + } + while (SCM_NIMP (arg1)); + RETURN (SCM_BOOL_T); + case scm_tc7_lsubr_2: + RETURN (SCM_SUBRF (proc) (arg1, arg2, + SCM_CDDR (debug.info->a.args))); + case scm_tc7_lsubr: + RETURN (SCM_SUBRF (proc) (debug.info->a.args)); + case scm_tc7_smob: + if (!SCM_SMOB_APPLICABLE_P (proc)) + goto badfun; + RETURN (SCM_SMOB_APPLY_3 (proc, arg1, arg2, + SCM_CDDR (debug.info->a.args))); + case scm_tc7_cclo: + goto cclon; + case scm_tc7_pws: + proc = SCM_PROCEDURE (proc); + debug.info->a.proc = proc; + if (!SCM_CLOSUREP (proc)) + goto evap3; + if (scm_badargsp (SCM_CLOSURE_FORMALS (proc), debug.info->a.args)) goto umwrongnumargs; case scm_tcs_closures: - /* clos2: */ -#ifdef DEVAL + SCM_SET_ARGSREADY (debug); env = EXTEND_ENV (SCM_CLOSURE_FORMALS (proc), debug.info->a.args, SCM_ENV (proc)); -#else - env = EXTEND_ENV (SCM_CLOSURE_FORMALS (proc), - scm_list_2 (arg1, arg2), SCM_ENV (proc)); -#endif x = SCM_CLOSURE_BODY (proc); goto nontoplevel_begin; +#else /* DEVAL */ + case scm_tc7_subr_3: + SCM_ASRTGO (SCM_NULLP (SCM_CDR (x)), wrongnumargs); + RETURN (SCM_SUBRF (proc) (arg1, arg2, EVALCAR (x, env))); + case scm_tc7_asubr: + arg1 = SCM_SUBRF (proc) (arg1, arg2); + do + { + arg1 = SCM_SUBRF(proc)(arg1, EVALCAR(x, env)); + x = SCM_CDR(x); + } + while (SCM_NIMP (x)); + RETURN (arg1); + case scm_tc7_rpsubr: + if (SCM_FALSEP (SCM_SUBRF (proc) (arg1, arg2))) + RETURN (SCM_BOOL_F); + do + { + arg1 = EVALCAR (x, env); + if (SCM_FALSEP (SCM_SUBRF (proc) (arg2, arg1))) + RETURN (SCM_BOOL_F); + arg2 = arg1; + x = SCM_CDR (x); + } + while (SCM_NIMP (x)); + RETURN (SCM_BOOL_T); + case scm_tc7_lsubr_2: + RETURN (SCM_SUBRF (proc) (arg1, arg2, scm_eval_args (x, env, proc))); + case scm_tc7_lsubr: + RETURN (SCM_SUBRF (proc) (scm_cons2 (arg1, + arg2, + scm_eval_args (x, env, proc)))); + case scm_tc7_smob: + if (!SCM_SMOB_APPLICABLE_P (proc)) + goto badfun; + RETURN (SCM_SMOB_APPLY_3 (proc, arg1, arg2, + scm_eval_args (x, env, proc))); + case scm_tc7_cclo: + goto cclon; + case scm_tc7_pws: + proc = SCM_PROCEDURE (proc); + if (!SCM_CLOSUREP (proc)) + goto evap3; + { + SCM formals = SCM_CLOSURE_FORMALS (proc); + if (SCM_NULLP (formals) + || (SCM_CONSP (formals) + && (SCM_NULLP (SCM_CDR (formals)) + || (SCM_CONSP (SCM_CDR (formals)) + && scm_badargsp (SCM_CDDR (formals), x))))) + goto umwrongnumargs; + } + case scm_tcs_closures: +#ifdef DEVAL + SCM_SET_ARGSREADY (debug); +#endif + env = EXTEND_ENV (SCM_CLOSURE_FORMALS (proc), + scm_cons2 (arg1, + arg2, + scm_eval_args (x, env, proc)), + SCM_ENV (proc)); + x = SCM_CLOSURE_BODY (proc); + goto nontoplevel_begin; +#endif /* DEVAL */ + case scm_tcs_struct: + if (SCM_OBJ_CLASS_FLAGS (proc) & SCM_CLASSF_PURE_GENERIC) + { +#ifdef DEVAL + arg1 = debug.info->a.args; +#else + arg1 = scm_cons2 (arg1, arg2, scm_eval_args (x, env, proc)); +#endif + x = SCM_ENTITY_PROCEDURE (proc); + goto type_dispatch; + } + else if (!SCM_I_OPERATORP (proc)) + goto badfun; + else + goto operatorn; + case scm_tc7_subr_2: + case scm_tc7_subr_1o: + case scm_tc7_subr_2o: + case scm_tc7_subr_0: + case scm_tc7_cxr: + case scm_tc7_subr_1: + goto wrongnumargs; + default: + goto badfun; } } -#ifdef SCM_CAUTIOUS - if (SCM_IMP (x) || !SCM_CONSP (x)) - goto wrongnumargs; -#endif -#ifdef DEVAL - debug.info->a.args = scm_cons2 (arg1, arg2, - deval_args (x, env, proc, SCM_CDRLOC (SCM_CDR (debug.info->a.args)))); -#endif - ENTER_APPLY; - evap3: - switch (SCM_TYP7 (proc)) - { /* have 3 or more arguments */ -#ifdef DEVAL - case scm_tc7_subr_3: - SCM_ASRTGO (SCM_NULLP (SCM_CDR (x)), wrongnumargs); - RETURN (SCM_SUBRF (proc) (arg1, arg2, - SCM_CADDR (debug.info->a.args))); - case scm_tc7_asubr: -#ifdef BUILTIN_RPASUBR - arg1 = SCM_SUBRF(proc)(arg1, arg2); - arg2 = SCM_CDDR (debug.info->a.args); - do - { - arg1 = SCM_SUBRF(proc)(arg1, SCM_CAR (arg2)); - arg2 = SCM_CDR (arg2); - } - while (SCM_NIMP (arg2)); - RETURN (arg1); -#endif /* BUILTIN_RPASUBR */ - case scm_tc7_rpsubr: -#ifdef BUILTIN_RPASUBR - if (SCM_FALSEP (SCM_SUBRF (proc) (arg1, arg2))) - RETURN (SCM_BOOL_F); - arg1 = SCM_CDDR (debug.info->a.args); - do - { - if (SCM_FALSEP (SCM_SUBRF (proc) (arg2, SCM_CAR (arg1)))) - RETURN (SCM_BOOL_F); - arg2 = SCM_CAR (arg1); - arg1 = SCM_CDR (arg1); - } - while (SCM_NIMP (arg1)); - RETURN (SCM_BOOL_T); -#else /* BUILTIN_RPASUBR */ - RETURN (SCM_APPLY (proc, arg1, - scm_acons (arg2, - SCM_CDDR (debug.info->a.args), - SCM_EOL))); -#endif /* BUILTIN_RPASUBR */ - case scm_tc7_lsubr_2: - RETURN (SCM_SUBRF (proc) (arg1, arg2, - SCM_CDDR (debug.info->a.args))); - case scm_tc7_lsubr: - RETURN (SCM_SUBRF (proc) (debug.info->a.args)); - case scm_tc7_smob: - if (!SCM_SMOB_APPLICABLE_P (proc)) - goto badfun; - RETURN (SCM_SMOB_APPLY_3 (proc, arg1, arg2, - SCM_CDDR (debug.info->a.args))); - case scm_tc7_cclo: - goto cclon; - case scm_tc7_pws: - proc = SCM_PROCEDURE (proc); - debug.info->a.proc = proc; - if (!SCM_CLOSUREP (proc)) - goto evap3; - if (scm_badargsp (SCM_CLOSURE_FORMALS (proc), debug.info->a.args)) - goto umwrongnumargs; - case scm_tcs_closures: - SCM_SET_ARGSREADY (debug); - env = EXTEND_ENV (SCM_CLOSURE_FORMALS (proc), - debug.info->a.args, - SCM_ENV (proc)); - x = SCM_CLOSURE_BODY (proc); - goto nontoplevel_begin; -#else /* DEVAL */ - case scm_tc7_subr_3: - SCM_ASRTGO (SCM_NULLP (SCM_CDR (x)), wrongnumargs); - RETURN (SCM_SUBRF (proc) (arg1, arg2, EVALCAR (x, env))); - case scm_tc7_asubr: -#ifdef BUILTIN_RPASUBR - arg1 = SCM_SUBRF (proc) (arg1, arg2); - do - { - arg1 = SCM_SUBRF(proc)(arg1, EVALCAR(x, env)); - x = SCM_CDR(x); - } - while (SCM_NIMP (x)); - RETURN (arg1); -#endif /* BUILTIN_RPASUBR */ - case scm_tc7_rpsubr: -#ifdef BUILTIN_RPASUBR - if (SCM_FALSEP (SCM_SUBRF (proc) (arg1, arg2))) - RETURN (SCM_BOOL_F); - do - { - arg1 = EVALCAR (x, env); - if (SCM_FALSEP (SCM_SUBRF (proc) (arg2, arg1))) - RETURN (SCM_BOOL_F); - arg2 = arg1; - x = SCM_CDR (x); - } - while (SCM_NIMP (x)); - RETURN (SCM_BOOL_T); -#else /* BUILTIN_RPASUBR */ - RETURN (SCM_APPLY (proc, arg1, - scm_acons (arg2, - scm_eval_args (x, env, proc), - SCM_EOL))); -#endif /* BUILTIN_RPASUBR */ - case scm_tc7_lsubr_2: - RETURN (SCM_SUBRF (proc) (arg1, arg2, scm_eval_args (x, env, proc))); - case scm_tc7_lsubr: - RETURN (SCM_SUBRF (proc) (scm_cons2 (arg1, - arg2, - scm_eval_args (x, env, proc)))); - case scm_tc7_smob: - if (!SCM_SMOB_APPLICABLE_P (proc)) - goto badfun; - RETURN (SCM_SMOB_APPLY_3 (proc, arg1, arg2, - scm_eval_args (x, env, proc))); - case scm_tc7_cclo: - goto cclon; - case scm_tc7_pws: - proc = SCM_PROCEDURE (proc); - if (!SCM_CLOSUREP (proc)) - goto evap3; - { - SCM formals = SCM_CLOSURE_FORMALS (proc); - if (SCM_NULLP (formals) - || (SCM_CONSP (formals) - && (SCM_NULLP (SCM_CDR (formals)) - || (SCM_CONSP (SCM_CDR (formals)) - && scm_badargsp (SCM_CDDR (formals), x))))) - goto umwrongnumargs; - } - case scm_tcs_closures: -#ifdef DEVAL - SCM_SET_ARGSREADY (debug); -#endif - env = EXTEND_ENV (SCM_CLOSURE_FORMALS (proc), - scm_cons2 (arg1, - arg2, - scm_eval_args (x, env, proc)), - SCM_ENV (proc)); - x = SCM_CLOSURE_BODY (proc); - goto nontoplevel_begin; -#endif /* DEVAL */ - case scm_tcs_struct: - if (SCM_OBJ_CLASS_FLAGS (proc) & SCM_CLASSF_PURE_GENERIC) - { -#ifdef DEVAL - arg1 = debug.info->a.args; -#else - arg1 = scm_cons2 (arg1, arg2, scm_eval_args (x, env, proc)); -#endif - x = SCM_ENTITY_PROCEDURE (proc); - goto type_dispatch; - } - else if (!SCM_I_OPERATORP (proc)) - goto badfun; - else - goto operatorn; - case scm_tc7_subr_2: - case scm_tc7_subr_1o: - case scm_tc7_subr_2o: - case scm_tc7_subr_0: - case scm_tc7_cxr: - case scm_tc7_subr_1: - goto wrongnumargs; - default: - goto badfun; - } } #ifdef DEVAL exit: From c44b6ec0d384cf630285d885555bc112e7d3583c Mon Sep 17 00:00:00 2001 From: Rob Browning Date: Thu, 21 Mar 2002 16:35:13 +0000 Subject: [PATCH 113/131] *** empty log message *** --- BUGS | 430 ----------------------------------------------------------- 1 file changed, 430 deletions(-) diff --git a/BUGS b/BUGS index e9235b567..e69de29bb 100644 --- a/BUGS +++ b/BUGS @@ -1,430 +0,0 @@ -BUGS - -This file contains bugs we haven't fixed yet, and some we have. -The format is very simple (one bug per page): - -# line regexp - -1 bug NUMBER -- ONE-LINE-DESCRIPTION ^bug ([0-9]+) -- (.+)$ -2 reported-by: SOMEONE / DATE ^reported-by: ([^/]) */ *(.+)$ -3 fixed: DATE (for guile VERSION) ^fixed: (.+) .for guile (.+).$ -4+ OTHER-NOTES - -DATE is formatted YYYY-MM-DD, or "not-yet". Line numbering is zero-origin; -line 0 is empty (newline always follows newpage (recognizable w/ "\f\n")). -The suggested regexps can be used in a line-oriented parser. - -You can use "fixed: no-need (EXPLANATION)" if the bug doesn't need to be -fixed. EXPLANATION might be "not a bug", "user error", etc. - - -bug 0 -- no BUGS file -reported-by: ttn / 2001-09-25 -fixed: 2001-09-30 (1.5.x, 1.7.x) - -bugs are good. - - -bug 1 -- (debug-disable 'debug) has no effect if first form in ~/.guile -reported-by: Sven.Hartrumpf@fernuni-hagen.de / 2001-08-31 -fixed: 2001-11-07 (1.7.x) - -ttn sez: -buggy behavior confirmed on both 1.5.x and 1.7.x. - -on the other hand, when second or later, the expected effect (disabling use of -debugging evaluator) seems to be reflected when viewing the debug options. it -could be that the bug is in display and not the actual setting. - -NJ 2002-03-08: - -Problem was caused by (top-repl)'s loading of (ice-9 debug), which -ended with unconditional `(debug-enable 'debug)'. Fixed by removing -the offending lines. - - -bug 2 -- documentation mirroring not complete -reported-by: lord@regexps.com / 2001-08 -fixed: 2002-03-17 - -ttn sez: -uncollated mirroring is already available: -http://savannah.gnu.org/cgi-bin/viewcvs/guile/ -http://mail.gnu.org/pipermail/guile-devel/ - -collated snapshots: http://www.glug.org/snap/ (user initiative) - - -bug 3 -- design decisions not recorded -reported-by: lord@regexps.com / 2001-08 -fixed: not-yet - -changes are made w/ little documentation on their motivation, design and -consequences. past initiatives and current maintainer discipline to support -them need shoring up. - -ttn sez: -someone also mentioned that process and product are orthogonal; nastiness can -result in/from either, and for different reasons. i tend to believe this up -until a certain point, when the process becomes self-aware and includes its own -improvement in its considerations. then, hopefully it becomes light. - -to change people is difficult, but that's why we have guile... - - -bug 4 -- named-let transform evaluates initvalue in the wrong scope -reported-by: agj@alum.mit.edu / 2001-09-21 -fixed: 2001-11-17 (1.7.x) - -currently: -> (let name ((var init) ...) body ...) -> -> to -> -> (letrec ((name (lambda (var ...) body ...))) -> (name init ...)) - -should be: -> ((letrec ((name (lambda (var ...) body ...))) name) init ...) - -Dirk Herrmann sez: -I will do it - no big deal (I hope). But, I won't have time to do it -before next week. What about adding this code as a test case to the test -suite? Until it is fixed, it can be tagged as expected to fail. - - -bug 5 -- uniform vector read-hash "e" clashes w/ exactness specification -reported-by: kwright@gis.net / 2001-10-07 -fixed: 2001-10-14 (1.5.x, 1.7.x) - -Keith Wright sez: -> Before getting into philosophy, I want to mention that while poking -> around and rethinking I found the following Bug. -> -> guile> (version) -> "1.5.2" -> guile> #E3 -> 3 -> guile> #e3 -> ERROR: read:uniform-vector list not found -> ABORT: (misc-error) -> guile> 3 -> -> This violates both R5RS 7.1 ``Case is insignificant'' and -> -> > From: guile-1.5.2/doc/ref/guile.info-3 Line 568 -> > -> > The codes for indicating exactness (which can, incidentally, be -> > applied to all numerical values) are: -> > -> > * `#e', `#E' -- the number is exact - -2001-10-14 Mikael Djurfeldt - - * read.c (scm_lreadr): When user-defined hash procedure returns - SCM_UNSPECIFIED: Fall back to standard handling instead of raising - an exception. (This prevents parsing of uniform vectors from - interfering with parsing of numbers.) - - -bug 6 -- exactness prefix doesn't do nothing gracefully -reported-by: kwright@gis.net / 2001-10-09 -fixed: 2001-10-14 (1.5.x, 1.7.x) (see bug 5) - -[this may be related to bug 5. --ttn] - -Keith Wright sez: -> The saga continues... -> -> > > The codes for indicating exactness (which can, incidentally, be -> > > applied to all numerical values) are: -> > > -> > > * `#e', `#E' -- the number is exact -> -> guile> #E3 ==> 3 -> guile> #E3.0 -> ERROR: In procedure scm_lreadr: -> ERROR: unknown # object -> -> Better change the reference manual s/, incidentally,/'t/. -> -> (That's a joke son. The Scheme language requires #e in front -> of any number to at least do nothing successfully.) - - -bug 7 -- readline configuration anomolies not handled gracefully -reported-by: kwright@gis.net / 2001-10-17 -fixed: not-yet - - -bug 8 -- install requires makeinfo -reported-by: kwright@gis.net / 2001-10-17 -fixed: not-yet - -Keith Wright sez: -> I got guile-1.5.4 and installed it on one machine with no problem. -> On another I did ./configure;make as before and it died with: -> -> > ... -> > on.doc vports.doc weaks.doc symbols-deprecated.doc regex-posix.doc ramap.doc unif.doc filesys.doc posix.doc net_db.doc socket.doc | ./guile-snarf-docs-texi > guile.texi \ -> > || { rm guile.texi; false; } -> > rm -f guile-procedures.txt -> > makeinfo --force -o guile-procedures.txt guile.texi || test -f guile-procedures.txt -> > /bin/sh: makeinfo: command not found -> > make[1]: *** [guile-procedures.txt] Error 1 -> > make[1]: Leaving directory `/home/kwright/build/guile-1.5.4/libguile' -> > make: *** [all-recursive] Error 1 -> -> I get the impression that it is supposed to build without 'makeinfo', -> if this is not so it should be mentioned in the README or INSTALL. - -NJ 2002-03-08: - -Addressed partially in Makefile.am, by copying guile-procedures.texi -to guile-procedures.txt if makeinfo is not available. - -However, a better IMO fix would be to include a prebuilt -guile-procedures.txt in the distribution. - - -bug 9 -- sibling threads not infinite looping -reported-by: giraud@tif.inria.fr / 2001-09-24 -fixed: not-yet - -Manuel Giraud sez: -> I've configure guile-1.5.4 '--with-threads' and '--with-modules' on a -> "classical" Linux box and used this code that crash silently : -> -> (use-modules (ice-9 threads)) -> -> (begin-thread -> (let loop () -> (display "a") -> (newline) -> (loop))) -> -> (begin-thread -> (let loop () -> (display "b") -> (newline) -> (loop))) - -mdj sez: -+ 2001-10-06 Mikael Djurfeldt -+ -+ These changes fixes a race condition in the Guile coop - pthread -+ compatibility code. -+ -+ * coop.c (mother_awake_p): New variable. -+ (coop_create): Set mother_awake_p before creating or signalling -+ mother; wait until mother is going to sleep before returning. -+ (mother): Reset mother_awake_p before going to sleep. -+ - -ttn sez: -crash still occurs w/ "guile -s bug.scm" (cvs checkout on 2001/11/06). -however, "guile -l bug.scm" works as expected. - - -bug 10 -- embedded libltdl masks system version unconditionally -reported-by: grib@linuxdevel.com / 2001-11-04 -fixed: not-yet - -Bill Gribble sez: -> The guideline for when to use the convenience version of libltdl is -> this: -> -> > In general you can safely use the convenience library in -> > programs which don't depend on other libraries that might -> > use libltdl too. -> -> So guile's use of the convenience library embodies an assumption about -> programs which use guile: that they will not use libltdl except through -> guile's wrapper (dynamic-link and friends). -> -> It seems like this is a bad assumption for guile to make, since it is -> intended to be used as an extension language for many different kinds of -> programs and not to put a priori restrictions on what they can do. -> Especially when those restrictions are not documented. -> -> I would suggest that prior to the guile-1.6 release the use of the -> convenience ltdl library be removed, instead depending on an installed -> version of libltdl. - - -bug 11 -- (ice-9 optargs) #:rest arg polluted by keys/values -reported-by: ttn / 2001-11-09 -fixed: no-need (behavior consistent w/ Common Lisp, user error) - -ttn sez: -> the following code displays -> -> (# ()) -> (# (1)) -> (# ((1 2 3))) -> (# JAY KAY (#:j JAY #:k KAY)) -> (# JAY KAY (#:j JAY #:k KAY 1)) -> (# JAY KAY (#:j JAY #:k KAY (1 2 3))) -> -> but `x' should be the same for both `good' and `blah': -> -> (use-modules (ice-9 optargs) (ice-9 rdelim)) -> -> (define* (good #:rest x) -> (write-line (list good x))) -> -> (good) -> (good 1) -> (good '(1 2 3)) -> -> (define* (blah #:key (j 'j) (k 'k) #:rest x) -> (write-line (list blah j k x))) -> -> (blah #:j 'JAY #:k 'KAY) -> (blah #:j 'JAY #:k 'KAY 1) -> (blah #:j 'JAY #:k 'KAY '(1 2 3)) - -mvo sez: -> In Common Lisp, there are no non-key rest-args when you have keyword -> parameters. After the required and optional arguments, there must -> follow an even number of additional arguments, and every two of them -> are treated as a keyword/value pair. -> -> I think it makes sense the way CL specifies this. Anything beyond -> this would lead to confusion. If you want to go beyond what (ice-9 -> optargs) offers, yo are probably best off writing your own argument -> parser. - - -bug 12 -- goops class redefinition not signalling "no such accessor" error -reported-by: wawrzin@cs.tu-berlin.de / 2001-12-04 -fixed: not-yet - -Thomas Wawrzinek sez: -> Running the following script produces some guile output which confueses me: -> -> ;;; script.scm -> (use-modules (oop goops)) -> -> (define-class ()) -> -> (define-class () -> (a #:init-value #f #:accessor a-value #:init-keyword #:a-value) -> (b #:init-value #f #:accessor b-value #:init-keyword #:b-value)) -> -> (define-class ()) -> -> (define-method (initialize (o ) . args) -> (set! (a-value o) "BAR") -> (next-method)) -> -> (define-generic print) -> -> (define-method (print (o )) -> (display (a-value o)) (newline) -> (display (b-value o)) (newline)) -> -> ;;; OK, this is very *wrong*! -> (define-class ()) -> -> (define baz (make #:b-value "BAZ")) -> -> (print baz) -> -> $ guile -s script.scm -> BAR -> # -> $ guile -v -> Guile 1.5.4 -> Copyright (c) 1995, 1996, 1997, 2000, 2001 Free Software Foundation -> Guile may be distributed under the terms of the GNU General Public Licence; -> certain other uses are permitted as well. For details, see the file -> `COPYING', which is included in the Guile distribution. -> There is no warranty, to the extent permitted by law. -> -> I'm running on a SuSE Linux 7.2 box ... -> -> I expected that because of the second (define-class ...) I would get -> some sensible error message (at least about the usage of (a-value ...) in -> the (print ...) generic function call). -> -> Maybe I'm mistaken here, I know that GOOPS has a class redefinition -> protocol, but does it go with the define-class macro? -> -> I accidently had such a second (define-class ...) with an already -> used class-name. In a much more complex program than the above, this -> resulted in a segmentation fault (backtrace told me it was GC related). -> -> To avoid such behavior, would it be sensible to have guile indicate -> a wrong usage error or something? - - -bug 13 -- incorrect error reporting after stack overflow -reported-by: Panagiotis Vossos / 2002-02-19 -fixed: not-yet - -Panagiotis Vossos sez: - -I have guile 1.5.4 installed and I discovered something strange. - -guile> (define (foo n) (+ n (foo n))) -guile> (foo 10) -ERROR: Stack overflow -ABORT: (stack-overflow) -guile> thisisabug -: In expression thisisabug: -: Unbound variable: thisisabug -ABORT: (unbound-variable) -guile> (foo 10) -: In expression thisisabug: -: Stack overflow -ABORT: (stack-overflow) - -The last message shows the previous unbound variable 'thisisabug'. -'foo' is just an example, this seems to happen for every function that -causes overflow. It's not serious, but it sure looks misleading.. - -Neil Jerram sez: - -It's something to do with the way that debug info frames cope with -stack overflow. - - -bug 14 -- strange gc loop caused by trap misuse -reported-by: Neil Jerram / 2002-02-03 -fixed: not-yet - -Neil Jerram sez: - -Using the current unstable CVS Guile... - -Running under gdb, type in the following: - -(gdb) run -q -Starting program: /usr/local/bin/guile -q -guile> (trap-set! enter-frame-handler (lambda () 1)) -(exit-frame-handler #f apply-frame-handler #f enter-frame-handler # traps) -guile> (trap-enable 'enter-frame) - -There is no response. Wait a few seconds, and then C-c to send an -interrupt. You'll find that the call stack shows a huge number of -recursive calls to scm_gc_mark (about 4000 per second waited on my -box). (If you don't see scm_gc_mark immediately, you may have -interrupted too quickly: let it run for another second and then C-c -again.) - -Here's as much of an explanation as I can offer... The intended -effect of the two `trap' lines above is that the evaluator calls the -specified procedure every time it enters a new evaluation frame or is -about to perform an application. However, the procedure above doesn't -accept the right number of arguments, so the attempt to call it gives -rise to a wrong-num-args error, which (I presume) jumps us out of that -level of the evaluator and is caught by the usual REPL machinery in -boot-9.scm. - -Then, the next time that we need to GC, we hit this scm_gc_mark loop. -My guess is that something about the trap+error scenario has left data -or the stack in a state which exposes a bug in the GC. - - -[BUGS ends here] From ab1f10940ce730e3c08ddce58ee9c49f485c23d5 Mon Sep 17 00:00:00 2001 From: Dirk Herrmann Date: Sat, 23 Mar 2002 00:39:25 +0000 Subject: [PATCH 114/131] * eval.c (SCM_CEVAL, SCM_APPLY): Eliminated labels wrongnumargs and the corresponding goto statements. Removed redundant code. --- libguile/ChangeLog | 5 ++++ libguile/eval.c | 73 ++++++++++++++++++++++++++-------------------- 2 files changed, 46 insertions(+), 32 deletions(-) diff --git a/libguile/ChangeLog b/libguile/ChangeLog index 064f5ef6c..c7a0bcc65 100644 --- a/libguile/ChangeLog +++ b/libguile/ChangeLog @@ -1,3 +1,8 @@ +2002-03-23 Dirk Herrmann + + * eval.c (SCM_CEVAL, SCM_APPLY): Eliminated labels wrongnumargs + and the corresponding goto statements. Removed redundant code. + 2002-03-21 Dirk Herrmann * eval.c (SCM_CEVAL): Minimized scope of variable arg2. diff --git a/libguile/eval.c b/libguile/eval.c index bd1059b87..8f0bf5fe0 100644 --- a/libguile/eval.c +++ b/libguile/eval.c @@ -2363,7 +2363,7 @@ dispatch: #endif #ifndef SCM_RECKLESS if (scm_badargsp (formals, arg1)) - goto wrongnumargs; + scm_wrong_num_args (proc); #endif ENTER_APPLY; /* Copy argument list */ @@ -2903,7 +2903,6 @@ evapply: /* inputs: x, proc */ case scm_tc7_lsubr_2: umwrongnumargs: unmemocar (x, env); - wrongnumargs: scm_wrong_num_args (proc); default: /* handle macros here */ @@ -2917,7 +2916,7 @@ evapply: /* inputs: x, proc */ if (SCM_CONSP (x)) arg1 = EVALCAR (x, env); else - goto wrongnumargs; + scm_wrong_num_args (proc); #else arg1 = EVALCAR (x, env); #endif @@ -3043,7 +3042,7 @@ evapply: /* inputs: x, proc */ case scm_tc7_subr_0: case scm_tc7_subr_3: case scm_tc7_lsubr_2: - goto wrongnumargs; + scm_wrong_num_args (proc); default: goto badfun; } @@ -3052,7 +3051,7 @@ evapply: /* inputs: x, proc */ if (SCM_CONSP (x)) arg2 = EVALCAR (x, env); else - goto wrongnumargs; + scm_wrong_num_args (proc); #else arg2 = EVALCAR (x, env); #endif @@ -3138,7 +3137,7 @@ evapply: /* inputs: x, proc */ case scm_tc7_subr_1o: case scm_tc7_subr_1: case scm_tc7_subr_3: - goto wrongnumargs; + scm_wrong_num_args (proc); default: goto badfun; case scm_tc7_pws: @@ -3166,7 +3165,7 @@ evapply: /* inputs: x, proc */ } #ifdef SCM_CAUTIOUS if (!SCM_CONSP (x)) - goto wrongnumargs; + scm_wrong_num_args (proc); #endif #ifdef DEVAL debug.info->a.args = scm_cons2 (arg1, arg2, @@ -3179,9 +3178,11 @@ evapply: /* inputs: x, proc */ { /* have 3 or more arguments */ #ifdef DEVAL case scm_tc7_subr_3: - SCM_ASRTGO (SCM_NULLP (SCM_CDR (x)), wrongnumargs); - RETURN (SCM_SUBRF (proc) (arg1, arg2, - SCM_CADDR (debug.info->a.args))); + if (!SCM_NULLP (SCM_CDR (x))) + scm_wrong_num_args (proc); + else + RETURN (SCM_SUBRF (proc) (arg1, arg2, + SCM_CADDR (debug.info->a.args))); case scm_tc7_asubr: arg1 = SCM_SUBRF(proc)(arg1, arg2); arg2 = SCM_CDDR (debug.info->a.args); @@ -3233,8 +3234,10 @@ evapply: /* inputs: x, proc */ goto nontoplevel_begin; #else /* DEVAL */ case scm_tc7_subr_3: - SCM_ASRTGO (SCM_NULLP (SCM_CDR (x)), wrongnumargs); - RETURN (SCM_SUBRF (proc) (arg1, arg2, EVALCAR (x, env))); + if (!SCM_NULLP (SCM_CDR (x))) + scm_wrong_num_args (proc); + else + RETURN (SCM_SUBRF (proc) (arg1, arg2, EVALCAR (x, env))); case scm_tc7_asubr: arg1 = SCM_SUBRF (proc) (arg1, arg2); do @@ -3316,7 +3319,7 @@ evapply: /* inputs: x, proc */ case scm_tc7_subr_0: case scm_tc7_cxr: case scm_tc7_subr_1: - goto wrongnumargs; + scm_wrong_num_args (proc); default: goto badfun; } @@ -3583,20 +3586,26 @@ tail: args = SCM_NULLP (args) ? SCM_UNDEFINED : SCM_CAR (args); RETURN (SCM_SUBRF (proc) (arg1, args)); case scm_tc7_subr_2: - SCM_ASRTGO (!SCM_NULLP (args) && SCM_NULLP (SCM_CDR (args)), - wrongnumargs); + if (SCM_NULLP (args) || !SCM_NULLP (SCM_CDR (args))) + scm_wrong_num_args (proc); args = SCM_CAR (args); RETURN (SCM_SUBRF (proc) (arg1, args)); case scm_tc7_subr_0: - SCM_ASRTGO (SCM_UNBNDP (arg1), wrongnumargs); - RETURN (SCM_SUBRF (proc) ()); + if (!SCM_UNBNDP (arg1)) + scm_wrong_num_args (proc); + else + RETURN (SCM_SUBRF (proc) ()); case scm_tc7_subr_1: - SCM_ASRTGO (!SCM_UNBNDP (arg1), wrongnumargs); + if (SCM_UNBNDP (arg1)) + scm_wrong_num_args (proc); case scm_tc7_subr_1o: - SCM_ASRTGO (SCM_NULLP (args), wrongnumargs); - RETURN (SCM_SUBRF (proc) (arg1)); + if (!SCM_NULLP (args)) + scm_wrong_num_args (proc); + else + RETURN (SCM_SUBRF (proc) (arg1)); case scm_tc7_cxr: - SCM_ASRTGO (!SCM_UNBNDP (arg1) && SCM_NULLP (args), wrongnumargs); + if (SCM_UNBNDP (arg1) || !SCM_NULLP (args)) + scm_wrong_num_args (proc); if (SCM_SUBRF (proc)) { if (SCM_INUMP (arg1)) @@ -3626,11 +3635,12 @@ tail: RETURN (arg1); } case scm_tc7_subr_3: - SCM_ASRTGO (!SCM_NULLP (args) - && !SCM_NULLP (SCM_CDR (args)) - && SCM_NULLP (SCM_CDDR (args)), - wrongnumargs); - RETURN (SCM_SUBRF (proc) (arg1, SCM_CAR (args), SCM_CADR (args))); + if (SCM_NULLP (args) + || SCM_NULLP (SCM_CDR (args)) + || !SCM_NULLP (SCM_CDDR (args))) + scm_wrong_num_args (proc); + else + RETURN (SCM_SUBRF (proc) (arg1, SCM_CAR (args), SCM_CADR (args))); case scm_tc7_lsubr: #ifdef DEVAL RETURN (SCM_SUBRF (proc) (SCM_UNBNDP (arg1) ? SCM_EOL : debug.vect[0].a.args)); @@ -3638,8 +3648,10 @@ tail: RETURN (SCM_SUBRF (proc) (SCM_UNBNDP (arg1) ? SCM_EOL : scm_cons (arg1, args))); #endif case scm_tc7_lsubr_2: - SCM_ASRTGO (SCM_CONSP (args), wrongnumargs); - RETURN (SCM_SUBRF (proc) (arg1, SCM_CAR (args), SCM_CDR (args))); + if (!SCM_CONSP (args)) + scm_wrong_num_args (proc); + else + RETURN (SCM_SUBRF (proc) (arg1, SCM_CAR (args), SCM_CDR (args))); case scm_tc7_asubr: if (SCM_NULLP (args)) RETURN (SCM_SUBRF (proc) (arg1, SCM_UNDEFINED)); @@ -3670,7 +3682,7 @@ tail: #endif #ifndef SCM_RECKLESS if (scm_badargsp (SCM_CLOSURE_FORMALS (proc), arg1)) - goto wrongnumargs; + scm_wrong_num_args (proc); #endif /* Copy argument list */ @@ -3771,12 +3783,9 @@ tail: else goto badproc; } - wrongnumargs: - scm_wrong_num_args (proc); default: badproc: scm_wrong_type_arg ("apply", SCM_ARG1, proc); - RETURN (arg1); } #ifdef DEVAL exit: From a7dc0db49a10515808e9179b54f4592be9ee1b10 Mon Sep 17 00:00:00 2001 From: Thien-Thi Nguyen Date: Sun, 24 Mar 2002 00:23:49 +0000 Subject: [PATCH 115/131] bye bye --- devel/build/testing.text | 0 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 devel/build/testing.text diff --git a/devel/build/testing.text b/devel/build/testing.text deleted file mode 100644 index e69de29bb..000000000 From 8660251f7d066bb1a34844ec4460eb38db485f27 Mon Sep 17 00:00:00 2001 From: Thien-Thi Nguyen Date: Sun, 24 Mar 2002 00:38:21 +0000 Subject: [PATCH 116/131] bye bye --- devel/ChangeLog | 0 devel/README | 0 devel/build/README | 0 devel/build/guile-projects-entry | 0 devel/build/pre-inst-guile.text | 0 devel/build/recording-api.text | 0 devel/build/snarf-macros.text | 0 devel/extension/dynamic-root.text | 0 devel/gc/README | 0 devel/gc/gc+callcc.text | 0 devel/htbmc-commentary.text | 0 devel/htbmc.text | 0 devel/memory.text | 0 devel/modules/design-notes.texi | 295 ------------ devel/modules/module-layout.text | 288 ------------ devel/modules/module-snippets.texi | 0 devel/modules/signatures.scm | 0 devel/modules/signatures.texi | 0 devel/policy/api.text | 149 ------- devel/policy/exceptions.text | 0 devel/policy/goals.text | 0 devel/policy/names.text | 0 devel/policy/plans.text | 0 devel/policy/principles.text | 0 devel/strings/sharedstr.text | 143 ------ devel/translation/langtools.text | 592 ------------------------- devel/translation/lisp-and-scheme.text | 0 devel/vm/ior/ior-intro.text | 0 devel/vm/ior/ior.text | 0 29 files changed, 1467 deletions(-) delete mode 100644 devel/ChangeLog delete mode 100644 devel/README delete mode 100644 devel/build/README delete mode 100644 devel/build/guile-projects-entry delete mode 100644 devel/build/pre-inst-guile.text delete mode 100644 devel/build/recording-api.text delete mode 100644 devel/build/snarf-macros.text delete mode 100644 devel/extension/dynamic-root.text delete mode 100644 devel/gc/README delete mode 100644 devel/gc/gc+callcc.text delete mode 100644 devel/htbmc-commentary.text delete mode 100644 devel/htbmc.text delete mode 100644 devel/memory.text delete mode 100644 devel/modules/design-notes.texi delete mode 100644 devel/modules/module-layout.text delete mode 100644 devel/modules/module-snippets.texi delete mode 100644 devel/modules/signatures.scm delete mode 100644 devel/modules/signatures.texi delete mode 100644 devel/policy/api.text delete mode 100644 devel/policy/exceptions.text delete mode 100644 devel/policy/goals.text delete mode 100644 devel/policy/names.text delete mode 100644 devel/policy/plans.text delete mode 100644 devel/policy/principles.text delete mode 100644 devel/strings/sharedstr.text delete mode 100644 devel/translation/langtools.text delete mode 100644 devel/translation/lisp-and-scheme.text delete mode 100644 devel/vm/ior/ior-intro.text delete mode 100644 devel/vm/ior/ior.text diff --git a/devel/ChangeLog b/devel/ChangeLog deleted file mode 100644 index e69de29bb..000000000 diff --git a/devel/README b/devel/README deleted file mode 100644 index e69de29bb..000000000 diff --git a/devel/build/README b/devel/build/README deleted file mode 100644 index e69de29bb..000000000 diff --git a/devel/build/guile-projects-entry b/devel/build/guile-projects-entry deleted file mode 100644 index e69de29bb..000000000 diff --git a/devel/build/pre-inst-guile.text b/devel/build/pre-inst-guile.text deleted file mode 100644 index e69de29bb..000000000 diff --git a/devel/build/recording-api.text b/devel/build/recording-api.text deleted file mode 100644 index e69de29bb..000000000 diff --git a/devel/build/snarf-macros.text b/devel/build/snarf-macros.text deleted file mode 100644 index e69de29bb..000000000 diff --git a/devel/extension/dynamic-root.text b/devel/extension/dynamic-root.text deleted file mode 100644 index e69de29bb..000000000 diff --git a/devel/gc/README b/devel/gc/README deleted file mode 100644 index e69de29bb..000000000 diff --git a/devel/gc/gc+callcc.text b/devel/gc/gc+callcc.text deleted file mode 100644 index e69de29bb..000000000 diff --git a/devel/htbmc-commentary.text b/devel/htbmc-commentary.text deleted file mode 100644 index e69de29bb..000000000 diff --git a/devel/htbmc.text b/devel/htbmc.text deleted file mode 100644 index e69de29bb..000000000 diff --git a/devel/memory.text b/devel/memory.text deleted file mode 100644 index e69de29bb..000000000 diff --git a/devel/modules/design-notes.texi b/devel/modules/design-notes.texi deleted file mode 100644 index a8853e594..000000000 --- a/devel/modules/design-notes.texi +++ /dev/null @@ -1,295 +0,0 @@ -@c devel/modules/desgin-notes.texi - -@c TODO -@c - distill wishlist, index -@c - in Findings, characterize current module system wrt wishlist - -@node Module System Design Notes -@chapter Module System Design Notes - -This chapter documents module system design history. At the moment -(guile-1.5.4, 2002-02-08), the module system is supposedly undergoing -redesign; the provisional implementation works but has problems, notably -making compilation difficult. - -Because module systems design is (was?) an area of active research and -development in the Scheme community, many different features are possible. -This section is a historical record of the selection process used by the Guile -hackers (if one can be discerned). - -@menu -* Wishlist:: -* Findings:: -* Selection Criteria:: -* Rationale Statements:: -* Specification:: -@end menu - -@node Wishlist -@subsection Wishlist - -In the guile-related mailing lists of yore, discussion resulted in the -following desirable traits. Note that some of these contradict each other. - -@itemize @bullet - -@item -support separate compilation - -@item -hierarchical module names - -@item -support relative references within the module name space (so that a -module within a package can use a sibling module without knowing the -prefix of the module name) - -@item -support re-use of code (the same implementation can be presented to -the world through several interfaces) - -@item -support individual and group renaming of bindings when using other -modules - -@item -easy to import and re-export entire interfaces (so that a main -interface in a package can function as a "relay" and publish -bindings from many modules in the package) - -@item -support both variable and syntactic bindings (these should be -clearly separated, though) and mesh well with hygienic macro -systems - -@item -hygienic implies that we shouldn't need to care to export bindings -which an exported macro introduces at the point of its use - -@item -autoloading - -@item -unmemoization protocol - -@item -cleanliness - -A module should be able to be totally clean. There should be no -need to have *any* extra bindings in a module (a la -%module-interface or `define-module'). - -Therefore, we should have at least one dedicated "command" or -"config" or "repl" module. - -It would probably be a good idea to follow other good Scheme -interpreters' lead and introduce the , syntax for walking -around modules, inspecting things, entering the debugger, etc. -Such commands can be looked up in this repl module. - -If we insist on not using , syntax, we are forced to let -the module use list consist of a "sticky" part and the rest, where -the "sticky" part is only available at the repl prompt and not to -the code within the module, and which follows us when we walk around -in the system. - -@item -well integrated with the translator framework - -We should be able to say that a module uses a different syntax or -language. - -Note here the nice config language of the Scheme48 module system -where it is possible to separate code from module specification: the -module specification can use scheme syntax and rest in one file, -while the module itself can use the syntax of another language. - -This config language also supports re-use of code in a neat way. - -@item -examine connection with object system: how easy is it to support -Java and other class-centered object systems? - -@item -easy to export the same module under several different names - -@item -easily supports both compiled and interpreted modules - -@item -compiled modules can by dynamically loaded or statically linked in -(libltdl might provide this automatically) - -@item -convenient syntax for referencing bindings in modules that are -loaded but not used - -(Assuming this distinction exists.) But maybe group renaming is a better -solution to a similar class of problems. - -@item -ability to unuse a module (and have it get collected when there are -no more references) - -@item -orthoganality between source files, directories and modules. i.e. ability to -have multiple modules in one source file and/or multiple source files in one -module - -@item -backward compatibility - -@item -whenever possible the module's meta-information should be stored -within the module itself (only possible for scheme files) - -@item -the compiler stores the meta-information into a single file and updates it -accordingly - -(FIXME: per module, per package, directory?, per project?) This -meta-information should still be human readable (Sun's EJB use XML for their -deployment descriptors). - -@item -use the file system as module repository - -Since guile is a GNU project we can expect a GNU (or Unix) environment. That -means that we should use the file system as the module repository. (This -would help us avoid modules pointing to files which are pointing to other -files telling the user "hey, that's me (the module) over there".) - -@item -every module has exactly @emph{one} owner who is responsible for the -module @emph{and} its interface (this contradicts with the "more than one -interface" concept) - -@item -support module collections - -Provide "packages" with a package scope for people working together on a -project. In some sense a module is a view on the underlying package. - -@item -ability to request (i.e. import or access) complete packages - -@item -support module "generations" (or "versions") - -Whenever a new module fails to handle a request (due to an error) it will be -replaced by the old version. - -@item -help the user to handle exceptions (note: exceptions -are not errors, see above) - -@item -no special configuration language (like @code{,in} etc.) - -You can always press Control-D to terminate the module's repl and return to -the config module. - -@item -both C and Scheme level interfaces - -@item -programming interface to module system primitives - -One should be able to make customized module systems from the low-level -interface, as an alternative to using the default module system. The -default module system should use the same low-level procedures. - -@item -Here are some features Keisuke Nishida desires to support his VM/compiler -[snarfed directly from post dated 2001-02-06, -and requires formatting]: - - * There is no "current module". - - * Module variables are globally identified by an identifier - like "system::core::car". - - * Bindings are solved syntactically, either by a translator - or a compiler. If you write just "car", it is expanded to - "system::core::car" by a translator or compiler, depending - on what modules you use. - - * An interpreter (repl) may memorize the "current working module". - It tells the translator or the compiler what modules should be - used to identify a variable. So, during interactive sessions, - a user may feel as if there *is* the current module. - - * But the fact is, all variables are globally identified at - syntax level. Therefore, the compiler can identify all - variables at compile time. This means the following code - is not allowed: - - ;; I want to access `foo' in the module named some-module-name - (let ((module (lookup-module some-module-name))) - (set! (current-module) module) - (foo x)) - -> ERROR: Unbound variable: current-module - - (let ((module (lookup-module some-module-name))) - (module::foo x)) - -> ERROR: There is no variable named "module::foo" - - Instead, you should write as follows if you need a dynamic access: - - (let ((module (lookup-module some-module-name))) - ((module-ref module 'foo) x)) - - (let ((module (lookup-module some-module-name))) - ((module 'foo) x)) ;; if module is an applicable smob - -@end itemize - -@c $Date: 2002-02-08 10:50:36 $ -@node Findings -@subsection Findings - -This section briefly describes module system truths that are one step more -detailed than "module systems are hairy". These truths are not self-evident; -we rely on research, active experimentation and lots of discussion. The goal -of this section is to save ourselves from rehashing that which was hashed -previously. - -@itemize @bullet - -@item Kent Dybvig's module system - -A paper is available at -@uref{http://www.cs.indiana.edu/~dyb/papers/popl99.ps.gz, - http://www.cs.indiana.edu/~dyb/papers/popl99.ps.gz}. - -This was discussed in 2000-11 and 2000-12. - -@item Distinction between Top-Level Environment and Module - -These two are different beasts! Each of the following needs to be -well-defined with respect to both of these concepts: @code{eval}, -@code{define}, @code{define-public}, @code{define-module}, @code{load}, -working from REPL, top-level @code{begin}, [add here]. - -In guile-1.4, the distinction was not clear. - -@item Current module system internals - -@xref{Top,Module Internals,,module-snippets}, for implemetation -details of the module system up to and including guile-1.6.x. - -@item [add here] - -@end itemize - -@node Selection Criteria -@subsection Selection Criteria - -@node Rationale Statements -@subsection Rationale Statements - -@node Specification -@subsection Specification - - -@c devel/modules/desgin-notes.texi ends here diff --git a/devel/modules/module-layout.text b/devel/modules/module-layout.text deleted file mode 100644 index c088ad822..000000000 --- a/devel/modules/module-layout.text +++ /dev/null @@ -1,288 +0,0 @@ -Module Layout Proposal -====================== - -Martin Grabmueller - -Draft: 2001-03-11 - -Version: $Id: module-layout.text,v 1.1 2001-03-16 08:37:37 mgrabmue Exp $ - -* Table of contents - -** Abstract -** Overview -*** What do we have now? -*** What should we change? -** Policy of module separation -*** Functionality -*** Standards -*** Importance -*** Compatibility -** Module naming -*** Scheme -*** Object oriented programming -*** Systems programming -*** Database programming -*** Text processing -*** Math programming -*** Network programming -*** Graphics -*** GTK+ programming -*** X programming -*** Games -*** Multiple names -*** Application modules -** Future ideas - - -* Abstract - -This is a proposal for a new layout of the module name space. The -goal is to reduce (or even eliminate) the clutter in the current ice-9 -module directory, and to provide a clean framework for splitting -libguile into subsystems, grouped by functionality, standards -compliance and maybe other characteristics. - -This is not a completed policy document, but rather a collection of -ideas and proposals which still have to be decided. I will mention by -personal preference, where appropriate, but the final decisions are of -course up to the maintainers. - - -* Overview - -Currently, new modules are added in an ad-hoc manner to the ice-9 -module name space when the need for them arises. I think that was -mainly because no other directory for installed Scheme modules was -created. With the integration of GOOPS, the new top-level module -directory oop was introduced, and we should follow this practice for -other subsystems which share functionality. - -DISCLAIMER: Please note that I am no expert on Guile's module system, -so be patient with me and correct me where I got anything wrong. - -** What do we have now? - -The module (oop goops) contains all functionality needed for -object-oriented programming with Guile (with a few exceptions in the -evaluator, which is clearly needed for performance). - -Except for the procedures in the module (ice-9 rdelim), all Guile -primitives are currently located in the root module (I think it is the -module (guile)), and some procedures defined in `boot-9.scm' are -installed in the module (guile-user). - -** What should we change? - -In the core, there are a lot of primitive procedures which can cleanly -be grouped into subsystems, and then grouped into modules. That would -make the core library more maintainable, would ease seperate testing -of subsystems and clean up dependencies between subsystems. - - -* Policy of module separation - -There are several possibilities to group procedures into modules. - -- They could be grouped by functionality. -- They could be grouped by standards compliance. -- They could be grouped by level of importance. - -One important group of modules should of course be provided -additionally: - -- Compatibility modules. - -So the first thing to decide is: Which of these policies should we -adopt? Personally, I think that it is not possible to cleanly use -exactly one of the possibilities, we will probably use a mixture of -them. I propose to group by functionality, and maybe use some -`bridge-modules', which make functionality available when the user -requests the modules for a given standard. - -** Functionality - -Candidates for the first possibility are groups of procedures, which -already are grouped in source files, such as - -- Regular expression procedures. -- Network procedures. -- Systems programming procedures. -- Random number procedures. -- Math/numeric procedures. -- String-processing procedures. -- List-processing procedures. -- Character handling procedures. -- Object-oriented programming support. - -** Standards - -Guile now complies to R5RS, and I think that the procedures required -by this standards should always be available to the programmer. -People who do not want them, could always create :pure modules when -they need it. - -On the other hand, the SRFI procedures fit nicely into a `group by -standards' scheme. An example which is already provided, is the -SRFI-8 syntax `receive'. Following that, we could provide two modules -for each SRFI, one named after the SRFI (like `srfi-8') and one named -after the main functionality (`receive'). - -** Importance - -By importance, I mean `how important are procedures for the average -Guile user'. That means that procedures which are only useful to a -small group of users (the Guile developers, for example) should not be -immediately available at the REPL, so that they not confuse the user -when thay appear in the `apropos' output or the tab completion. - -A good example would be debugging procedures (which also could be -added with a special command-line option), or low-level system calls. - -** Compatibility - -This group is for modules providing compatibility procedures. An -example would be a module for old string-processing procedures, which -could someday get overridden by incompatible SRFI procedures of the -same name. - - -* Module naming - -Provided we choose to take the `group by functionality' approach, I -propose the following naming hierarchy (some of them were actually -suggested by Mikael Djurfeldt). - -- Schame language related in (scheme) -- Object oriented programming in (oop) -- Systems programming in (system) -- Database programming in (database) -- Text processing in (text) -- Math/numeric programming in (math) -- Network programming in (network) -- Graphics programming in (graphics) -- GTK+ programming in (gtk) -- X programming in (xlib) -- Games in (games) - -The layout of sub-hierarchies is up to the writers of modules, we -should not enforce a strict policy here, because we can not imagine -what will happen in this area. - -** Scheme - -(scheme r5rs) Complete R5RS procedures set. -(scheme safe) Safe modules. -(scheme srfi-1) List processing. -(scheme srfi-8) Multiple valuas via `receive'. -(scheme receive) dito. -(scheme and-let-star) and-let* -(scheme syncase) syntax-case hygienic macros (maybe included in - (scheme r5rs?). -(scheme slib) SLIB, for historic reasons in (scheme). - -** Object oriented programming - -Examples in this section are -(oop goops) For GOOPS. -(oop goops ...) For lower-level GOOPS functionality and utilities. - -** Systems programming - -(system shell) Shell utilities (glob, system etc). -(system process) Process handling. -(system file-system) Low-level filesystem support. -(system user) getuid, setpgrp, etc. - -_or_ - -(system posix) All posix procedures. - -** Database programming - -In the database section, there should be sub-module hierarchies for -each supported database which contains the low-level code, and a -common database layer, which should unify access to SQL databases via a single interface a la Perl's DBMI. - -(database postgres ...) Low-level database functionality. -(database oracle ...) ... -(database mysql ...) ... -(database msql ...) ... -(database sql) Common SQL accessors. -(database gdbm ...) ... -(database hashed) Common hashed database accessors (like gdbm). -(database util) Leftovers. - -** Text processing - -(text rdelim) Line oriented in-/output. -(text util) Mangling text files. - -** Math programming - -(math random) Random numbers. -(math primes) Prime numbers. -(math vector) Vector math. -(math algebra) Algebra. -(math analysis) Analysis. -(math util) Leftovers. - -** Network programming - -(network inet) Internet procedures. -(network socket) Socket interface. -(network db) Network database accessors. -(network util) ntohl, htons and friends. - -** Graphics - -(graphics vector) Generalized vector graphics handling. -(graphics vector vrml) VRML parsers etc. -(graphisc bitmap) Generalized bitmap handling. -(graphics bitmap ...) Bitmap format handling (TIFF, PNG, etc.). - -** GTK+ programming - -(gtk gtk) GTK+ procedures. -(gtk gdk) GDK procedures. -(gtk threads) gtktreads. - -** X programming - -(xlib xlib) Low-level XLib programming. - -** Games - -(games robots) GNU robots. - -** Multiple names - -As already mentioned above, I think that some modules should have -several names, to make it easier for the user to get the functionality -she needs. For example, a user could say: `hey, I need the receive -macro', or she could say: `I want to stick to SRFI syntax, so where -the hell is the module for SRFI-8?!?'. - -** Application modules - -We should not enforce policy on applications. So I propose that -application writers should be advised to place modules either in -application-specific directories $PREFIX/share/$APP/guile/... and name -that however they like, or to use the application's name as the first -part of the module name, e.g (gnucash import), (scwm background), -(rcalc ui). - -* Future ideas - -I have not yet come up with a good idea for grouping modules, which -deal for example with XML processing. They would fit into the (text) -module space, because most XML files contain text data, but they would -also fit into (database), because XML files are essentially databases. - -On the other hand, XML processing is such a large field that it -probably is worth it's own top-level name space (xml). - - -Local Variables: -mode: outline -End: diff --git a/devel/modules/module-snippets.texi b/devel/modules/module-snippets.texi deleted file mode 100644 index e69de29bb..000000000 diff --git a/devel/modules/signatures.scm b/devel/modules/signatures.scm deleted file mode 100644 index e69de29bb..000000000 diff --git a/devel/modules/signatures.texi b/devel/modules/signatures.texi deleted file mode 100644 index e69de29bb..000000000 diff --git a/devel/policy/api.text b/devel/policy/api.text deleted file mode 100644 index b53a8613f..000000000 --- a/devel/policy/api.text +++ /dev/null @@ -1,149 +0,0 @@ -* Intro / Index (last modified: $Date: 2002-02-28 05:09:19 $) - -This working document explains the design of the libguile API, -specifically the interface to the C programming language. -Note that this is NOT an API reference manual. - -- Motivation -- History -- Decisions - - gh_ removal - - malloc policy - - [add here] - - -* Motivation - -The file goals.text says: - - Guile's primary aim is to provide a good extension language - which is easy to add to an application written in C for the GNU - system. This means that it must export the features of a higher - level language in a way that makes it easy not to break them - from C code. - -Although it may no longer be a "primary aim", creating a stable API is -important anyway since without something defined, people will take libguile -and use it in ad-hoc ways that may cause them trouble later. - - -* History - -The initial (in ttn's memory, which only goes back to guile-1.3.4) stab at an -API was known as the "gh_ interface", which provided "high-level" abstraction -to libguile w/ the premise of supporting multiple implementations at some -future date. In practice this approach resulted in many gh_* objects being -very slight wrappers for the underlying scm_* objects, so eventually this -maintenance burden outweighed the (as yet unrealized) hope for alternate -implementations, and the gh_ interface was deprecated starting in guile-1.5.x. - -Starting w/ guile-1.7.x, in concurrence w/ an effort to make libguile -available to usloth windows platforms, the naked library was once again -dressed w/ the "SCM_API interface". - -Here is a table of versions (! means planned): - - guile libguile readline qthreads srfi-4 -13-14 - --------------------------------------------------- - 1.3.4 6.0.0 0.0.0 0.0.0 - - - 1.4 9.0.0 0.0.0 0.0.0 - - - 1.4.1 10.0.0 TBD 15.0.0 - - ! - 1.6.x 15.0.0 10.0.0 15.0.0 1.0.0 1.0.0 ! - - Note: These are libtool-style versions: CURRENT:REVISION:AGE - - -* Decisions - -** gh_ removal - -At some point, we need to remove gh_ entirely: guile-X.Y.Z. - -** malloc policy - -Here's a proposal by ela: - - I would like to propose the follow gh_() equivalents: - - gh_scm2newstr() -> scm_string2str() in string.[ch] - gh_symbol2newstr() -> scm_symbol2str() in symbol.[ch] - - Both taking the (SCM obj, char *context) and allocating memory via - scm_must_malloc(). Thus the user can safely free the returned strings - with scm_must_free(). The latter feature would be an improvement to the - previous gh_() interface functions, for which the user was told to free() - them directly. This caused problems when libguile.so used libc malloc() - and the calling application used its own standard free(), which might not - be libc free(). - -It seems to address the general question of: How should client programs use -malloc with respect to libguile? Some specific questions: - - * Do you like the names of the functions? Maybe they should be named - scm_c_*() instead of scm_*(). - * Do they make sense? - * Should we provide something like scm_c_free() for pointers returned by - these kind of functions? - -The first proposal regarding a malloc policy has been rejected for the -following resons: - -That would mean, users of guile - even on non M$ systems - would have to -keep track where their memory came from? -Assume there are users which have some kind of hash table where they store -strings in. The hash table is responsible for removing entries from the -table. Now, if you want to put strings from guile as well as other -strings into that table you would have to store a pointer to the -corresponding version of 'free' with every string? We should demand such -coding from all guile users? - -The proposal itself read: For a clean memory interface of a client program -to libguile we use the following functions from libguile: - - * scm_c_malloc -- should be used to allocate memory returned by some - of the SCM to C converter functions in libguile if the - client program does not supply memory - * scm_c_free -- must be used by the client program to free the memory - returned by the SCM to C converter functions in - libguile if the client program did not supply a buffer - * scm_c_realloc -- to be complete, do not know a real purpose yet - - -Yet another proposal regarding this problem reads as follows: We could make -life easier, if we supplied the following: - -[in gc.h] -typedef void * (* scm_t_malloc_func) (size_t); -typedef void (* svz_t_free_func) (void *); -SCM_API scm_t_malloc_func scm_c_malloc; -SCM_API scm_t_free_func scm_c_free; - -[in gc.c] -{ - /* At some library initialization point. */ - scm_c_malloc = malloc; - scm_c_free = free; -} - -Then the SCM to C converters allocating memory to store their results use -scm_c_malloc() instead of simply malloc(). This way all libguile/Unix users -can stick to the previous free() policy, saying that you need to free() -pointers delivered by libguile. On the other hand M$-Windows users can pass -their own malloc()-function-pointer to the library and use their own free() -then. Basically this can be achieved in the following order: - -{ - char *str; - scm_boot_guile (...); - scm_c_malloc = malloc; - str = scm_c_string2str (obj, NULL, NULL); - free (str); -} - -This policy is still discussed: -If there is one global variable scm_c_malloc, then setting it within one -thread may interfere with another thread that expects scm_c_malloc to be -set differently. In other words, you would have to introduce some locking -mechanism to guarantee that the sequence of setting scm_c_malloc and -calling scm_string2str can not be interrupted by a different thread that -sets scm_c_malloc to a different value. diff --git a/devel/policy/exceptions.text b/devel/policy/exceptions.text deleted file mode 100644 index e69de29bb..000000000 diff --git a/devel/policy/goals.text b/devel/policy/goals.text deleted file mode 100644 index e69de29bb..000000000 diff --git a/devel/policy/names.text b/devel/policy/names.text deleted file mode 100644 index e69de29bb..000000000 diff --git a/devel/policy/plans.text b/devel/policy/plans.text deleted file mode 100644 index e69de29bb..000000000 diff --git a/devel/policy/principles.text b/devel/policy/principles.text deleted file mode 100644 index e69de29bb..000000000 diff --git a/devel/strings/sharedstr.text b/devel/strings/sharedstr.text deleted file mode 100644 index f568c3ebf..000000000 --- a/devel/strings/sharedstr.text +++ /dev/null @@ -1,143 +0,0 @@ -Implementation of shared substrings with fresh-copy semantics -============================================================= - -Version: $Id: sharedstr.text,v 1.1 2000-08-26 20:55:21 mdj Exp $ - -Background ----------- - -In Guile, most string operations work on two other data types apart -from strings: shared substrings and read-only strings (which includes -symbols). One of Guile's sub-goals is to be a scripting language in -which string management is important. Read-only strings and shared -substrings were introduced in order to reduce overhead in string -manipulation. - -We now want to simplify the Guile API by removing these two data -types, but keeping performance by allowing ordinary strings to share -storage. - -The idea is to let operations like `symbol->string' and `substring' -return a pointer into the original string/symbol, thus avoiding the -need to copy the string. - -Two of the problems which then arise are: - -* If s2 is derived from s1, and therefore share storage with s1, a - modification to either s1 or s2 will affect the other. - -* Guile is supposed to interact closely with many UNIX libraries in - which the NUL character is used to terminate strings. Therefore - Guile strings contain a NUL character at the end, in addition to the - string length (the latter of which is used by Guile's string - operations). - -The solutions to these problems are to - -* Copy a string with shared storage when it's modified. - -* Copy a string with shared storage when it's being used as argument - to a C library call. (Copying implies inserting an ending NUL - character.) - -But this leads to memory management problems. When is it OK to free -a character array which was allocated for a symbol or a string? - -Abstract description of proposed solution ------------------------------------------ - -Definitions - - STRING = - - SYMBOL = - - CHARRECORD = - - PHASE = black | white - - SHAREDFLAG = private | shared - - CHARS is a character array - - CHARPTR points into it - -Memory management - -A string or symbol is initially allocated with its contents stored in -a character array in a character record. The string/symbol header -contains a pointer to this record. The initial value of the shared -flag in the character record is `private'. - -The GC mark phases alternate between black and white---every second -phase is black, the rest are white. This is used to distinguish -whether a character record has been encountered before: - -During a black mark phase, when the GC encounters a string or symbol, -it changes the PHASE and SHAREDFLAG marks of the corresponding -character record according to the following table: - - --> (white => unconditionally - --> set to ) - --> (SHAREDFLAG changed) - --> (no change) - -The behaviour of a white phase is quivalent with the color names -switched. - -The GC sweep phase frees any unmarked string or symbol header and -frees its character record either if it is marked with the "wrong" -color (not matching the color of the last mark phase) or if its -SHAREDFLAG is `private'. - -Copy-on-write - -An attempt at mutating string contents leads to copying if SHAREDFLAG -is `shared'. Copying means making a copy of the character record and -mutating the CHARRECORDPTR and CHARPTR fields of the object header to -point to the copy. - -Substring operation - -When making a substring, a new string header is allocated, with new -contents for the LENGTH and CHARPTR fields. - -Implementation details ----------------------- - -* We store the character record consecutively with the character - array and lump the PHASE and SHAREDFLAG fields together into one - byte containing an integer code for the four possible states of the - PHASE and SHAREDFLAG fields. Another way of viewing it is that - these fields are represented as bits 1 and 0 in the "header" of the - character array. We let CHARRECORDPTR point to the first character - position instead of on this header: - - CHARRECORDPTR - | - V - FCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC - - F = 0, 1, 2, 3 - -* We represent strings as the sub-types `simple-string' and - `substring'. - -* In a simple string, CHARRECORDPTR and CHARPTR are represented by a - single pointer, so a `simple-string' is an ordinary heap cell with - TYPETAG and LENGTH in the CAR and CHARPTR in the CDR. - -* substring:s are represented as double cells, with TYPETAG and LENGTH - in word 0, CHARRECORDPTR in word 1 and CHARPTR in word 2 - (alternatively, we could store an offset from CHARRECORDPTR). - -Problems with this implementation ---------------------------------- - -* How do we make copy-on-write thread-safe? Is there a different - implementation which is efficient and thread-safe? - -* If small substrings are frequently generated from large, temporary - strings and the small substrings are kept in a data structure, the - heap will still have to host the large original strings. Should we - simply accept this? diff --git a/devel/translation/langtools.text b/devel/translation/langtools.text deleted file mode 100644 index ac07ce034..000000000 --- a/devel/translation/langtools.text +++ /dev/null @@ -1,592 +0,0 @@ -* Introduction - -Version: $Id: langtools.text,v 1.5 2000-08-13 04:47:26 mdj Exp $ - -This is a proposal for how Guile could interface with language -translators. It will be posted on the Guile list and revised for some -short time (days rather than weeks) before being implemented. - -The document can be found in the CVS repository as -guile-core/devel/translation/langtools.text. All Guile developers are -welcome to modify and extend it according to the ongoing discussion -using CVS. - -Ideas and comments are welcome. - -For clarity, the proposal is partially written as if describing an -already existing system. - -MDJ 000812 - -* Language names - -A translator for Guile is a certain kind of Guile module, implemented -in Scheme, C, or a mixture of both. - -To make things simple, the name of the language is closely related to -the name of the translator module. - -Languages have long and short names. The long form is simply the name -of the translator module: `(lang ctax)', `(lang emacs-lisp)', -`(my-modules foo-lang)' etc. - -Languages with the long name `(lang IDENTIFIER)' can be referred to -with the short name IDENTIFIER, for example `emacs-lisp'. - -* How to tell Guile to read code in a different language (than Scheme) - -There are four methods of specifying which translator to use when -reading a file: - -** Command option - -The options to the guile command are parsed linearly from left to -right. You can change the language at zero or more points using the -option - - -t, --language LANGUAGE - -Example: - - guile -t emacs-lisp -l foo -l bar -t scheme -l baz - -will use the emacs-lisp translator while reading "foo" and "bar", and -the default translator (scheme) for "baz". - -You can use this technique in a script together with the meta switch: - -#!/usr/local/bin/guile \ --t emacs-lisp -s -!# - -** Commentary in file - -When opening a file for reading, Guile will read the first few lines, -looking for the string "-*- LANGNAME -*-", where LANGNAME can be -either the long or short form of the name. - -If found, the corresponding translator is loaded and used to read the -file. - -** File extension - -Guile maintains an alist mapping filename extensions to languages. -Each entry has the form: - - (REGEXP . LANGNAME) - -where REGEXP is a string and LANGNAME a symbol or a list of symbols. - -The alist can be accessed using `language-alist' which is exported -by the module `(core config)': - - (language-alist) --> current alist - (language-alist ALIST) sets the alist to ALIST - (language-alist ALIST :prepend) prepends ALIST onto the current list - (language-alist ALIST :append) appends ALIST after current list - -The `load' command will match filenames against this alist and choose -the translator to use accordingly. - -There will be a default alist for common translators. For translators -not listed, the alist has to be extended in .guile just as Emacs users -extend auto-mode-alist in .emacs. - -** Module header - -You specify the language used by a module with the :language option in -the module header. (See below under "Module configuration language".) - -* Module system - -This section describes how the Guile module system is adapted to use -with other languages. - -** Module configuration language - -*** The `(config)' module - -Guile has a sophisticated module system. We don't require each -translator implementation to implement its own syntax for modules. -That would be too much work for the implementor, and users would have -to learn the module system anew for each syntax. - -Instead, the module `(config)' exports the module header form -`(define-module ...)'. - -The config module also exports a number of primitives by which you can -customize the Guile library, such as `language-alist' and `load-path'. - -*** Default module environment - -The bindings of the config module is available in the default -interaction environment when Guile starts up. This is because the -config module is on the module use list for the startup environment. - -However, config bindings are *not* available by default in new -modules. - -The default module environment provides bindings from the R5RS module -only. - -*** Module headers - -The module header of the current module system is the form - - (define-module NAME OPTION1 ...) - -You can specify a translator using the option - - :language LANGNAME - -where LANGNAME is the long or short form of language name as described -above. - -The translator is being fed characters from the module file, starting -immediately after the end-parenthesis of the module header form. - -NOTE: There can be only one module header per file. - -It is also possible to put the module header in a separate file and -use the option - - :file FILENAME - -to point out a file containing the actual code. - -Example: - -foo.gm: ----------------------------------------------------------------------- -(define-module (foo) - :language emacs-lisp - :file "foo.el" - :export (foo bar) - ) ----------------------------------------------------------------------- - -foo.el: ----------------------------------------------------------------------- -(defun foo () - ...) - -(defun bar () - ...) ----------------------------------------------------------------------- - -** Repl commands - -Up till now, Guile has been dependent upon the available bindings in -the selected module in order to do basic operations such as moving to -a different module, enter the debugger or getting documentation. - -This is not acceptable since we want be able to control Guile -consistently regardless of in which module we are, and sinc we don't -want to equip a module with bindings which don't have anything to do -with the purpose of the module. - -Therefore, the repl provides a special command language on top of -whatever syntax the current module provides. (Scheme48 and RScheme -provides similar repl command languages.) - -[Jost Boekemeier has suggested the following alternative solution: - Commands are bindings just like any other binding. It is enough if - some modules carry command bindings (it's in fact enough if *one* - module has them), because from such a module you can use the command - (in MODULE) to walk into a module not carrying command bindings, and - then use CTRL-D to exit. - - However, this has the disadvantage of mixing the "real" bindings with - command bindings (the module might want to use "in" for other - purposes), that CTRL-D could cause problems since for some channels - CTRL-D might close down the connection, and that using one type of - command ("in") to go "into" the module and another (CTRL-D) to "exit" - is more complex than simply "going to" a module.] - -*** Repl command syntax - -Normally, repl commands have the syntax - - ,COMMAND ARG1 ... - -Input starting with arbitrary amount of whitespace + a comma thus -works as an escape syntax. - -This syntax is probably compatible with all languages. (Note that we -don't need to activate the lexer of the language until we've checked -if the first non-whitespace char is a comma.) - -(Hypothetically, if this would become a problem, we can provide means -of disabling this behaviour of the repl and let that particular -language module take sole control of reading at the repl prompt.) - -Among the commands available are - -*** ,in MODULE - -Select module named MODULE, that is any new expressions typed by the -user after this command will be evaluated in the evaluation -environment provided by MODULE. - -*** ,in MODULE EXPR - -Evaluate expression EXPR in MODULE. EXPR has the syntax supplied by -the language used by MODULE. - -*** ,use MODULE - -Import all bindings exported by MODULE to the current module. - -* Language modules - -Since code written in any kind of language should be able to implement -most tasks, which may include reading, evaluating and writing, and -generally computing with, expressions and data originating from other -languages, we want the basic reading, evaluation and printing -operations to be independent of the language. - -That is, instead of supplying separate `read', `eval' and `write' -procedures for different languages, a language module is required to -use the system procedures in the translated code. - -This means that the behaviour of `read', `eval' and `write' are -context dependent. (See further "How Guile system procedures `read', -`eval', `write' use language modules" below.) - -** Language data types - -Each language module should try to use the fundamental Scheme data -types as far as this is possible. - -Some data types have important differences in semantics between -languages, though, and all required data types may not exist in -Guile. - -In such cases, the language module must supply its own, distinct, data -types. So, each language supported by Guile uses a certain set of -data types, with the basic Scheme data types as the intersection -between all sets. - -Specifically, syntax trees representing source code expressions should -normally be a distinct data type. - -** Foreign language escape syntax - -Note that such data can flow freely between modules. In order to -accomodate data with different native syntaxes, each language module -provides a foreign language escape syntax. In Scheme, this syntax -uses the sharp comma extension specified by SRFI-10. The read -constructor is simply the last symbol in the long language name (which -is usually the same as the short language name). - -** Example 1 - -Characters have the syntax in Scheme and in ctax. Lists currently -have syntax in Scheme but lack ctax syntax. Ctax doesn't have a -datatype "enum", but we pretend it has for this example. - -The following table now shows the syntax used for reading and writing -these expressions in module A using the language scheme, and module B -using the language ctax (we assume that the foreign language escape -syntax in ctax is #LANGUAGE EXPR): - - A B - -chars #\X 'X' - -lists (1 2 3) #scheme (1 2 3) - -enums #,(ctax ENUM) ENUM - -** Example 2 - - A user is typing expressions in a ctax module which imports the - bindings x and y from the module `(foo)': - - ctax> x = read (); - 1+2; - 1+2; - ctax> x - 1+2; - ctax> y = 1; - 1 - ctax> y; - 1 - ctax> ,in (guile-user) - guile> ,use (foo) - guile> x - #,(ctax 1+2;) - guile> y - 1 - guile> - -The example shows that ctax uses a distinct representation for ctax -expressions, but Scheme integers for integers. - -** Language module interface - -A language module is an ordinary Guile module importing bindings from -other modules and exporting bindings through its public interface. - -It is required to export the following variable and procedures: - -*** language-environment --> ENVIRONMENT - -Returns a fresh top-level ENVIRONMENT (a module) where expressions -in this language are evaluated by default. - -Modules using this language will by default have this environment -on their use list. - -The intention is for this procedure to provide the "run-time -environment" for the language. - -*** native-read PORT --> OBJECT - -Read next expression in the foreign syntax from PORT and return an -object OBJECT representing it. - -It is entirely up to the language module to define what one -expression is, that is, how much to read. - -In lisp-like languages, `native-read' corresponds to `read'. Note -that in such languages, OBJECT need not be source code, but could -be data. - -The representation of OBJECT is also chosen by the language -module. It can consist of Scheme data types, data types distinct for -the language, or a mixture. - -There is one requirement, however: Distinct data types must be -instances of a subclass of `language-specific-class'. - -This procedure will be called during interactive use (the user -types expressions at a prompt) and when the system `read' -procedure is called at a time when a module using this language is -selected. - -Some languages (for example Python) parse differently depending if -its an interactive or non-interactive session. Guile prvides the -predicate `interactive-port?' to test for this. - -*** language-specific-class - -This variable contains the superclass of all non-Scheme data-types -provided by the language. - -*** native-write OBJECT PORT - -This procedure prints the OBJECT on PORT using the specific -language syntax. - -*** write-foreign-syntax OBJECT LANGUAGE NATIVE-WRITE PORT - -Write OBJECT in the foreign language escape syntax of this module. -The object is specific to language LANGUAGE and can be written using -NATIVE-WRITE. - -Here's an implementation for Scheme: - -(define (write-foreign-syntax object language native-write port) - (format port "#(~A " language)) - (native-write object port) - (display #\) port) - -*** translate EXPRESSION --> SCHEMECODE - -Translate an EXPRESSION into SCHEMECODE. - -EXPRESSION can be anything returned by `read'. - -SCHEMECODE is Scheme source code represented using ordinary Scheme -data. It will be passed to `eval' in an environment containing -bindings in the environment returned by `language-environment'. - -This procedure will be called duing interactive use and when the -system `eval - -*** translate-all PORT [ALIST] --> THUNK - -Translate the entire stream of characters PORT until #. -Return a THUNK which can be called repeatedly like this: - - THUNK --> SCHEMECODE - -Each call will yield a new piece of scheme code. The THUNK signals -end of translation by returning the value *end-of-translation* (which -is tested using the predicate `end-of-translation?'). - -The optional argument ALIST provides compilation options for the -translator: - - (debug . #t) means produce code suitable for debugging - -This procedure will be called by the system `load' command and by -the module system when loading files. - -The intensions are: - -1. To let the language module decide when and in how large chunks - to do the processing. It may choose to do all processing at - the time translate-all is called, all processing when THUNK is - called the first time, or small pieces of processing each time - THUNK is called, or any conceivable combination. - -2. To let the language module decide in how large chunks to output - the resulting Scheme code in order not to overload memory. - -3. To enable the language module to use temporary files, and - whole-module analysis and optimization techniques. - -*** untranslate SCHEMECODE --> EXPRESSION - -Attempt to do the inverse of `translate'. An approximation is OK. It -is also OK to return #f. This procedure will be called from the -debugger, when generating error messages, backtraces etc. - -The debugger uses the local evaluation environment to determine from -which module an expression come. This is how the debugger can know -which `untranslate' procedure to call for a given expression. - -(This is used currently to decide whether which backtrace frames to -display. System modules use the option :no-backtrace to prevent -displaying of Guile's internals to the user.) - -Note that `untranslate' can use source-properties set by `native-read' -to give hints about how to do the reverse translation. Such hints -could for example be the filename, and line and column numbers for the -source expression, or an actual copy of the source expression. - -** How Guile system procedures `read', `eval', `write' use language modules - -*** read - -The idea is that the `read' exported from the R5RS library will -continue work when called from other languages, and will keep its -semantics. - -A call to `read' simply means "read in an expression from PORT using -the syntax associated with that port". - -Each module carries information about its language. - -When an input port is created for a module to be read or during -interaction with a given module, this information is copied to the -port object. - -read uses this information to call `native-read' in the correct -language module. - -*** eval - -[To be written.] - -*** write - -[To be written.] - -* Error handling - -** Errors during translation - -Errors during translation are generated as usual by calling scm-error -(from Scheme) or scm_misc_error etc (from C). The effect of -throwing errors from within `translate-all' is the same as when they -are generated within a call to the THUNK returned from -`translate-all'. - -scm-error takes a fifth argument. This is a property list (alist) -which you can use to pass extra information to the error reporting -machinery. - -Currently, the following properties are supported: - - filename filename of file being translated - line line number of errring expression - column column number - -** Run-time errors (errors in SCHEMECODE) - -This section pertains to what happens when a run-time error occurs -during evaluation of the translated code. - -In order to get "foreign code" in error messages, make sure that -`untranslate' yields good output. Note the possibility of maintaining -a table (preferably using weak references) mapping SCHEMECODE to -EXPRESSION. - -Note the availability of source-properties for attaching filename, -line and column number, and other, information, such as EXPRESSION, to -SCHEMECODE. If filename, line, and, column properties are defined, -they will be automatically used by the error reporting machinery. - -* Proposed changes to Guile - -** Implement the above proposal. - -** Add new field `reader' and `translator' to all module objects - -Make sure they are initialized when a language is specified. - -** Use `untranslate' during error handling. - -** Implement the use of arg 5 to scm-error - -(specified in "Errors during translation") - -** Implement a generic lexical analyzer with interface similar to read/rp - -Mikael is working on this. (It might take a few days, since he is -busy with his studies right now.) - -** Remove scm:eval-transformer - -This is replaced by new fields in each module object (environment). - -`eval' will instead directly the `transformer' field in the module -passed as second arg. - -Internal evaluation will, similarly, use the transformer of the module -representing the top-level of the local environment. - -Note that this level of transformation is something independent of -language translation. *This* is a hook for adding Scheme macro -packages and belong to the core language. - -We also need to check the new `translator' field, potentially using -it. - -** Package local environments as smobs - -so that environment list structures can't leak out on the Scheme -level. (This has already been done in SCM.) - -** Introduce new fields in input ports - -These carries state information such as - -*** which keyword syntax to support - -*** whether to be case sensitive or not - -*** which lexical grammar to use - -*** whether the port is used in an interactive session or not - -There will be a new Guile primitive `interactive-port?' testing for this. - -** Move configuration of keyword syntax and case sensitivity to the read-state - -Add new fields to the module objects for these values, so that the -read-state can be initialized from them. - - *fixme* When? Why? How? - -Probably as soon as the language has been determined during file loading. - -Need to figure out how to set these values. - - -Local Variables: -mode: outline -End: diff --git a/devel/translation/lisp-and-scheme.text b/devel/translation/lisp-and-scheme.text deleted file mode 100644 index e69de29bb..000000000 diff --git a/devel/vm/ior/ior-intro.text b/devel/vm/ior/ior-intro.text deleted file mode 100644 index e69de29bb..000000000 diff --git a/devel/vm/ior/ior.text b/devel/vm/ior/ior.text deleted file mode 100644 index e69de29bb..000000000 From 66c4b1098555447715d70f871815cf99514b6276 Mon Sep 17 00:00:00 2001 From: Marius Vollmer Date: Sun, 24 Mar 2002 13:47:06 +0000 Subject: [PATCH 117/131] When the output filename is "-", write to stdout. When no "-o" option is given, use "-" as the output filename (i.e., stdout). Only 'clean' the inputfile or remove the output file on error when the output file name is not "-". Define the preprocessor macro SCM_MAGIC_SNARFER while snarfing. --- libguile/guile-snarf.in | 47 ++++++++++++++++++++++++----------------- 1 file changed, 28 insertions(+), 19 deletions(-) diff --git a/libguile/guile-snarf.in b/libguile/guile-snarf.in index 8973a52a8..67fbddda7 100644 --- a/libguile/guile-snarf.in +++ b/libguile/guile-snarf.in @@ -23,15 +23,19 @@ # Usage: guile-snarf [-d | -D] [-o OUTFILE] INFILE [CPP-OPTIONS ...] # # Process INFILE using the C pre-processor and some other programs. -# Write output to a file, named OUTFILE if specified, or STEM.x if -# INFILE looks like STEM.c and no OUTFILE is specified. Ignore -# lines from the input matching grep(1) regular expression: +# Write output to a file named OUTFILE or to the standard output when no +# OUTFILE has been specified or when OUTFILE is "-". When writing +# to a file, ignore lines from the input matching the following grep(1) +# regular expression: # # ^#include ".*OUTFILE" # # If there are errors during processing, delete OUTFILE and exit with # non-zero status. # +# During snarfing, the pre-processor macro SCM_MAGIC_SNARFER is +# defined. +# # Optional arg "-d" means grep INFILE for deprecated macros and # issue a warning if any are found. Alternatively, "-D" means # do the same thing but signal error and exit w/ non-zero status. @@ -55,8 +59,12 @@ deprecated_list=" modern_snarf () # writes stdout { -${cpp} -DSCM_MAGIC_SNARF_INITS "$@" > ${temp} && cpp_ok_p=true -grep "^ *\^ *\^" ${temp} | sed -e "s/^ *\^ *\^//" -e "s/\^\ *:\ *\^.*/;/" + ## Apparently, AIX's preprocessor is unhappy if you try to #include an + ## empty file. + echo "/* source: $infile */" ; + echo "/* cpp arguments: $@ */" ; + ${cpp} -DSCM_MAGIC_SNARF_INITS -DSCM_MAGIC_SNARFER "$@" > ${temp} && cpp_ok_p=true + grep "^ *\^ *\^" ${temp} | sed -e "s/^ *\^ *\^//" -e "s/\^\ *:\ *\^.*/;/" } grep_deprecated () # $1 is the filename @@ -88,7 +96,7 @@ case x"$1" in x-d) grep_dep_p=true ; grep_dep_exit_p=false ; shift ;; esac if [ x"$1" = x-o ] then outfile=$2 ; shift ; shift ; infile=$1 ; shift - else infile=$1 ; shift ; outfile=`basename $infile .c`.x + else outfile="-"; infile=$1 ; shift fi [ x"$infile" = x ] && { echo $0: No input file ; exit 1 ; } @@ -98,30 +106,31 @@ fi cpp_ok_p=false temp="/tmp/snarf.$$" if [ x"$CPP" = x ] ; then cpp="@CPP@" ; else cpp="$CPP" ; fi -self_blind_regexp='^#include ".*'`basename $outfile`'"' -clean_infile=$infile.clean.c # temp file in same dir as infile + +trap "rm -f $temp $clean_infile" 0 1 2 15 + +if [ ! "$outfile" = "-" ]; then + self_blind_regexp='^#include ".*'`basename $outfile`'"' + clean_infile=$infile.clean.c # temp file in same dir as infile # so that #include "foo" works # (e.g., see libguile/eval.c). # use .c to satisfy cpp heuristics. -trap "rm -f $temp $clean_infile" 0 1 2 15 -# clean input file -grep -v "$self_blind_regexp" $infile > $clean_infile + # clean input file + grep -v "$self_blind_regexp" $infile > $clean_infile + modern_snarf "$@" $clean_infile > $outfile +else + modern_snarf "$@" $infile +fi # grep deprecated -$grep_dep_p && grep_deprecated $clean_infile - -# do the snarfing -- output something extra for needy cpp programs (AIX) -{ echo "/* source: $infile */" ; - echo "/* cpp-options: $@ */" ; - modern_snarf "$@" $clean_infile ; -} > $outfile +$grep_dep_p && grep_deprecated $infile # zonk outfile if errors occurred if $cpp_ok_p ; then exit 0 else - rm -f $outfile + [ ! "$outfile" = "-" ] && rm -f $outfile exit 1 fi From 2c7a286a97c6bb7c86d2bf29760bcc21cdff83fa Mon Sep 17 00:00:00 2001 From: Marius Vollmer Date: Sun, 24 Mar 2002 13:48:34 +0000 Subject: [PATCH 118/131] (.c.x): Pass "-o $@" to guile-snarf. --- guile-readline/Makefile.am | 2 +- libguile/Makefile.am | 2 +- srfi/Makefile.am | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/guile-readline/Makefile.am b/guile-readline/Makefile.am index 73c098f93..2b13b6dc6 100644 --- a/guile-readline/Makefile.am +++ b/guile-readline/Makefile.am @@ -48,7 +48,7 @@ ice9_DATA = readline.scm snarfcppopts = $(DEFS) $(INCLUDES) $(CPPFLAGS) $(CFLAGS) SUFFIXES = .x .c.x: - $(GUILE_SNARF) $< $(snarfcppopts) + $(GUILE_SNARF) -o $@ $< $(snarfcppopts) EXTRA_DIST = $(ice9_DATA) LIBGUILEREADLINE-VERSION ETAGS_ARGS = $(ice9_DATA) diff --git a/libguile/Makefile.am b/libguile/Makefile.am index 4d18ebcbd..ec9be0c86 100644 --- a/libguile/Makefile.am +++ b/libguile/Makefile.am @@ -195,7 +195,7 @@ snarfcppopts = $(DEFS) $(INCLUDES) $(CPPFLAGS) $(CFLAGS) SUFFIXES = .x .doc .c.x: - ./guile-snarf $< $(snarfcppopts) + ./guile-snarf -o $@ $< $(snarfcppopts) .c.doc: -(test -n "${AWK+set}" || AWK="@AWK@"; ${AWK} -f ./guile-func-name-check $<) (./guile-snarf-docs $(snarfcppopts) $< | \ diff --git a/srfi/Makefile.am b/srfi/Makefile.am index d8d612753..b46d2acbb 100644 --- a/srfi/Makefile.am +++ b/srfi/Makefile.am @@ -70,6 +70,6 @@ snarfcppopts = $(DEFS) $(INCLUDES) $(CPPFLAGS) $(CFLAGS) SUFFIXES = .x .c.x: - $(GUILE_SNARF) $< $(snarfcppopts) + $(GUILE_SNARF) -o $@ $< $(snarfcppopts) CLEANFILES = *.x From e2bd68e02c5dc542ce52d152b8cacdd8a2d56270 Mon Sep 17 00:00:00 2001 From: Marius Vollmer Date: Sun, 24 Mar 2002 13:49:14 +0000 Subject: [PATCH 119/131] *** empty log message *** --- guile-readline/ChangeLog | 4 ++++ libguile/ChangeLog | 10 ++++++++++ srfi/ChangeLog | 4 ++++ 3 files changed, 18 insertions(+) diff --git a/guile-readline/ChangeLog b/guile-readline/ChangeLog index 0a47dc4b2..9e5e55fc6 100644 --- a/guile-readline/ChangeLog +++ b/guile-readline/ChangeLog @@ -1,3 +1,7 @@ +2002-03-24 Marius Vollmer + + * Makefile.am (.c.x): Pass "-o $@" to guile-snarf. + 2002-03-13 Thien-Thi Nguyen * Makefile.am (snarfcppopts): New var. diff --git a/libguile/ChangeLog b/libguile/ChangeLog index c7a0bcc65..449534e29 100644 --- a/libguile/ChangeLog +++ b/libguile/ChangeLog @@ -1,3 +1,13 @@ +2002-03-24 Marius Vollmer + + * guile-snarf.in: When the output filename is "-", write to + stdout. When no "-o" option is given, use "-" as the output + filename (i.e., stdout). Only 'clean' the inputfile or remove the + output file on error when the output file name is not "-". Define + the preprocessor macro SCM_MAGIC_SNARFER while snarfing. + + * Makefile.am (.c.x): Pass "-o $@" to guile-snarf. + 2002-03-23 Dirk Herrmann * eval.c (SCM_CEVAL, SCM_APPLY): Eliminated labels wrongnumargs diff --git a/srfi/ChangeLog b/srfi/ChangeLog index c3f8779b8..1200424b3 100644 --- a/srfi/ChangeLog +++ b/srfi/ChangeLog @@ -1,3 +1,7 @@ +2002-03-24 Marius Vollmer + + * Makefile.am (.c.x): Pass "-o $@" to guile-snarf. + 2002-03-13 Thien-Thi Nguyen * srfi-13.c, srfi-14.c, srfi-4.c: From 033aa07c016786b1b2a2b52cb7bc9ec85b4ccee4 Mon Sep 17 00:00:00 2001 From: Marius Vollmer Date: Sun, 24 Mar 2002 14:12:07 +0000 Subject: [PATCH 120/131] Updated to reflect changes to the guile-snarf tool. --- doc/ref/tools.texi | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/doc/ref/tools.texi b/doc/ref/tools.texi index e27cc0fc7..061e34477 100644 --- a/doc/ref/tools.texi +++ b/doc/ref/tools.texi @@ -75,9 +75,10 @@ Usage: guile-snarf [-d | -D] [-o OUTFILE] INFILE [CPP-OPTIONS ...] What @code{guile-snarf} does: Process INFILE using the C pre-processor and some other programs. -Write output to a file, named OUTFILE if specified, or STEM.x if -INFILE looks like STEM.c and no OUTFILE is specified. Ignore -lines from the input matching grep(1) regular expression: +Write output to a file named OUTFILE or to the standard output when no +OUTFILE has been specified or when OUTFILE is @code{-}. When writing +to a file, ignore lines from the input matching the following grep(1) +regular expression: @example ^#include ".*OUTFILE" @@ -93,6 +94,9 @@ do the same thing but signal error and exit with non-zero status. If env var CPP is set, use its value instead of the C pre-processor determined at Guile configure-time. +During snarfing, the pre-processor macro @code{SCM_MAGIC_SNARFER} is +defined. + @xref{Macros guile-snarf recognizes}, for a list of the special (some would say magic) cpp macros you can use, including the list of deprecated macros. From e31a525e8091d72e205c007cf63bb221b30deddc Mon Sep 17 00:00:00 2001 From: Marius Vollmer Date: Sun, 24 Mar 2002 14:12:14 +0000 Subject: [PATCH 121/131] *** empty log message *** --- doc/ref/ChangeLog | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/doc/ref/ChangeLog b/doc/ref/ChangeLog index e312ca50d..89eea9bb5 100644 --- a/doc/ref/ChangeLog +++ b/doc/ref/ChangeLog @@ -1,3 +1,7 @@ +2002-03-24 Marius Vollmer + + * tools.texi: Updated to reflect changes to the guile-snarf tool. + 2002-03-16 Neil Jerram * scheme-utility.texi (Hooks): Further updates. New material on From 680516ba5f0e661cf2fc04132d9acbeb374a2731 Mon Sep 17 00:00:00 2001 From: Dirk Herrmann Date: Sun, 24 Mar 2002 22:19:46 +0000 Subject: [PATCH 122/131] * debug.h (scm_ready_p, debug_print): Removed declarations. * eval.c (EVALCELLCAR): Removed. (SCM_CEVAL): Eliminated label loopnoap. Removed side-effecting operation from condition. --- libguile/ChangeLog | 9 +++++++++ libguile/debug.h | 2 -- libguile/eval.c | 28 ++++++++++++++-------------- 3 files changed, 23 insertions(+), 16 deletions(-) diff --git a/libguile/ChangeLog b/libguile/ChangeLog index 449534e29..dbd0c19a5 100644 --- a/libguile/ChangeLog +++ b/libguile/ChangeLog @@ -1,3 +1,12 @@ +2002-03-24 Dirk Herrmann + + * debug.h (scm_ready_p, debug_print): Removed declarations. + + * eval.c (EVALCELLCAR): Removed. + + (SCM_CEVAL): Eliminated label loopnoap. Removed side-effecting + operation from condition. + 2002-03-24 Marius Vollmer * guile-snarf.in: When the output filename is "-", write to diff --git a/libguile/debug.h b/libguile/debug.h index da7cad68f..537436a74 100644 --- a/libguile/debug.h +++ b/libguile/debug.h @@ -186,8 +186,6 @@ SCM_API scm_t_bits scm_tc16_memoized; -SCM_API int scm_ready_p (void); -SCM_API void debug_print (SCM obj); SCM_API SCM scm_debug_object_p (SCM obj); SCM_API SCM scm_local_eval (SCM exp, SCM env); SCM_API SCM scm_reverse_lookup (SCM env, SCM data); diff --git a/libguile/eval.c b/libguile/eval.c index 8f0bf5fe0..3605d6785 100644 --- a/libguile/eval.c +++ b/libguile/eval.c @@ -128,9 +128,6 @@ char *alloca (); * * EVALCAR evaluates the car of an expression. * - * EVALCELLCAR is like EVALCAR, but is used when it is known that the - * car is a lisp cell. - * * The following macros should be used in code which is read once * (where the choice of evaluator is dynamic): * @@ -146,13 +143,12 @@ char *alloca (); */ #define SCM_CEVAL scm_ceval -#define EVALCELLCAR(x, env) (SCM_SYMBOLP (SCM_CAR (x)) \ - ? *scm_lookupcar (x, env, 1) \ - : SCM_CEVAL (SCM_CAR (x), env)) #define EVALCAR(x, env) (SCM_IMP (SCM_CAR (x)) \ ? SCM_EVALIM (SCM_CAR (x), env) \ - : EVALCELLCAR (x, env)) + : (SCM_SYMBOLP (SCM_CAR (x)) \ + ? *scm_lookupcar (x, env, 1) \ + : SCM_CEVAL (SCM_CAR (x), env))) #define EXTEND_ENV SCM_EXTEND_ENV @@ -1918,8 +1914,6 @@ SCM_CEVAL (SCM x, SCM env) goto start; #endif -loopnoap: - PREP_APPLY (SCM_UNDEFINED, SCM_EOL); loop: #ifdef DEVAL SCM_CLEAR_ARGSREADY (debug); @@ -1932,8 +1926,7 @@ loop: * * For this to be the case, however, it is necessary that primitive * special forms which jump back to `loop', `begin' or some similar - * label call PREP_APPLY. A convenient way to do this is to jump to - * `loopnoap' or `cdrxnoap'. + * label call PREP_APPLY. */ else if (++debug.info >= debug_info_end) { @@ -2791,10 +2784,17 @@ dispatch: SCM_SETCAR (x, SCM_CAR (arg1)); SCM_SETCDR (x, SCM_CDR (arg1)); SCM_ALLOW_INTS; - goto loopnoap; + PREP_APPLY (SCM_UNDEFINED, SCM_EOL); + goto loop; case 1: - if (SCM_NIMP (x = arg1)) - goto loopnoap; + x = arg1; + if (SCM_NIMP (x)) + { + PREP_APPLY (SCM_UNDEFINED, SCM_EOL); + goto loop; + } + else + RETURN (arg1); case 0: RETURN (arg1); } From 5132eef0cfa81c8734b8477754884d886a340363 Mon Sep 17 00:00:00 2001 From: Dirk Herrmann Date: Mon, 25 Mar 2002 23:45:02 +0000 Subject: [PATCH 123/131] * debug.h, eval.c: Deprecated CHECK_ENTRY, CHECK_APPLY and CHECK_EXIT and removed all references to them. --- NEWS | 5 ++++ libguile/ChangeLog | 5 ++++ libguile/debug.h | 21 +++++++------ libguile/eval.c | 74 ++++++++++++++++++++++++---------------------- 4 files changed, 60 insertions(+), 45 deletions(-) diff --git a/NEWS b/NEWS index f6d4003f8..605a50fc0 100644 --- a/NEWS +++ b/NEWS @@ -105,6 +105,11 @@ had problems because with them allocation and initialization was separated and the GC could sometimes observe half initialized cells. Only careful coding by the user of SCM_NEWCELL and SCM_NEWCELL2 could make this safe and efficient. +** CHECK_ENTRY, CHECK_APPLY and CHECK_EXIT have been deprecated. + +Use the variables scm_check_entry_p, scm_check_apply_p and scm_check_exit_p +instead. + ** Removed definitions: scm_lisp_nil, scm_lisp_t, s_nil_ify, scm_m_nil_ify, s_t_ify, scm_m_t_ify, s_0_cond, scm_m_0_cond, s_0_ify, scm_m_0_ify, s_1_ify, scm_m_1_ify, scm_debug_newcell, scm_debug_newcell2, scm_tc16_allocated, diff --git a/libguile/ChangeLog b/libguile/ChangeLog index dbd0c19a5..331ef3d2d 100644 --- a/libguile/ChangeLog +++ b/libguile/ChangeLog @@ -1,3 +1,8 @@ +2002-03-25 Dirk Herrmann + + * debug.h, eval.c: Deprecated CHECK_ENTRY, CHECK_APPLY and + CHECK_EXIT and removed all references to them. + 2002-03-24 Dirk Herrmann * debug.h (scm_ready_p, debug_print): Removed declarations. diff --git a/libguile/debug.h b/libguile/debug.h index 537436a74..90dbee02f 100644 --- a/libguile/debug.h +++ b/libguile/debug.h @@ -3,7 +3,7 @@ #ifndef SCM_DEBUG_H #define SCM_DEBUG_H -/* Copyright (C) 1995,1996,1998,1999,2000,2001 Free Software Foundation, Inc. +/* Copyright (C) 1995,1996,1998,1999,2000,2001,2002 Free Software Foundation, Inc. * * 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 @@ -93,19 +93,16 @@ SCM_API int scm_check_entry_p; SCM_API int scm_check_apply_p; SCM_API int scm_check_exit_p; -#define CHECK_ENTRY scm_check_entry_p -#define CHECK_APPLY scm_check_apply_p -#define CHECK_EXIT scm_check_exit_p - #define SCM_RESET_DEBUG_MODE \ do {\ - CHECK_ENTRY = (SCM_ENTER_FRAME_P || SCM_BREAKPOINTS_P)\ + scm_check_entry_p = (SCM_ENTER_FRAME_P || SCM_BREAKPOINTS_P)\ && !SCM_FALSEP (SCM_ENTER_FRAME_HDLR);\ - CHECK_APPLY = (SCM_APPLY_FRAME_P || SCM_TRACE_P)\ + scm_check_apply_p = (SCM_APPLY_FRAME_P || SCM_TRACE_P)\ && !SCM_FALSEP (SCM_APPLY_FRAME_HDLR);\ - CHECK_EXIT = (SCM_EXIT_FRAME_P || SCM_TRACE_P)\ + scm_check_exit_p = (SCM_EXIT_FRAME_P || SCM_TRACE_P)\ && !SCM_FALSEP (SCM_EXIT_FRAME_HDLR);\ - scm_debug_mode = SCM_DEVAL_P || CHECK_ENTRY || CHECK_APPLY || CHECK_EXIT;\ + scm_debug_mode = SCM_DEVAL_P\ + || scm_check_entry_p || scm_check_apply_p || scm_check_exit_p;\ scm_ceval_ptr = scm_debug_mode ? scm_deval : scm_ceval;\ } while (0) @@ -212,6 +209,12 @@ SCM_API SCM scm_proc_to_mem (SCM obj); SCM_API SCM scm_debug_hang (SCM obj); #endif /*GUILE_DEBUG*/ +#if SCM_ENABLE_DEPRECATED == 1 +#define CHECK_ENTRY scm_check_entry_p +#define CHECK_APPLY scm_check_apply_p +#define CHECK_EXIT scm_check_exit_p +#endif + #endif /* SCM_DEBUG_H */ /* diff --git a/libguile/eval.c b/libguile/eval.c index 3605d6785..7d3bf2ac4 100644 --- a/libguile/eval.c +++ b/libguile/eval.c @@ -1670,7 +1670,7 @@ scm_eval_body (SCM code, SCM env) #define ENTER_APPLY \ do { \ SCM_SET_ARGSREADY (debug);\ - if (CHECK_APPLY && SCM_TRAPS_P)\ + if (scm_check_apply_p && SCM_TRAPS_P)\ if (SCM_APPLY_FRAME_P || (SCM_TRACE_P && PROCTRACEP (proc)))\ {\ SCM tmp, tail = SCM_BOOL(SCM_TRACED_FRAME_P (debug)); \ @@ -1937,39 +1937,41 @@ loop: start: debug.info->e.exp = x; debug.info->e.env = env; - if (CHECK_ENTRY && SCM_TRAPS_P) - if (SCM_ENTER_FRAME_P || (SCM_BREAKPOINTS_P && SRCBRKP (x))) - { - SCM tail = SCM_BOOL(SCM_TAILRECP (debug)); - SCM_SET_TAILREC (debug); - if (SCM_CHEAPTRAPS_P) - arg1 = scm_make_debugobj (&debug); - else - { - int first; - SCM val = scm_make_continuation (&first); - - if (first) - arg1 = val; - else - { - x = val; - if (SCM_IMP (x)) - RETURN (x); - else - /* This gives the possibility for the debugger to - modify the source expression before evaluation. */ - goto dispatch; - } - } - SCM_TRAPS_P = 0; - scm_call_4 (SCM_ENTER_FRAME_HDLR, - scm_sym_enter_frame, - arg1, - tail, - scm_unmemocopy (x, env)); - SCM_TRAPS_P = 1; - } + if (scm_check_entry_p && SCM_TRAPS_P) + { + if (SCM_ENTER_FRAME_P || (SCM_BREAKPOINTS_P && SRCBRKP (x))) + { + SCM tail = SCM_BOOL(SCM_TAILRECP (debug)); + SCM_SET_TAILREC (debug); + if (SCM_CHEAPTRAPS_P) + arg1 = scm_make_debugobj (&debug); + else + { + int first; + SCM val = scm_make_continuation (&first); + + if (first) + arg1 = val; + else + { + x = val; + if (SCM_IMP (x)) + RETURN (x); + else + /* This gives the possibility for the debugger to + modify the source expression before evaluation. */ + goto dispatch; + } + } + SCM_TRAPS_P = 0; + scm_call_4 (SCM_ENTER_FRAME_HDLR, + scm_sym_enter_frame, + arg1, + tail, + scm_unmemocopy (x, env)); + SCM_TRAPS_P = 1; + } + } #endif #if defined (USE_THREADS) || defined (DEVAL) dispatch: @@ -3327,7 +3329,7 @@ evapply: /* inputs: x, proc */ } #ifdef DEVAL exit: - if (CHECK_EXIT && SCM_TRAPS_P) + if (scm_check_exit_p && SCM_TRAPS_P) if (SCM_EXIT_FRAME_P || (SCM_TRACE_P && SCM_TRACED_FRAME_P (debug))) { SCM_CLEAR_TRACED_FRAME (debug); @@ -3789,7 +3791,7 @@ tail: } #ifdef DEVAL exit: - if (CHECK_EXIT && SCM_TRAPS_P) + if (scm_check_exit_p && SCM_TRAPS_P) if (SCM_EXIT_FRAME_P || (SCM_TRACE_P && SCM_TRACED_FRAME_P (debug))) { SCM_CLEAR_TRACED_FRAME (debug); From bc76d628650140c26e5dc772c2a38bb91eeb5e0e Mon Sep 17 00:00:00 2001 From: Dirk Herrmann Date: Tue, 26 Mar 2002 00:19:04 +0000 Subject: [PATCH 124/131] * srcprop.[ch] (scm_c_source_property_breakpoint_p): New function, replaces macro SRCBRKP. (SRCBRKP): Deprecated. * eval.c (SCM_CEVAL): Replaced use of SRCBRKP by call to scm_c_source_property_breakpoint_p. Removed some use of arg1 as temporary variable. --- NEWS | 4 ++++ libguile/ChangeLog | 11 +++++++++++ libguile/eval.c | 12 +++++++----- libguile/srcprop.c | 8 ++++++++ libguile/srcprop.h | 10 +++++----- 5 files changed, 35 insertions(+), 10 deletions(-) diff --git a/NEWS b/NEWS index 605a50fc0..13ab506ca 100644 --- a/NEWS +++ b/NEWS @@ -110,6 +110,10 @@ the user of SCM_NEWCELL and SCM_NEWCELL2 could make this safe and efficient. Use the variables scm_check_entry_p, scm_check_apply_p and scm_check_exit_p instead. +** SRCBRKP has been deprecated. + +Use scm_c_source_property_breakpoint_p instead. + ** Removed definitions: scm_lisp_nil, scm_lisp_t, s_nil_ify, scm_m_nil_ify, s_t_ify, scm_m_t_ify, s_0_cond, scm_m_0_cond, s_0_ify, scm_m_0_ify, s_1_ify, scm_m_1_ify, scm_debug_newcell, scm_debug_newcell2, scm_tc16_allocated, diff --git a/libguile/ChangeLog b/libguile/ChangeLog index 331ef3d2d..3623a11f3 100644 --- a/libguile/ChangeLog +++ b/libguile/ChangeLog @@ -1,3 +1,14 @@ +2002-03-26 Dirk Herrmann + + * srcprop.[ch] (scm_c_source_property_breakpoint_p): New + function, replaces macro SRCBRKP. + + (SRCBRKP): Deprecated. + + * eval.c (SCM_CEVAL): Replaced use of SRCBRKP by call to + scm_c_source_property_breakpoint_p. Removed some use of arg1 as + temporary variable. + 2002-03-25 Dirk Herrmann * debug.h, eval.c: Deprecated CHECK_ENTRY, CHECK_APPLY and diff --git a/libguile/eval.c b/libguile/eval.c index 7d3bf2ac4..2eb1367ed 100644 --- a/libguile/eval.c +++ b/libguile/eval.c @@ -1939,19 +1939,21 @@ start: debug.info->e.env = env; if (scm_check_entry_p && SCM_TRAPS_P) { - if (SCM_ENTER_FRAME_P || (SCM_BREAKPOINTS_P && SRCBRKP (x))) + if (SCM_ENTER_FRAME_P + || (SCM_BREAKPOINTS_P && scm_c_source_property_breakpoint_p (x))) { - SCM tail = SCM_BOOL(SCM_TAILRECP (debug)); + SCM stackrep; + SCM tail = SCM_BOOL (SCM_TAILRECP (debug)); SCM_SET_TAILREC (debug); if (SCM_CHEAPTRAPS_P) - arg1 = scm_make_debugobj (&debug); + stackrep = scm_make_debugobj (&debug); else { int first; SCM val = scm_make_continuation (&first); if (first) - arg1 = val; + stackrep = val; else { x = val; @@ -1966,7 +1968,7 @@ start: SCM_TRAPS_P = 0; scm_call_4 (SCM_ENTER_FRAME_HDLR, scm_sym_enter_frame, - arg1, + stackrep, tail, scm_unmemocopy (x, env)); SCM_TRAPS_P = 1; diff --git a/libguile/srcprop.c b/libguile/srcprop.c index bc8a582ab..ae18babf2 100644 --- a/libguile/srcprop.c +++ b/libguile/srcprop.c @@ -117,6 +117,14 @@ srcprops_print (SCM obj, SCM port, scm_print_state *pstate) } +int +scm_c_source_property_breakpoint_p (SCM form) +{ + SCM obj = scm_whash_lookup (scm_source_whash, form); + return SRCPROPSP (obj) && SRCPROPBRK (obj); +} + + SCM scm_make_srcprops (long line, int col, SCM filename, SCM copy, SCM plist) { diff --git a/libguile/srcprop.h b/libguile/srcprop.h index 2f92b0621..117dc39ed 100644 --- a/libguile/srcprop.h +++ b/libguile/srcprop.h @@ -115,10 +115,6 @@ typedef struct scm_t_srcprops_chunk #define SETSRCPROPLINE(p,l) SETSRCPROPPOS (p, l, SRCPROPCOL (p)) #define SETSRCPROPCOL(p,c) SETSRCPROPPOS (p, SRCPROPLINE (p), c) -#define SRCBRKP(x) (!SCM_IMP (arg1 = scm_whash_lookup (scm_source_whash, (x)))\ - && SRCPROPSP (arg1)\ - && SRCPROPBRK (arg1)) - #define PROCTRACEP(x) (!SCM_FALSEP (scm_procedure_property (x, scm_sym_trace))) SCM_API SCM scm_sym_filename; @@ -129,7 +125,7 @@ SCM_API SCM scm_sym_breakpoint; - +SCM_API int scm_c_source_property_breakpoint_p (SCM form); SCM_API SCM scm_srcprops_to_plist (SCM obj); SCM_API SCM scm_make_srcprops (long line, int col, SCM fname, SCM copy, SCM plist); SCM_API SCM scm_source_property (SCM obj, SCM key); @@ -139,6 +135,10 @@ SCM_API SCM scm_set_source_properties_x (SCM obj, SCM props); SCM_API void scm_finish_srcprop (void); SCM_API void scm_init_srcprop (void); +#if SCM_ENABLE_DEPRECATED == 1 +#define SRCBRKP(x) (scm_source_property_breakpoint_p (x)) +#endif + #endif /* SCM_SRCPROP_H */ /* From 801892e7888467dcd3443c8dbd4e1eddfbf402c5 Mon Sep 17 00:00:00 2001 From: Neil Jerram Date: Wed, 27 Mar 2002 21:55:31 +0000 Subject: [PATCH 125/131] Various manual updates, including syncing with stable branch. --- doc/ref/ChangeLog | 11 +++++ doc/ref/guile.texi | 6 +-- doc/ref/intro.texi | 8 ++-- doc/ref/scheme-compound.texi | 55 +++++-------------------- doc/ref/scheme-data.texi | 78 +++++++++++++++++++++++++++--------- 5 files changed, 86 insertions(+), 72 deletions(-) diff --git a/doc/ref/ChangeLog b/doc/ref/ChangeLog index 89eea9bb5..501f3c4a6 100644 --- a/doc/ref/ChangeLog +++ b/doc/ref/ChangeLog @@ -1,3 +1,14 @@ +2002-03-27 Neil Jerram + + * scheme-compound.texi (List Searching): Remove docs for + `scm_sloppy_mem*', which no longer exist. + +2002-03-24 Neil Jerram + + * guile.texi (Top), intro.texi (What is Guile?, The Basic Guile + Package): Use @ifnottex instead of @ifinfo, so that HTML + generation works correctly. + 2002-03-24 Marius Vollmer * tools.texi: Updated to reflect changes to the guile-snarf tool. diff --git a/doc/ref/guile.texi b/doc/ref/guile.texi index 4e131332d..cd83b3e79 100644 --- a/doc/ref/guile.texi +++ b/doc/ref/guile.texi @@ -121,7 +121,7 @@ by the Free Software Foundation. @sp 10 @comment The title is printed in a large font. @title Guile Reference Manual -@subtitle $Id: guile.texi,v 1.15 2002-03-16 13:51:03 ossau Exp $ +@subtitle $Id: guile.texi,v 1.16 2002-03-27 21:55:31 ossau Exp $ @subtitle For use with Guile @value{VERSION} @c AUTHORS @@ -208,7 +208,7 @@ by Free Software Foundation. @c Where to find Guile examples. @set example-dir doc/examples -@ifinfo +@ifnottex @node Top, Guile License, (dir), (dir) @top The Guile Reference Manual @@ -218,7 +218,7 @@ and interesting ways. This Info file contains edition @value{MANUAL_EDITION} of the reference manual, corresponding to Guile version @value{VERSION}. -@end ifinfo +@end ifnottex @menu Preface diff --git a/doc/ref/intro.texi b/doc/ref/intro.texi index 6d373a7cc..af1b48d0e 100644 --- a/doc/ref/intro.texi +++ b/doc/ref/intro.texi @@ -8,9 +8,9 @@ described in the @tex Revised$^5$ @end tex -@ifinfo +@ifnottex Revised^5 -@end ifinfo +@end ifnottex Report on the Algorithmic Language Scheme (usually known as R5RS), providing clean and general data and control structures. Guile goes beyond the rather austere language presented in R5RS, extending it with @@ -899,9 +899,9 @@ known as R5RS, or the @iftex ``Revised$^5$ Report on the Algorithmic Language Scheme'', @end iftex -@ifinfo +@ifnottex ``Revised^5 Report on the Algorithmic Language Scheme'', -@end ifinfo +@end ifnottex we have included the report in the Guile distribution; @xref{Top, , Introduction, r5rs, Revised(5) Report on the Algorithmic Language Scheme}. diff --git a/doc/ref/scheme-compound.texi b/doc/ref/scheme-compound.texi index ec49bccd7..cff67d012 100644 --- a/doc/ref/scheme-compound.texi +++ b/doc/ref/scheme-compound.texi @@ -27,8 +27,6 @@ values can be looked up within them. @section Pairs @tpindex Pairs -@c FIXME::martin: Review me! - Pairs are used to combine two Scheme objects into one compound object. Hence the name: A pair stores a pair of objects. @@ -133,8 +131,6 @@ by @code{set-cdr!} is unspecified. @section Lists @tpindex Lists -@c FIXME::martin: Review me! - A very important data type in Scheme---as well as in all other Lisp dialects---is the data type @dfn{list}.@footnote{Strictly speaking, Scheme does not have a real datatype @dfn{list}. Lists are made up of @@ -173,8 +169,6 @@ or a pair which has a list in its cdr. @node List Syntax @subsection List Read Syntax -@c FIXME::martin: Review me! - The syntax for lists is an opening parentheses, then all the elements of the list (separated by whitespace) and finally a closing parentheses.@footnote{Note that there is no separation character between @@ -208,8 +202,6 @@ applications (@pxref{Simple Invocation}). @node List Predicates @subsection List Predicates -@c FIXME::martin: Review me! - Often it is useful to test whether a given Scheme object is a list or not. List-processing procedures could use this information to test whether their input is valid, or they could do different things @@ -279,8 +271,6 @@ use the procedure @code{copy-tree} (@pxref{Copying}). @node List Selection @subsection List Selection -@c FIXME::martin: Review me! - These procedures are used to get some information about a list, or to retrieve one or more elements of a list. @@ -323,8 +313,6 @@ return it. @node Append/Reverse @subsection Append and Reverse -@c FIXME::martin: Review me! - @code{append} and @code{append!} are used to concatenate two or more lists in order to form a new list. @code{reverse} and @code{reverse!} return lists with the same elements as their arguments, but in reverse @@ -463,8 +451,6 @@ Like @code{delete!}, but only deletes the first occurrence of @node List Searching @subsection List Searching -@c FIXME::martin: Review me! - The following procedures search lists for particular elements. They use different comparison predicates for comparing list elements with the object to be searched. When they fail, they return @code{#f}, otherwise @@ -504,33 +490,10 @@ the non-empty lists returned by @code{(list-tail @var{lst} empty list) is returned. @end deffn -[FIXME: Is there any reason to have the `sloppy' functions available at -high level at all? Maybe these docs should be relegated to a "Guile -Internals" node or something. -twp] - -@deffn {Scheme Procedure} sloppy-memq x lst -This procedure behaves like @code{memq}, but does no type or error checking. -Its use is recommended only in writing Guile internals, -not for high-level Scheme programs. -@end deffn - -@deffn {Scheme Procedure} sloppy-memv x lst -This procedure behaves like @code{memv}, but does no type or error checking. -Its use is recommended only in writing Guile internals, -not for high-level Scheme programs. -@end deffn - -@deffn {Scheme Procedure} sloppy-member x lst -This procedure behaves like @code{member}, but does no type or error checking. -Its use is recommended only in writing Guile internals, -not for high-level Scheme programs. -@end deffn @node List Mapping @subsection List Mapping -@c FIXME::martin: Review me! - List processing is very convenient in Scheme because the process of iterating over the elements of a list can be highly abstracted. The procedures in this section are the most basic iterating procedures for @@ -893,7 +856,7 @@ The field holds a Scheme value and is GC protected. When a structure is created with this type of field, the field is initialized to refer to the structure's own handle. This kind of field is mainly useful when mixing Scheme and C code in which the C code may need to compute a -structure's handle given only the address of its malloc-ed data. +structure's handle given only the address of its malloc'd data. @end itemize @@ -1713,19 +1676,19 @@ because association lists are so useful, Guile also provides specific procedures for manipulating them. @menu -* Alist Key Equality:: -* Adding or Setting Alist Entries:: -* Retrieving Alist Entries:: -* Removing Alist Entries:: -* Sloppy Alist Functions:: -* Alist Example:: +* Alist Key Equality:: +* Adding or Setting Alist Entries:: +* Retrieving Alist Entries:: +* Removing Alist Entries:: +* Sloppy Alist Functions:: +* Alist Example:: @end menu @node Alist Key Equality @subsubsection Alist Key Equality All of Guile's dedicated association list procedures, apart from -@code{acons}, come in three flavors, depending on the level of equality +@code{acons}, come in three flavours, depending on the level of equality that is required to decide whether an existing key in the association list is the same as the key that the procedure call uses to identify the required entry. @@ -1864,7 +1827,7 @@ function is @emph{not} destructive; @var{alist} is not modified. @deffnx {C Function} scm_assq_set_x (alist, key, val) @deffnx {C Function} scm_assv_set_x (alist, key, val) @deffnx {C Function} scm_assoc_set_x (alist, key, val) -Re-associate @var{key} in @var{alist} with @var{value}: find any existing +Reassociate @var{key} in @var{alist} with @var{value}: find any existing @var{alist} entry for @var{key} and associate it with the new @var{value}. If @var{alist} does not contain an entry for @var{key}, add a new one. Return the (possibly new) alist. diff --git a/doc/ref/scheme-data.texi b/doc/ref/scheme-data.texi index 1c46a7004..b935dd952 100755 --- a/doc/ref/scheme-data.texi +++ b/doc/ref/scheme-data.texi @@ -3,7 +3,7 @@ @chapter Simple Generic Data Types This chapter describes those of Guile's simple data types which are -primarily are used for their role as items of generic data. By +primarily used for their role as items of generic data. By @dfn{simple} we mean data types that are not primarily used as containers to hold other data --- i.e. pairs, lists, vectors and so on. For the documentation of such @dfn{compound} data types, see @@ -193,8 +193,7 @@ discover whether the value is any of the supported numerical types. @deffn {Scheme Procedure} number? obj @deffnx {C Function} scm_number_p (obj) -Return @code{#t} if @var{obj} is any kind of number, @code{#f} else. -@findex number? +Return @code{#t} if @var{obj} is any kind of number, else @code{#f}. @end deffn For example: @@ -265,7 +264,7 @@ completely invisible to the Scheme level programmer. @deffn {Scheme Procedure} integer? x @deffnx {C Function} scm_integer_p (x) -Return @code{#t} if @var{x} is an integer number, @code{#f} else. +Return @code{#t} if @var{x} is an integer number, else @code{#f}. @lisp (integer? 487) @@ -329,11 +328,10 @@ with those that are already implemented. @deffn {Scheme Procedure} real? obj @deffnx {C Function} scm_real_p (obj) -Return @code{#t} if @var{obj} is a real number, @code{#f} else. +Return @code{#t} if @var{obj} is a real number, else @code{#f}. Note that the sets of integer and rational values form subsets of the set of real numbers, so the predicate will also be fulfilled if @var{obj} is an integer number or a rational number. -@findex real? @end deffn @deffn {Scheme Procedure} rational? x @@ -1464,6 +1462,7 @@ called with string containing unusual characters. * String Searching:: Searching in strings. * Alphabetic Case Mapping:: Convert the alphabetic case of strings. * Appending Strings:: Appending strings to form a new string. +* String Miscellanea:: Miscellaneous string procedures. @end menu @node String Syntax @@ -1859,6 +1858,19 @@ concatenation of the given strings, @var{args}. @end deffn +@node String Miscellanea +@subsection String Miscellanea + +This section contains all remaining string procedures. + +@deffn {Scheme Procedure} string-ci->symbol str +@deffnx {C Function} scm_string_ci_to_symbol (str) +Return the symbol whose name is @var{str}. @var{str} is +converted to lowercase before the conversion is done, if Guile +is currently reading symbols case-insensitively. +@end deffn + + @node Regular Expressions @section Regular Expressions @tpindex Regular expressions @@ -2262,6 +2274,7 @@ objects @i{per se}. @menu * Symbol Read Syntax:: Extended read syntax for symbols. * Symbol Primitives:: Operations related to symbols. +* Symbol Tables:: Collecting symbols into obarrays. * Symbol Discrete:: Using symbols as discrete values. * Symbol Props:: Function slots and property lists. * Symbol Uninterned:: Uninterned symbols. @@ -2271,7 +2284,7 @@ objects @i{per se}. @node Symbol Read Syntax @subsection Extended Read Syntax for Symbols -The read syntax for symbols is a sequence of letters, digits, and +The read syntax for a symbol is a sequence of letters, digits, and @dfn{extended alphabetic characters}, beginning with a character that cannot begin a number. In addition, the special cases of @code{+}, @code{-}, and @code{...} are read as symbols even though numbers can @@ -2281,7 +2294,7 @@ Extended alphabetic characters may be used within identifiers as if they were letters. The set of extended alphabetic characters is: @example -! $ % & * + - . / : < = > ? @@ ^ _ ~ +! $ % & * + - . / : < = > ? @@ ^ _ ~ @end example In addition to the standard read syntax defined above (which is taken @@ -2348,8 +2361,8 @@ standard case is lower case: (eq? 'mISSISSIppi 'mississippi) @result{} #t (string->symbol "mISSISSIppi") @result{} @r{the symbol with name "mISSISSIppi"} (eq? 'bitBlt (string->symbol "bitBlt")) @result{} #f -(eq? 'JollyWog - (string->symbol (symbol->string 'JollyWog))) @result{} #t +(eq? 'LolliPop + (string->symbol (symbol->string 'LolliPop))) @result{} #t (string=? "K. Harper, M.D." (symbol->string (string->symbol "K. Harper, M.D."))) @result{}#t @@ -2391,10 +2404,17 @@ standard case is lower case: @end lisp @end deffn -@deffn {Scheme Procedure} symbol-hash symbol -@deffnx {C Function} scm_symbol_hash (symbol) -Return a hash value for @var{symbol}. -@end deffn +@node Symbol Tables +@subsection Symbol Tables + +@c FIXME::martin: Are all these procedures still relevant? + +Guile symbol tables are hash tables. Each hash table, also called an +@dfn{obarray} (for `object array'), is a vector of association lists. +Each entry in the alists is a pair (@var{SYMBOL} . @var{VALUE}). To +@dfn{intern} a symbol in a symbol table means to return its +(@var{SYMBOL} . @var{VALUE}) pair, adding a new entry to the symbol +table (with an undefined value) if none is yet present. @deffn {Scheme Procedure} gensym [prefix] @deffnx {C Function} scm_gensym (prefix) @@ -2405,6 +2425,12 @@ is increased by 1 at each call. There is no provision for resetting the counter. @end deffn +@vgone{gentemp,1.6} +@vgone{intern-symbol,1.6} +@vgone{string->obarray-symbol,1.6} +@vgone{symbol-binding,1.6} +@vgone{symbol-bound?,1.6} + @node Symbol Discrete @subsection Using Symbols as Discrete Values @@ -2434,6 +2460,17 @@ Return the contents of @var{symbol}'s @dfn{function slot}. Change the binding of @var{symbol}'s function slot. @end deffn +@deffn {Scheme Procedure} symbol-hash symbol +@deffnx {C Function} scm_symbol_hash (symbol) +Return a hash value for @var{symbol}. +@end deffn + +@deffn {Scheme Procedure} symbol-interned? obarray string +@deffnx {C Function} scm_symbol_interned_p (obarray, string) +Return @code{#t} if @var{obarray} contains a symbol with name +@var{string}, and @code{#f} otherwise. +@end deffn + @deffn {Scheme Procedure} symbol-pref symbol @deffnx {C Function} scm_symbol_pref (symbol) Return the @dfn{property list} currently associated with @var{symbol}. @@ -2444,6 +2481,10 @@ Return the @dfn{property list} currently associated with @var{symbol}. Change the binding of @var{symbol}'s property slot. @end deffn +@vgone{symbol-set!,1.6} +@vgone{unintern-symbol,1.6} + + @node Symbol Uninterned @subsection Uninterned Symbols @@ -2465,14 +2506,14 @@ just returns that symbol. When not, a new symbol with the name is created and entered into the table so that it can be found later. Sometimes you might want to create a symbol that is guaranteed `fresh', -i.e., a symbol that did not exist previously. You might also want to +i.e. a symbol that did not exist previously. You might also want to somehow guarantee that no one else will ever unintentionally stumble across your symbol in the future. These properties of a symbol are often needed when generating code during macro expansion. When introducing new temporary variables, you want to guarantee that they -don't conflict with variables in other peoples code. +don't conflict with variables in other people's code. -The simplest way to arrange for this is to create a new symbol and to +The simplest way to arrange for this is to create a new symbol but not enter it into the global table of all symbols. That way, no one will ever get access to your symbol by chance. Symbols that are not in the table are called @dfn{uninterned}. Of course, symbols that @@ -2531,6 +2572,7 @@ foo-3 @end lisp + @node Keywords @section Keywords @tpindex Keywords @@ -2717,8 +2759,6 @@ ABORT: (unbound-variable) @node Keyword Procedures @subsection Keyword Procedures -@c FIXME::martin: Review me! - The following procedures can be used for converting symbols to keywords and back. From ead451469683b5140fb09eb4c7b84dd9edbf02a5 Mon Sep 17 00:00:00 2001 From: Thien-Thi Nguyen Date: Thu, 28 Mar 2002 00:18:13 +0000 Subject: [PATCH 126/131] *** empty log message *** --- srfi/srfi-14.scm | 92 ++++++++++++++++++++++++++---------------------- 1 file changed, 50 insertions(+), 42 deletions(-) diff --git a/srfi/srfi-14.scm b/srfi/srfi-14.scm index c47ddd514..b82990e04 100644 --- a/srfi/srfi-14.scm +++ b/srfi/srfi-14.scm @@ -1,45 +1,51 @@ -;;;; srfi-14.scm --- SRFI-14 procedures for Guile -;;;; -;;;; Copyright (C) 2001 Free Software Foundation, Inc. -;;;; -;;;; 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 -;;;; the Free Software Foundation, Inc., 59 Temple Place, Suite 330, -;;;; Boston, MA 02111-1307 USA -;;;; -;;;; 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. -;;;; If you do not wish that, delete this exception notice. +;;; srfi-14.scm --- SRFI-14 procedures for Guile +;;; +;;; Copyright (C) 2001, 2002 Free Software Foundation, Inc. +;;; +;;; 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 +;;; the Free Software Foundation, Inc., 59 Temple Place, Suite 330, +;;; Boston, MA 02111-1307 USA +;;; +;;; 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. +;;; If you do not wish that, delete this exception notice. + +;;; Commentary: + +;; This module is fully documented in the Guile Reference Manual. + +;;; Code: (define-module (srfi srfi-14) :export ( @@ -165,3 +171,5 @@ (char-set-filter (lambda (ch) (< (char->integer ch) 128)) char-set:full)) (define char-set:empty (char-set)) + +;;; srfi-14.scm ends here From 0706ae06dcef28b7639692d27f054b0db5c3cdde Mon Sep 17 00:00:00 2001 From: Thien-Thi Nguyen Date: Thu, 28 Mar 2002 00:21:04 +0000 Subject: [PATCH 127/131] Update copyright. Add commentary; nfc. --- srfi/srfi-11.scm | 34 +++++++++++++----- srfi/srfi-13.scm | 90 ++++++++++++++++++++++++++---------------------- srfi/srfi-19.scm | 14 +++++--- 3 files changed, 84 insertions(+), 54 deletions(-) diff --git a/srfi/srfi-11.scm b/srfi/srfi-11.scm index 32f35a8d7..6eda30d98 100644 --- a/srfi/srfi-11.scm +++ b/srfi/srfi-11.scm @@ -1,6 +1,6 @@ ;;;; srfi-11.scm --- SRFI-11 procedures for Guile -;;; Copyright (C) 2000, 2001 Free Software Foundation, Inc. +;;; Copyright (C) 2000, 2001, 2002 Free Software Foundation, Inc. ;;; ;;; This program is free software; you can redistribute it and/or ;;; modify it under the terms of the GNU General Public License as @@ -41,6 +41,24 @@ ;;; whether to permit this exception to apply to your modifications. ;;; If you do not wish that, delete this exception notice. +;;; Commentary: + +;; This module exports two syntax forms: let-values and let*-values. +;; +;; Sample usage: +;; +;; (let-values (((x y . z) (foo a b)) +;; ((p q) (bar c))) +;; (baz x y z p q)) +;; +;; This binds `x' and `y' to the first to values returned by `foo', +;; `z' to the rest of the values from `foo', and `p' and `q' to the +;; values returned by `bar'. All of these are available to `baz'. +;; +;; let*-values : let-values :: let* : let + +;;; Code: + (define-module (srfi srfi-11) :use-module (ice-9 syncase) :export-syntax (let-values let*-values)) @@ -100,7 +118,7 @@ ; body ...) ; (lambda lambda-tmps ; (let-values-helper "cwv" lv-bindings final-let-bindings body ...))) - + ; ((_ "consumer" (var-1 var-2 ...) (lambda-tmp ...) final-let-bindings lv-bindings ; body ...) ; (let-values-helper "consumer" @@ -165,7 +183,7 @@ ; tmp-vars ; ((vars-2 binding-2) ...) ; body ...)))))) -; +; ; (syntax-rules () ; ((_ () body ...) ; (begin body ...)) @@ -184,7 +202,7 @@ ((null? elts) '()) ((pair? elts) (cons (proc (car elts)) (map-1-dot proc (cdr elts)))) (else (proc elts)))) - + (define (undot-list lst) ;; produce a non-dotted list from a possibly dotted list. (cond @@ -199,7 +217,7 @@ (let-vars (map (lambda (sym tmp) (list sym tmp)) (undot-list (car var-binding)) (undot-list new-tmps)))) - + (if (null? (cdr vars)) `(call-with-values (lambda () ,(cadr var-binding)) (lambda ,new-tmps @@ -209,7 +227,7 @@ (lambda ,new-tmps ,(let-values-helper (cdr vars) body (cons let-vars prev-let-vars))))))) - + (if (null? vars) `(begin ,@body) (let-values-helper vars body '()))) @@ -242,7 +260,7 @@ body ...)))))) ; Alternate define-macro implementation... -; +; ; (define-macro (let*-values vars . body) ; (define (let-values-helper vars body) ; (let ((var-binding (car vars))) @@ -253,7 +271,7 @@ ; `(call-with-values (lambda () ,(cadr var-binding)) ; (lambda ,(car var-binding) ; ,(let-values-helper (cdr vars) body)))))) - + ; (if (null? vars) ; `(begin ,@body) ; (let-values-helper vars body))) diff --git a/srfi/srfi-13.scm b/srfi/srfi-13.scm index 90e7691a0..7986e5a8a 100644 --- a/srfi/srfi-13.scm +++ b/srfi/srfi-13.scm @@ -1,45 +1,51 @@ -;;;; srfi-13.scm --- SRFI-13 procedures for Guile -;;;; -;;;; Copyright (C) 2001 Free Software Foundation, Inc. -;;;; -;;;; 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 -;;;; the Free Software Foundation, Inc., 59 Temple Place, Suite 330, -;;;; Boston, MA 02111-1307 USA -;;;; -;;;; 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. -;;;; If you do not wish that, delete this exception notice. +;;; srfi-13.scm --- SRFI-13 procedures for Guile +;;; +;;; Copyright (C) 2001, 2002 Free Software Foundation, Inc. +;;; +;;; 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 +;;; the Free Software Foundation, Inc., 59 Temple Place, Suite 330, +;;; Boston, MA 02111-1307 USA +;;; +;;; 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. +;;; If you do not wish that, delete this exception notice. + +;;; Commentary: + +;; This module is fully documented in the Guile Reference Manual. + +;;; Code: (define-module (srfi srfi-13)) diff --git a/srfi/srfi-19.scm b/srfi/srfi-19.scm index 5f21847b4..efdd5f76e 100644 --- a/srfi/srfi-19.scm +++ b/srfi/srfi-19.scm @@ -1,6 +1,6 @@ ;;; srfi-19.scm --- SRFI-19 procedures for Guile ;;; -;;; Copyright (C) 2001 Free Software Foundation, Inc. +;;; Copyright (C) 2001, 2002 Free Software Foundation, Inc. ;;; ;;; This program is free software; you can redistribute it and/or ;;; modify it under the terms of the GNU General Public License as @@ -40,9 +40,15 @@ ;;; If you write modifications of your own for GUILE, it is your choice ;;; whether to permit this exception to apply to your modifications. ;;; If you do not wish that, delete this exception notice. -;;; -;;; Originally from SRFI reference implementation by Will Fitzgerald. -;;; Ported to Guile by Rob Browning + +;;; Commentary: + +;; Originally from SRFI reference implementation by Will Fitzgerald. +;; Ported to Guile by Rob Browning . +;; +;; This module is fully documented in the Guile Reference Manual. + +;;; Code: ;; FIXME: I haven't checked a decent amount of this code for potential ;; performance improvements, but I suspect that there may be some From 6be07c52784bacfa1ed218cf1145a62181c1799f Mon Sep 17 00:00:00 2001 From: Thien-Thi Nguyen Date: Thu, 28 Mar 2002 01:39:12 +0000 Subject: [PATCH 128/131] Update copyright. Point to manual in commentary; nfc. --- srfi/srfi-1.scm | 101 +++++++++++++++--------------- srfi/srfi-10.scm | 132 +++++++++++++++++++------------------- srfi/srfi-11.scm | 86 +++++++++++++------------ srfi/srfi-13.scm | 85 ++++++++++++------------- srfi/srfi-14.scm | 84 ++++++++++++------------- srfi/srfi-16.scm | 137 ++++++++++++++++++++-------------------- srfi/srfi-17.scm | 89 +++++++++++++------------- srfi/srfi-19.scm | 90 +++++++++++++------------- srfi/srfi-2.scm | 92 ++++++++++++++------------- srfi/srfi-4.scm | 97 ++++++++++++++-------------- srfi/srfi-6.scm | 92 ++++++++++++++------------- srfi/srfi-8.scm | 90 ++++++++++++++------------ srfi/srfi-9.scm | 160 ++++++++++++++++++++++++----------------------- 13 files changed, 692 insertions(+), 643 deletions(-) diff --git a/srfi/srfi-1.scm b/srfi/srfi-1.scm index 1d9dd678c..a06e8462e 100644 --- a/srfi/srfi-1.scm +++ b/srfi/srfi-1.scm @@ -1,58 +1,59 @@ -;;;; srfi-1.scm --- SRFI-1 procedures for Guile -;;;; -;;;; Copyright (C) 2001 Free Software Foundation, Inc. -;;;; -;;;; 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 -;;;; the Free Software Foundation, Inc., 59 Temple Place, Suite 330, -;;;; Boston, MA 02111-1307 USA -;;;; -;;;; 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. -;;;; If you do not wish that, delete this exception notice. +;;; srfi-1.scm --- List Library + +;; Copyright (C) 2001, 2002 Free Software Foundation, Inc. +;; +;; 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 +;; the Free Software Foundation, Inc., 59 Temple Place, Suite 330, +;; Boston, MA 02111-1307 USA +;; +;; 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. +;; If you do not wish that, delete this exception notice. ;;; Author: Martin Grabmueller ;;; Date: 2001-06-06 ;;; Commentary: -;;; This is an implementation of SRFI-1 (List Library) -;;; -;;; All procedures defined in SRFI-1, which are not already defined in -;;; the Guile core library, are exported. The procedures in this -;;; implementation work, but they have not been tuned for speed or -;;; memory usage. -;;; +;; This is an implementation of SRFI-1 (List Library). +;; +;; All procedures defined in SRFI-1, which are not already defined in +;; the Guile core library, are exported. The procedures in this +;; implementation work, but they have not been tuned for speed or +;; memory usage. +;; +;; This module is fully documented in the Guile Reference Manual. ;;; Code: @@ -1051,3 +1052,5 @@ (define (lset-diff+intersection! = list1 . rest) (apply lset-diff+intersection = list1 rest)) ; XXX:optimize + +;;; srfi-1.scm ends here diff --git a/srfi/srfi-10.scm b/srfi/srfi-10.scm index e3327548c..481732051 100644 --- a/srfi/srfi-10.scm +++ b/srfi/srfi-10.scm @@ -1,70 +1,72 @@ -;;;; srfi-10.scm --- SRFI-10 read hash extension for Guile -;;;; -;;;; Copyright (C) 2001 Free Software Foundation, Inc. -;;;; -;;;; 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 -;;;; the Free Software Foundation, Inc., 59 Temple Place, Suite 330, -;;;; Boston, MA 02111-1307 USA -;;;; -;;;; 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. -;;;; If you do not wish that, delete this exception notice. +;;; srfi-10.scm --- Hash-Comma Reader Extension + +;; Copyright (C) 2001, 2002 Free Software Foundation, Inc. +;; +;; 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 +;; the Free Software Foundation, Inc., 59 Temple Place, Suite 330, +;; Boston, MA 02111-1307 USA +;; +;; 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. +;; If you do not wish that, delete this exception notice. ;;; Commentary: -;;; This module implements the syntax extension #,(), also called -;;; hash-comma, which is defined in SRFI-10. -;;; -;;; The support for SRFI-10 consists of the procedure -;;; `define-reader-ctor' for defining new reader constructors and the -;;; read syntax form -;;; -;;; #,( ...) -;;; -;;; where must be a symbol for which a read constructor was -;;; defined previously. -;;; -;;; Example: -;;; -;;; (define-reader-ctor 'file open-input-file) -;;; (define f '#,(file "/etc/passwd")) -;;; (read-line f) -;;; => -;;; "root:x:0:0:root:/root:/bin/bash" -;;; -;;; Please note the quote before the #,(file ...) expression. This is -;;; necessary because ports are not self-evaluating in Guile. +;; This module implements the syntax extension #,(), also called +;; hash-comma, which is defined in SRFI-10. +;; +;; The support for SRFI-10 consists of the procedure +;; `define-reader-ctor' for defining new reader constructors and the +;; read syntax form +;; +;; #,( ...) +;; +;; where must be a symbol for which a read constructor was +;; defined previously. +;; +;; Example: +;; +;; (define-reader-ctor 'file open-input-file) +;; (define f '#,(file "/etc/passwd")) +;; (read-line f) +;; => +;; "root:x:0:0:root:/root:/bin/bash" +;; +;; Please note the quote before the #,(file ...) expression. This is +;; necessary because ports are not self-evaluating in Guile. +;; +;; This module is fully documented in the Guile Reference Manual. ;;; Code: @@ -108,3 +110,5 @@ ;; Install the hash extension. ;; (read-hash-extend #\, hash-comma) + +;;; srfi-10.scm ends here diff --git a/srfi/srfi-11.scm b/srfi/srfi-11.scm index 6eda30d98..cabd8e6f3 100644 --- a/srfi/srfi-11.scm +++ b/srfi/srfi-11.scm @@ -1,45 +1,45 @@ -;;;; srfi-11.scm --- SRFI-11 procedures for Guile +;;; srfi-11.scm --- let-values and let*-values -;;; Copyright (C) 2000, 2001, 2002 Free Software Foundation, Inc. -;;; -;;; 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 -;;; the Free Software Foundation, Inc., 59 Temple Place, Suite 330, -;;; Boston, MA 02111-1307 USA -;;; -;;; 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. -;;; If you do not wish that, delete this exception notice. +;; Copyright (C) 2000, 2001, 2002 Free Software Foundation, Inc. +;; +;; 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 +;; the Free Software Foundation, Inc., 59 Temple Place, Suite 330, +;; Boston, MA 02111-1307 USA +;; +;; 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. +;; If you do not wish that, delete this exception notice. ;;; Commentary: @@ -56,6 +56,8 @@ ;; values returned by `bar'. All of these are available to `baz'. ;; ;; let*-values : let-values :: let* : let +;; +;; This module is fully documented in the Guile Reference Manual. ;;; Code: @@ -275,3 +277,5 @@ ; (if (null? vars) ; `(begin ,@body) ; (let-values-helper vars body))) + +;;; srfi-11.scm ends here diff --git a/srfi/srfi-13.scm b/srfi/srfi-13.scm index 7986e5a8a..1ca8edac3 100644 --- a/srfi/srfi-13.scm +++ b/srfi/srfi-13.scm @@ -1,45 +1,45 @@ -;;; srfi-13.scm --- SRFI-13 procedures for Guile -;;; -;;; Copyright (C) 2001, 2002 Free Software Foundation, Inc. -;;; -;;; 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 -;;; the Free Software Foundation, Inc., 59 Temple Place, Suite 330, -;;; Boston, MA 02111-1307 USA -;;; -;;; 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. -;;; If you do not wish that, delete this exception notice. +;;; srfi-13.scm --- String Library + +;; Copyright (C) 2001, 2002 Free Software Foundation, Inc. +;; +;; 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 +;; the Free Software Foundation, Inc., 59 Temple Place, Suite 330, +;; Boston, MA 02111-1307 USA +;; +;; 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. +;; If you do not wish that, delete this exception notice. ;;; Commentary: @@ -173,3 +173,4 @@ (string-length s)))) (hash (string-upcase (substring/shared s start end)) bound)))) +;;; srfi-13.scm ends here diff --git a/srfi/srfi-14.scm b/srfi/srfi-14.scm index b82990e04..3faebe2b8 100644 --- a/srfi/srfi-14.scm +++ b/srfi/srfi-14.scm @@ -1,45 +1,45 @@ -;;; srfi-14.scm --- SRFI-14 procedures for Guile -;;; -;;; Copyright (C) 2001, 2002 Free Software Foundation, Inc. -;;; -;;; 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 -;;; the Free Software Foundation, Inc., 59 Temple Place, Suite 330, -;;; Boston, MA 02111-1307 USA -;;; -;;; 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. -;;; If you do not wish that, delete this exception notice. +;;; srfi-14.scm --- Character-set Library + +;; Copyright (C) 2001, 2002 Free Software Foundation, Inc. +;; +;; 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 +;; the Free Software Foundation, Inc., 59 Temple Place, Suite 330, +;; Boston, MA 02111-1307 USA +;; +;; 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. +;; If you do not wish that, delete this exception notice. ;;; Commentary: diff --git a/srfi/srfi-16.scm b/srfi/srfi-16.scm index fe179e849..f283e3c1a 100644 --- a/srfi/srfi-16.scm +++ b/srfi/srfi-16.scm @@ -1,74 +1,75 @@ -;;;; srfi-16.scm --- `case-lambda' for Guile +;;; srfi-16.scm --- case-lambda -;;; Copyright (C) 2001 Free Software Foundation, Inc. -;;; -;;; 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 -;;; the Free Software Foundation, Inc., 59 Temple Place, Suite 330, -;;; Boston, MA 02111-1307 USA -;;; -;;; 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. -;;; If you do not wish that, delete this exception notice. - -;;; Commentary: - -;;; Implementation of SRFI-16. `case-lambda' is a syntactic form -;;; which permits writing functions acting different according to the -;;; number of arguments passed. -;;; -;;; The syntax of the `case-lambda' form is defined in the following -;;; EBNF grammar. -;;; -;;; -;;; --> (case-lambda ) -;;; -;;; --> ( *) -;;; -;;; --> (*) -;;; | (* . ) -;;; | -;;; -;;; The value returned by a `case-lambda' form is a procedure which -;;; matches the number of actual arguments against the signatures in -;;; the various clauses, in order. The first matching clause is -;;; selected, the corresponding values from the actual parameter list -;;; are bound to the variable names in the clauses and the body of the -;;; clause is evaluated. +;; Copyright (C) 2001, 2002 Free Software Foundation, Inc. +;; +;; 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 +;; the Free Software Foundation, Inc., 59 Temple Place, Suite 330, +;; Boston, MA 02111-1307 USA +;; +;; 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. +;; If you do not wish that, delete this exception notice. ;;; Author: Martin Grabmueller +;;; Commentary: + +;; Implementation of SRFI-16. `case-lambda' is a syntactic form +;; which permits writing functions acting different according to the +;; number of arguments passed. +;; +;; The syntax of the `case-lambda' form is defined in the following +;; EBNF grammar. +;; +;; +;; --> (case-lambda ) +;; +;; --> ( *) +;; +;; --> (*) +;; | (* . ) +;; | +;; +;; The value returned by a `case-lambda' form is a procedure which +;; matches the number of actual arguments against the signatures in +;; the various clauses, in order. The first matching clause is +;; selected, the corresponding values from the actual parameter list +;; are bound to the variable names in the clauses and the body of the +;; clause is evaluated. + ;;; Code: + (define-module (srfi srfi-16) :export-syntax (case-lambda)) @@ -120,7 +121,7 @@ (define (gen-temps vars args-name) (let lp ((v vars) (i 0)) (cond ((null? v) '()) - ((pair? v) + ((pair? v) (cons `(,(car v) ,(accessor args-name i #f)) (lp (cdr v) (+ i 1)))) (else `((,v ,(accessor args-name i #t))))))) @@ -146,3 +147,5 @@ (let ((,length-name (length ,args-name))) (cond ,@(gen-clauses clauses length-name args-name)))))) proc))) + +;;; srfi-16.scm ends here diff --git a/srfi/srfi-17.scm b/srfi/srfi-17.scm index 27538a17d..4ec71c595 100644 --- a/srfi/srfi-17.scm +++ b/srfi/srfi-17.scm @@ -1,46 +1,47 @@ -;;;; srfi-17.scm --- SRFI-17 procedures for Guile +;;; srfi-17.scm --- Generalized set! -;;; Copyright (C) 2001 Free Software Foundation, Inc. -;;; Originally by Matthias Koeppe -;;; -;;; 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 -;;; the Free Software Foundation, Inc., 59 Temple Place, Suite 330, -;;; Boston, MA 02111-1307 USA -;;; -;;; 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. -;;; If you do not wish that, delete this exception notice. +;; Copyright (C) 2001, 2002 Free Software Foundation, Inc. +;; +;; 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 +;; the Free Software Foundation, Inc., 59 Temple Place, Suite 330, +;; Boston, MA 02111-1307 USA +;; +;; 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. +;; If you do not wish that, delete this exception notice. + +;;; Author: Matthias Koeppe ;;; Commentary: @@ -61,6 +62,8 @@ ;; setter") via the `getter-with-setter' procedure. This procedure is ;; also specified in the SRFI. Using it avoids the described ;; problems. +;; +;; This module is fully documented in the Guile Reference Manual. ;;; Code: @@ -123,3 +126,5 @@ (define cddddr (getter-with-setter cddddr (compose-setter set-cdr! cdddr))) (define string-ref (getter-with-setter string-ref string-set!)) (define vector-ref (getter-with-setter vector-ref vector-set!)) + +;;; srfi-17.scm ends here diff --git a/srfi/srfi-19.scm b/srfi/srfi-19.scm index efdd5f76e..d828b0443 100644 --- a/srfi/srfi-19.scm +++ b/srfi/srfi-19.scm @@ -1,51 +1,51 @@ -;;; srfi-19.scm --- SRFI-19 procedures for Guile -;;; -;;; Copyright (C) 2001, 2002 Free Software Foundation, Inc. -;;; -;;; 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 -;;; the Free Software Foundation, Inc., 59 Temple Place, Suite 330, -;;; Boston, MA 02111-1307 USA -;;; -;;; 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. -;;; If you do not wish that, delete this exception notice. +;;; srfi-19.scm --- Time/Date Library + +;; Copyright (C) 2001, 2002 Free Software Foundation, Inc. +;; +;; 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 +;; the Free Software Foundation, Inc., 59 Temple Place, Suite 330, +;; Boston, MA 02111-1307 USA +;; +;; 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. +;; If you do not wish that, delete this exception notice. + +;;; Author: Rob Browning +;;; Originally from SRFI reference implementation by Will Fitzgerald. ;;; Commentary: -;; Originally from SRFI reference implementation by Will Fitzgerald. -;; Ported to Guile by Rob Browning . -;; ;; This module is fully documented in the Guile Reference Manual. ;;; Code: diff --git a/srfi/srfi-2.scm b/srfi/srfi-2.scm index 9febda017..8fe692efc 100644 --- a/srfi/srfi-2.scm +++ b/srfi/srfi-2.scm @@ -1,48 +1,56 @@ -;;;; srfi-2.scm --- SRFI-2 procedures for Guile -;;;; -;;;; Copyright (C) 2001 Free Software Foundation, Inc. -;;;; -;;;; 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 -;;;; the Free Software Foundation, Inc., 59 Temple Place, Suite 330, -;;;; Boston, MA 02111-1307 USA -;;;; -;;;; 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. -;;;; If you do not wish that, delete this exception notice. +;;; srfi-2.scm --- and-let* + +;; Copyright (C) 2001, 2002 Free Software Foundation, Inc. +;; +;; 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 +;; the Free Software Foundation, Inc., 59 Temple Place, Suite 330, +;; Boston, MA 02111-1307 USA +;; +;; 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. +;; If you do not wish that, delete this exception notice. + +;;; Commentary: + +;; This module is fully documented in the Guile Reference Manual. + +;;; Code: (define-module (srfi srfi-2) :use-module (ice-9 and-let-star) :re-export-syntax (and-let*)) (cond-expand-provide (current-module) '(srfi-2)) + +;;; srfi-2.scm ends here diff --git a/srfi/srfi-4.scm b/srfi/srfi-4.scm index 134ac5875..44aaade91 100644 --- a/srfi/srfi-4.scm +++ b/srfi/srfi-4.scm @@ -1,54 +1,55 @@ -;;;; srfi-4.scm --- Homogeneous numeric vector datatypes. -;;;; -;;;; Copyright (C) 2001 Free Software Foundation, Inc. -;;;; -;;;; 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 -;;;; the Free Software Foundation, Inc., 59 Temple Place, Suite 330, -;;;; Boston, MA 02111-1307 USA -;;;; -;;;; 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. -;;;; If you do not wish that, delete this exception notice. +;;; srfi-4.scm --- Homogeneous Numeric Vector Datatypes + +;; Copyright (C) 2001, 2002 Free Software Foundation, Inc. +;; +;; 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 +;; the Free Software Foundation, Inc., 59 Temple Place, Suite 330, +;; Boston, MA 02111-1307 USA +;; +;; 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. +;; If you do not wish that, delete this exception notice. + +;;; Author: Martin Grabmueller ;;; Commentary: -;;; This module implements homogeneous numeric vectors as defined in SRFI-4. +;; This module implements homogeneous numeric vectors as defined in SRFI-4. +;; This module is fully documented in the Guile Reference Manual. ;;; Code: -;;; Author: Martin Grabmueller - (define-module (srfi srfi-4) :export ( ;;; Unsigned 8-bit vectors. @@ -157,7 +158,7 @@ (else (error "syntax error in #u...() vector literal")))) (error "syntax error in #u...() vector literal"))) - + ;; Reader extension for #s8(), #s16(), #s32() and #s64() vectors. ;; @@ -190,10 +191,12 @@ (else (error "syntax error in #s...() vector literal")))) (error "syntax error in #s...() vector literal"))) - + ;; Install the hash extensions. ;; (read-hash-extend #\f hash-f) (read-hash-extend #\u hash-u) (read-hash-extend #\s hash-s) + +;;; srfi-4.scm ends here diff --git a/srfi/srfi-6.scm b/srfi/srfi-6.scm index 216e4875a..5b6187ad5 100644 --- a/srfi/srfi-6.scm +++ b/srfi/srfi-6.scm @@ -1,45 +1,51 @@ -;;;; srfi-6.scm --- SRFI-6 procedures for Guile -;;;; -;;;; Copyright (C) 2001 Free Software Foundation, Inc. -;;;; -;;;; 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 -;;;; the Free Software Foundation, Inc., 59 Temple Place, Suite 330, -;;;; Boston, MA 02111-1307 USA -;;;; -;;;; 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. -;;;; If you do not wish that, delete this exception notice. +;;; srfi-6.scm --- Basic String Ports + +;; Copyright (C) 2001, 2002 Free Software Foundation, Inc. +;; +;; 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 +;; the Free Software Foundation, Inc., 59 Temple Place, Suite 330, +;; Boston, MA 02111-1307 USA +;; +;; 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. +;; If you do not wish that, delete this exception notice. + +;;; Commentary: + +;; This module is fully documented in the Guile Reference Manual. + +;;; Code: (define-module (srfi srfi-6)) @@ -47,3 +53,5 @@ ;; is needed, and this file is just a placeholder. (cond-expand-provide (current-module) '(srfi-6)) + +;;; srfi-6.scm ends here diff --git a/srfi/srfi-8.scm b/srfi/srfi-8.scm index 85b31830e..21e141066 100644 --- a/srfi/srfi-8.scm +++ b/srfi/srfi-8.scm @@ -1,48 +1,56 @@ -;;;; srfi-8.scm --- SRFI-8 procedures for Guile +;;; srfi-8.scm --- receive -;;; Copyright (C) 2000, 2001 Free Software Foundation, Inc. -;;; -;;; 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 -;;; the Free Software Foundation, Inc., 59 Temple Place, Suite 330, -;;; Boston, MA 02111-1307 USA -;;; -;;; 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. -;;; If you do not wish that, delete this exception notice. +;; Copyright (C) 2000, 2001, 2002 Free Software Foundation, Inc. +;; +;; 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 +;; the Free Software Foundation, Inc., 59 Temple Place, Suite 330, +;; Boston, MA 02111-1307 USA +;; +;; 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. +;; If you do not wish that, delete this exception notice. + +;;; Commentary: + +;; This module is fully documented in the Guile Reference Manual. + +;;; Code: (define-module (srfi srfi-8) :use-module (ice-9 receive) :re-export-syntax (receive)) (cond-expand-provide (current-module) '(srfi-8)) + +;;; srfi-8.scm ends here diff --git a/srfi/srfi-9.scm b/srfi/srfi-9.scm index b36b11f4e..5a6591e5b 100644 --- a/srfi/srfi-9.scm +++ b/srfi/srfi-9.scm @@ -1,85 +1,85 @@ -;;;; srfi-9.scm --- SRFI-9 procedures for Guile -;;;; -;;;; Copyright (C) 2001 Free Software Foundation, Inc. -;;;; -;;;; 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 -;;;; the Free Software Foundation, Inc., 59 Temple Place, Suite 330, -;;;; Boston, MA 02111-1307 USA -;;;; -;;;; 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. -;;;; If you do not wish that, delete this exception notice. +;;; srfi-9.scm --- define-record-type + +;; Copyright (C) 2001, 2002 Free Software Foundation, Inc. +;; +;; 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 +;; the Free Software Foundation, Inc., 59 Temple Place, Suite 330, +;; Boston, MA 02111-1307 USA +;; +;; 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. +;; If you do not wish that, delete this exception notice. ;;; Commentary: -;;; This module exports the syntactic form `define-record-type', which -;;; is the means for creating record types defined in SRFI-9. -;;; -;;; The syntax of a record type definition is: -;;; -;;; -;;; -> (define-record-type -;;; ( ...) -;;; -;;; ...) -;;; -;;; -> ( ) -;;; -> ( ) -;;; -;;; -> -;;; <... name> -> -;;; -;;; Usage example: -;;; -;;; guile> (use-modules (srfi srfi-9)) -;;; guile> (define-record-type :foo (make-foo x) foo? -;;; (x get-x) (y get-y set-y!)) -;;; guile> (define f (make-foo 1)) -;;; guile> f -;;; #<:foo x: 1 y: #f> -;;; guile> (get-x f) -;;; 1 -;;; guile> (set-y! f 2) -;;; 2 -;;; guile> (get-y f) -;;; 2 -;;; guile> f -;;; #<:foo x: 1 y: 2> -;;; guile> (foo? f) -;;; #t -;;; guile> (foo? 1) -;;; #f +;; This module exports the syntactic form `define-record-type', which +;; is the means for creating record types defined in SRFI-9. +;; +;; The syntax of a record type definition is: +;; +;; +;; -> (define-record-type +;; ( ...) +;; +;; ...) +;; +;; -> ( ) +;; -> ( ) +;; +;; -> +;; <... name> -> +;; +;; Usage example: +;; +;; guile> (use-modules (srfi srfi-9)) +;; guile> (define-record-type :foo (make-foo x) foo? +;; (x get-x) (y get-y set-y!)) +;; guile> (define f (make-foo 1)) +;; guile> f +;; #<:foo x: 1 y: #f> +;; guile> (get-x f) +;; 1 +;; guile> (set-y! f 2) +;; 2 +;; guile> (get-y f) +;; 2 +;; guile> f +;; #<:foo x: 1 y: 2> +;; guile> (foo? f) +;; #t +;; guile> (foo? 1) +;; #f ;;; Code: @@ -112,3 +112,5 @@ (else (error "invalid field spec " spec)))) field-specs))) + +;;; srfi-9.scm ends here From cdfc4a7ddd5e4ce0d48716e17e0a0a11de413608 Mon Sep 17 00:00:00 2001 From: Thien-Thi Nguyen Date: Thu, 28 Mar 2002 01:41:35 +0000 Subject: [PATCH 129/131] *** empty log message *** --- srfi/ChangeLog | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/srfi/ChangeLog b/srfi/ChangeLog index 1200424b3..af8ccb223 100644 --- a/srfi/ChangeLog +++ b/srfi/ChangeLog @@ -1,3 +1,10 @@ +2002-03-27 Thien-Thi Nguyen + + * srfi-1.scm, srfi-13.scm, srfi-17.scm, srfi-4.scm, srfi-9.scm, + srfi-10.scm, srfi-14.scm, srfi-19.scm, srfi-6.scm, srfi-11.scm, + srfi-16.scm, srfi-2.scm, srfi-8.scm: Update copyright. + Point to manual in commentary; nfc. + 2002-03-24 Marius Vollmer * Makefile.am (.c.x): Pass "-o $@" to guile-snarf. From e8f1ff7188f658696b3926e74f628f2fcafb8cfc Mon Sep 17 00:00:00 2001 From: Neil Jerram Date: Fri, 29 Mar 2002 20:25:24 +0000 Subject: [PATCH 130/131] Minor changes for syncing with stable branch. --- doc/ref/ChangeLog | 10 ++++++++++ doc/ref/data-rep.texi | 6 +++--- doc/ref/posix.texi | 2 -- doc/ref/scheme-compound.texi | 4 ++-- doc/ref/scheme-evaluation.texi | 3 --- doc/ref/scheme-procedures.texi | 21 +++++++++++---------- 6 files changed, 26 insertions(+), 20 deletions(-) diff --git a/doc/ref/ChangeLog b/doc/ref/ChangeLog index 501f3c4a6..765348f94 100644 --- a/doc/ref/ChangeLog +++ b/doc/ref/ChangeLog @@ -1,3 +1,13 @@ +2002-03-29 Neil Jerram + + * posix.texi (Ports and File Descriptors), scheme-evaluation.texi + (Fly Evaluation): Remove vgone markers for close-all-ports-except, + eval2 and read-and-eval!. + + * data-rep.texi (Describing a New Type), scheme-compound.texi + (Append/Reverse), scheme-procedures.texi (Internal Macros): + Trivial updates to sync with stable branch. + 2002-03-27 Neil Jerram * scheme-compound.texi (List Searching): Remove docs for diff --git a/doc/ref/data-rep.texi b/doc/ref/data-rep.texi index 6e0dc1ae0..30fcee6c6 100644 --- a/doc/ref/data-rep.texi +++ b/doc/ref/data-rep.texi @@ -46,7 +46,7 @@ @c essay @sp 10 @c essay @comment The title is printed in a large font. @c essay @title Data Representation in Guile -@c essay @subtitle $Id: data-rep.texi,v 1.6 2002-03-12 21:08:57 ossau Exp $ +@c essay @subtitle $Id: data-rep.texi,v 1.7 2002-03-29 20:25:23 ossau Exp $ @c essay @subtitle For use with Guile @value{VERSION} @c essay @author Jim Blandy @c essay @author Free Software Foundation @@ -1410,8 +1410,8 @@ refers to. The default smob mark function is to not mark any data. @xref{Garbage Collecting Smobs}, for more details. @item free -Guile will apply this function to each instance of the new type it -could not find any live pointers to. The function should release all +Guile will apply this function to each instance of the new type it could +not find any live pointers to. The function should release all resources held by the object and return the number of bytes released. This is analogous to the Java finalization method-- it is invoked at an unspecified time (when garbage collection occurs) after the object diff --git a/doc/ref/posix.texi b/doc/ref/posix.texi index 724015f68..4b1e6a7b9 100644 --- a/doc/ref/posix.texi +++ b/doc/ref/posix.texi @@ -396,8 +396,6 @@ the port was opened, since modes such as "append" which are used only during port creation are not retained. @end deffn -@vgone{close-all-ports-except,1.6} - @deffn {Scheme Procedure} port-for-each proc @deffnx {C Function} scm_port_for_each (proc) Apply @var{proc} to each port in the Guile port table diff --git a/doc/ref/scheme-compound.texi b/doc/ref/scheme-compound.texi index cff67d012..75623563b 100644 --- a/doc/ref/scheme-compound.texi +++ b/doc/ref/scheme-compound.texi @@ -344,7 +344,7 @@ if the last argument is not a proper list. @deffn {Scheme Procedure} append! . lists @deffnx {C Function} scm_append_x (lists) A destructive version of @code{append} (@pxref{Pairs and -Lists,,,r5rs, The Revised^5 Report on Scheme}). The cdr field +lists,,,r5rs, The Revised^5 Report on Scheme}). The cdr field of each list's final pair is changed to point to the head of the next list, so no consing is performed. Return a pointer to the mutated list. @@ -360,7 +360,7 @@ in reverse order. @c NJFIXME explain new_tail @deffn {Scheme Procedure} reverse! lst [new_tail] @deffnx {C Function} scm_reverse_x (lst, new_tail) -A destructive version of @code{reverse} (@pxref{Pairs and Lists,,,r5rs, +A destructive version of @code{reverse} (@pxref{Pairs and lists,,,r5rs, The Revised^5 Report on Scheme}). The cdr of each cell in @var{lst} is modified to point to the previous list element. Return a pointer to the head of the reversed list. diff --git a/doc/ref/scheme-evaluation.texi b/doc/ref/scheme-evaluation.texi index 059e664be..fbfcd87a8 100644 --- a/doc/ref/scheme-evaluation.texi +++ b/doc/ref/scheme-evaluation.texi @@ -235,9 +235,6 @@ Evaluate @var{exp} in the top-level environment specified by the current module. @end deffn -@vgone{eval2,1.6} -@vgone{read-and-eval!,1.6} - @node Loading @section Loading Scheme Code from File diff --git a/doc/ref/scheme-procedures.texi b/doc/ref/scheme-procedures.texi index 8ef23737e..3da356f4f 100644 --- a/doc/ref/scheme-procedures.texi +++ b/doc/ref/scheme-procedures.texi @@ -727,25 +727,26 @@ all implemented as mmacros.) @deffn {Scheme Procedure} procedure->syntax code @deffnx {C Function} scm_makacro (code) -Return a @dfn{macro} which, when a symbol defined to this value -appears as the first symbol in an expression, returns the -result of applying @var{code} to the expression and the -environment. +Return a macro which, when a symbol defined to this value appears as the +first symbol in an expression, returns the result of applying @var{code} +to the expression and the environment. @end deffn @deffn {Scheme Procedure} procedure->macro code @deffnx {C Function} scm_makmacro (code) -Return a @dfn{macro} which, when a symbol defined to this value -appears as the first symbol in an expression, evaluates the -result of applying @var{code} to the expression and the -environment. For example: +Return a macro which, when a symbol defined to this value appears as the +first symbol in an expression, evaluates the result of applying +@var{code} to the expression and the environment. For example: @lisp (define trace (procedure->macro - (lambda (x env) `(set! ,(cadr x) (tracef ,(cadr x) ',(cadr x)))))) + (lambda (x env) + `(set! ,(cadr x) (tracef ,(cadr x) ',(cadr x)))))) -(trace @i{foo}) @equiv{} (set! @i{foo} (tracef @i{foo} '@i{foo})). +(trace @i{foo}) +@equiv{} +(set! @i{foo} (tracef @i{foo} '@i{foo})). @end lisp @end deffn From 3f679f625bc3b542c1b48da75b5bc040e6307220 Mon Sep 17 00:00:00 2001 From: Thien-Thi Nguyen Date: Sun, 31 Mar 2002 01:12:57 +0000 Subject: [PATCH 131/131] Initial revision --- am/maintainer-dirs | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 am/maintainer-dirs diff --git a/am/maintainer-dirs b/am/maintainer-dirs new file mode 100644 index 000000000..b5ec2998a --- /dev/null +++ b/am/maintainer-dirs @@ -0,0 +1,37 @@ +## am/maintainer-dirs --- define workbook and mscripts vars + +## Copyright (C) 2002 Free Software Foundation +## +## This file is part of GUILE. +## +## GUILE 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. +## +## GUILE 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 GUILE; see the file COPYING. If not, write +## to the Free Software Foundation, Inc., 59 Temple Place, Suite +## 330, Boston, MA 02111-1307 USA + +## Commentary: + +## This fragment defines two variables: workbook and mscripts. +## These are only defined in MAINTAINER_MODE. +## It can be included in any Makefile.am by adding the line: +## include $(top_srcdir)/am/maintainer-dirs +## See $(workbook)/build/maintainer-dirs.text for more info. + +## Code: + +if MAINTAINER_MODE +workbook = $(top_srcdir_absolute)/../workbook +mscripts = $(top_srcdir_absolute)/../scripts +endif + +## am/maintainer-dirs ends here