common-lisp Questions
1
I am using common-lisp for my real-time graphics experiments and so far it has being great. My requirements for speed and easy compatibility with cffi mean I am using 'typed' arrays. The one area o...
Chophouse asked 2/10, 2013 at 15:2
3
Solved
I'm under the impression that CFFI cant pass structs by value, but the CFFI documentation says:
To pass or return a structure by value to a function, load the cffi-libffi system and specify the ...
Macroclimate asked 24/9, 2013 at 1:34
4
Solved
I have a matrix defined so if I do this
(format t "~a" (get-real-2d 0 0))
it prints out the element in the first row first column
and if I do this
(format t "~a" (get-real-2d a 0 1))
it prin...
Bellis asked 21/9, 2013 at 4:23
1
Solved
I want to use buildapp to make the curl-lisp executable given as an example:
buildapp --output lisp-curl --asdf-path ~/src/clbuild/systems/ \
--load-system drakma \
--eval '(defun main (args) (w...
Queenstown asked 20/9, 2013 at 12:40
3
Solved
In book 'land of lisp' I read
Because the case command uses eq for comparisons, it is usually used
only for branching on symbol values. It cannot be used to branch on
string values, among othe...
Bucella asked 18/9, 2013 at 17:40
1
Solved
I have a list of seven integers, initially all 0s, let's call it "data." Periodically during the course of running my program I want to increment the value of one of those integers by one. At...
Epigraph asked 13/9, 2013 at 15:37
1
Solved
Suppose I have a file named "includes.cl", inside which there are several function definitions. Now I have two ways to use these functions:
(load "includes.cl")
(load (compile-file "includes.cl")...
Fassett asked 8/9, 2013 at 2:56
2
Solved
Say I've played a bit with SBCL with no SLIME, no whatsoever, plain interpreter. Now I want to save couple of functions in a file. Not an core image, just a bits of code in a text form. How should ...
Gautea asked 6/9, 2013 at 6:5
1
Solved
The Common Lisp Hyperspec states "Macro forms cannot expand into declarations; declare expressions must appear as actual subexpressions of the form to which they refer."
I'm confused on the meanin...
Braithwaite asked 5/9, 2013 at 20:26
2
Solved
Why does the following not work?
;;;; foo.lisp
(in-package :cl-user)
(eval-when (:compile-toplevel :load-toplevel :execute)
(require :cl-interpol))
(cl-interpol:enable-interpol-syntax)
(defun ...
Sexuality asked 2/9, 2013 at 13:53
2
Solved
Essentially I'd say that you'll have to use (typep var 'string-type), but there is no such type as string as far as I known.
Determining a type via type-of results in
(type-of "rowrowrowyourboat"...
Photofluorography asked 1/9, 2013 at 14:48
7
As many other people interested in learning Lisp, I feel the resources available are not the best for beginners and eventually prevent many new people from learning it. Do you feel it could b...
Virginavirginal asked 10/2, 2010 at 23:24
1
Solved
I'm familiar with Emacs Lisp, but not Common (or any other) Lisp. Some Lisp programmers suggest (e.g. A basic function for emacs) that it's good to use #' in front of function arguments in Lisp cod...
Hygrograph asked 22/8, 2013 at 20:52
7
Solved
In Haskell, if I have a lambda that looks like the following
(\x -> doStuff x y)
where y is from the surrounding scope, I could section it and turn it into
(`doStuff` y)
which is shorter a...
Howell asked 22/3, 2013 at 10:57
2
Solved
http://www.aiai.ed.ac.uk/~jeff/lisp/cl-pitfalls states this as one of Common Lisp pitfalls
Destructive functions that you think would modify CDRs might
modify CARs instead. (Eg, NREVERSE.)
I ...
Hulbard asked 18/8, 2013 at 16:56
3
Solved
I know how to do this in every other language that I know, but I'm just starting Lisp and not quite getting it. My idea of
make a list of characters
convert to ascii values
sort
convert back to c...
Fellah asked 17/8, 2013 at 15:53
1
Solved
I don't know if it is implementation dependent. Just in case it matters, I'm using Corman Lisp 3.0
When I do something like this:
(loop for v being the hash-values of *my-hash-table*
when (> ...
Chelseachelsey asked 14/8, 2013 at 10:24
3
Solved
I have experience in C# and JavaScript, and have been working for the last few years with Node.js. Basically, I'm very confident with this environment, but one language has always caught my eye: LI...
Petulia asked 11/8, 2013 at 14:17
3
Solved
I'm trying to run an external program in SBCL and capture its output.
The output is binary data (a png image), while SBCL insists on interpreting it as strings.
I tried a number of ways, like
(tr...
Zeuxis asked 11/1, 2012 at 8:51
6
Solved
What is the difference between "set", "setq", and "setf" in Common Lisp?
Burny asked 15/5, 2009 at 16:0
1
Solved
I've found a great example of type checking in LispWorks Hyper Spec, but the "type specifier" link leads to a mere glossary not the denotation, and I got a little confused with the syntax.
In (che...
Cognizable asked 8/8, 2013 at 7:42
3
Solved
I want to use formatted output in a loop to generate a string. Manual says it can be easily done by giving format function a string with a fill pointer as a destination. Unfortunately, it is not tr...
Outstretch asked 7/8, 2013 at 7:47
2
Solved
How would I loop over the characters in a string of text in Common-lisp?
Here's what I want to do, but in Ruby:
string = "bacon"
string.each_char do |c|
putc c
end
Junji asked 5/8, 2013 at 19:20
3
Solved
I think I just use setq (or setf, I'm not really sure the difference), but I don't understand how to reference the [i][j]-th element in an array in lisp.
My start condition is this:
? (setq x (ma...
Tarahtaran asked 5/8, 2013 at 15:32
2
I have a character ch that I want to append to a string str. I realize you can concatenate strings like such:
(setf str (concatenate 'string str (list ch)))
But that seems rather inefficient. Is...
Munsey asked 4/8, 2013 at 17:53
© 2022 - 2024 — McMap. All rights reserved.