diff options
Diffstat (limited to 'str.lisp')
| -rw-r--r-- | str.lisp | 20 |
1 files changed, 0 insertions, 20 deletions
@@ -52,23 +52,3 @@ (format result "~a" (char-downcase (char str i))) (format result "~a" (char str i)))) (get-output-stream-string result))) - -(defun line-and-column (str index) - (let ((line 1) (column 1)) - (dotimes (i index) - (let ((c (char str i))) - (case c - (#\Newline - (incf line) - (setf column 1)) - (t (incf column))))) - (cons line column))) - -(defun context-window (str index &key (side-length 20)) - (let ((begin (max (- index side-length) 0)) - (end (min (+ index side-length) (length str))) - (result '())) - (push (subseq str begin index) result) - (push (elt str index) result) - (push (subseq str (1+ index) end) result) - result)) |
