diff options
| author | Juan Manuel Tomás <jtomas1815@gmail.com> | 2026-05-01 14:16:07 -0300 |
|---|---|---|
| committer | Juan Manuel Tomás <jtomas1815@gmail.com> | 2026-05-01 14:16:07 -0300 |
| commit | a4411bcc3919c2099934fd49664ee689460ebf80 (patch) | |
| tree | 524492a5febcd921528da7634ff91068b8c63d02 /str.lisp | |
| parent | d1816df4c029447f94963355cbdce5c434063ee6 (diff) | |
| download | utils-a4411bcc3919c2099934fd49664ee689460ebf80.tar.gz utils-a4411bcc3919c2099934fd49664ee689460ebf80.zip | |
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)) |
