diff options
author | Ricardo Wurmus <rekado@elephly.net> | 2019-06-03 12:47:49 +0200 |
---|---|---|
committer | Ricardo Wurmus <rekado@elephly.net> | 2019-06-03 12:47:49 +0200 |
commit | 0f4885b162b7a4d5c23fca456be60d44f03d80ef (patch) | |
tree | 7b4a311388b923eab7412ccb45c4f438f47095df /modules | |
parent | 0b9dad593e5cec7345f33b3ce1545ef2849d3696 (diff) |
modules: Use string-null? instead of (equal? "" ...).
* modules/language/python/bytes.scm (replace): Use string-null?.
* modules/language/python/completer.scm (complete-fkn): Likewise.
* modules/language/python/module/io.scm (StringIO): Likewise.
* modules/language/python/spec.scm (cc): Likewise.
* modules/language/python/string.scm (py-replace): Likewise.
Diffstat (limited to 'modules')
-rw-r--r-- | modules/language/python/bytes.scm | 2 | ||||
-rw-r--r-- | modules/language/python/completer.scm | 2 | ||||
-rw-r--r-- | modules/language/python/module/io.scm | 2 | ||||
-rw-r--r-- | modules/language/python/spec.scm | 4 | ||||
-rw-r--r-- | modules/language/python/string.scm | 2 |
5 files changed, 7 insertions, 5 deletions
diff --git a/modules/language/python/bytes.scm b/modules/language/python/bytes.scm index e3d8245..6e08300 100644 --- a/modules/language/python/bytes.scm +++ b/modules/language/python/bytes.scm @@ -1052,7 +1052,7 @@ (reverse (let lp ((s s) (r '())) (let ((l (py-partition s old))) - (if (equal? (cadr l) "") + (if (string-null? (cadr l)) (cons s r) (lp (list-ref l 2) (cons (car l) r)))))) n diff --git a/modules/language/python/completer.scm b/modules/language/python/completer.scm index 73f96bd..047248e 100644 --- a/modules/language/python/completer.scm +++ b/modules/language/python/completer.scm @@ -38,7 +38,7 @@ (set! strs d) (set! pp p) (set! regexp (string-append - "^" (if (equal? t "") + "^" (if (string-null? t) "[^_]" (regexp-quote t)))) (compl text #t))) diff --git a/modules/language/python/module/io.scm b/modules/language/python/module/io.scm index 3c7809c..e48abcf 100644 --- a/modules/language/python/module/io.scm +++ b/modules/language/python/module/io.scm @@ -536,7 +536,7 @@ (define __init__ (lam (self (= initial_value "") (= newline "\n")) (set self 'newline newline) - (if (equal? initial_value "") + (if (string-null? initial_value) (set self '_port (open-output-string)) (set self '_port (open-input-string initial_value))))) diff --git a/modules/language/python/spec.scm b/modules/language/python/spec.scm index 7814d2c..ea545ac 100644 --- a/modules/language/python/spec.scm +++ b/modules/language/python/spec.scm @@ -31,7 +31,9 @@ (define (c int x) (pr (comp int (pr (p (pr x)))))) (define (cc int port x) - (if (equal? x "") (read port) (c int x))) + (if (string-null? x) + (read port) + (c int x))) (define (e x) (eval (c #t x) (current-module))) diff --git a/modules/language/python/string.scm b/modules/language/python/string.scm index b3708b5..26b3482 100644 --- a/modules/language/python/string.scm +++ b/modules/language/python/string.scm @@ -361,7 +361,7 @@ (reverse (let lp ((s s) (r '())) (let ((l (py-partition s old))) - (if (equal? (cadr l) "") + (if (string-null? (cadr l)) (cons s r) (lp (list-ref l 2) (cons (car l) r)))))) new))) |