Coder Social home page Coder Social logo

common-lisp-recipes's Introduction

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)

common-lisp-recipes's People

Contributors

polaris avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.