common-lisp Questions

2

Solved

I was trying to install SLIME. I downloaded the zipped package and according to the README file, I have to put this piece of code in my Emacs configuration file: (add-to-list 'load-path "~/hacking...
Hail asked 26/9, 2012 at 18:2

2

Solved

I have an object o that is an instance of a class X in SBCL. I want a function write-X-object that serializes o to a file in such a way that when that file is read back in with load-X-object, the...
Merla asked 18/9, 2016 at 7:54

5

Solved

At least some implementations of Common Lisp don't allow user-defined constants to be used as array dimensions in some type specifiers. For example, in SBCL, this code: (defconstant +len+ 3) (def...
Aeolis asked 30/9, 2013 at 3:19

5

Solved

I am wondering if there is some way to call C++ code from Common Lisp (preferably portably, and if not, preferably in SBCL, and if not, well, then Clozure, CLisp or ECL). The C++ would be called i...
Caucus asked 5/9, 2009 at 5:16

6

Solved

Is there a function in Common Lisp that takes a string as an argument and returns a keyword? Example: (keyword "foo") -> :foo
Zymase asked 17/10, 2008 at 10:54

2

Solved

I'm making a simple applet in Common Lisp and I want to control it using mouse movement. I use LTK for the window. I couldn't find any function that would retrieve the mouse location. For example, ...
Cosmos asked 28/3, 2019 at 19:5

2

Solved

I've been doing some Genetic Programming and I've been separating functions into different function sets based on their arity; it's all rather complex. I'd like to know if there's a simpler way to...
Procedure asked 17/3, 2013 at 19:23

4

Solved

Once upon a time I was playing with macros and came up with this: (defmacro my-recursive-fact (n) (if (= 0 n) '1 (let ((m (1- n))) `(* ,n (my-recursive-fact ,m))))) And it worked. CL-USER&gt...
Lattimore asked 25/11, 2013 at 7:12

1

Solved

I have tried a lot to print a new line in lisp. I want to print a new line like java (system.out.println()), and not necessarily having anything. I know that print goes to a new line however I must...
Civic asked 1/3, 2019 at 22:58

14

I wanted to try and learn Lisp, but I very quickly gave up. I figured I'd try again. I'm looking at Problem 2 on Project Euler - finding the sum of all even Fibonacci numbers under 4 Million. I wr...
Homecoming asked 9/3, 2009 at 18:6

5

Solved

One thing I really miss when writing Common Lisp code is access to Python libraries, both standard library and third party modules. CLPython provides a limited subset of Python functionality which ...
Montes asked 2/3, 2011 at 22:13

3

Solved

I wrote the following loop using local-time: (defun count-dates (stop-date k) (loop for step = (local-time:today) then (local-time:timestamp- step 1 :day) while (local-time:timestamp>= step ...
Concerning asked 19/2, 2019 at 6:9

4

Solved

In CL, we have many operators to check for equality that depend on the data type: =, string-equal, char=, then equal, eql and whatnot, so on for other data types, and the same for comparison operat...
Grossularite asked 14/4, 2017 at 17:26

4

I was trying to use the slime-connect function to get access to a remote server with sbcl. I followed all the steps from the slime.mov movie from Marco Baringer, but I got stuck when creating the s...
Jueta asked 16/12, 2008 at 21:15

1

I come from a background in Haskell, and I want to learn Common Lisp. It's well discussed that CL is "not a functional language", but I would like to know whether it can be used as a functional l...
Headrail asked 26/1, 2019 at 3:38

0

I find the Common Lisp HyperSpec to be useful as a sort of man pages for the Common Lisp programming language. Is there a Scheme equivalent covering either the R7RS or R5RS standard (or for that ...
Naples asked 24/1, 2019 at 16:39

5

Solved

What is the Lisp convention about how many semicolons to use for different kinds of comments (and what the level of indentation for various numbers of semicolons should be)? Also, is there any co...
Millican asked 15/6, 2011 at 22:47

6

Solved

I wrote my silly function which returns a list without the last element in common lisp. Is there any more elegant solution to this problem? Here's my code: (defun list-without-last (l) (if (>...
Cuesta asked 17/5, 2012 at 13:18

3

Solved

When I compile the following code, SBCL complains that g!-unit-value and g!-unit are undefined. I'm not sure how to debug this. As far as I can tell, flatten is failing. When flatten reaches the u...
Asdic asked 15/11, 2015 at 19:56

2

Solved

Having recently discovered an active fork of weblocks, I would like to combine it with the ORM library mito. Weblocks defines a macro defwidget, which in practice wraps defclass like so: (defcla...
Insessorial asked 9/12, 2018 at 16:54

1

Solved

Generics seem to offer a nice facility for pulling out a common word and letting it act on things according to the types you pass it, with extensibility after-the-fact. But what about common words...
Rhetorician asked 1/12, 2018 at 20:37

3

Solved

I set myself to the task to write a Common Lisp function that concatenates two lists without using append. Common Lisp input (concat-lists '(1 2 3) '(4 5 6)) should return (1 2 3 4 5 6) Even thou...
Scrogan asked 20/11, 2018 at 22:51

2

Solved

i am having problem exporting a macro, it works when in it is declared in the same package, but not when it is imported. I use Emacs, SLIME, Clozure on Windows. Package file (defpackage :tokenize...
Unblessed asked 26/5, 2017 at 10:48

7

Solved

In particular, I just want to ensure that two lists have the same elements, ignoring order
Salley asked 5/11, 2010 at 22:48

2

Solved

Is there a build-in function in Common Lisp to coerce any thing into it's boolean value, like the bool function in Python does?
Venture asked 29/10, 2018 at 15:9

© 2022 - 2024 — McMap. All rights reserved.