summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndy Wingo <wingo@pobox.com>2010-06-11 01:35:41 +0200
committerAndy Wingo <wingo@pobox.com>2010-06-11 16:58:24 +0200
commit010b159f563dec3f6565723218b67858e6f9129d (patch)
tree4dfd2a1bd332747f20e2a65be35c6efc26f7a48d
parent02b582cef51b982e6fbb0487ea45ea2f56dde5bb (diff)
downloadguile-010b159f563dec3f6565723218b67858e6f9129d.tar.gz
deprecate has-suffix?
* module/ice-9/boot-9.scm: * module/ice-9/deprecated.scm (has-suffix?): Deprecate. * test-suite/guile-test: * benchmark-suite/guile-benchmark: Fix uses of deprecated has-suffix?.
-rwxr-xr-xbenchmark-suite/guile-benchmark4
-rw-r--r--module/ice-9/boot-9.scm5
-rw-r--r--module/ice-9/deprecated.scm8
-rwxr-xr-xtest-suite/guile-test2
4 files changed, 12 insertions, 7 deletions
diff --git a/benchmark-suite/guile-benchmark b/benchmark-suite/guile-benchmark
index 41cae06a1..da2b2a1ad 100755
--- a/benchmark-suite/guile-benchmark
+++ b/benchmark-suite/guile-benchmark
@@ -5,7 +5,7 @@
;;;; guile-benchmark --- run the Guile benchmark suite
;;;; Adapted from code by Jim Blandy <jimb@red-bean.com> --- May 1999
;;;;
-;;;; Copyright (C) 2002, 2006 Free Software Foundation, Inc.
+;;;; Copyright (C) 2002, 2006, 2010 Free Software Foundation, Inc.
;;;;
;;;; This program is free software; you can redistribute it and/or
;;;; modify it under the terms of the GNU Lesser General Public
@@ -148,7 +148,7 @@
(let ((root-len (+ 1 (string-length benchmark-dir)))
(benchmarks '()))
(for-each-file (lambda (file)
- (if (has-suffix? file ".bm")
+ (if (string-suffix? ".bm" file)
(let ((short-name
(substring file root-len)))
(set! benchmarks (cons short-name benchmarks))))
diff --git a/module/ice-9/boot-9.scm b/module/ice-9/boot-9.scm
index 4540d8567..dae879ac0 100644
--- a/module/ice-9/boot-9.scm
+++ b/module/ice-9/boot-9.scm
@@ -592,6 +592,8 @@ If there is no handler at all, Guile prints an error and then exits."
;;; {Keywords}
;;;
+;;; It's much better if you can use lambda* / define*, of course.
+
(define (kw-arg-ref args kw)
(let ((rem (member kw args)))
(and rem (pair? (cdr rem)) (cadr rem))))
@@ -833,9 +835,6 @@ If there is no handler at all, Guile prints an error and then exits."
(if port (begin (close-port port) #t)
#f)))))
-(define (has-suffix? str suffix)
- (string-suffix? suffix str))
-
(define (system-error-errno args)
(if (eq? (car args) 'system-error)
(car (list-ref args 4))
diff --git a/module/ice-9/deprecated.scm b/module/ice-9/deprecated.scm
index 73e787d58..3c2a4dd54 100644
--- a/module/ice-9/deprecated.scm
+++ b/module/ice-9/deprecated.scm
@@ -42,7 +42,8 @@
error-catching-loop
error-catching-repl
scm-style-repl
- apply-to-args)
+ apply-to-args
+ has-suffix?)
#:replace (module-ref-submodule module-define-submodule!))
@@ -395,3 +396,8 @@ better yet, use the repl from `(system repl repl)'.")
(issue-deprecation-warning
"`apply-to-args' is deprecated. Include a local copy in your program.")
(apply fn args))
+
+(define (has-suffix? str suffix)
+ (issue-deprecation-warning
+ "`has-suffix?' is deprecated. Use `string-suffix?' instead (args reversed).")
+ (string-suffix? suffix str))
diff --git a/test-suite/guile-test b/test-suite/guile-test
index c114ad66a..3917395b6 100755
--- a/test-suite/guile-test
+++ b/test-suite/guile-test
@@ -155,7 +155,7 @@
(let ((root-len (+ 1 (string-length test-dir)))
(tests '()))
(for-each-file (lambda (file)
- (if (has-suffix? file ".test")
+ (if (string-suffix? ".test" file)
(let ((short-name
(substring file root-len)))
(set! tests (cons short-name tests))))