From 71a50ca5d55893d6bd6ae89b425cbad2971f9da0 Mon Sep 17 00:00:00 2001 From: Thomas Morley Date: Sat, 26 Nov 2016 13:38:51 +0100 Subject: [PATCH] Fix some warnings about string-delete and string-filter argument order This makes guile2 stop printing some warning messages: Guile used to use the wrong argument order for string-delete. This call to string-filter had the arguments in the wrong order. See SRFI-13 for more details. At some point we will remove this hack. guile-1.8 will continue working. --- scm/graphviz.scm | 4 +++- scm/lily-library.scm | 6 +++--- scm/lily.scm | 6 +++++- 3 files changed, 11 insertions(+), 5 deletions(-) diff --git a/scm/graphviz.scm b/scm/graphviz.scm index 61fa5b1..657fdb2 100644 --- a/scm/graphviz.scm +++ b/scm/graphviz.scm @@ -69,7 +69,9 @@ es) (for-each (lambda (c) (format out "subgraph cluster_~a {\nlabel= \"~a\"\ncolor=blue\n" - (string-filter (car c) char-alphabetic?) + (if (guile-v2) + (string-filter char-alphabetic? (car c)) + (string-filter (car c) char-alphabetic?)) (car c)) (for-each (lambda (n) (format out "~a\n" n)) (cdr c)) (display "}\n" out)) diff --git a/scm/lily-library.scm b/scm/lily-library.scm index 214c095..42d5e82 100644 --- a/scm/lily-library.scm +++ b/scm/lily-library.scm @@ -778,9 +778,9 @@ as rectangular coordinates @code{(x-length . y-length)}." (define-public (remove-whitespace strg) "Remove characters satisfying @code{char-whitespace?} from string @var{strg}" - (string-delete - strg - char-whitespace?)) + (if (guile-v2) + (string-delete char-whitespace? strg) + (string-delete strg char-whitespace?)) (define-public (string-encode-integer i) (cond diff --git a/scm/lily.scm b/scm/lily.scm index d4553ee..4b3c9c7 100644 --- a/scm/lily.scm +++ b/scm/lily.scm @@ -963,7 +963,11 @@ PIDs or the number of the process." (remove string-null? (append-map (lambda (f) - (string-split (string-delete (ly:gulp-file f) #\cr) #\nl)) + (string-split + (if (guile-v2) + (string-delete #\cr (ly:gulp-file f)) + (string-delete (ly:gulp-file f) #\cr)) + #\nl)) files)))) (if (and (number? (ly:get-option 'job-count)) (>= (length files) (ly:get-option 'job-count))) -- 2.7.4