Questions tagged [common-lisp]

Common Lisp is a standardized version of the Lisp programming language intended for production-strength power.

Common Lisp, the programmable programming language.

See the Wikipedia page on Common Lisp for more information about the language. There is an online version of the ANSI Common Lisp standard and a list of recommended Common Lisp implementations. Many Lisp specific mailing lists are archived at Gmane.

There is a stackoverflow chat room for Lisp-like languages: Lisp.

Popular Common Lisp implementations

Free Common Lisp Programming Books

Common Lisp Programming Books

See also

6194 questions
4
votes
1 answer

Common Lisp: making rules about input values

While coding a predicate that tests whether or not a number is divisible by all integers across a certain range, I was wondering if it is possible to make rules about input, maybe through the "declare" symbol? Code: (defun integer-divisiblep (n m i)…
Soyuz
  • 1,077
  • 1
  • 8
  • 16
4
votes
1 answer

using a foreign library in sbcl - uffi or cffi?

I am an struggling with using a C++ library I have just sucessfully compiled on ubuntu in sbcl. I have tried to use the .h file parser 'ah2cl' but from the documentation it is not clear if I require UFFI or CFFI (is there a difference?). My attempts…
4
votes
1 answer

Emacs: ac-slime for auto complete

I am trying to add auto complete for *.lisp files. My slime setting is: (add-to-list 'load-path "~/.emacs.d/plugins/slime/") (setq slime-lisp-implementations '((sbcl ("/opt/sbcl/bin/sbcl" "--core" "/opt/sbcl/lib/sbcl/sbcl.core") …
Boris
  • 555
  • 7
  • 22
4
votes
1 answer

How to reload and restart quickly in SLIME in development

I started using emacs and slime to develop some little service. I have found a way to reload the code after changes but I want this a lot more convenient and faster. This is how I doo it now: 1) start emacs, start slime, then in slime: 2) (load…
SHernandez
  • 1,060
  • 1
  • 14
  • 21
4
votes
6 answers

Lisp: Elegant way to strip trailing nil's from a list? (Review)

I want to write a function that removes trailing nil's from a list. I first tried to write it elegantly with recursion, but ended up like this: (defun strip-tail (lst) (let ((last-item-pos (position-if-not #'null lst :from-end t))) (if…
Johan Kotlinski
  • 25,185
  • 9
  • 78
  • 101
4
votes
2 answers

Common Lisp Error: Undeclared Free Variables

I have a function that I'm trying to compile, but I've been pulling my hair out for the last 30 minutes trying to figure out why this code is giving me a Undeclared free variable error. I'm using Emacs, and cannot decipher why I'm getting this…
Zchpyvr
  • 1,119
  • 3
  • 12
  • 26
4
votes
4 answers

How do I use (require :PACKAGE) in clisp under Ubuntu Hardy?

I am trying to evaluate the answer provided here, and am getting the error: "A file with name ASDF-INSTALL does not exist" when using clisp: dsm@localhost:~$ clisp -q [1]> (require :asdf-install) *** - LOAD: A file with name ASDF-INSTALL does not…
dsm
  • 10,263
  • 1
  • 38
  • 72
4
votes
2 answers

Defining custom setf for class in lisp

Suppose I have a class called board: (defclass board () ((blocker :accessor blocker :initarg :blocker :initform 0)) According to this book I can define a custom setf for blocker by: (defmethod (setf blocker) (new-blocker (b board)) …
Mark
  • 8,408
  • 15
  • 57
  • 81
4
votes
1 answer

Common Lisp: getting version of an ASDF package

I know I can get the version number of ASDF itself with (asdf:asdf-version). But the same does not work with all other packages I load using ASDF, e.g. (my-system:my-system-version). Is there any programmatic way to get the value of a :version…
4
votes
1 answer

Reading User Input in Emacs Inferior Lisp

I'm trying to learn Lisp by reading Practical Common Lisp and I've hit a small stumbling block early on when trying to read user input. I've defined prompt-read to prompt the user for input: (defun prompt-read (prompt) (format *query-io* "~a: "…
mclark1129
  • 7,532
  • 5
  • 48
  • 84
4
votes
3 answers

Common Lisp: Launch subprocess with different working directory than lisp process

Suppose I have a directory A, and subdirectory B. I cd into A and launch lisp. In that lisp process, I would like to launch a Python subprocess where Python sees B as its current working directory. The lisp process needs to have cwd in A, and the…
Clayton Stanley
  • 7,513
  • 9
  • 32
  • 46
3
votes
3 answers

Neater way of prying a DECLARE from a &body

I'm writing a macro that generates a DEFUN call—accordingly, I want to ensure that any DECLAREs in the body to the macro get placed immediately after the DEFUN. Here's what I have: (defmacro defsynced (name (&rest args) &body body) (let* ((decl…
Asherah
  • 18,948
  • 5
  • 53
  • 72
3
votes
1 answer

Common Lisp Sampling in Parallel

Assume that I want to draw samples from some probability distribution. In the case below I draw some uniformly distributed rv's between 0 and 1 for 10000 times. I do not care about the ordering of the random samples in the vector, after all they are…
jkt
  • 2,538
  • 3
  • 26
  • 28
3
votes
2 answers

How to specialize generic function for subclasses of given class

How can i specialize a generic function to take symbols designating subclasses of given class. For example: (defclass a () ()) (defclass b (a) ()) (defclass c (b) ()) (defclass d () ()) (defgeneric fun (param)) (defmethod fun ((param (
Necto
  • 2,594
  • 1
  • 20
  • 45
3
votes
2 answers

Parsing S-expressions with arbitrary delimiters in LISP

(I'm new enough to Lisp not to know how to do this, but familiar enough to know there just must be a simple way.) I was intrigued by an article that I read recently which advocated storing log files as Lisp-style S-expressions, so that the log files…
chimeracoder
  • 20,648
  • 21
  • 60
  • 60
1 2 3
99
100