Lisp is a family of programmable programming languages.

learn more… | top users | synonyms

2
votes
1answer
21 views

Scheme/Racket: idiomatic infix math evaluator

Inspired by xkcd and a couple of praising blog posts, I decided to try out Lisp. It seemed that the best-supported dialect was Racket, itself a variant of Scheme, so I went with that and wrote an ...
2
votes
0answers
110 views

Connect Four AI (Minimax) in Clojure

I wrote a Connect Four game inlcuding 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 ...
2
votes
1answer
31 views

LISP - Modify string

I have to write a program that changes a string's vowels, consonants and other symbols into C, V respectively 0. I've done this but I wonder if there is a more efficient and elegant way to do it. ...
0
votes
2answers
52 views

Improving readability of non-recursive depth first search function in Lisp

As a free-time activity in order to learn some Lisp I had to implement depth first directed graph search. Due to large graph size (800K nodes, 5M arcs) recursion-based approach I could devise didn't ...
0
votes
1answer
49 views

Proper use of reduce, nested loops

Below is an implementation of Dijkstra's shortest path algorithm. It's input graph is represented as an association list of source nodes to assoc of target node and arc weight. My question is about ...
1
vote
1answer
62 views

How to improve readability of a big lisp function

My main method (remove-random-edge) looks quite difficult to read. I'm new to list, so would appreciate any advice on how to improve the code. (defun find-node (node graph) (find-if #'(lambda (i) ...
4
votes
1answer
100 views

Seeking advice on lispiness of style and approach

I'm new to Lisp and I'm yet to wrap my head around the Lisp way of writing programs. Any comments regarding approach, style, missed opportunities appreciated: In particular, please advice if I build ...
2
votes
1answer
107 views

Looking for any improvements to my Common Lisp code

To start with Common Lisp I am doing Project Euler using this language. Usually I manage to solve problems but I am quite sure that my code is not as efficient as it could be in Common Lisp. That is ...
5
votes
1answer
109 views

First Go at Clojure and Functional Programming in General

Here's the code... My goal is to simulate a Pile shuffle of a vector. Here's the function.. (defn pile ([cards] (pile cards 3 1)) ([cards num_piles] (pile cards num_piles 1)) ([cards ...
3
votes
2answers
112 views

Combinations of list elements

It was written in Emacs Lisp and requires Common Lisp loop facility. Can this code be improved? Did I hit any anti-patterns along the way? (defun combos (list) (let* ((a (car list)) (d ...
2
votes
1answer
124 views

Counting Ways to Make Change — Is this good functional/Lisp style?

I have just started learning some Scheme this weekend. I recently solved a problem that goes something like: Count the number of ways possible to give out a certain amount of change using 1 5 10 25 ...
3
votes
1answer
217 views

Connect Four: Bitboard checking algorithm

I'm rather new to Clojure and so I decided to program a Connect Four for fun and learning. The code below is a Clojure implementation of this bitboard algorithm. The whole code can be found here: ...
3
votes
2answers
72 views

simple “if”-less algebraic computation using CLOS

For educational purposes I've tried to implement a simple algebraic OOP example using CLOS. The functionality is as far as I can say as it is supposed to be. The intended approach was to implement a ...
1
vote
1answer
125 views

Solution to 99 lisp problems: P08 with functional javascript

Solution to 99 lisp problems: P08, with functional javascript If a list contains repeated elements they should be replaced with a single copy of the element. The order of the elements should not ...
2
votes
0answers
115 views

iterative copy-tree in lisp

The common lisp function copy-tree is often implemented in a recursive way, and thus is prone to stack overflow. Here is my attempt at writing an iterative version, one-pass, no stack, no ...

1 2 3 4 5 6
15 30 50 per page