cd function

Signed-off-by: Ava Hahn <ava@sunnypup.io>
This commit is contained in:
Ava Apples Affine 2023-04-17 22:11:49 -07:00
parent db55c54dd3
commit ee1ef9700d
Signed by: affine
GPG key ID: 3A4645B8CF806069
6 changed files with 87 additions and 33 deletions

View file

@ -108,4 +108,14 @@ Returns true if the list contains the element.'
'Takes one argument.
adds a directory to PATH'
(path) (set (q PATH)
(concat PATH ':' path)))
(concat PATH ':' path)))
(def display-paths
'prints out each element of $PATH one by one'
()
(let ((path-iter (pop (get-paths))))
(while (gt? (len path-iter) 1)
(let ((pat (car path-iter))
(rem (cdr path-iter)))
(echo pat)
(set (q path-iter) (pop rem))))))