ambrevar/shell: Add token helper.

master
Pierre Neidhardt 2021-02-08 17:04:41 +01:00
parent 544f8fc934
commit 00d799d409
1 changed files with 5 additions and 0 deletions

View File

@ -313,6 +313,11 @@ As a second value, return a list of (FILE SIZE) pairs, biggest file first."
(sera:tokens line))
(str:split (string #\newline) string)))
(export-always 'token)
(defun token (line column lines)
"Return token at line LINE and column COLUMN in the list of strings LINES."
(nth column (nth line lines)))
(export-always 'port-process)
(defun port-process (port)
"Return process PID using PORT, NIL is none.