This is a work-in-progress implementation of the L99 Lisp problem set using Racket, a variant of Scheme Lisp.
- Unit tests using RackUnit to demonstrate correctness of the algorithms
- Racket contracts to ensure correct usage of functions
To keep true to the spirit of the challenge, only a limited subset of Lisp functions are used to implement the problems themselves (basically those which would be available in most implementations of Lisp). These include:
+
,-
,*
,/
,=
,<
,>
, etc.add1
and
car
/cdr
(and variants likecadr
)cond
cons
equal?
if
inexact->exact
let
/let*
list
list?
map
modulo
not
null
null?
or
remainder
sqrt
sub1
truncate
values
In addition, if an implementation for a function has been given in a previous solution, it's OK to use the built-in version for later problems. These functions include:
append
(implemented in P07-flatten-list.rkt asappend-list
)gcd
(implemented in P32-greatest-common-divisor.rkt asgreatest-common-divisor
)length
(implemented in P04-count-list.rkt ascount-list
)list-ref
(implemented in P03-element-at.rkt aselement-at
)reverse
(implemented in P04-reverse-list.rkt asreverse-list
)split-at
(implemented in P17-split.rkt assplit
)
Other functions are fair game for unit tests.