1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-04-29 19:30:36 +02:00

SRFI-1: Rewrite drop-right!', drop-while', `reduce', etc. in Scheme.

This partially reverts commit e9508fbb7d
(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.
This commit is contained in:
Ludovic Courtès 2010-09-02 00:03:07 +02:00
parent 5335850dbf
commit dcde43869a
3 changed files with 176 additions and 336 deletions

View file

@ -36,3 +36,12 @@
(benchmark "small" 2000000
(fold (lambda (x y) y) #f %small-list)))
(with-benchmark-prefix "drop-while"
(benchmark "big" 30
(drop-while (lambda (n) #t) %big-list))
(benchmark "small" 2000000
(drop-while (lambda (n) #t) %small-list)))