Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to navigate the file system in common lisp

The more I write Common Lisp in a REPL (in Emacs/Slime), the more I'm annoyed about leaving the REPL to perform operations like making directories, listing files in directories, changing directories (although ,cd is nice), etc.

So I was wondering if other Lispers used the REPL to perform the sort of file operations I'd normally use a shell for, and if so how they do it? The best I've managed starting to write a few wrappers around uiop. Is there a better way?

like image 859
gypsydave5 Avatar asked Jan 27 '23 14:01

gypsydave5


1 Answers

Not long time ago I had the same problem you have, so I made some research. Result:

SHELISP: Unix shell commands from Common Lisp:
http://dan.corlan.net/shelisp/

Shelisp is a very short program that provides mechanisms for composing and running Unix shell (particularly bash) commands and constructs from Common Lisp.

Essentially, it provides a '!' syntax that you can use to run commands and a '[]' embedded mode where you can enter bash scripts and obtain the standard output as a lisp string.

Lisp expressions can be included in any command or script using a '?' syntax. The new version also includes a 'sh' macro that allows to call unix utilities directly with a syntax familiar to the lisp users.

I didn't use it yet, but I read manual and it looks interesting

like image 91
rsm Avatar answered Jan 31 '23 09:01

rsm