Lisp is a (family of) general purpose programming language(s), based on the lambda calculus, and with the ability to manipulate source code as a data structure.

learn more… | top users | synonyms

6
votes
0answers
374 views

Connect Four AI (Minimax) in Clojure

I wrote a Connect Four game including a AI in Clojure and since I'm rather new to Clojure, some review would be highly appreciated. It can include everything, coding style, simplifications, etc. But ...
5
votes
0answers
581 views

Merge sort in Scheme

...
4
votes
0answers
101 views

Quick Insert Merge Sort

I have written this code to sort a list of numbers, in increasing order. It is a combination of quick sort, insertion sort, and merge sort. I make the first element of the list a pivot, then I go ...
3
votes
0answers
118 views

Representing a queue as a procedure with local state

From SICP: Exercise 3.22. Instead of representing a queue as a pair of pointers, we can build a queue as a procedure with local state. The local state will consist of pointers to the ...
2
votes
0answers
768 views

Union-set intersection-set for a binary-tree implementation of sets [SICP ex. 2.65]

From SICP: Exercise 2.65. Use the results of exercises 2.63 and 2.64 to give (n) implementations of union-set and intersection-set for sets implemented as (balanced) binary trees.41 I ...
1
vote
0answers
75 views

Implementing buffered channels in Guile

I was looking for a way of doing simple message passing in Guile and found some references to the module (ice-9 occam-channel) which is a pretty nifty, but undocumented, module for occam-like ...
1
vote
0answers
144 views

Write a definition of a semaphore in terms of test-and-set! operations

From SICP: Exercise 3.47. A semaphore (of size n) is a generalization of a mutex. Like a mutex, a semaphore supports acquire and release operations, but it is more general in that up to n ...
1
vote
0answers
147 views

Write a definition of a semaphore in terms of mutexes

From SICP: Exercise 3.47. A semaphore (of size n) is a generalization of a mutex. Like a mutex, a semaphore supports acquire and release operations, but it is more general in that up to n ...
1
vote
0answers
274 views

[SICP ex. 3.17] correctly count the number of pairs in an irregular list structure

From SICP: For background, here is exercise 3.16: Exercise 3.16. Ben Bitdiddle decides to write a procedure to count the number of pairs in any list structure. ...
1
vote
0answers
136 views

[SICP ex. 2.84] coercion of arguments using successive raising

From SICP: Exercise 2.84. Using the raise operation of exercise 2.83, modify the apply-generic procedure so that it coerces its arguments to have the same type by the method of successive ...
1
vote
0answers
298 views

(scheme [SICP ex. 2.82] coercion with multiple arguments

From SICP: Exercise 2.82. Show how to generalize apply-generic to handle coercion in the general case of multiple arguments. One strategy is to attempt to coerce all the arguments to the ...
1
vote
0answers
287 views

Union-set for ordered representation

From SICP: Exercise 2.62. Give a (n) implementation of union-set for sets represented as ordered lists. I wrote this answer: ...
1
vote
0answers
307 views

Standard Algebraic Derivative Calculator [SICP ex. 2.58 part b]

I had some difficulty with this problem, so I'm sure there is a better way. Here is the question from SICP: Exercise 2.58. Suppose we want to modify the differentiation program so that it ...
0
votes
0answers
68 views

Creating an updating hash table

I'm not sure if this implementation is good enough. The function takes a vector of 1 million chars and creates a table of the sequences that pass before the next occurrence of itself. Some questions ...