Skip to main content

Questions tagged [common-lisp]

Common Lisp, or ANSI Common Lisp, is a standardized version of the Lisp programming language intended for production-strength power and libraries.

Filter by
Sorted by
Tagged with
5 votes
1 answer
95 views

I asked for feedback on part 1 of this Advent of Code challenge: Advent of Code 2015 "Not Quite Lisp", in Common Lisp I have read everyone's feedback and done a lot of further reading. I ...
Mountain Man's user avatar
4 votes
2 answers
144 views

I've been toying around with random programming languages for about 15 years. I'm just more of a sysadmin type than a programmer, but I've always wanted to do programming, so here I am. I know a bit ...
Mountain Man's user avatar
3 votes
1 answer
108 views

I have recently started learning lisp by reading ANSI Common Lisp, and I thought advent of code would be good for practice. Any feedback on my code for Day 1 would be appreciated. ...
advent-of-code-asker's user avatar
5 votes
2 answers
382 views

A simple recursive descent JSON parser. The entrypoint to the code is the parse function. Since I'm pretty new to common lisp, I wanted to get feedback on how to ...
zoravur's user avatar
  • 51
7 votes
2 answers
387 views

Introduction Here's an interpreter, written in Common Lisp, for a simple Lisp dialect that has some semi-“advanced” features, namely lexical scope with closures, ...
texdr.aft's user avatar
  • 268
3 votes
0 answers
139 views

I've implemented a destructive merge and quick sort in common lisp, but the code feels verbose and highly imperative. I was wondering if anyone could offer guidance on idioms that could make the code ...
bfair's user avatar
  • 131
0 votes
2 answers
343 views

