aboutsummaryrefslogtreecommitdiff
path: root/src/boot/strap/utility.clisp
diff options
context:
space:
mode:
Diffstat (limited to 'src/boot/strap/utility.clisp')
-rw-r--r--src/boot/strap/utility.clisp11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/boot/strap/utility.clisp b/src/boot/strap/utility.clisp
index 02f52e9f..7bfc9387 100644
--- a/src/boot/strap/utility.clisp
+++ b/src/boot/strap/utility.clisp
@@ -302,3 +302,14 @@
((OR (CHARACTERP |x|) (INTEGERP |x|)) (|removeScalar| |l| |x|))
(T (|removeValue| |l| |x|))))
+(DEFUN |charPosition| (|c| |s| |k|)
+ (PROG (|n|)
+ (RETURN
+ (PROGN
+ (SETQ |n| (LENGTH |s|))
+ (LOOP
+ (COND
+ ((NOT (< |k| |n|)) (RETURN NIL))
+ ((CHAR= (SCHAR |s| |k|) |c|) (RETURN |k|))
+ (T (SETQ |k| (+ |k| 1)))))))))
+