common-lisp Questions

2

Solved

I am trying to load a file in Lisp from a file in the same directory using a relative path. My file structure looks like this: repo/ subdir/ main.lisp test.lisp In main.lisp I have a number ...
Hodden asked 12/9, 2014 at 3:32

2

Solved

I'm using Emacs as my Lisp environment, and would like to have offline access to the Common Lisp HyperSpec. I downloaded it, and put the folders into my emacs.d directory. I then put the following ...
Morgue asked 15/5, 2014 at 10:52

2

Solved

Using #x... like below one obtains the decimal of hex value > #xB1 177 > #xA5 165 > #xFF 255 Say we have a list of hex, what is the correct syntax using mapcar #x... over the list? Be...
Hebetate asked 27/8, 2014 at 3:45

5

Solved

What is the rationale behind the design decision to have separate namespaces for values and functions in Common Lisp? What are the arguments for and against it?
Finance asked 25/7, 2010 at 8:13

7

Solved

I had never really thought about whether a symbol could be a number in Lisp, so I played around with it today: > '1 1 > (+ '1 '1) 2 > (+ '1 1) 2 > (define a '1) > (+ a 1) 2 The ab...
Dympha asked 3/6, 2010 at 14:15

2

Solved

I can't figure, is there any way to put something like _ in erlang, for "unused value" in destructuring-bind? For example there we have something like that: (destructuring-bind ((_SNIPPET (_TITL...
Sailplane asked 23/8, 2014 at 15:58

2

Solved

I've read that every form in Common Lisp returns something when evaluated. However, recently I've been playing with ASDF API and found a function that returns nothing: CL-USER> (asdf:clear-outp...
Lepsy asked 15/8, 2014 at 6:54

2

Solved

Sometimes we need to modify a place but here is no built-in function that meets our needs. For instance, here are incf and decf for addition and subtraction: CL-USER> (defvar *x* 5) *X* CL-USE...
Steffens asked 6/8, 2014 at 12:14

3

Solved

I want to do some simulations with ACT-R and I will need a Common Lisp implementation. I have three Common Lisp implementations available: (1) CLISP [1], (2) ECL [1], and (3) SBCL [1]. As you might...
Musso asked 2/8, 2014 at 6:28

1

Solved

I have installed slime using https://github.com/thephoeron/slime-pack and want to explore the common-lisp a bit more. How do I access the source for a particular function in emacs? for example, i...
Wyckoff asked 18/7, 2014 at 6:13

1

Solved

Is there a repeat directive for (format) in Common lisp, something like(I know this won't work): (format t "~5C" #\*) Just wondering if there isn't a more elegant way to do it than this:(from ro...
Defelice asked 15/7, 2014 at 9:28

1

Solved

In On Lisp, p. 267, Paul Graham provides an implementation of continuation passing macros: (setq *cont* #'identity) (defmacro =lambda (parms &body body) `#'(lambda (*cont* ,@parms) ,@body)) ...
Piccoloist asked 13/7, 2014 at 10:24

3

Solved

In Common Lisp, is there a function in the standard library that simply returns the parameter given (i.e. doesn't manipulate the data)? This function would be equivalent to (lambda (x) x). I'm look...
Cara asked 8/7, 2014 at 21:49

5

Solved

Christian Queinnec has written a masterpiece called LISP In Small Pieces, which features eleven Lisp Interpreters and two Lisp compilers. When you go to download the code from the website here - ...
Trocki asked 28/4, 2012 at 9:46

2

Solved

I am working on project euler problems in SBCL and keep a short file for every solution. Every problem has some 5am-based tests, which are referenced from a "main" test suite. These tests are run w...
Leonorleonora asked 11/6, 2014 at 19:42

2

Solved

BACKGROUND When using 64bit Steel Bank Common Lisp on Windows for a trivial identity function: (defun a (x) (declare (fixnum x)) (declare (optimize (speed 3) (safety 0))) (the fixnum x)) I...
Regenerative asked 18/2, 2014 at 16:11

2

Solved

Here's the thing: I don't "get" setf-expanders and would like to learn how they work. I need to learn how they work because I've got a problem which seems like a typical example for why you should...
Bananas asked 12/7, 2012 at 17:13

2

In Practical Common Lisp chapter 17. Object Reorientation: Classes section Accessor Functions, I was finding it difficult understanding the way SETF is being extended. The functions: (defun (setf...
Forefather asked 6/6, 2014 at 21:3

2

Solved

Basically, the title says it all: In Common Lisp, why is the null predicate called null. not nullp (to conform to other predicates such as evenp or oddp)? Is there a special reason for this?
Tog asked 4/6, 2014 at 12:34

2

Solved

I now have learnt about arrays and aref in Lisp. So far, it's quite easy to grasp, and it works like a charme: (defparameter *foo* (make-array 5)) (aref *foo* 0) ; => nil (setf (aref *foo* 0) 2...
Final asked 7/6, 2014 at 7:34

2

Solved

I want to delete some characters at the end of a string. I made this function : (defun del-delimiter-at-end (string) (cond ((eq (delimiterp (char string (- (length string) 1))) nil) string ) ...
Warring asked 2/6, 2014 at 17:57

3

Solved

I am confused about the &environment parameter in common lisp. In particular, what is it useful for, and why is it a parameter, rather than a special variable? EDIT: It would also be nice to ...
Ard asked 29/5, 2014 at 23:46

2

Solved

What is the difference between the keyword symbol :foo and the quoted symbol: 'foo Both stand for themselves, and can be used as an identifier. I can see that keyword symbols are mainly used ...
Hardnosed asked 31/5, 2014 at 10:54

2

Solved

So far I have been using mapcar to apply a function to all elements of a list, such as: (mapcar (lambda (x) (* x x)) '(1 2 3 4 5)) ;; => '(1 4 9 16 25) Now I learned that there is also the m...
Simla asked 31/5, 2014 at 9:46

5

Solved

As far as I understood, NIL is a symbol for many things: empty lists, or the boolean false. So far so good, but why there is sometimes NULL showing up in the output? clisp> (type-of NIL) NULL c...
Alyss asked 23/5, 2014 at 9:55

© 2022 - 2024 — McMap. All rights reserved.