I wanted to split a list into 2 parts, as per the chosen size, first the size and then the list. Example: (split 3'(1 3 5 7 9)) ...
The Nightm4re's user avatar
3 votes
0 answers
283 views

My implementation is based on the incremental prime sieve described on Wikipedia. I'm relatively new to lisp so I would appreciate any comments on my coding style or on the algorithm. The below code ...
rose's user avatar
  • 325
1 vote
1 answer
81 views

I'm new to common lisp. I basically translated a procedural implementation of balanced parenthesis using a stack to common lisp. How can I make my implementation more lispy? ...
Caesar's user avatar
  • 11
2 votes
1 answer
106 views

I am looking for ways to improve this little utility function: ...
Michaël Le Barbier's user avatar
2 votes
0 answers
138 views

I have written a Common Lisp implementation of Scheme's s-expression comments (SRFI 62): ...
Flux's user avatar
  • 403
4 votes
0 answers
58 views

This is a rewrite of the Dependencies program submitted previously at https://codereview.stackexchange.com/questions/255635/detecting-dependencies-in-common-lisp-project-files/256336?noredirect=1#...
davypough's user avatar
  • 405
2 votes
1 answer
147 views

The following short program is a collection of routines for detecting the dependencies among a project’s component files. Dependencies serve as a rough measure of the complexity of a program. ...
davypough's user avatar
  • 405
4 votes
1 answer
80 views

An elevator starts on the ground floor 0 and moves up or down by one floor at a time as described by an input string travel. ...
user235906's user avatar
4 votes
1 answer
91 views

This defines count-pairs which takes a collection of integers returns the number of pairs of integers that are equal to each other. If the input collection has ...
user235906's user avatar
4 votes
1 answer
368 views

I created a library with two CLOS class to implement a deque structure similar to the one available in C++, plus a few Lisp-ian twists. The two classes are node, ...
Paulo Mendes's user avatar
2 votes
0 answers
66 views

My answer to Project Euler problem 4 (largest palindrome of product of two 3-digit numbers) is below. Please suggest improvements, style changes, indentation, commenting, naming, ... And nitpicks are ...
pmg's user avatar
  • 530
3 votes
2 answers
299 views

My answer to Project Euler problem 3 (largest prime factor of 600851475143) is below. Please suggest improvements, style changes, indentation, commenting, naming of "objects", ... ...
pmg's user avatar
  • 530
3 votes
1 answer
296 views

I've started learning Lisp one more time (I seem to do this every couple years); my experience is with C, basically. I attempted to solve the Project Euler problem 1: If we list all the natural ...
pmg's user avatar
  • 530
3 votes
0 answers
54 views

I stumbled across the 100 prisoners problem on Rosetta Code. I thought it would be fun to add a Common Lisp solution, see below. Before I publish my solution I would like to have some feedback on my ...
Martin Buchmann's user avatar
4 votes
0 answers
334 views

In the following hunchentoot easy-handler definition: ...
mwal's user avatar
  • 483
4 votes
0 answers
191 views

Coming from this question https://stackoverflow.com/questions/58131614/how-to-convert-json-string-into-complex-clos-object-using-cl-json-library I've finally come up with the following solution. I ...
user212061's user avatar
6 votes
1 answer
129 views

I took a simple BST implementation which is only really a set (i.e. just element, not key value), and decided to add a node count. I was translating this, which is explained here. In particular the ...
mwal's user avatar
  • 483
1 vote
1 answer
79 views

A fairly simple program that I tried to write in Common Lisp in order to practice/learn. I'm sure this can be done more elegantly but Lisp's string handling seems to be very werd. ...
Mark Green's user avatar
2 votes
3 answers
314 views

Consider the following function to traverse a BST ...
mwal's user avatar
  • 483
2 votes
1 answer
139 views

This is an experiment on extending a basic built-in Common Lisp sequence function (namely remove), in order to provide more functionality with little or no impact ...
davypough's user avatar
  • 405
3 votes
3 answers
138 views

I've been studying the BST code in Paul Graham's ANSI Common Lisp. He provides (my comments): ...
mwal's user avatar
  • 483
3 votes
3 answers
2k views

I'd like to find a more elegant solution to the following. Below appears correct, but it's hard to read. Is my first use of the map function below poor in stylistic terms? It feels that way, and ...
mwal's user avatar
  • 483
1 vote
2 answers
161 views

I have been meaning to learn LISP and for a small task I wanted to find out the sum of all integers on STDIN. So for > clisp a.lisp 1 2 3^D 6 My code is as ...
user45891's user avatar
  • 630
0 votes
1 answer
79 views

Regarding the following code ...
mwal's user avatar
  • 483
5 votes
1 answer
100 views

I wrote a little program that adds and subtracts some algebraic expressions. In my code (2 x 3) represents \$2x^3\$. The purpose of this post is to get some ...
Job H's user avatar
  • 51
2 votes
2 answers
206 views

During implementation and testing of different small hobby projects I often reach the point where I need (at least I like it more) some random data beyond the usual foo-bar strings or lists. Random ...
Martin Buchmann's user avatar
6 votes
1 answer
186 views

Inspired by a question on SO I was checking how to calculate the cube root of an integer and found a C-ish solution on Hacker's Delight: ...
Martin Buchmann's user avatar
2 votes
1 answer
628 views

I decided to do an algorithms course (Roughgarden's on Coursera), and am setting out to implement each algorithm as it's introduced, in Lisp. We start with mergesort which is introduced as the ...
mwal's user avatar
  • 483
7 votes
1 answer
410 views

I implemented a basic binary heap in Common Lisp to learn programming using the CLOS. It is quite neat and self-contained, the core of the program is about 100 SLOC. The whole repository can be found ...
Thomas Houllier's user avatar
3 votes
1 answer
70 views

I'm working through Paul Graham's "ANSI Common Lisp". In Chapter 6 (p105), he introduces the idea of utility functions. He points out these are core to bottom-up programming and reusability. He ...
mwal's user avatar
  • 483
1 vote
1 answer
1k views

Code below is answer to an exercise in Paul Graham's ANSI Common Lisp (ex. 4.1). The challenge is to rotate an array by 90 degrees. I found an example solution which I've commented below. It seems ok'...
mwal's user avatar
  • 483
5 votes
0 answers
190 views

I’ve written a program for solving a problem using standard single-threaded code. However, it looks like it could be recast as a multi-threaded problem using divide & conquer. Since this is a ...
davypough's user avatar
  • 405
1 vote
1 answer
172 views

I'm working through Paul Graham's ANSI Common Lisp and in Exercise 2.5, I'm stumped. My specific question (I wasn't sure whether this type of question is suitable for stack overflow, code review, or ...
mwal's user avatar
  • 483
3 votes
2 answers
121 views

The problem is to take a list of integers and map them to another list containing those integers added to their respective position in the list. Example runs with required outputs: ...
mwal's user avatar
  • 483
6 votes
1 answer
573 views

Looking for hints on style and clarity re. below. While I'm not saying speed is irrelevant, it's less of a priority than style & avoiding bad habits at this point. Focus is on clean use of ...
mwal's user avatar
  • 483
1 vote
1 answer
367 views

The master launch sequence consists of several independent sequences for different systems. Your goal is to verify that all the individual system sequences are in strictly increasing order. In other ...
JRowan's user avatar
  • 121
4 votes
1 answer
191 views

I've solved an assignment a week ago, which is my first assignment using Lisp. Tasks: Task 1: a. Given a tree as recursive lists, print the tree in breadth first order. b. Given a tree like in ...
Mikhail Krassavin's user avatar
3 votes
2 answers
568 views

I am trying to learn some Common Lisp, except basically all of my computing background is the C family of languages. So, I'm starting small. I have made a Tic-Tac-Toe game, and I am looking for some ...
user1762507's user avatar
4 votes
1 answer
494 views

Where I stand on Lisp So, Lisp. It's been on my radar for years and I'm finally getting around to learning it. The syntax is foreign but I find I'm having the most difficulty in the areas of ...
Braden Best's user avatar
2 votes
1 answer
188 views

This is a function intended to take an XML element (in closure XML format) and a name and find a piece of simple data by that name (either in a tag or attribute) within that XML element. It works, but ...
Mark Green's user avatar
6 votes
2 answers
985 views

I am trying to create a function prime-factors that returns the prime factors of a number. To do so, I created is-prime function,...
Benz's user avatar
  • 61
4 votes
0 answers
90 views

The code below gives me the list of sublists of a list. Code can still be improved to avoid the use of append, right? ...
Alexandre Rademaker's user avatar
4 votes
1 answer
216 views

I have implemented Greed as part of the lisp-koans extra-credit challenge. I am seeking some general feedback with respect to Common Lisp style, appropriate use of language features, and so forth. ...
dtg's user avatar
  • 143
3 votes
2 answers
911 views

I have a text file containing integers in different lines which I want to read into a list of lists. So 01 11 14 45 50 09 should become ...
Martin Buchmann's user avatar