RSS Feed

Lisp Project of the Day

literate-lisp

You can support this project by donating at:

Donate using PatreonDonate using Liberapay

Or see the list of project sponsors.

literate-lispasdfasdf-extension

Documentation😀
Docstrings😀
Tests 😀
Examples😀
RepositoryActivity😀
CI 😀

During the week of ASDF extensions I didn't tell you about this library, however I'm using it to render #poftheday site. But preparing the yesterday post about print-html I found it is written in Literate Programming Style.

But print-html is written in org-mode file which was preprocessed and transformed into usual lisp file. Literate-lisp is an ASDF extension which allows you to load org-mode as usual lisp files.

All that you need to do is to write :defsystem-depends-on ("literate-lisp") in the system definition file and to use :org type for components.

Here is the content of my ASD file:

(asdf:defsystem "poftheday"
  :author "Alexander Artemenko <svetlyak.40wt@gmail.com>"
  :serial t
  :defsystem-depends-on ("literate-lisp")
  :depends-on ("cl-org-mode"
               "cl-bootstrap"
               "cl-fad"
               "str"
               "cl-ppcre"
               "cl-who"
               "ppath"
               "alexandria"
               "xml-emitter"
               "rutils"
               "doplus")
  ;; This component type is defined by
  ;; literate-lisp system:
  :components ((:org "readme")))

My README.org is a usual org-mode file with lisp code blocks in it. Literate-lisp system defines a custom reader which skips all file content except code blocks and loads them into lisp image.

When used with poly-org mode, this allows having convenient Lisp code navigation and shortcuts right inside the org-mode file. I can hit C-c C-c to evaluate functions, etc.

So, if you wanted to try Literate Programming, then Jintao Xu's literate-lisp is the best way to go!


Brought to you by 40Ants under Creative Commons License