Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
- Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
- Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
- Neither the name of Christopher Mark Gore nor the names of other contributors may be used to endorse or promote products derived from this software without specific prior written permission.
This is a library of utility functions that I use in ANSI Common Lisp. I find them useful, and hopefully you will too. Most of the code should work in any ANSI Common Lisp, but I use SBCL exclusively and some of the code will assume that and only work there. You will need a working and modern ASDF system.
First we need to clone the utilities.
% mkdir -p ~/programming/lisp % cd ~/programming/lisp % git clone [email protected]:cgore/sigma.git
Now we need to make a directory for our project and symlink to the ASDF definition. There are other ways to load ASDF libraries, especially if you want to have them available globally; I strongly recommend you read the documentation to ASDF.
% mkdir our-new-project % cd our-new-project % ln -s ~/programming/lisp/sigma/sigma.asd
Now we need to start up our Lisp REPL. The best way to do this for perfonal use is SLIME from within Emacs, but I will demonstrate using the shell itself here.
% sbcl
Now we are in SBCL.
(require :asdf) ; Require ASDF (asdf:operate 'asdf:load-op 'sigma) ; Require the system via ASDF. (sigma:use-all-sigma) ; This will pollute COMMON-LISP-USER (sum (loop for i from 1 to 100 collect i)) ; Returns 5050 and makes Euler sad.
Have fun!