mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-04-30 03:40:34 +02:00
move srfi-1 and srfi-60 C impl to libguile, without public C api
* libguile/srfi-1.c: * libguile/srfi-1.h: * libguile/srfi-60.c: * libguile/srfi-60.h: * libguile/ChangeLog-srfi: Move here, from the srfi/ dir. The C API is internal. Add API to register the extensions, called by init.c. * libguile/init.c: Verily, register srfi extensions. * libguile/Makefile.am: Add srfi files. * module/srfi/srfi-1.scm: * module/srfi/srfi-60.scm: Update load-extension invocation. * Makefile.am: * configure.ac: Remove srfi/ dir. * test-suite/standalone/Makefile.am: * test-suite/standalone/test-srfi-1.c: Remove srfi-1 C test, we don't support this API any more.
This commit is contained in:
parent
4453f887ed
commit
37710f7e8f
17 changed files with 182 additions and 432 deletions
|
@ -25,7 +25,7 @@
|
|||
AUTOMAKE_OPTIONS = 1.10
|
||||
|
||||
SUBDIRS = lib meta libguile guile-readline emacs \
|
||||
srfi examples test-suite benchmark-suite am \
|
||||
examples test-suite benchmark-suite am \
|
||||
module doc
|
||||
|
||||
libguileincludedir = $(pkgincludedir)/$(GUILE_EFFECTIVE_VERSION)
|
||||
|
|
13
configure.ac
13
configure.ac
|
@ -1547,18 +1547,6 @@ AC_SUBST(LIBGUILE_INTERFACE_REVISION)
|
|||
AC_SUBST(LIBGUILE_INTERFACE_AGE)
|
||||
AC_SUBST(LIBGUILE_INTERFACE)
|
||||
|
||||
AC_SUBST(LIBGUILE_SRFI_SRFI_1_MAJOR)
|
||||
AC_SUBST(LIBGUILE_SRFI_SRFI_1_INTERFACE_CURRENT)
|
||||
AC_SUBST(LIBGUILE_SRFI_SRFI_1_INTERFACE_REVISION)
|
||||
AC_SUBST(LIBGUILE_SRFI_SRFI_1_INTERFACE_AGE)
|
||||
AC_SUBST(LIBGUILE_SRFI_SRFI_1_INTERFACE)
|
||||
|
||||
AC_SUBST(LIBGUILE_SRFI_SRFI_60_MAJOR)
|
||||
AC_SUBST(LIBGUILE_SRFI_SRFI_60_INTERFACE_CURRENT)
|
||||
AC_SUBST(LIBGUILE_SRFI_SRFI_60_INTERFACE_REVISION)
|
||||
AC_SUBST(LIBGUILE_SRFI_SRFI_60_INTERFACE_AGE)
|
||||
AC_SUBST(LIBGUILE_SRFI_SRFI_60_INTERFACE)
|
||||
|
||||
AC_SUBST(LIBGUILE_I18N_MAJOR)
|
||||
AC_SUBST(LIBGUILE_I18N_INTERFACE_CURRENT)
|
||||
AC_SUBST(LIBGUILE_I18N_INTERFACE_REVISION)
|
||||
|
@ -1609,7 +1597,6 @@ AC_CONFIG_FILES([
|
|||
examples/Makefile
|
||||
libguile/Makefile
|
||||
libguile/version.h
|
||||
srfi/Makefile
|
||||
guile-readline/Makefile
|
||||
test-suite/Makefile
|
||||
test-suite/standalone/Makefile
|
||||
|
|
|
@ -189,9 +189,11 @@ libguile_@GUILE_EFFECTIVE_VERSION@_la_SOURCES = \
|
|||
smob.c \
|
||||
sort.c \
|
||||
srcprop.c \
|
||||
srfi-1.c \
|
||||
srfi-4.c \
|
||||
srfi-13.c \
|
||||
srfi-14.c \
|
||||
srfi-4.c \
|
||||
srfi-60.c \
|
||||
stackchk.c \
|
||||
stacks.c \
|
||||
stime.c \
|
||||
|
@ -284,9 +286,11 @@ DOT_X_FILES = \
|
|||
smob.x \
|
||||
sort.x \
|
||||
srcprop.x \
|
||||
srfi-1.x \
|
||||
srfi-4.x \
|
||||
srfi-13.x \
|
||||
srfi-14.x \
|
||||
srfi-4.x \
|
||||
srfi-60.x \
|
||||
stackchk.x \
|
||||
stacks.x \
|
||||
stime.x \
|
||||
|
@ -383,9 +387,11 @@ DOT_DOC_FILES = \
|
|||
smob.doc \
|
||||
sort.doc \
|
||||
srcprop.doc \
|
||||
srfi-1.doc \
|
||||
srfi-4.doc \
|
||||
srfi-13.doc \
|
||||
srfi-14.doc \
|
||||
srfi-4.doc \
|
||||
srfi-60.doc \
|
||||
stackchk.doc \
|
||||
stacks.doc \
|
||||
stime.doc \
|
||||
|
@ -557,9 +563,11 @@ modinclude_HEADERS = \
|
|||
socket.h \
|
||||
sort.h \
|
||||
srcprop.h \
|
||||
srfi-1.h \
|
||||
srfi-4.h \
|
||||
srfi-13.h \
|
||||
srfi-14.h \
|
||||
srfi-4.h \
|
||||
srfi-60.h \
|
||||
stackchk.h \
|
||||
stacks.h \
|
||||
stime.h \
|
||||
|
|
|
@ -115,8 +115,11 @@
|
|||
#include "libguile/stacks.h"
|
||||
#include "libguile/stime.h"
|
||||
#include "libguile/strings.h"
|
||||
#include "libguile/srfi-1.h"
|
||||
#include "libguile/srfi-4.h"
|
||||
#include "libguile/srfi-13.h"
|
||||
#include "libguile/srfi-14.h"
|
||||
#include "libguile/srfi-60.h"
|
||||
#include "libguile/strorder.h"
|
||||
#include "libguile/strports.h"
|
||||
#include "libguile/struct.h"
|
||||
|
@ -134,7 +137,6 @@
|
|||
#include "libguile/guardians.h"
|
||||
#include "libguile/extensions.h"
|
||||
#include "libguile/uniform.h"
|
||||
#include "libguile/srfi-4.h"
|
||||
#include "libguile/deprecated.h"
|
||||
|
||||
#include "libguile/init.h"
|
||||
|
@ -454,6 +456,8 @@ scm_i_init_guile (SCM_STACKITEM *base)
|
|||
scm_bootstrap_programs ();
|
||||
scm_bootstrap_vm ();
|
||||
scm_register_foreign ();
|
||||
scm_register_srfi_1 ();
|
||||
scm_register_srfi_60 ();
|
||||
|
||||
scm_init_strings (); /* Requires array-handle */
|
||||
scm_init_struct (); /* Requires strings */
|
||||
|
|
|
@ -19,17 +19,25 @@
|
|||
* 02110-1301 USA
|
||||
*/
|
||||
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
# include <config.h>
|
||||
#endif
|
||||
|
||||
#include <libguile.h>
|
||||
#include "libguile/_scm.h"
|
||||
#include "libguile/eq.h"
|
||||
|
||||
#include "libguile/validate.h"
|
||||
#include "libguile/list.h"
|
||||
#include "libguile/eval.h"
|
||||
#include "libguile/srfi-1.h"
|
||||
|
||||
#include <stdarg.h>
|
||||
|
||||
#include "srfi-1.h"
|
||||
|
||||
/* The intent of this file was to gradually replace those Scheme
|
||||
* procedures in srfi-1.scm that extend core primitive procedures,
|
||||
* so that using srfi-1 won't have performance penalties.
|
||||
* so that using srfi-1 wouldn't have performance penalties.
|
||||
*
|
||||
* However, we now prefer to write these procedures in Scheme, let the compiler
|
||||
* optimize them, and have the VM execute them efficiently.
|
||||
|
@ -1585,12 +1593,20 @@ scm_srfi1_xcons (SCM d, SCM a)
|
|||
}
|
||||
|
||||
|
||||
void
|
||||
scm_register_srfi_1 (void)
|
||||
{
|
||||
scm_c_register_extension ("libguile-" SCM_EFFECTIVE_VERSION,
|
||||
"scm_init_srfi_1",
|
||||
(scm_t_extension_init_func)scm_init_srfi_1, NULL);
|
||||
}
|
||||
|
||||
void
|
||||
scm_init_srfi_1 (void)
|
||||
{
|
||||
SCM the_root_module = scm_lookup_closure_module (SCM_BOOL_F);
|
||||
#ifndef SCM_MAGIC_SNARFER
|
||||
#include "srfi/srfi-1.x"
|
||||
#include "libguile/srfi-1.x"
|
||||
#endif
|
||||
scm_c_extend_primitive_generic
|
||||
(SCM_VARIABLE_REF (scm_c_module_lookup (the_root_module, "map")),
|
84
libguile/srfi-1.h
Normal file
84
libguile/srfi-1.h
Normal file
|
@ -0,0 +1,84 @@
|
|||
/* srfi-1.h --- SRFI-1 procedures for Guile
|
||||
*
|
||||
* Copyright (C) 2002, 2003, 2005, 2006, 2010 Free Software Foundation, Inc.
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public License
|
||||
* as published by the Free Software Foundation; either version 3 of
|
||||
* the License, or (at your option) any later version.
|
||||
*
|
||||
* This library 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
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
|
||||
* 02110-1301 USA
|
||||
*/
|
||||
|
||||
|
||||
#ifndef SCM_SRFI_1_H
|
||||
#define SCM_SRFI_1_H
|
||||
|
||||
#include "libguile/__scm.h"
|
||||
|
||||
SCM_INTERNAL SCM scm_srfi1_alist_copy (SCM alist);
|
||||
SCM_INTERNAL SCM scm_srfi1_append_reverse (SCM revhead, SCM tail);
|
||||
SCM_INTERNAL SCM scm_srfi1_append_reverse_x (SCM revhead, SCM tail);
|
||||
SCM_INTERNAL SCM scm_srfi1_break (SCM pred, SCM lst);
|
||||
SCM_INTERNAL SCM scm_srfi1_break_x (SCM pred, SCM lst);
|
||||
SCM_INTERNAL SCM scm_srfi1_car_plus_cdr (SCM pair);
|
||||
SCM_INTERNAL SCM scm_srfi1_concatenate (SCM lstlst);
|
||||
SCM_INTERNAL SCM scm_srfi1_concatenate_x (SCM lstlst);
|
||||
SCM_INTERNAL SCM scm_srfi1_count (SCM pred, SCM list1, SCM rest);
|
||||
SCM_INTERNAL SCM scm_srfi1_delete (SCM x, SCM lst, SCM pred);
|
||||
SCM_INTERNAL SCM scm_srfi1_delete_x (SCM x, SCM lst, SCM pred);
|
||||
SCM_INTERNAL SCM scm_srfi1_delete_duplicates (SCM lst, SCM pred);
|
||||
SCM_INTERNAL SCM scm_srfi1_delete_duplicates_x (SCM lst, SCM pred);
|
||||
SCM_INTERNAL SCM scm_srfi1_drop_right (SCM lst, SCM n);
|
||||
SCM_INTERNAL SCM scm_srfi1_drop_right_x (SCM lst, SCM n);
|
||||
SCM_INTERNAL SCM scm_srfi1_drop_while (SCM pred, SCM lst);
|
||||
SCM_INTERNAL SCM scm_srfi1_eighth (SCM lst);
|
||||
SCM_INTERNAL SCM scm_srfi1_fifth (SCM lst);
|
||||
SCM_INTERNAL SCM scm_srfi1_filter_map (SCM proc, SCM list1, SCM rest);
|
||||
SCM_INTERNAL SCM scm_srfi1_find (SCM pred, SCM lst);
|
||||
SCM_INTERNAL SCM scm_srfi1_find_tail (SCM pred, SCM lst);
|
||||
SCM_INTERNAL SCM scm_srfi1_fold (SCM proc, SCM init, SCM list1, SCM rest);
|
||||
SCM_INTERNAL SCM scm_srfi1_last (SCM lst);
|
||||
SCM_INTERNAL SCM scm_srfi1_length_plus (SCM lst);
|
||||
SCM_INTERNAL SCM scm_srfi1_lset_adjoin (SCM equal, SCM lst, SCM rest);
|
||||
SCM_INTERNAL SCM scm_srfi1_lset_difference_x (SCM equal, SCM lst, SCM rest);
|
||||
SCM_INTERNAL SCM scm_srfi1_list_copy (SCM lst);
|
||||
SCM_INTERNAL SCM scm_srfi1_list_index (SCM pred, SCM list1, SCM rest);
|
||||
SCM_INTERNAL SCM scm_srfi1_list_tabulate (SCM n, SCM proc);
|
||||
SCM_INTERNAL SCM scm_srfi1_map (SCM proc, SCM arg1, SCM args);
|
||||
SCM_INTERNAL SCM scm_srfi1_for_each (SCM proc, SCM arg1, SCM args);
|
||||
SCM_INTERNAL SCM scm_srfi1_member (SCM obj, SCM ls, SCM pred);
|
||||
SCM_INTERNAL SCM scm_srfi1_ninth (SCM lst);
|
||||
SCM_INTERNAL SCM scm_srfi1_assoc (SCM key, SCM alist, SCM pred);
|
||||
SCM_INTERNAL SCM scm_srfi1_not_pair_p (SCM obj);
|
||||
SCM_INTERNAL SCM scm_srfi1_partition (SCM pred, SCM list);
|
||||
SCM_INTERNAL SCM scm_srfi1_partition_x (SCM pred, SCM list);
|
||||
SCM_INTERNAL SCM scm_srfi1_reduce (SCM proc, SCM def, SCM lst);
|
||||
SCM_INTERNAL SCM scm_srfi1_reduce_right (SCM proc, SCM def, SCM lst);
|
||||
SCM_INTERNAL SCM scm_srfi1_remove (SCM pred, SCM list);
|
||||
SCM_INTERNAL SCM scm_srfi1_remove_x (SCM pred, SCM list);
|
||||
SCM_INTERNAL SCM scm_srfi1_seventh (SCM lst);
|
||||
SCM_INTERNAL SCM scm_srfi1_sixth (SCM lst);
|
||||
SCM_INTERNAL SCM scm_srfi1_span (SCM pred, SCM lst);
|
||||
SCM_INTERNAL SCM scm_srfi1_span_x (SCM pred, SCM lst);
|
||||
SCM_INTERNAL SCM scm_srfi1_split_at (SCM lst, SCM n);
|
||||
SCM_INTERNAL SCM scm_srfi1_split_at_x (SCM lst, SCM n);
|
||||
SCM_INTERNAL SCM scm_srfi1_take_x (SCM lst, SCM n);
|
||||
SCM_INTERNAL SCM scm_srfi1_take_right (SCM lst, SCM n);
|
||||
SCM_INTERNAL SCM scm_srfi1_take_while (SCM pred, SCM lst);
|
||||
SCM_INTERNAL SCM scm_srfi1_take_while_x (SCM pred, SCM lst);
|
||||
SCM_INTERNAL SCM scm_srfi1_tenth (SCM lst);
|
||||
SCM_INTERNAL SCM scm_srfi1_xcons (SCM d, SCM a);
|
||||
|
||||
SCM_INTERNAL void scm_register_srfi_1 (void);
|
||||
SCM_INTERNAL void scm_init_srfi_1 (void);
|
||||
|
||||
#endif /* SCM_SRFI_1_H */
|
|
@ -1,6 +1,6 @@
|
|||
/* srfi-60.c --- Integers as Bits
|
||||
*
|
||||
* Copyright (C) 2005, 2006, 2008 Free Software Foundation, Inc.
|
||||
* Copyright (C) 2005, 2006, 2008, 2010 Free Software Foundation, Inc.
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public License
|
||||
|
@ -18,12 +18,19 @@
|
|||
* 02110-1301 USA
|
||||
*/
|
||||
|
||||
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
# include <config.h>
|
||||
#endif
|
||||
|
||||
#include <libguile.h>
|
||||
#include <srfi/srfi-60.h>
|
||||
#include "libguile/_scm.h"
|
||||
#include "libguile/eq.h"
|
||||
|
||||
#include "libguile/validate.h"
|
||||
#include "libguile/numbers.h"
|
||||
|
||||
#include "libguile/srfi-60.h"
|
||||
|
||||
|
||||
SCM_DEFINE (scm_srfi60_log2_binary_factors, "log2-binary-factors", 1, 0, 0,
|
||||
|
@ -414,10 +421,18 @@ SCM_DEFINE (scm_srfi60_list_to_integer, "list->integer", 1, 0, 0,
|
|||
SCM_REGISTER_PROC (s_srfi60_booleans_to_integer, "booleans->integer", 0, 0, 1, scm_srfi60_list_to_integer);
|
||||
|
||||
|
||||
void
|
||||
scm_register_srfi_60 (void)
|
||||
{
|
||||
scm_c_register_extension ("libguile-" SCM_EFFECTIVE_VERSION,
|
||||
"scm_init_srfi_60",
|
||||
(scm_t_extension_init_func)scm_init_srfi_60, NULL);
|
||||
}
|
||||
|
||||
void
|
||||
scm_init_srfi_60 (void)
|
||||
{
|
||||
#ifndef SCM_MAGIC_SNARFER
|
||||
#include "srfi/srfi-60.x"
|
||||
#include "libguile/srfi-60.x"
|
||||
#endif
|
||||
}
|
37
libguile/srfi-60.h
Normal file
37
libguile/srfi-60.h
Normal file
|
@ -0,0 +1,37 @@
|
|||
/* srfi-60.h --- SRFI-60 procedures for Guile
|
||||
*
|
||||
* Copyright (C) 2005, 2006, 2010 Free Software Foundation, Inc.
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public License
|
||||
* as published by the Free Software Foundation; either version 3 of
|
||||
* the License, or (at your option) any later version.
|
||||
*
|
||||
* This library 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
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
|
||||
* 02110-1301 USA
|
||||
*/
|
||||
|
||||
|
||||
#ifndef SCM_SRFI_60_H
|
||||
#define SCM_SRFI_60_H
|
||||
|
||||
#include "libguile/__scm.h"
|
||||
|
||||
SCM_INTERNAL SCM scm_srfi60_log2_binary_factors (SCM n);
|
||||
SCM_INTERNAL SCM scm_srfi60_copy_bit (SCM index, SCM n, SCM bit);
|
||||
SCM_INTERNAL SCM scm_srfi60_rotate_bit_field (SCM n, SCM count, SCM start, SCM end);
|
||||
SCM_INTERNAL SCM scm_srfi60_reverse_bit_field (SCM n, SCM start, SCM end);
|
||||
SCM_INTERNAL SCM scm_srfi60_integer_to_list (SCM n, SCM len);
|
||||
SCM_INTERNAL SCM scm_srfi60_list_to_integer (SCM lst);
|
||||
|
||||
SCM_INTERNAL void scm_register_srfi_60 (void);
|
||||
SCM_INTERNAL void scm_init_srfi_60 (void);
|
||||
|
||||
#endif /* SCM_SRFI_60_H */
|
|
@ -220,7 +220,8 @@
|
|||
|
||||
;; Load the compiled primitives from the shared library.
|
||||
;;
|
||||
(load-extension "libguile-srfi-srfi-1-v-4" "scm_init_srfi_1")
|
||||
(load-extension (string-append "libguile-" (effective-version))
|
||||
"scm_init_srfi_1")
|
||||
|
||||
|
||||
;;; Constructors
|
||||
|
|
|
@ -44,7 +44,8 @@
|
|||
logbit?
|
||||
ash))
|
||||
|
||||
(load-extension "libguile-srfi-srfi-60-v-3" "scm_init_srfi_60")
|
||||
(load-extension (string-append "libguile-" (effective-version))
|
||||
"scm_init_srfi_60")
|
||||
|
||||
(define bitwise-and logand)
|
||||
(define bitwise-ior logior)
|
||||
|
|
|
@ -1,70 +0,0 @@
|
|||
## Process this file with Automake to create Makefile.in
|
||||
##
|
||||
## Copyright (C) 2001, 2002, 2004, 2005, 2006, 2007, 2008, 2009, 2010 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 Lesser General Public License as
|
||||
## published by the Free Software Foundation; either version 3, 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 Lesser General Public License for more details.
|
||||
##
|
||||
## You should have received a copy of the GNU Lesser General Public
|
||||
## License along with GUILE; see the file COPYING.LESSER. If not,
|
||||
## write to the Free Software Foundation, Inc., 51 Franklin Street,
|
||||
## Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
include $(top_srcdir)/am/snarf
|
||||
|
||||
AUTOMAKE_OPTIONS = gnu
|
||||
|
||||
## Prevent automake from adding extra -I options
|
||||
DEFS = @DEFS@ @EXTRA_DEFS@
|
||||
## Check for headers in $(srcdir)/.., so that #include
|
||||
## <libguile/MUMBLE.h> will find MUMBLE.h in this dir when we're
|
||||
## building. Also look for Gnulib headers in `lib'.
|
||||
AM_CPPFLAGS = -I.. -I$(srcdir)/.. \
|
||||
-I$(top_srcdir)/lib -I$(top_builddir)/lib
|
||||
|
||||
AM_CFLAGS = $(GCC_CFLAGS)
|
||||
AM_LDFLAGS = $(GNU_LD_FLAGS)
|
||||
|
||||
# FIXME: should be libguile/srfi
|
||||
srfiincludedir = $(pkgincludedir)/$(GUILE_EFFECTIVE_VERSION)/srfi
|
||||
|
||||
# These headers are visible as <guile/srfi/mumble.h>
|
||||
srfiinclude_HEADERS = srfi-1.h srfi-60.h
|
||||
|
||||
lib_LTLIBRARIES = \
|
||||
libguile-srfi-srfi-1-v-@LIBGUILE_SRFI_SRFI_1_MAJOR@.la \
|
||||
libguile-srfi-srfi-60-v-@LIBGUILE_SRFI_SRFI_60_MAJOR@.la
|
||||
|
||||
BUILT_SOURCES = srfi-1.x srfi-60.x
|
||||
|
||||
libguile_srfi_srfi_1_v_@LIBGUILE_SRFI_SRFI_1_MAJOR@_la_SOURCES = srfi-1.c
|
||||
libguile_srfi_srfi_1_v_@LIBGUILE_SRFI_SRFI_1_MAJOR@_la_LIBADD = \
|
||||
$(top_builddir)/libguile/libguile-@GUILE_EFFECTIVE_VERSION@.la $(top_builddir)/lib/libgnu.la
|
||||
libguile_srfi_srfi_1_v_@LIBGUILE_SRFI_SRFI_1_MAJOR@_la_LDFLAGS = -no-undefined -export-dynamic -version-info @LIBGUILE_SRFI_SRFI_1_INTERFACE@
|
||||
|
||||
libguile_srfi_srfi_60_v_@LIBGUILE_SRFI_SRFI_60_MAJOR@_la_SOURCES = srfi-60.c
|
||||
libguile_srfi_srfi_60_v_@LIBGUILE_SRFI_SRFI_60_MAJOR@_la_LIBADD = \
|
||||
$(top_builddir)/libguile/libguile-@GUILE_EFFECTIVE_VERSION@.la $(top_builddir)/lib/libgnu.la
|
||||
libguile_srfi_srfi_60_v_@LIBGUILE_SRFI_SRFI_60_MAJOR@_la_LDFLAGS = -no-undefined -export-dynamic -version-info @LIBGUILE_SRFI_SRFI_60_INTERFACE@
|
||||
|
||||
EXTRA_DIST = ChangeLog-2008
|
||||
|
||||
MKDEP = gcc -M -MG $(DEFS) $(AM_CPPFLAGS) $(CPPFLAGS) $(CFLAGS)
|
||||
|
||||
snarfcppopts = $(DEFS) $(AM_CPPFLAGS) $(CPPFLAGS) $(CFLAGS)
|
||||
|
||||
SUFFIXES = .x
|
||||
|
||||
.c.x:
|
||||
$(AM_V_SNARF)$(GUILE_SNARF) -o $@ $< $(snarfcppopts)
|
||||
|
||||
CLEANFILES = *.x
|
100
srfi/README
100
srfi/README
|
@ -1,100 +0,0 @@
|
|||
This directory includes most of Guile's SRFI support. -*- text -*-
|
||||
|
||||
For more details about what SRFI means, and what the various numbers
|
||||
stand for, please refer to the SRFI homepage at
|
||||
|
||||
http://srfi.schemers.org
|
||||
|
||||
SRFI-0: cond-expand
|
||||
|
||||
Supported by default, no module required.
|
||||
|
||||
SRFI-1: List Library
|
||||
|
||||
A full toolbox of list processing procedures. (use-modules (srfi
|
||||
srfi-1)) will make them available for use.
|
||||
|
||||
SRFI-2: and-let*
|
||||
|
||||
(use-modules (srfi srfi-2)) to make and-let* available.
|
||||
|
||||
SRFI-4: Homogeneous numeric vector datatypes
|
||||
|
||||
SRFI-6: open-input-string, open-output-string and get-output-string
|
||||
|
||||
(use-modules (srfi srfi-6)) to make these available. (Currently,
|
||||
these procedures are available without using the module, but the
|
||||
procedures might be factored out of the core library in the
|
||||
future.)
|
||||
|
||||
SRFI-8: receive
|
||||
|
||||
(use-modules (srfi srfi-8)) to make receive available.
|
||||
|
||||
SRFI-9: define-record-type
|
||||
|
||||
A mechanism for defining record types. (use-modules (srfi srfi-9))
|
||||
makes this syntactic form available.
|
||||
|
||||
SRFI-10: #,()
|
||||
|
||||
The hash-comma reader extension. (use-modules (srfi srfi-10))
|
||||
activates the extension.
|
||||
|
||||
SRFI-11: let-values and let-values*
|
||||
|
||||
Syntactic extensions for handling multiple values. (use-modules
|
||||
(srfi srfi-11)) makes these syntactic forms available.
|
||||
|
||||
SRFI-13: string library
|
||||
|
||||
A lot of (more or less) useful string processing procedures.
|
||||
(use-modules (srfi srfi-13)) loads the procedures.
|
||||
|
||||
SRFI-14: character-set library
|
||||
|
||||
Character-set library. (use-modules (srfi srfi-14)) loads the
|
||||
procedures and standard variables.
|
||||
|
||||
SRFI-16: case-lambda
|
||||
|
||||
Syntactic form which permits writing functions acting different
|
||||
according to the number of arguments passed. (use-modules (srfi
|
||||
srfi-16)) makes this syntactic form available.
|
||||
|
||||
SRFI-17: Generalized set!
|
||||
|
||||
Guile supports generalized set! by default, but this module makes it
|
||||
fully compliant to the SRFI. (use-modules (srfi srfi-17)) loads the
|
||||
procedures.
|
||||
|
||||
SRFI-19: Time Data Types and Procedures
|
||||
|
||||
A lot of data types and procedures for dealing with times and
|
||||
dates. (use-modules (srfi srfi-19)) loads the procedures.
|
||||
|
||||
SRFI-23: Error reporting mechanism
|
||||
|
||||
Guile fully supports this SRFI. No need to load any module.
|
||||
|
||||
SRFI-26: Notation for Specializing Parameters without Currying
|
||||
|
||||
Exports: cut, cute.
|
||||
|
||||
SRFI-31: A special form for recursive evaluation
|
||||
|
||||
Exports: rec.
|
||||
|
||||
SRFI-34: Exception Handling for Programs
|
||||
|
||||
Exports: with-exception-handler, raise.
|
||||
Exports syntax: guard.
|
||||
|
||||
SRFI-39: Parameter objects
|
||||
|
||||
Exports: make-parameter, with-parameters*.
|
||||
Exports syntax: parameterize.
|
||||
|
||||
SRFI-55: require-extension
|
||||
|
||||
Supported by default, no module required.
|
|
@ -1,92 +0,0 @@
|
|||
#ifndef SCM_SRFI_1_H
|
||||
#define SCM_SRFI_1_H
|
||||
/* srfi-1.h --- SRFI-1 procedures for Guile
|
||||
*
|
||||
* Copyright (C) 2002, 2003, 2005, 2006 Free Software Foundation, Inc.
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public License
|
||||
* as published by the Free Software Foundation; either version 3 of
|
||||
* the License, or (at your option) any later version.
|
||||
*
|
||||
* This library 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
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
|
||||
* 02110-1301 USA
|
||||
*/
|
||||
|
||||
|
||||
/* SCM_SRFI1_API is a macro prepended to all function and data definitions
|
||||
which should be exported or imported in the resulting dynamic link
|
||||
library in the Win32 port. */
|
||||
|
||||
#if defined (SCM_SRFI1_IMPORT)
|
||||
# define SCM_SRFI1_API __declspec (dllimport) extern
|
||||
#elif defined (SCM_SRFI1_EXPORT) || defined (DLL_EXPORT)
|
||||
# define SCM_SRFI1_API __declspec (dllexport) extern
|
||||
#else
|
||||
# define SCM_SRFI1_API extern
|
||||
#endif
|
||||
|
||||
SCM_SRFI1_API SCM scm_srfi1_alist_copy (SCM alist);
|
||||
SCM_SRFI1_API SCM scm_srfi1_append_reverse (SCM revhead, SCM tail);
|
||||
SCM_SRFI1_API SCM scm_srfi1_append_reverse_x (SCM revhead, SCM tail);
|
||||
SCM_SRFI1_API SCM scm_srfi1_break (SCM pred, SCM lst);
|
||||
SCM_SRFI1_API SCM scm_srfi1_break_x (SCM pred, SCM lst);
|
||||
SCM_SRFI1_API SCM scm_srfi1_car_plus_cdr (SCM pair);
|
||||
SCM_SRFI1_API SCM scm_srfi1_concatenate (SCM lstlst);
|
||||
SCM_SRFI1_API SCM scm_srfi1_concatenate_x (SCM lstlst);
|
||||
SCM_SRFI1_API SCM scm_srfi1_count (SCM pred, SCM list1, SCM rest);
|
||||
SCM_SRFI1_API SCM scm_srfi1_delete (SCM x, SCM lst, SCM pred);
|
||||
SCM_SRFI1_API SCM scm_srfi1_delete_x (SCM x, SCM lst, SCM pred);
|
||||
SCM_SRFI1_API SCM scm_srfi1_delete_duplicates (SCM lst, SCM pred);
|
||||
SCM_SRFI1_API SCM scm_srfi1_delete_duplicates_x (SCM lst, SCM pred);
|
||||
SCM_SRFI1_API SCM scm_srfi1_drop_right (SCM lst, SCM n);
|
||||
SCM_SRFI1_API SCM scm_srfi1_drop_right_x (SCM lst, SCM n);
|
||||
SCM_SRFI1_API SCM scm_srfi1_drop_while (SCM pred, SCM lst);
|
||||
SCM_SRFI1_API SCM scm_srfi1_eighth (SCM lst);
|
||||
SCM_SRFI1_API SCM scm_srfi1_fifth (SCM lst);
|
||||
SCM_SRFI1_API SCM scm_srfi1_filter_map (SCM proc, SCM list1, SCM rest);
|
||||
SCM_SRFI1_API SCM scm_srfi1_find (SCM pred, SCM lst);
|
||||
SCM_SRFI1_API SCM scm_srfi1_find_tail (SCM pred, SCM lst);
|
||||
SCM_SRFI1_API SCM scm_srfi1_fold (SCM proc, SCM init, SCM list1, SCM rest);
|
||||
SCM_SRFI1_API SCM scm_srfi1_last (SCM lst);
|
||||
SCM_SRFI1_API SCM scm_srfi1_length_plus (SCM lst);
|
||||
SCM_SRFI1_API SCM scm_srfi1_lset_adjoin (SCM equal, SCM lst, SCM rest);
|
||||
SCM_SRFI1_API SCM scm_srfi1_lset_difference_x (SCM equal, SCM lst, SCM rest);
|
||||
SCM_SRFI1_API SCM scm_srfi1_list_copy (SCM lst);
|
||||
SCM_SRFI1_API SCM scm_srfi1_list_index (SCM pred, SCM list1, SCM rest);
|
||||
SCM_SRFI1_API SCM scm_srfi1_list_tabulate (SCM n, SCM proc);
|
||||
SCM_SRFI1_API SCM scm_srfi1_map (SCM proc, SCM arg1, SCM args);
|
||||
SCM_SRFI1_API SCM scm_srfi1_for_each (SCM proc, SCM arg1, SCM args);
|
||||
SCM_SRFI1_API SCM scm_srfi1_member (SCM obj, SCM ls, SCM pred);
|
||||
SCM_SRFI1_API SCM scm_srfi1_ninth (SCM lst);
|
||||
SCM_SRFI1_API SCM scm_srfi1_assoc (SCM key, SCM alist, SCM pred);
|
||||
SCM_SRFI1_API SCM scm_srfi1_not_pair_p (SCM obj);
|
||||
SCM_SRFI1_API SCM scm_srfi1_partition (SCM pred, SCM list);
|
||||
SCM_SRFI1_API SCM scm_srfi1_partition_x (SCM pred, SCM list);
|
||||
SCM_SRFI1_API SCM scm_srfi1_reduce (SCM proc, SCM def, SCM lst);
|
||||
SCM_SRFI1_API SCM scm_srfi1_reduce_right (SCM proc, SCM def, SCM lst);
|
||||
SCM_SRFI1_API SCM scm_srfi1_remove (SCM pred, SCM list);
|
||||
SCM_SRFI1_API SCM scm_srfi1_remove_x (SCM pred, SCM list);
|
||||
SCM_SRFI1_API SCM scm_srfi1_seventh (SCM lst);
|
||||
SCM_SRFI1_API SCM scm_srfi1_sixth (SCM lst);
|
||||
SCM_SRFI1_API SCM scm_srfi1_span (SCM pred, SCM lst);
|
||||
SCM_SRFI1_API SCM scm_srfi1_span_x (SCM pred, SCM lst);
|
||||
SCM_SRFI1_API SCM scm_srfi1_split_at (SCM lst, SCM n);
|
||||
SCM_SRFI1_API SCM scm_srfi1_split_at_x (SCM lst, SCM n);
|
||||
SCM_SRFI1_API SCM scm_srfi1_take_x (SCM lst, SCM n);
|
||||
SCM_SRFI1_API SCM scm_srfi1_take_right (SCM lst, SCM n);
|
||||
SCM_SRFI1_API SCM scm_srfi1_take_while (SCM pred, SCM lst);
|
||||
SCM_SRFI1_API SCM scm_srfi1_take_while_x (SCM pred, SCM lst);
|
||||
SCM_SRFI1_API SCM scm_srfi1_tenth (SCM lst);
|
||||
SCM_SRFI1_API SCM scm_srfi1_xcons (SCM d, SCM a);
|
||||
|
||||
SCM_SRFI1_API void scm_init_srfi_1 (void);
|
||||
|
||||
#endif /* SCM_SRFI_1_H */
|
|
@ -1,46 +0,0 @@
|
|||
/* srfi-60.h --- SRFI-60 procedures for Guile
|
||||
*
|
||||
* Copyright (C) 2005, 2006 Free Software Foundation, Inc.
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public License
|
||||
* as published by the Free Software Foundation; either version 3 of
|
||||
* the License, or (at your option) any later version.
|
||||
*
|
||||
* This library 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
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
|
||||
* 02110-1301 USA
|
||||
*/
|
||||
|
||||
|
||||
#ifndef SCM_SRFI_60_H
|
||||
#define SCM_SRFI_60_H
|
||||
|
||||
/* SCM_SRFI60_API is a macro prepended to all function and data definitions
|
||||
which should be exported or imported in the resulting dynamic link
|
||||
library in the Win32 port. */
|
||||
|
||||
#if defined (SCM_SRFI60_IMPORT)
|
||||
# define SCM_SRFI60_API __declspec (dllimport) extern
|
||||
#elif defined (SCM_SRFI60_EXPORT) || defined (DLL_EXPORT)
|
||||
# define SCM_SRFI60_API __declspec (dllexport) extern
|
||||
#else
|
||||
# define SCM_SRFI60_API extern
|
||||
#endif
|
||||
|
||||
SCM_SRFI60_API SCM scm_srfi60_log2_binary_factors (SCM n);
|
||||
SCM_SRFI60_API SCM scm_srfi60_copy_bit (SCM index, SCM n, SCM bit);
|
||||
SCM_SRFI60_API SCM scm_srfi60_rotate_bit_field (SCM n, SCM count, SCM start, SCM end);
|
||||
SCM_SRFI60_API SCM scm_srfi60_reverse_bit_field (SCM n, SCM start, SCM end);
|
||||
SCM_SRFI60_API SCM scm_srfi60_integer_to_list (SCM n, SCM len);
|
||||
SCM_SRFI60_API SCM scm_srfi60_list_to_integer (SCM lst);
|
||||
|
||||
SCM_SRFI60_API void scm_init_srfi_60 (void);
|
||||
|
||||
#endif /* SCM_SRFI_60_H */
|
|
@ -163,15 +163,6 @@ libtest_extensions_la_LIBADD = ${top_builddir}/libguile/libguile-@GUILE_EFFECTIV
|
|||
check_SCRIPTS += test-extensions
|
||||
TESTS += test-extensions
|
||||
|
||||
# test-srfi-1
|
||||
test_srfi_1_SOURCES = test-srfi-1.c
|
||||
test_srfi_1_CFLAGS = ${test_cflags}
|
||||
test_srfi_1_LDADD = \
|
||||
${top_builddir}/srfi/libguile-srfi-srfi-1-v-@LIBGUILE_SRFI_SRFI_1_MAJOR@.la \
|
||||
${top_builddir}/libguile/libguile-@GUILE_EFFECTIVE_VERSION@.la
|
||||
check_PROGRAMS += test-srfi-1
|
||||
TESTS += test-srfi-1
|
||||
|
||||
if BUILD_PTHREAD_SUPPORT
|
||||
|
||||
# test-with-guile-module
|
||||
|
|
|
@ -1,86 +0,0 @@
|
|||
/* Copyright (C) 2010 Free Software Foundation, Inc.
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public License
|
||||
* as published by the Free Software Foundation; either version 3 of
|
||||
* the License, or (at your option) any later version.
|
||||
*
|
||||
* This library 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
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
|
||||
* 02110-1301 USA
|
||||
*/
|
||||
|
||||
/* Exercise the compatibility layer of `libguile-srfi-srfi-1'. */
|
||||
|
||||
#ifndef HAVE_CONFIG_H
|
||||
# include <config.h>
|
||||
#endif
|
||||
|
||||
#include <libguile.h>
|
||||
#include <srfi/srfi-1.h>
|
||||
|
||||
#include <stdlib.h>
|
||||
|
||||
static void
|
||||
failure (const char *proc, SCM result)
|
||||
{
|
||||
scm_simple_format (scm_current_error_port (),
|
||||
scm_from_locale_string ("`~S' failed: ~S~%"),
|
||||
scm_list_2 (scm_from_locale_symbol (proc), result));
|
||||
}
|
||||
|
||||
static void *
|
||||
tests (void *data)
|
||||
{
|
||||
SCM times, negative_p, lst, result;
|
||||
|
||||
scm_init_srfi_1 ();
|
||||
|
||||
times = SCM_VARIABLE_REF (scm_c_lookup ("*"));
|
||||
lst = scm_list_3 (scm_from_int (1), scm_from_int (2), scm_from_int (3));
|
||||
|
||||
/* (fold * 1 '(1 2 3) '(1 2 3)) */
|
||||
result = scm_srfi1_fold (times, scm_from_int (1), lst, scm_list_1 (lst));
|
||||
|
||||
if (scm_to_int (result) == 36)
|
||||
{
|
||||
negative_p = SCM_VARIABLE_REF (scm_c_lookup ("negative?"));
|
||||
result = scm_srfi1_break (negative_p,
|
||||
scm_list_3 (scm_from_int (1),
|
||||
scm_from_int (2),
|
||||
scm_from_int (-1)));
|
||||
|
||||
if (SCM_VALUESP (result))
|
||||
/* There's no API to access the values, so assume this is OK. */
|
||||
* (int *) data = EXIT_SUCCESS;
|
||||
else
|
||||
{
|
||||
failure ("break", result);
|
||||
* (int *) data = EXIT_FAILURE;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
failure ("fold", result);
|
||||
* (int *) data = EXIT_FAILURE;
|
||||
}
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
|
||||
int
|
||||
main (int argc, char *argv[])
|
||||
{
|
||||
int ret;
|
||||
|
||||
scm_with_guile (tests, &ret);
|
||||
|
||||
return ret;
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue