Ludovic Courtès
0b7f2eb8bf
Start rewriting SRFI-1 in Scheme.
...
This partially reverts commit e556f8c3c6
(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-07-21 01:07:56 +02:00
Andy Wingo
cd038da546
remove libguile/lang.h, deprecate %nil (in favor of #nil)
...
* 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.
2010-04-09 14:26:31 +02:00
Andy Wingo
a3e923770e
formally deprecate trampolines
...
* 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-01 21:00:25 +01:00
Andy Wingo
95e5998204
gut trampolines
...
* 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-12-01 21:00:23 +01:00
Neil Jerram
53befeb700
Change Guile license to LGPLv3+
...
(Not quite finished, the following will be done tomorrow.
module/srfi/*.scm
module/rnrs/*.scm
module/scripts/*.scm
testsuite/*.scm
guile-readline/*
)
2009-06-17 00:22:09 +01:00
Ludovic Courtès
dbb605f575
Include <config.h> in all C files; use #ifdef HAVE_CONFIG_H' rather than
#if'.
2008-09-13 15:35:27 +02:00
Ludovic Courtès
0fb11ae432
Fix type-checking of SRFI-1 `partition'.
2008-04-28 18:03:27 +02:00
Ludovic Courtès
a030cb4b16
Include <config.h> in SRFI-1.
2008-04-27 00:50:19 +02:00
Kevin Ryde
9a9931719d
merge 1.8 branch
2006-06-17 22:47:50 +00:00
Kevin Ryde
cf9d3c47fd
(scm_srfi1_delete, scm_srfi1_delete_duplicates): Use a
...
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.
2006-02-04 00:50:39 +00:00
Kevin Ryde
9dcee2b7a1
(lset-difference!): Rewrite in C.
2005-11-23 23:56:08 +00:00
Marius Vollmer
3c55f6f1e2
Use scm_is_null instead of SCM_NULLP. Thanks to Peter Gavin!
2005-08-11 21:03:42 +00:00
Marius Vollmer
705f4f57ee
(check_map_args): Move check_map_error label and elt variable outside
...
of loop scope so that we do not jump past the initialization of elt.
2005-07-31 21:54:48 +00:00
Marius Vollmer
b730fbf131
Do not use INUM macros, they are deprecated.
2005-06-12 12:30:47 +00:00
Marius Vollmer
92205699d0
The FSF has a new address.
2005-05-23 19:57:22 +00:00
Kevin Ryde
e556f8c3c6
(car+cdr, fold, last, list-index,
...
list-tabulate, not-pair, xcons): Rewrite in C.
2005-05-06 23:59:35 +00:00
Kevin Ryde
03731332d5
(fifth, sixth, seventh, eighth, ninth, tenth): Rewrite in C.
2005-05-03 23:24:31 +00:00
Kevin Ryde
6e9f3c2676
(break, break!): Rewrite in C.
2005-05-03 23:03:27 +00:00
Kevin Ryde
597dbd4eea
(drop-right!, drop-while,
...
lset-adjoin, reduce, reduce-right, span, take!, take-while,
take-while!): Rewrite in C.
2005-05-03 22:56:01 +00:00
Kevin Ryde
eccd308a5b
(scm_srfi1_count, scm_srfi1_filter_map): Don't modify the
...
rest argument, that belongs to the caller when reached from apply.
Use a temp vector like scm_srfi1_for_each.
2005-04-23 00:10:50 +00:00
Kevin Ryde
c66c6d535d
(scm_srfi1_concatenate, scm_srfi1_concatenate_x): Add code
...
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-03 22:41:15 +00:00
Kevin Ryde
b1fff4e793
(alist-copy): Rewrite in C.
2005-04-02 00:19:35 +00:00
Kevin Ryde
6507b83189
(scm_srfi1_filter_map): Have 2-arg case share finalization
...
code of 1-arg case.
2005-04-01 23:45:41 +00:00
Kevin Ryde
5fc743b48d
(scm_srfi1_count): Use scm_list_copy to make arg list,
...
instead of an inline loop. Share final list check between all cases
to save some code.
2005-04-01 23:43:49 +00:00
Kevin Ryde
c16359466b
(filter-map): Rewrite in C.
2005-03-17 23:15:19 +00:00
Kevin Ryde
d2f57ee014
(split-at, split-at!): Rewrite in C.
2005-03-15 21:49:25 +00:00
Kevin Ryde
2b077051db
(drop-right, partition!, remove!, take-right): Rewrite in C.
...
remove! derived from core filter!.
2005-03-15 21:15:24 +00:00
Kevin Ryde
5df2ac97e9
(find, find-tail): Rewrite in C.
2005-03-13 22:49:28 +00:00
Marius Vollmer
896df2d58b
Use scm_is_pair instead of SCM_CONSP; use scm_is_null instead of
...
SCM_NULLP.
2005-03-02 20:50:48 +00:00
Kevin Ryde
59747b8d2d
(remove): Rewrite in C, a trivial adaption from scm_filter in the core.
2005-01-28 21:53:47 +00:00
Kevin Ryde
4e3cc389f0
(scm_srfi1_member): Update docstring from manual.
2005-01-23 21:27:51 +00:00
Kevin Ryde
2796304a40
(scm_srfi1_member): Correction to pred call arg order, srfi
...
spec is (PRED X elem).
2005-01-23 21:02:13 +00:00
Marius Vollmer
3a0cf65611
(check_args): Bugfix to change from 2005-01-02: ARGV is the vector to
...
check, not ARGS.
2005-01-10 01:50:29 +00:00
Marius Vollmer
3c4ce91b65
Use new vector elements API or simple vector API, as
...
appropriate.
2005-01-02 21:01:55 +00:00
Stefan Jahn
edea856ce5
2004-09-03 Stefan Jahn <stefan@lkcc.org>
...
* 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-09-03 19:45:37 +00:00
Marius Vollmer
bc36d0502b
* tags.h, deprecated.h (SCM_EQ_P): Deprecated by moving it into
...
deprecated.h. Replaced all uses with scm_is_eq.
2004-07-27 15:41:49 +00:00
Marius Vollmer
93ccaef0c6
* numbers.h (SCM_MAKINUM, SCM_I_MAKINUM): Renamed SCM_MAKINUM to
...
SCM_I_MAKINUM and changed all uses.
2004-07-08 15:58:11 +00:00
Marius Vollmer
00874d5fb0
Replaced all uses of deprecated SCM_FALSEP, SCM_NFALSEP, SCM_BOOL,
...
SCM_NEGATE_BOOL, and SCM_BOOLP with scm_is_false, scm_is_true,
scm_from_bool, and scm_is_bool, respectively.
2004-07-06 11:02:47 +00:00
Kevin Ryde
110348aee9
(count): Rewrite in C, avoiding non-tail recursion.
2003-12-02 21:12:20 +00:00
Kevin Ryde
d61261f07d
(list-copy): New function, derived
...
from core list-copy but allowing improper lists, per SRFI-1 spec.
2003-08-22 22:36:18 +00:00
Kevin Ryde
de51f5955d
(length+): Rewrite using scm_ilength.
2003-07-28 23:54:39 +00:00
Kevin Ryde
47f2726f4c
(concatenate, concatenate!): Use scm_append and scm_append_x.
2003-07-28 23:43:51 +00:00
Kevin Ryde
65978fb2bd
2003-07-14 Matthias Koeppe <mkoeppe@mail.math.uni-magdeburg.de>
...
* 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-13 23:05:31 +00:00
Kevin Ryde
d0a634de7d
(scm_srfi1_delete, scm_srfi1_delete_x,
...
scm_srfi1_delete_duplicates, scm_srfi1_delete_duplicates_x): New
functions. scm_srfi1_delete_x is derived from scm_delete_x.
2003-07-08 00:09:17 +00:00
Dirk Herrmann
1685446c0d
* srfi/srfi-1.c (srfi1_ilength), libguile/list.c (scm_ilength,
...
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-21 01:59:57 +00:00
Marius Vollmer
73be1d9e8e
Changed license terms to the plain LGPL thru-out.
2003-04-05 19:15:35 +00:00
Mikael Djurfeldt
a48d60b1c0
* srfi-1.c (scm_init_srfi_1): Extend root module map and for-each
...
with the versions in this module using
scm_c_extend_primitive_generic.
* goops.scm (equal?): Define default method.
* goops.c (scm_primitive_generic_generic): Enable primitive
generic if not enabled.
(scm_sys_goops_loaded): Setup unextended primitive generics.
* goops.c, goops.h (scm_c_extend_primitive_generic): New function.
* snarf.h (SCM_PRIMITIVE_GENERIC, SCM_PRIMITIVE_GENERIC_1): New
snarf macros.
* numbers.c (scm_abs): Use SCM_PRIMITIVE_GENERIC. (This is only a
testing example. All uses of SCM_GPROC should be converted.)
* procprop.c (scm_stand_in_scm_proc): Use scm_assq instead of
scm_assoc.
* eq.c (scm_equal_p): Turned into a primitive generic.
2003-03-06 12:51:57 +00:00
Mikael Djurfeldt
f9ac1c2df8
* srfi-1.c (srfi1_for_each): Corrected argument checking for the
...
case of two argument lists. (Thanks to Kevin Ryde.)
2003-02-03 14:48:25 +00:00
Mikael Djurfeldt
7692d26b31
* srfi-1.scm: Load srfi-1 extension.
...
(map, map-in-order, for-each, member, assoc): Replaced by
primitives in srfi-1.c.
(map1): Defined as `map'.
2002-12-01 13:56:11 +00:00
Mikael Djurfeldt
ee6aac9733
* srfi-1.scm: Load srfi-1 extension.
...
(map, map-in-order, for-each, member): Replaced by primitives in
srfi-1.c.
* Makefile.am: Added rules for srfi-1.c.
* srfi-1.c, srfi-1.h: New files.
2002-12-01 13:10:51 +00:00