an unmanageable pleasant jam of Lisp functions, written by Lusine Keshishyan | tado-mi in spring 2019, while working as a teaching assistant for initially for the CSC 173 course at the University of Rochester, in order to learn & practice Lisp, as well as get more familiar with functional programming paradigm. It is made public to demonstrate a code sample by the author, and for learning. We trust it will not be used to violate academic honesty policies.
Functions are as simple as their names. The restrictions for the project, however, were, to avoid using any imperative constructs, such as variables (setq
), or for loops. The recommendation was to go on town with recursion.
The code has extensive comments for both your convenience and sanity, and mine.
There is no 'extra' interactivity with the user implemented (such as a (set of) REPL functions), as I found that to be an uninspiring syntactic challenge. In order to load functions for testing (load main.lisp)
. If you need a lisp compiler, abcl may be useful.
- append two lists
- reverse a list
- map a function over every element in a list (called
mapcar
in Lisp) - remove duplicates from a list
- fold-left (arguments: initial value, function, list)
- filte list with a boolean function
- merge two sorted lists
- add an element to the end of a list
- index of an element in a list
- remove all e from a list l
- set membership
- insert element into set
- intersection
- union
- set difference
- symmetric difference (disjunctive union)
- subset
- superset
- cardinality
- powerset
- absolute value
- factorial
- gcd
- lcm
- nth fibonacci number
- test if a number is prime
- nth prime number
- sum of factors