common-lisp Questions

3

Solved

I have two codebases: one written in C++ and the other in Common Lisp. There is a particular functionality implemented in the Lisp codebase that I would like to access from my C++ code. I searched ...
Reproval asked 19/11, 2013 at 20:6

1

i defined a special variable *unsorted-lst* and a function for reseting this variable in my script: (defparameter *unsorted-lst* nil) (defun reset-to-unsorted-list () (setf *unsorted-lst* '(1 3 ...
Glidebomb asked 19/11, 2013 at 14:41

2

Solved

I see this a lot in examples I read in books and articles: (caddr *something*) Or the many variants of c***r commands. It seems a bit ridiculous to me, when you can more clearly just pull things...
Malchy asked 14/11, 2013 at 3:19

1

Solved

I need to print something with variable number of spaces before it. For example if I need to print 5 spaces before my text, I will do: (format T "%5T My Text") Output: My Text In place of 5, can...
Tetchy asked 10/11, 2013 at 16:35

3

Solved

In https://www.thc.org/root/phun/unmaintain.html Lisp is regarded such that "LISP is a dream language for the writer of unmaintainable code." and then proceeds to provide some code exampl...
Selfimprovement asked 8/11, 2013 at 3:35

1

Solved

I'm getting into some Lisp, and I've come across various different functions that to me appear to be doing the same thing... Namely printing to console... So what exactly is the difference between ...
Avoid asked 3/11, 2013 at 18:19

1

Solved

So I can do this: (defparameter *some-function* ... ; returns lambda later or this: (defun some-function ... With either, I can use funcall: (funcall 'some-function ... or (funcall *some-funct...
Degrading asked 31/10, 2013 at 14:29

2

Solved

I've a database which returns vaild CL expressions within double quotes. Is it possible to convert these strings to expressions. For example, I make a query from this DB via CLSQL and as a result...
Throwback asked 30/9, 2011 at 14:41

2

Solved

I am reading this in a Lisp textbook: Lisp can perform some amazing feats with numbers, especially when compared with most other languages. For instance, here we’re using the function expt to ca...
Maccarthy asked 30/10, 2013 at 9:41

6

I'm working on a web app using Hunchentoot (on SBCL and Linux), and usually I just run it from Emacs (SLIME), but for deployment I want something that's easier to automate. So I'm trying to figure ...
Seabrook asked 21/3, 2009 at 20:53

3

Solved

Hopefully this is not a redundant question. As a newcomer to scheme I am aware that syntax-case macros are more powerful than the syntax-rules alternative, at the cost of unwanted complexity. I...
Upward asked 29/10, 2013 at 17:18

2

Lets say I have two lists, ((1 2 3)) and (((1 2 3)) ((4 5))). I want to be able to tell if the first list is a member of the second list. I have tried to use subsetp, but it does not return true fo...
Stockton asked 26/10, 2013 at 21:40

3

Solved

I would like to know if there is any way to mimic C behaviour with pointers in LISP. In C if you change a value of a variable, that pointer is pointing to, it has a global effect (i.e. the value wi...
Finegrain asked 21/10, 2013 at 9:52

2

Solved

I used to write nested helper functions (which, btw, ocasionally used parameters of outer functions and are recursive) in Haskell like this (loop): sum a b = let loop s i = if i > b then s els...
Cootch asked 23/10, 2013 at 7:5

1

Solved

How can I to add a carriage return (using ~%) after every third argument in a list? E.g., I have now: (format nil "~{~a ~}" (list '"one" '"two" '"three" '"four" '"five" '"six" '"seven" '"eight" '"...
Gehring asked 22/10, 2013 at 15:38

2

Solved

I need an incf function which does some bounds checking during the increment: val := val + delta if val >= 1.0 then return 1.0 else return val I can write this using incf: (defun incf-boun...
Hypostasis asked 21/10, 2013 at 3:48

4

Solved

Is there a way to see the arguments for a common lisp function and its documentation from within emacs? Or also to see a list of all available functions?
Patio asked 21/10, 2013 at 1:47

3

Solved

I am trying define symbols a and b in following way a + 1 1 b 2 I am trying to do this by using define-symbol-macro (define-symbol-macro a '( ) (define-symbol-macro b ') ) but this way is no...
Creationism asked 11/10, 2013 at 13:22

2

Solved

We find this function builder to realize composition in P.Graham's "ANSI Common Lisp" (page 110). The arguments are n>0 quoted function names. I don't understand it completely, so I'll quote the co...
Ezarra asked 17/10, 2013 at 11:4

3

Solved

I assumed that values passed into a lisp function are assigned to a quote matching the name of the parameter. However, I was surprised that this: (defun test (x) (print (eval 'x))) (test 5) does...
Maugre asked 16/10, 2013 at 15:15

2

Solved

Given a variable with content 1, I know that it's a member of at least five types: 1 (let* ((fred 1)) 2 (princ (typep fred 'bit)) (terpri) 3 (princ (typep fred 'integer)) (terpri) 4 (princ (t...
Uphemia asked 13/10, 2013 at 13:21

3

Solved

I'm a little confused about Common Lisp's destructive DELETE function. It seems to work as expected, except for if the item is the first item on the list: CL-USER> (defvar *test* (list 1 2 3)) ...
Geelong asked 12/10, 2013 at 20:44

1

Solved

I have two items. The first, a-child, is a list which contains an array as its first element and then some strings as the remaining elements. The other, mapped, is a list which contains a number of...
Blamed asked 10/10, 2013 at 5:31

1

Solved

(defun billion-test () (setq i 0) (loop while (< i 100) do (setq i (+ i 1)))) (billion-test) (print "done") I have the above Lisp code that simply loops to one billion. The problem is ...
Appreciative asked 8/10, 2013 at 16:13

1

Solved

CL-USER> (defclass a () ()) CL-USER> (defclass b (a) ()) CL-USER> (make-instance 'b) #<STANDARD-CLASS B> What predicate function can I call on my instance b, which returns T if it ...
Granulation asked 3/10, 2013 at 5:38

© 2022 - 2024 — McMap. All rights reserved.