aboutsummaryrefslogtreecommitdiff
path: root/src/ellinika/elmorph.scm4
diff options
context:
space:
mode:
authorSergey Poznyakoff <gray@gnu.org.ua>2011-06-06 17:37:28 +0300
committerSergey Poznyakoff <gray@gnu.org.ua>2011-06-06 17:37:28 +0300
commitc598bc4dee28a9480ca9b7e9d5a20d75a5baccda (patch)
treec768bf56be6fda3e5cac9ed3f56d5289be5905c9 /src/ellinika/elmorph.scm4
parent8a7e9b26e073731c82c02594d081c57aa474eade (diff)
downloadellinika-c598bc4dee28a9480ca9b7e9d5a20d75a5baccda.tar.gz
ellinika-c598bc4dee28a9480ca9b7e9d5a20d75a5baccda.tar.bz2
Rewrite all elstr- functions to take either elstr or string as arguments.
Diffstat (limited to 'src/ellinika/elmorph.scm4')
-rw-r--r--src/ellinika/elmorph.scm430
1 files changed, 18 insertions, 12 deletions
diff --git a/src/ellinika/elmorph.scm4 b/src/ellinika/elmorph.scm4
index e3ed4b5..f916d1c 100644
--- a/src/ellinika/elmorph.scm4
+++ b/src/ellinika/elmorph.scm4
@@ -23,16 +23,22 @@
23(define-public (elstr-trim word n) 23(define-public (elstr-trim word n)
24 (cond 24 (let ((word (if (string? word)
25 ((> n 0) 25 (string->elstr word)
26 (elstr-slice word n (- (elstr-length word) n))) 26 word)))
27 ((< n 0) 27 (cond
28 (elstr-slice word 0 (+ (elstr-length word) n))) 28 ((> n 0)
29 (else 29 (elstr-slice word n (- (elstr-length word) n)))
30 word))) 30 ((< n 0)
31 (elstr-slice word 0 (+ (elstr-length word) n)))
32 (else
33 word))))
31 34
32(define-public (elstr-trim! word n) 35(define-public (elstr-trim! word n)
33 (cond 36 (let ((word (if (string? word)
34 ((> n 0) 37 (string->elstr word)
35 (elstr-slice! word n (- (elstr-length word) n))) 38 word)))
36 ((< n 0) 39 (cond
37 (elstr-slice! word 0 (+ (elstr-length word) n))))) 40 ((> n 0)
41 (elstr-slice! word n (- (elstr-length word) n)))
42 ((< n 0)
43 (elstr-slice! word 0 (+ (elstr-length word) n))))))
38 44

Return to:

Send suggestions and report system problems to the System administrator.