common-lisp Questions

5

Solved

I have this homework in LISP where I need to sort out atoms and then sublists from a list. I'm sure this is supposed to be easy task but as I'm not much of a programmer then this is really taking q...
Semiaquatic asked 13/5, 2012 at 15:59

2

Exactly as the question says. I want to use shared memory to communicate between two lisp processes. Any pointers on how to do that? I can see some tutorials on doing this in clozure at :- http:/...
Astrograph asked 12/12, 2014 at 19:57

3

Solved

Is there a way to find out how much memory is used by an instance of a class or basic data types in general? I have a toy webframework in cl that creates and manages web pages with instances of c...
Frascati asked 1/9, 2012 at 18:58

3

Solved

The example below is given in Paul Grahams ANSI Common Lisp as an example of doing encapsulation: (defpackage "CTR" (:use "COMMON-LISP") (:export "COUNTER" "INCREMENT" "CLEAR")) (in-package ctr...
Enclosure asked 7/12, 2011 at 13:26

3

Is there a Common Lisp function or typical way for creating a temporary file name or file?
Beagle asked 6/9, 2009 at 5:49

1

Solved

I'm writing an multiarchitecture assembler/disassembler in Common Lisp (SBCL 1.1.5 in 64-bit Debian GNU/Linux), currently the assembler produces correct code for a subset of x86-64. For assembling ...
Reiterate asked 24/11, 2014 at 0:4

3

Solved

What I'm trying to do is this: (defgeneric fn (x)) (defmethod fn ((x (integer 1 *))) "Positive integer") (defmethod fn ((x (integer * -1))) "Negative integer") I want a generic function that...
Bruch asked 23/11, 2014 at 3:57

3

Solved

I am trying to find a solution to typical diamond inheritance problem in Common Lisp CLOS. The code : (defclass C1.0 () ... ) (defclass C2.1 (C1.0) ...) (defclass C2.2 (C1.0) ...) (defclass C3.0 (...
Bennink asked 22/11, 2014 at 4:46

2

Solved

There's a format directive to zero-pad digits. cl-user> (format nil "~12,'0d" 27) "000000000027" and there's a similar-ish directive to left-align strings while padding them cl-user> (for...
Alasteir asked 18/11, 2014 at 20:45

1

Solved

I expanded the macro below to see how it worked and found myself a little confused. (loop for i below 4 collect i) expands to (I have cleaned it up a little for readability) (block nil (let ((...
Telepathist asked 17/11, 2014 at 10:0

3

Solved

If we assign a value to a variable: (setf i 10) and then a create a lambda function closing over it: (setf f #'(lambda () i)) We have the behavior (incf i) ;=> 11 (funcall f) ;=> 11 ...
Firework asked 3/11, 2014 at 0:21

1

Solved

I'm trying to get three numbers out of a string (parse-integer "12 3 6" :start 0 :junk-allowed t) 12 ; 2 Now this returns 2 as well, which is the number where it could be parsed. So I can now gi...
Inefficient asked 3/11, 2014 at 2:49

3

Solved

The following page talks about how atoms work in Clojure. It doesn't say a whole lot about the differences between atoms in Clojure and other lisp dialects. What is the primary difference between...
Ghats asked 8/9, 2010 at 6:26

7

Does there exist anything like CLOS (Common Lisp Object System) for Clojure?
Fleming asked 28/10, 2010 at 19:9

2

Solved

I have a recursive function which needs to recurse until it finds a certain result. However in the body of my function after my first recursive call I might do some other calculations or possibly r...
Unalloyed asked 10/10, 2014 at 4:17

2

Solved

I'm having some trouble understanding the scope of variables and functions when defined inside a function call. I tried searching for this scope, but could not find a suitable answer (or maybe was ...
Twitty asked 7/10, 2014 at 7:57

2

Solved

I'm fairly new to Lisp, and I've run into a printing issue. I have one function which does printing to the standard output (among other things). I want to then run this function through another fun...
Gunter asked 6/10, 2014 at 3:0

2

Solved

I'm very new to Lisp and am trying to write a program that simply asks a user to enter 3 numbers and then sums them and prints the output. I've read that you can you a function like: (defvar a) ...
Cyclopropane asked 3/10, 2014 at 1:7

2

Solved

So, I'm trying to learn Lisp, and I've come across a problem in the definition of what a String is. I'm reading the ANSI Common Lisp by Paul Graham, and in this book it states that a String is a v...
Malaco asked 2/10, 2014 at 15:40

2

Solved

Is there a way to parse integers to their char equivalents in Common Lisp? I've been looking all morning, only finding char-int... * (char-int #\A) 65 Some other sources also claim the existan...
Subirrigate asked 2/10, 2014 at 8:58

1

I want to learn Common Lisp and have installed emacs (24.3) and slime via the emacs package manager. In the slime REPL syntax highlighting doesn't work. When I start Lisp-Mode (while in the slime ...
Lodicule asked 12/9, 2014 at 13:29

1

Solved

I have to compute a polynomial like this -- f(x) = x^4 - 2.274x^3 + 1.8x^2 - 0.576x + 1.0 with this lisp function -- (defun polynomial (x) (+ (+ (+ (+ (expt x 4) (* -2.274 * (expt x 3))) (* 1...
Benne asked 23/9, 2014 at 20:5

1

Solved

Previously I had been using "being the elements of" feature of loop to iterate over a sequence of an unknown type. I just found out that "being the elements of" is not provided in every implementat...
Jilolo asked 17/9, 2014 at 21:33

2

Solved

I've been trying to use Quicklisp packages in an executable script of mine. A (trivial) working example is: #!/usr/bin/sbcl --script (eval-when (:compile-toplevel :load-toplevel :execute) (ql:qu...
Unalterable asked 15/9, 2014 at 23:9

1

Solved

I'm reading Gigamonkey's (Peter Seibel's) Practical Common Lisp, and came across the following statement in the section about DO in the Macros chapter: As with the variable definitions in a L...
Taylor asked 13/9, 2014 at 23:43

© 2022 - 2024 — McMap. All rights reserved.