Problem So, here’s my code: public class NList : SExp, IEnumerable<Object> { private Object _car; private NList _cdr; IEnumerator<Object> IEnumerable<Object>.GetEnumerator() […]
Tag: lisp
A Lisp version of the Schwartzian transform
Problem Randal Schwartz stole Lisp’s decorate-sort-undecorate idiom when he came up with what we’d later call the Schwartzian transform. All […]
Iterative sum using recursion
Problem Given the following recursive definition of sum: (define (sum term a next b) (if (> a b) 0 (+ […]
Reading/writing null-terminated strings from socket
Problem I need to handle C style (” delimited) strings from/to a socket and came up with this as a […]
Print an integer and its digits reversed
Problem This Common Lisp program is an exercise to print an integer and its digits reversed to the screen: (defun […]
Simple, functional URL parsing library in Clojure
Problem I recently wrote some code to handle parsing of URLs, even if those URLs might not be one hundred […]
On Implementing a Lisp
Problem Background: This began with James Colgan‘s Lisp-Dojo for Ruby. My implementation can be found here. I then moved on […]
Creating a repetitive string in Common Lisp
Problem I needed to have a Lisp function that could produce a string of a certain length, created by repeated […]
Sum of all multiples of 3 or 5 below 1000 (Project Euler #1 – typical)
Problem I’m learning LISP and am starting with Project Euler. I would love some initial feedback on my LISP code […]
Project Euler #2 (classic) – Sum of even fibonacci numbers below 4 million
Problem I’m looking to use LISP as best I can, not just get the right answer. This is very early […]