common-lisp

Association in Common Lisp

There's a structure of the following format: (setq dist '(((1 1) 1) ((0 2) 3) ((1 2) 1) ((2 3) 3) ((3 5) 4))) Is there any function which, if I call (myf '(0 2)) could give me 3 or ((0 2) 3) Something like a reverse assoc ...

SBCL standard library documentation?

I want to learn and use SBCL because of its ease of learning and speed. (I've been playing with Lisp 3 years ago, and now am refreshing it.) But how can I learn what's included in the standard library, so that I don't re-implement things? After Python this is like a nightmare: the SBCL website has a manual that covers the software only,...

How to make a list of arrays, not their symbols, in Lisp?

I'm trying to make a function to get a delta between arrays, but right now just want to make a subset: get Nth element. (defvar p1 #(1 2)) (defvar p2 #(3 4)) (mapcar '(lambda (x) (aref x 0)) '(p1 p2)) debugger invoked on a TYPE-ERROR in ... The value P1 is not of type ARRAY. The same error if I make it with make-array. How do...

Where do these namings in common lisp come from?

Hi, in common lisp, the names labels and flet are somewhat peculiar to me. flet could be described as a sort of let for functions. So it named as such. What about labels? And where does the "f" of getf, setf, remf come from? Thanks. ...

Hunchentoot 1.0 returns only empty responses

I'm using an Intel Mac with Mac OS 10.5 and SBCL 1.0.29. I've done pre-1.0 Hunchentoot development here before, so I've had that installed (via asdf-install). Recently I started a new project, and decided I'd start from Hunchentoot 1.0. I asdf-install'ed Hunchentoot, and it seemed to install 1.0 (and deps) just fine. I can load it in...

What is the difference between require and load in common lisp?

I'm going through Practical Common Lisp, I'm almost finished, and one question that has not been answered for me so far (or maybe I just missed it) is the difference between "require" and "load". So what is the difference? Thanks. ...

How to make an empty sequence in common lisp?

A function takes a sequence as the parameter. In the function, I want to make an empty sequence of the same type of the parameter. Then I'll store something and return it such that the return type is the same as the parameter. But (make-sequence (type-of parameter) 0) will cause error if parameter is any list or vector of some length. ...

Can I write a DLL file that export some functions use the common lisp?

Can I write a DLL file that export some functions use the common lisp?Thank you! ...

Common Lisp Timer

I would like to start a timer in my common lisp application that after a certain amount of time it will call a certain method. What would be the best way to accomplish this? ...

What are the good "rich" IDEs for Lisp?

What are the good "rich" IDEs for Lisp? To clarify by "rich" I mean it should have a good look-up reference, auto complete, auto inclusion, checking of various sorts, some kind of compilation support, version management, REPL, etc. I have reviewed some of the previous questions/answers (Such as What’s a good Common Lisp implementation ...

Problem Installing Lispy Package Manager

Hi, I am installing Hunchentoot on a new machine. This time I thought I would try out Lispy, because it appears to be simplest way of managing the dependencies for Hunchentoot in a standard and hopefully automatic way. However, when I install it, it trips on not being able to verify a key. I have seen ASDF-INSTALL try to use a key bef...

Allegro Common Lisp software problem

Hello,I've just installed the Allegro Common Lisp CL Enterprise edition. The installation manual said if run (require:build) with output like "fast loading.."then means the installation is successful. However,after I run cg-user(1): (require :build),I only get "NIL". Does that mean my installation of the software is unsuccessful?Th...

Connect SBCL on Windows to SQL Server using Integrated Authentication

What is the path of least resistance in getting an SBCL application running on Windows to connect to a SQL Server instance, using integrated authentication? I have found posts on connecting from CL-SQL to SQL Server using ODBC connections but as far as I can tell, there is no way to this without first manually setting up a DSN. Is ther...

Mandelbrot Set implementation in Common Lisp.

I've been working on an implementation of the Mandelbrot Set in several different languages. I have a working implementation in C++, C#, Java, and Python, but the Common Lisp implementation has some bugs that I just can't figure out. It generates the set but somewhere in the pipeline the set gets distorted. I've tested and know with n...

Lisp format and force-output

I don't understand why this code behaves differently in different implementations: (format t "asdf") (setq var (read)) In CLISP it behaves as would be expected, with the prompt printed followed by the read, but in SBCL it reads, then outputs. I read a bit on the internet and changed it: (format t "asdf") (force-output t) (setq var ...

How can I get all possible permutations of a list with Common Lisp?

I'm trying to write a Common Lisp function that will give me all possible permutations of a list, using each element only once. For example, the list '(1 2 3) will give the output ((1 2 3) (1 3 2) (2 1 3) (2 3 1) (3 1 2) (3 2 1)). I already wrote something that kind of works, but it's clunky, it doesn't always work and I don't even real...

Scheme or Common Lisp

For a school project (a free choice project), I was planning on working my way through SICP(Structure and Interpretation of Computer Programs) and learning Scheme. After that I want to create something interesting with it (also part of this project). However, from what I've read, Scheme might not be the best dialect to use for a project ...

Is it possible to rewrite recursive function as macro in lisp?

I wrote this quicksort function: (defun quicksort (lst) (if (null lst) nil (let ((div (car lst)) (tail (cdr lst))) (append (quicksort (remove-if-not (lambda (x) (< x div)) tail)) (list div) (quicksort (remove-if (lambda (x) (< x div)) tail)))))) but I can't rewrite...

How to change a Hunchentoot session cookie name by specializing a function?

I'm using Hunchentoot and would like to change the name of the session cookie. This is implemented with a generic function and the docs say to change the name you can "specialize the function". I'm not really sure what this means here. I was under the impression that specializing a function is to dispatch a method on certain argument ty...

How can ecl include asdf dependencies in an executable? (take 2)

This question was asked and answered by ayrnieu at http://stackoverflow.com/questions/580083/how-can-ecl-include-asdf-dependencies-in-an-executable But the example code he linked to does not actually involve any dependencies. I've tried copying the model in the stumpwm code he refers to but I can't get it to work. He are my files. -...