| .. | ||
| assets | ||
| .nojekyll | ||
| _coverpage.md | ||
| _sidebar.md | ||
| after-plus.jpeg | ||
| alexandria.md | ||
| before.jpeg | ||
| dependencies.md | ||
| FAQ.md | ||
| index.html | ||
| install.md | ||
| language-extensions.md | ||
| libraries.md | ||
| README.md | ||
| serapeum.md | ||
| trivial-types.md | ||
CIEL
CIEL is a collection of useful libraries.
It's Common Lisp, batteries included.
Questions, doubts? See the FAQ.
Install
See the installation instructions.
CIEL's custom REPL
This REPL is more user friendly than the default SBCL one:
-
it has readline capabilities, meaning that the arrow keys work by default (wouhou!) and there is a persistent history, like in any shell.
-
it has multiline input.
-
it has TAB completion.
-
it handles errors gracefully: you are not dropped into the debugger and its sub-REPL, you simply see the error message.
-
it has optional syntax highlighting.
-
it defines short helper commands:
:help => Prints this general help message
:doc => Prints the available documentation for this symbol
:? => Gets help on a symbol <sym>: :? str
:w => Writes the current session to a file <filename>
:d => Dumps the disassembly of a symbol <sym>
:t => Prints the type of a expression <expr>
:lisp-critic => Toggles the lisp-critic
:q => Ends the session.
- it has a shell pass-through: try
!ls.
Our REPL is adapted from sbcli. See also cl-repl, that has an interactive debugger.
Quick documentation lookup
The documentation for a symbol is available with :doc and also by
appending a "?" after a function name:
ciel-user> :doc dict
;; or:
ciel-user> (dict ?
Shell pass-through
Use ! to send a shell command:
!ls
Makefile
README.org
repl.lisp
repl-utils.lisp
src
...
!pwd
/home/vindarel/projets/ciel
Use square brackets [...] to write a shell script, and use $ inside it to escape to lisp:
(dotimes (i 7) (princ [echo ?i]))
The result is concatenated into a string and printed on stdout.
This feature is only available in CIEL's REPL, not on the CIEL-USER package.
We use the Clesh library.
See also SHCL for a more unholy union of posix-shell and Common Lisp.
Syntax highlighting
Syntax highlighting is off by default. To enable it, install pygments and add this in your ~/.cielrc:
(in-package :sbcli)
(setf *syntax-highlighting* t)
;; and, optionally:
;; (setf *pygmentize* "/path/to/pygmentize")
;; (setf *pygmentize-options* (list "-s" "-l" "lisp"))
You can also switch it on and off from the REPL:
(setf sbcli:*syntax-highlighting* t)
Friendly lisp-critic
The :lisp-critic helper command toggles on and off the
lisp-critic. The Lisp Critic
scans your code for instances of bad Lisp programming practice. For
example, when it sees the following function:
(critique
(defun count-a (lst)
(setq n 0)
(dolist (x lst)
(if (equal x 'a)
(setq n (+ n 1))))
n))
the lisp-critic gives you these advices:
----------------------------------------------------------------------
SETS-GLOBALS: GLOBALS!! Don't use global variables, i.e., N
----------------------------------------------------------------------
DOLIST-SETF: Don't use SETQ inside DOLIST to accumulate values for N.
Use DO. Make N a DO variable and don't use SETQ etc at all.
----------------------------------------------------------------------
USE-EQL: Unless something special is going on, use EQL, not EQUAL.
----------------------------------------------------------------------
X-PLUS-1: Don't use (+ N 1), use (1+ N) for its value or (INCF N) to
change N, whichever is appropriate here.
----------------------------------------------------------------------
; in: DEFUN COUNT-A
; (SETQ CIEL-USER::N 0)
;
; caught WARNING:
; undefined variable: N
;
; compilation unit finished
; Undefined variable:
; N
; caught 1 WARNING condition
=> COUNT-A
generic-cl
https://github.com/alex-gutev/generic-cl/
todo:
generic-ciel
Example:
;; with a struct or class "point":
(defmethod equalp ((p1 point) (p2 point))
(…))
Final words
That was your life in CL:

