Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/polaris/common-lisp-recipes
Common Lisp Recipes
https://github.com/polaris/common-lisp-recipes
common-lisp recipes
Last synced: 19 days ago
JSON representation
Common Lisp Recipes
- Host: GitHub
- URL: https://github.com/polaris/common-lisp-recipes
- Owner: polaris
- Created: 2023-02-12T16:17:54.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2023-02-12T17:41:27.000Z (almost 2 years ago)
- Last Synced: 2024-11-13T15:56:58.394Z (3 months ago)
- Topics: common-lisp, recipes
- Homepage:
- Size: 2.93 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Common Lisp Recipes
This repository contains a collection of Common Lisp recipes that I found helpful.
## Creating a project skeleton
```
* (ql:quickload "quickproject")
* (quickproject:make-project #p"~/src/myproject/" :depends-on '(drakma cxml))
* (asdf:load-system "myproject")
```## Building self-contained executables
### SBCL
#### `SB-EXT:SAVE-LISP-AND-DIE`
https://koji-kojiro.github.io/sb-docs/build/html/sb-ext/function/SAVE-LISP-AND-DIE.html
##### Example
```
sbcl --eval '(ql:quickload :myproject)' \
--eval "(sb-ext:save-lisp-and-die #p\"myproject\" :compression 9 \
:toplevel #'myproject::main \
:executable t)"
```### buildapp
https://www.xach.com/lisp/buildapp/
#### Usage
##### Example 1
```
buildapp --output myproject \
--compress-core \
--asdf-path ~/src/myproject/ \
--load-system myproject \
--eval '(defun main (args) (myproject:main))' \
--entry main
```##### Example 2
```
buildapp --eval '(defun main (argv) (declare (ignore argv)) (write-line "Hello, world"))' \
--entry main \
--compress-core \
--output hello-world
```## Executing a shell command
### `INFERIOR-SHELL`
https://github.com/fare/inferior-shell
```
(ql:quickload "inferior-shell")
(inferior-shell:run "ls"
:on-error nil
:error-output :string
:output :string)
```## Scheduling a job
### Clerk
https://github.com/lisp-maintainers/clerk
```
(ql:quickload "clerk")
(clerk:job "print hello" every 5.seconds (print "hello"))
(clerk:start)
...
(clerk:stop)
(clerk:empty-jobs-queue)
```