# Tagged Questions

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.

23 views

### Find common factor of numbers in a list

This program calculates common factor for given numbers. The original use case is to find a possible resolution for pixel games that scale well with new screen resolutions (that's why I don't have any ...
50 views

### Netstring parser in common lisp

Below is a netstring parser I wrote in Common Lisp. The docstring contains the usage and return. ...
62 views

### Exercism: clean and format a phone number in Clojure

Problem statement Phone Number Write a program that cleans up user-entered phone numbers so that they can be sent SMS messages. The rules are as follows: If the phone number is ...
79 views

### SICP exercise 1.28 - miller-rabin primality test

From SICP Exercise 1.28: One variant of the Fermat test that cannot be fooled is called the Miller-Rabin test (Miller 1976; Rabin 1980). This starts from an alternate form of Fermat’s Little ...
66 views

### Selecting HTML nodes

I'm new to Clojure, and I'm writing some code that processes HTML. I'm parsing the HTML using clj-tagsoup and then trying to pull out the relevant bits with this function: ...
23 views

### SICP 1.3 Sum of Squares of two largest numbers

Define a procedure that takes three numbers as arguments and returns the sum of squares of the two largest numbers. I'm using just the machinery that was developed so far in SICP to be true to the ...
40 views

### SICP - exercise 1.12 - pascal's triangle

From SICP: Exercise 1.12: The following pattern of numbers is called Pascal’s triangle. 1 1 1 1 2 1 1 3 3 1 1 4 6 4 1 . . . The numbers at the ...
118 views

### Tail recursive FizzBuzz in Common Lisp

I solved FizzBuzz using tail recursion. Is it efficient enough? ...
111 views

61 views

### Split every vector in a sequence into two parts: old elements that were contained in previous vectors and new elements never before seen

Am I doing it right? Is there some function in the standard library I should be using? This is my first real(ish) world Clojure program… Input ...
174 views

### Reading/writing null-terminated strings from socket

I need to handle C style ('\0' delimited) strings from/to a socket and came up with this as a first attempt: ...
328 views

### Is this IRC bot utility library Racket-y enough?

To help myself learn Racket, I ported a simple JavaScript ircbot module I wrote for Node.js to Racket. The Racket version is built atop the Racket irc package, so ...
151 views

### Getting functional Common Lisp code for handling state in a SDL animation

The following code draws a red rectangle bouncing between the borders of a white display. I'm not particularly happy with the update function: ...
224 views

### FizzBuzz - officially now in CLISP

I had to jump on the bandwagon for this one. The task does a great job of helping you learn a language you're unfamiliar with. So today I present you with my version of the infamous FizzBuzz game in ...
1k views

### Finding the sum of all the multiples of 3 or 5 below 1000

As a Lisp (and functional programming) newbie, I wrote the following code that finds the sum of all the multiples of 3 or 5 below 1000, and I suspect that it is lousy: ...
164 views

### Creating a repetitive string in Common Lisp

I needed to have a Lisp function that could produce a string of a certain length, created by repeated concatenations of a another string given as argument (so for example by giving 10 and "abc" I ...
70 views

### Accessor functions in elisp

I'm writing some simple emacs tools for visual studio solutions. I've got a function sln-process-csproj-file. This function takes the path to a project, and ...
499 views

### Generic sequence splitter in Common Lisp

I wrote a function split-seq-by-n which accepts a sequence and a number and splits the sequence into subsequences of length n (the last subsequence getting the ...
2k views

### Clojure Neural Network

After reading this article about Neural Networks I was inspired to write my own implementation that allows for more than one hidden layer. I am interested in how to make this code more idiomatic - ...
70 views

### Calculating series of rows to use to play a melody on 5-row Bayan Accordion

This was my first attempt at writing a program in LISP. Can anyone give any guides as to how it could be improved? The multiple loops in best-pattern seem awkward (I'd normally do that in just one ...
102 views

### Rewrite apply function to use recursion instead

Probably the hardest part of learning lisp has been to think in the "lisp way" which is elegant and impressive, but not always easy. I know that recursion is used to solve a lot of problems, and I am ...