common-lisp Questions
4
Solved
I'm learning a little bit about functional programming in LISP and here's what I've bumped into: LISP uses CAR, CDR functions as well as FIRST and REST functions. Both related to lists.
From what ...
Fireworks asked 27/4, 2015 at 23:0
2
Solved
Let's say I run the following
(loop for i to 4 collect i)
Then I get a list (0 1 2 3 4). Now, if I want to append something to the result, I may use rplacd on its last element, but since Lisp li...
Goodfellowship asked 26/4, 2015 at 23:13
2
Solved
First of all, let me say I'm a beginner in Lisp. To be honest I have been a beginner for some time now, but there are still many things I don't know well.
While I was writing this question, ...
Spouse asked 26/4, 2015 at 23:29
2
Solved
The other day (perhaps yesterday) I was quite perplexed about this #+nil read-time conditional found in https://github.com/billstclair/defperson/blob/master/defperson.lisp#L289.
After some deep th...
Currency asked 24/4, 2015 at 14:21
1
Solved
I read in Google Common Lisp Style Guide (see the very last section) that there is a mistake in the Common Lisp standard regarding and as a type specifier. Namely, that it does not "short circuit",...
Aliquant asked 21/4, 2015 at 10:0
1
Solved
With format you can use, among other things, ~S and ~A.
While the S in ~S is for S-expression, what does the A in ~A stand for? Apparently it outputs without escaping, but I was wondering what the...
Barytes asked 19/4, 2015 at 15:59
2
Solved
Chapter 9.10 of Common Lisp: A Gentle Introduction To Symbolic Computation claims:
The primitive i/o functions TERPRI, PRIN1, PRINC and PRINT were defined in Lisp 1.5 (the ancestor of all modern...
Saiz asked 19/4, 2015 at 15:4
2
Solved
I was reading a code sample that calculates the factorial using Lisp as below:
(defun fatorial (n)
(cond
((= n 1) 1)
(t (* n (fatorial (- n 1))))))
So, I was wondering what is t in this code...
Exhortation asked 18/4, 2015 at 20:4
2
Solved
I notice, upon reading Keene's book, that defgeneric has a :method option, which seems like it allows you to specify a method in the generic definition itself. Most documentation I've seen has all ...
Chilly asked 15/4, 2015 at 0:26
1
Solved
I have come across a problem where I'm not sure whether I got everything right I learned so far on Lisp.
Basically the task is trivial: Create a list that contains only a single item - the T liter...
Selle asked 15/4, 2015 at 7:40
3
Solved
I'm trying to learning Common Lisp reading Ansi Common Lisp from Paul Graham and Using EEC325 course critique and run-tests functions and the lectures. I set up Emacs with slime and SBCL
The probl...
Ulotrichous asked 11/4, 2015 at 15:38
2
Solved
To check for a symbol, one might use symbolp. To check for a number, one might use numberp. And so on…
Why is there no booleanp to check for a boolean value? Of course I can use
(defun booleanp (...
Addiel asked 8/4, 2015 at 16:35
3
Solved
My code is a mess many long lines in this language like the following
(defn check-if-installed[x] (:exit(sh "sh" "-c" (str "command -v " x " >/dev/null 2>&1 || { echo >&2 \"\"; ex...
Fremantle asked 29/8, 2012 at 7:22
2
Solved
In Common Lisp, the let uses a list for a bindings, i.e:
(let ((var1 1)
(var2 2))
...)
While Clojure uses a vector instead:
(let [a 1
b 2]
...)
Is there any specific reason, other than re...
Keppel asked 31/3, 2015 at 9:20
4
Solved
I am learning Lisp from the book "The Land of Lisp" by Conrad Barski. Now I have hit my first stumbling block, where the author says:
Calling yourself in this way is not only allowed in Lisp, bu...
Consistent asked 7/3, 2013 at 10:50
1
Solved
I've seen Executing a shell command from Common Lisp and its answers, but I'm still not sure whether SBCL provides a way execute shell commands from code.
The SBCL Manual does support POSIX, but I...
Roofdeck asked 10/3, 2015 at 4:9
1
Solved
I am new to lisp. I didn't properly understand how to implement append function on a list. I tried the following program.
(defvar temp)
(setq temp '())
(append temp (logxor 1 0))
temp seems to s...
Goddamned asked 8/3, 2015 at 15:42
2
I find that incremental development tends to break when coding for Hunchentoot.
For example, I might write a web page that is composed of a few functions. If one of these inner functions contains ...
Jamin asked 7/4, 2014 at 3:31
1
Solved
To simplify my question:
why this works
(mapcan #'(lambda (l) (list '1 '2) ) '(a b))
and this doesn't
(mapcan #'(lambda (l) '(1 2) ) '(a b))
?
I have to write a function that substitutes an...
Arteriosclerosis asked 15/2, 2015 at 11:16
3
Every Common Lisp programmer knows that macros are a powerful tool. Common Lisp macros have been used, among other things, to add object orientation on top of Lisp without changing the language spe...
Yeo asked 18/6, 2014 at 9:39
4
Solved
I thought I would be able to find this through Google, SO, or the books I'm reading, but it is proving elusive.
In the implementation I'm learning with, I can do the following at the top-level:
(...
Horaciohorae asked 4/2, 2015 at 17:59
2
Solved
I've just been reading up on the sharpsign colon reader macro and it sounded like it had a very similar effect to gensym
Sharpsign Colon: "introduces an uninterned symbol"
Gensym: "Creates an...
Humiliating asked 2/2, 2015 at 9:35
2
Solved
In Common Lisp, there are obviously some special characters that act as shortcuts for certain forms. 'x means (quote x). #'f means (function f). I had thought those (as well as backtick) were the o...
Mccully asked 15/1, 2015 at 21:23
5
Solved
I'm relatively new to Lisp, and I was wondering if there really is an upper limit to the "+" function.
(I guess this applies to all the other arithmetic functions "-", "/" etc.)
Niels asked 2/4, 2012 at 9:40
3
Solved
Svante just blew my mind by showing string designators in another answer do this:
(string= :& "&") -> T
Looking at CLHS, they say A designator is an object that denotes another object...
Tiossem asked 11/12, 2014 at 16:38
© 2022 - 2024 — McMap. All rights reserved.