Exercism exercises in Lisp
Please be familiar with the language track contributing guide . This describes how all the language tracks are put together, as well as details about the common metadata, and high-level information about contributing to existing problems and adding new problems.
Feel free to file an issues on the track repository for problems of any size. Feel free to report typographical errors or poor wording for example. You can greatly help improve the quality of the exercises by filing reports of invalid solutions that pass tests or of valid solutions that fail tests
Direct contributions to the Common Lisp code in this track are always welcome. Refer to Installing Common Lisp guide to get your environment set up if needed.
New exercises or changes to existing ones can be submitted via a pull
request. You will need a GitHub account and you will need to fork
exercism/common-lisp
to your account. See
GitHub Help if you
are unfamiliar with the process.
All changes will be built under several implementations via the TravisCI build so it advisable to be able to run at least some of those same builds locally before submitting the changes.
A contributor will need to install:
Instructions for installing Roswell can be found in its README.
It is beyond the scope of this document to describe how to install different Lisp implementations. Please find those instructions on those implementations' websites.
After installing Lisp implementations. Check that Roswell can see them by
running ros list installed
.
Although QuickLisp is required, Roswell will install and configure it for you, by default.
There are many exercises for Exercism. This track does not yet
implement all of them for Common Lisp. Please see the info about all
exercises in the
problem-specifications
repository. To create a good submission for a new exercise you will
need to have cloned the above repository and ensure it is up to date.
- Choose the exercise you'd like to create from the
problem-specifications
repository. - Create an exercise sub-directory for your exercise:
mkdir exercises/<your-exercise>
. - Use
./bin/configlet
to get theREADME
:./bin/configlet generate . --only <your-exercise> --spec-path <path-to-problem-specifications>
. - Using the canonical data found in the
problems-specifications
repository create tests for the exercise. A template for the test file can be found indocs/template-test.lisp
(changeexercise
to the name of your exercise in kebab-case). - Create an example implementation which passes the tests. This does not need to be clever or amazing (save that for your own solution submission), but it should have good style and idiom and use nothing outside of the Common Lisp specification.
- Create a stub "production file" for the mentee to start with. A
template for this file can be found in
/template-production.lisp
. - Add your exercise to
config.json
and use./bin/configlet
to ensure that it is well formatted:./bin/configlet fmt .
. - Create a PR.
Load the generate-exercise
ASDF system (found in src
) and then
call the function generate-exercise:generate
with the name the
exercise in problem specifications repository you'd like to stub out.
Also provide the path to the problems specifications repository and
the exericses
directory to put the new exercise into.
Alternatively use the generate-exercise/executable
ASDF system to
create the standalone executable bin/generate-exercise
which can do
the same (use bin/generate-exercise -h
to see the usage info).
Before submitting a new exercise please ensure that it passes the
Travis build. This build will run all exercises on many Common Lisp
implementations. To run the build yourself on your implementation load
src/xlisp-test/xlisp-test.lisp
and then evaluate
(xlisp-test:full-build)
. The same can be done by calling asdf:make
on the "xlisp-test/test"
system (ASDF system definition file is
src/xlisp-test.asd
).
If Roswell is installed then running all the tests for one implementation can be done with (this will return with a non-zero error code if there are problems):
ros run -l 'src/xlisp-test/xlisp-test.lisp' -e '(xlisp-test:travis-build)' -q