summaryrefslogtreecommitdiff
path: root/srfi/srfi-1.c
AgeCommit message (Collapse)AuthorFilesLines
2010-09-12move srfi-1 and srfi-60 C impl to libguile, without public C apiAndy Wingo1-1603/+0
* 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.
2010-09-02SRFI-1: Rewrite `drop-right!', `drop-while', `reduce', etc. in Scheme.Ludovic Courtès1-336/+40
This partially reverts commit e9508fbb7df0b1ead007637f16d80cf831776307 (May 3 2005). * module/srfi/srfi-1.scm (take!, drop-right!, reduce, reduce-right, take-while, take-while!, drop-while, span, span!, lset-adjoin): New procedures. * srfi/srfi-1.c (scm_srfi1_drop_right_x, scm_srfi1_drop_while, scm_srfi1_lset_adjoin, scm_srfi1_reduce, scm_srfi1_reduce_right, scm_srfi1_span, scm_srfi1_span_x, scm_srfi1_take_x, scm_srfi1_take_while, scm_srfi1_take_while_x): Rewrite as proxies to the corresponding Scheme procedures. * benchmark-suite/benchmarks/srfi-1.bm ("drop-while"): New benchmark prefix.
2010-08-27SRFI-1: Rewrite `break' and `break!' in Scheme.Ludovic Courtès1-61/+8
This partially reverts commit 6e9f3c2676c0101590d4229653e9c628cb293064 (Tue May 3 2005). * module/srfi/srfi-1.scm (break, break!): New procedures. * srfi/srfi-1.c (scm_srfi1_break, scm_srfi1_break_x): Rewrite as proxies to the corresponding Scheme procedures. * test-suite/standalone/test-srfi-1.c (failure): New function. (tests): Add `scm_srfi1_break' test. Use `failure'.
2010-08-27SRFI-1: Rewrite `fifth', `sixth', etc. in Scheme.Ludovic Courtès1-40/+24
This partially reverts commit 03731332d5dc8d650b947f5126427402c2b1d8bb (Tue May 3 2005). * module/srfi/srfi-1.scm (fifth, sixth, seventh, eighth, ninth, tenth): New procedures. * srfi/srfi-1.c (scm_srfi1_fifth, scm_srfi1_sixth, scm_srfi1_seventh, scm_srfi1_eighth, scm_srfi1_ninth, scm_srfi1_tenth): Rewrite as proxies to the corresponding Scheme procedure. * test-suite/tests/srfi-1.test ("eighth")["() -1"]: Change exception type to `exception:wrong-type-arg'. ("fifth")["() -1"]: Likewise. ("ninth")["() -1"]: Likewise. ("seventh")["() -1"]: Likewise. ("sixth")["() -1"]: Likewise. ("tenth")["() -1"]: Likewise.
2010-07-21Start rewriting SRFI-1 in Scheme.Ludovic Courtès1-267/+53
This partially reverts commit e556f8c3c6b74ee6596e8dcbe829109d7745da2c (Fri May 6 2005). * module/srfi/srfi-1.scm (xcons, list-tabulate, not-pair?, car+cdr, last, fold, list-index): New procedures. * srfi/srfi-1.c (srfi1_module): New variable. (CACHE_VAR): New macro. (scm_srfi1_car_plus_cdr, scm_srfi1_fold, scm_srfi1_last, scm_srfi1_list_index, scm_srfi1_list_tabulate, scm_srfi1_not_pair_p, scm_srfi1_xcons): Rewrite as proxies of the corresponding Scheme procedure. * test-suite/tests/srfi-1.test ("list-tabulate")["-1"]: Change exception type to `exception:wrong-type-arg'. * benchmark-suite/benchmarks/srfi-1.bm: New file. * benchmark-suite/Makefile.am (SCM_BENCHMARKS): Add `benchmarks/srfi-1.bm'. * test-suite/standalone/Makefile.am (test_srfi_1_SOURCES, test_srfi_1_CFLAGS, test_srfi_1_LDADD): New variables. (check_PROGRAMS): Add `test-srfi-1'. (TESTS): Ditto. * test-suite/standalone/test-srfi-1.c: New file.
2010-04-09remove libguile/lang.h, deprecate %nil (in favor of #nil)Andy Wingo1-2/+1
* libguile/Makefile.am: * libguile/init.c: * libguile/lang.c: * libguile/lang.h: Remove lang.c and lang.h. * libguile/pairs.h (SCM_NIL_P, SCM_NULL_OR_NIL_P): Moved here. * module/ice-9/deprecated.scm (%nil): %nil definition moved here. * libguile/alist.c: * libguile/async.c: * libguile/backtrace.c: * libguile/boolean.c: * libguile/dynl.c: * libguile/eval.c: * libguile/filesys.c: * libguile/fluids.c: * libguile/list.c: * libguile/load.c: * libguile/options.c: * libguile/posix.c: * libguile/print.c: * libguile/promises.c: * libguile/sort.c: * libguile/throw.c: * libguile/trees.c: * libguile/vectors.c: * libguile/vm.c: * libguile/weaks.c: * srfi/srfi-1.c: <libguile/lang.h> references removed.
2009-12-01formally deprecate trampolinesAndy Wingo1-124/+74
* libguile/eval.c: * libguile/deprecated.h: * libguile/deprecated.c (scm_trampoline_0, scm_trampoline_1) (scm_trampoline_2): Actually deprecate trampolines. * srfi/srfi-1.c: Fix all trampoline uses in srfi-1.c.
2009-12-01gut trampolinesAndy Wingo1-1/+2
* libguile/eval.c: Gut the trampoline implementation. We'll be doing much more clever things here that will obviate the need for the procedure arg of map and for-each to be allocated in many cases... trampolines were a noble attempt at optimizing in the wrong place. * srfi/srfi-1.c (scm_srfi1_lset_difference_x): Validate that we get a proc, because the trampoline won't do it for us. * test-suite/tests/sort.test ("sort"): * test-suite/tests/srfi-1.test ("count", "fold", "list-index"): Change expected exceptions, due to trampoline functions not doing any computation.
2009-06-17Change Guile license to LGPLv3+Neil Jerram1-6/+7
(Not quite finished, the following will be done tomorrow. module/srfi/*.scm module/rnrs/*.scm module/scripts/*.scm testsuite/*.scm guile-readline/* )
2008-09-13Include <config.h> in all C files; use `#ifdef HAVE_CONFIG_H' rather than `#if'.Ludovic Courtès1-1/+1
2008-04-28Fix type-checking of SRFI-1 `partition'.Ludovic Courtès1-2/+9
2008-04-27Include <config.h> in SRFI-1.Ludovic Courtès1-1/+5
2006-06-17merge 1.8 branchKevin Ryde1-1/+60
2006-02-04(scm_srfi1_delete, scm_srfi1_delete_duplicates): Use aKevin Ryde1-56/+87
count to protect against nasty code in the equality procedure changing the lists we're working on. The results don't have to be sensible in that case, just not hang or access non-cells.
2005-11-23(lset-difference!): Rewrite in C.Kevin Ryde1-0/+61
2005-08-11Use scm_is_null instead of SCM_NULLP. Thanks to Peter Gavin!Marius Vollmer1-2/+2
2005-07-31(check_map_args): Move check_map_error label and elt variable outsideMarius Vollmer1-11/+14
of loop scope so that we do not jump past the initialization of elt.
2005-06-12Do not use INUM macros, they are deprecated.Marius Vollmer1-9/+8
2005-05-23The FSF has a new address.Marius Vollmer1-1/+1
2005-05-06(car+cdr, fold, last, list-index,Kevin Ryde1-0/+289
list-tabulate, not-pair, xcons): Rewrite in C.
2005-05-03(fifth, sixth, seventh, eighth, ninth, tenth): Rewrite in C.Kevin Ryde1-0/+61
2005-05-03(break, break!): Rewrite in C.Kevin Ryde1-0/+70
2005-05-03(drop-right!, drop-while,Kevin Ryde1-0/+381
lset-adjoin, reduce, reduce-right, span, take!, take-while, take-while!): Rewrite in C.
2005-04-23(scm_srfi1_count, scm_srfi1_filter_map): Don't modify theKevin Ryde1-24/+28
rest argument, that belongs to the caller when reached from apply. Use a temp vector like scm_srfi1_for_each.
2005-04-03(scm_srfi1_concatenate, scm_srfi1_concatenate_x): Add codeKevin Ryde1-5/+32
to check argument is a list, scm_append and scm_append_x don't do that on their "rest" list (in a normal build).
2005-04-02(alist-copy): Rewrite in C.Kevin Ryde1-0/+34
2005-04-01(scm_srfi1_filter_map): Have 2-arg case share finalizationKevin Ryde1-5/+2
code of 1-arg case.
2005-04-01(scm_srfi1_count): Use scm_list_copy to make arg list,Kevin Ryde1-17/+15
instead of an inline loop. Share final list check between all cases to save some code.
2005-03-17(filter-map): Rewrite in C.Kevin Ryde1-0/+112
2005-03-15(split-at, split-at!): Rewrite in C.Kevin Ryde1-0/+51
2005-03-15(drop-right, partition!, remove!, take-right): Rewrite in C.Kevin Ryde1-0/+130
remove! derived from core filter!.
2005-03-13(find, find-tail): Rewrite in C.Kevin Ryde1-0/+43
2005-03-02Use scm_is_pair instead of SCM_CONSP; use scm_is_null instead ofMarius Vollmer1-28/+28
SCM_NULLP.
2005-01-28(remove): Rewrite in C, a trivial adaption from scm_filter in the core.Kevin Ryde1-0/+31
2005-01-23(scm_srfi1_member): Update docstring from manual.Kevin Ryde1-8/+15
2005-01-23(scm_srfi1_member): Correction to pred call arg order, srfiKevin Ryde1-1/+1
spec is (PRED X elem).
2005-01-10(check_args): Bugfix to change from 2005-01-02: ARGV is the vector toMarius Vollmer1-1/+1
check, not ARGS.
2005-01-02Use new vector elements API or simple vector API, asMarius Vollmer1-15/+13
appropriate.
2004-09-032004-09-03 Stefan Jahn <stefan@lkcc.org>Stefan Jahn1-14/+14
* configure.in (isinf): Let configure find the isinf() function on MinGW32 systems. 2004-09-03 Stefan Jahn <stefan@lkcc.org> * threads.c (scm_threads_mark_stacks): Fixed local variable definitions. * strings.c (scm_i_substring_copy, s_scm_string_append): Fixed local variable definitions. * stime.c (_POSIX_C_SOURCE): Do not define this item on MinGW32 because it conflicts with its pthread headers. (s_scm_mktime): Consider the HAVE_STRUCT_TM_TM_ZONE define. (s_scm_strftime): Using scm_from_locale_string() instead of scm_makfrom0str(). * posix.c (s_scm_putenv): Fixed typo in the !HAVE_UNSETENV part. * numbers.c (scm_init_numbers): Removed check_sanity() call inside GUILE_DEBUG. The function has been removed somewhen... * filesys.c (_POSIX_C_SOURCE): Do not define this item on MinGW32 because it conflicts with its pthread headers. 2004-09-03 Stefan Jahn <stefan@lkcc.org> * srfi-1.c, srfi-1.h: Renamed any 'lst1' into 'list1' because lst1 is a #define on Win32 systems.
2004-07-27* tags.h, deprecated.h (SCM_EQ_P): Deprecated by moving it intoMarius Vollmer1-5/+5
deprecated.h. Replaced all uses with scm_is_eq.
2004-07-08* numbers.h (SCM_MAKINUM, SCM_I_MAKINUM): Renamed SCM_MAKINUM toMarius Vollmer1-2/+2
SCM_I_MAKINUM and changed all uses.
2004-07-06Replaced all uses of deprecated SCM_FALSEP, SCM_NFALSEP, SCM_BOOL,Marius Vollmer1-11/+11
SCM_NEGATE_BOOL, and SCM_BOOLP with scm_is_false, scm_is_true, scm_from_bool, and scm_is_bool, respectively.
2003-12-02(count): Rewrite in C, avoiding non-tail recursion.Kevin Ryde1-0/+103
2003-08-22(list-copy): New function, derivedKevin Ryde1-0/+33
from core list-copy but allowing improper lists, per SRFI-1 spec.
2003-07-28(length+): Rewrite using scm_ilength.Kevin Ryde1-0/+12
2003-07-28(concatenate, concatenate!): Use scm_append and scm_append_x.Kevin Ryde1-0/+8
2003-07-132003-07-14 Matthias Koeppe <mkoeppe@mail.math.uni-magdeburg.de>Kevin Ryde1-0/+40
* srfi-1.c, srfi-1.h (scm_srfi1_partition), srfi-1.scm (partition): Re-implement in C to avoid stack overflows for long input lists.
2003-07-08(scm_srfi1_delete, scm_srfi1_delete_x,Kevin Ryde1-7/+308
scm_srfi1_delete_duplicates, scm_srfi1_delete_duplicates_x): New functions. scm_srfi1_delete_x is derived from scm_delete_x.
2003-04-21 * srfi/srfi-1.c (srfi1_ilength), libguile/list.c (scm_ilength,Dirk Herrmann1-2/+2
scm_last_pair), libguile/unif.c (l2ra): Prefer !SCM_CONSP over SCM_NCONSP. * libguile/unif.c (l2ra): Eliminate redundant check. Now, guile itself does not include any calls to SCM_NCONSP any more.
2003-04-05Changed license terms to the plain LGPL thru-out.Marius Vollmer1-38/+12