common-lisp Questions
4
Solved
I read in the book 'On Lisp' that one should avoid excessive use of cons in the body of expanded macros. Why is cons considered to be an inefficient operation? Does Lisp not do structure sharing wi...
Theriault asked 13/2, 2010 at 2:27
2
Solved
Since Common Lisp's function arguments evaluate in left-to-right order, why wouldn't use an ordinary function:
(defun progn2 (&rest body)
(first (last body)))
instead of special form?
Taste asked 16/6, 2013 at 20:46
3
Solved
This is one doubt that always made me curious.
Why is it necessary to also recompile the definitions that use a Common Lisp macro when we modify it (besides, obviously, recompile the modified Comm...
Charteris asked 7/6, 2013 at 10:20
1
Solved
I've been getting a strange behavior when invoking a destructive definition receiving as argument a local variable whose type is a list created with a quote.
Destructive function:
(defun insert-a...
Olnee asked 3/6, 2013 at 8:53
3
SBCL 64bit, 1.1.7
If I want to create a package and use a little symbols from package :CL, I will create a package like this one:
(defpackage :foo
(:import-from :cl
:defun :defmacro :in-packag...
Studding asked 30/5, 2013 at 13:20
3
I have found that SBCL 'do-symbols' (and loop) return duplicate items.
Testing environment: SBCL 1.1.4 x86 on Windows
Firstly, We define some helper functions:
;; compress from Ansi-Common-Lisp
...
Tokenism asked 27/5, 2013 at 4:31
4
Solved
Let's say I build an application on top of net.aserve and bordeaux-threads. My package declaration might look like this:
(defpackage :my-package
(:use :cl :net.aserve :bordeaux-threads)
(:export...
Sargassum asked 23/3, 2012 at 0:6
4
Solved
Scheme offers a primitive call-with-current-continuation, commonly abbreviated call/cc, which has no equivalent in the ANSI Common Lisp specification (although there are some libraries that try to ...
Wace asked 20/5, 2013 at 14:35
2
Solved
I want to be able to translate a certain directory in my homedirectory on any OS to the actual absolute path on that OS e.g. (make-pathname :directory '(:absolute :home "directoryiwant") should be ...
Carpous asked 20/5, 2013 at 18:37
2
I'm trying to create a class that can store a vector of symbols in a slot in SBCL. I cannot figure out how to set it up.
My best guess thus far has been
(defclass Individual ()
((discrete-decisi...
Fornof asked 23/9, 2012 at 21:41
4
Solved
I'd like to learn the internals of Lisp, so I want to see how everything is implemented.
For example,
(macroexpand '(loop for i upto 10 collect i))
gives me (in SBCL)
(BLOCK NIL
(LET ((I 0)...
Armandinaarmando asked 16/5, 2013 at 5:48
2
Solved
I am working in Common Lisp, trying to make Windows game minesweeper.
I have a list (1 1 1 2 2 2 3 3 3) and want to print that like matrix
(1 1 1
2 2 2
3 3 3)
How to do that?
Edit
I am at t...
Siffre asked 12/5, 2013 at 13:7
6
I did a fair amount of Lisp programming a few years back, but it was all really console-based things. I did use cells-gtk(2), but now that's really not maintained anymore and obviously we're ...
Norman asked 4/5, 2013 at 14:13
4
Solved
I have the following common lisp functions: (aggregate line1 line2) and (queuer data result).
queuer should push into result either the values line1 and line2 if they have the 1st field different,...
Lemay asked 6/5, 2013 at 9:56
5
It is almost impossible to google, hence my understanding is limited to contextual clues from reading through the slime source code: perhaps it is part of the object system in common lisp? Somethin...
Bergren asked 26/4, 2011 at 3:59
2
What is the best practice for selectively passing evaluated arguments to a macro form?
To elaborate: The usefulness of macros lies in its ability to receives unevaluated parameter, unlike the defa...
Olwen asked 27/3, 2013 at 21:16
2
Solved
Has anyone been able to successfully deploy an app on Heroku with the Heroku Common Lisp Buildpack using Hunchentoot?
I'm getting a
! Heroku push rejected, no Cedar-supported app detected
and ...
Ultimatum asked 12/3, 2012 at 2:2
1
I have a text file with one sentence per line. I would like to lemmatize the worlds in each line using hunspell (-s option). Since I want to have the lemmas of each line separately, it wouldn't mak...
Joaniejoann asked 13/4, 2013 at 14:29
3
Solved
Are there any Lisp or scheme dialects that have good support for Array and linear algebraic manipulations. By good support I do not mean interfaces to BLAS/LAPACk, but efficient array primitives in...
Ostler asked 15/7, 2011 at 2:54
1
Solved
Why does evaluating (list + 1 2) in Common Lisp (CCL REPL) returns ('(+ 1 2) 1 2)?
More: OK, I see that + actually evaluates to the last REPL result, but I still have a question: Is this a stand...
Sidle asked 11/4, 2013 at 7:32
3
Solved
I'm teaching myself Common Lisp using Norvig's Paradigms of AI Programming and came across something I didn't understand and he didn't explain.
(defun mappend (fn the-list)
(apply #'append (mapca...
Laster asked 10/4, 2013 at 21:32
3
Solved
During development I defined an 'initialize-instance :after' method which after a while was not needed anymore and actually gets in my way because inside it calls code that is not valid anymore. Si...
Stilly asked 12/5, 2011 at 10:12
2
Solved
Why do these forms behave this way?
CL-USER>
(setf *closures*
(loop for num in (list 1 2 3 4)
collect (lambda ()
num)))
(
#<COMPILED-LEXICAL-CLOSURE #x302004932E1F>
#<COMPILED-LEXI...
Neuroblast asked 30/3, 2013 at 3:12
1
So I just got Land of Lisp and started to do the first program.
I have a couple questions.
Is there a way to just write some code and run it through a compiler, or interpreter, and not use the RE...
Knapsack asked 29/3, 2013 at 18:8
1
Solved
How would i redefine a built-in function, while
keeping a reference to the old function under a different name?
ie with SBCL
(unlock-package 'common-lisp)
(defun old+ (a b) ??????
(defun + (a b)...
Transcontinental asked 28/3, 2013 at 20:49
© 2022 - 2024 — McMap. All rights reserved.