Data dodania Pytanie
2017-03-31 21:03 Lisp: How to obtain the final loop value? »
(defun index-iteration (n) (let ((x 0)) (loop for j from 0 to n while (< x n) do (setf x (max-index-for-iteration j))))) I have the ...
(2) odpowiedzi
2017-03-29 22:03 COND clause with test only »
When COND is given only one test clause and nothing else at all it always returns the test result: CL-USER> (cond (t)) T CL-USER> (cond...
(1) odpowiedzi
2017-03-29 21:03 How to print the elements in odd positions in a list using an iterative function in Lisp? »
I have to make a recursive function in lisp which takes a list and makes another list with only the elements on odd position in the given list. If I ...
(2) odpowiedzi
2017-03-29 06:03 How to remove escaped double-quotes inside a string in Common Lisp? »
Running (cl-json:encode-json-to-string 'ctx) gives "\"ctx\"" I need "ctx" not "\"ctx\"". I could use cl-ppcre and remove matching double-quotes ins...
(1) odpowiedzi
2017-03-28 19:03 Can implicit conversion by Lisp's FORMAT function be controlled? »
While trying to round a fraction to 9 digits, I came across the following: ? (format t "~9$" 763700091/112000148) 6.818742300 Nil But the rounding ...
(2) odpowiedzi
2017-03-28 14:03 Unbound variable error when using defmacro in LISP »
I am trying to use macro with two forms in LISP, which evaluates both forms but always return the result of form 2. Below is the code that I am using ...
(2) odpowiedzi
2017-03-27 23:03 Where is the implementation of values-list in SBCL? »
I am trying to figure out the implementation of values-list function in SBCL. The source code at src/code/eval.lisp looks like pretty simple, but why ...
(1) odpowiedzi
2017-03-27 20:03 How do I read a text file in LISP? »
I have a .txt file like this: 0 1 2 3 4 5 6 7 8 0 1 2 3 4 5 6 7 8 And i want LISP to read the text file and generate two lists, the first one with...
(1) odpowiedzi
2017-03-26 22:03 common lisp function/macro aliases »
I would like to set aliases in common lisp(clisp to be exact) for commands that are used a lot, such as "defun" and "lambda" etc, is it possible to do...
(2) odpowiedzi
2017-03-26 18:03 Undefined Function Error when using pop Lisp »
When testing a lisp function I hard-coded in a list. This then generated the follow error when using pop: (pop '(1 2 3)) EVAL: 1 is not a functi...
(1) odpowiedzi
2017-03-25 21:03 Common Lisp auto completion in emacs »
Update Apparently, the auto-complete package is not the culprit. Emacs fails to download melpa archive. A quick google search indicates that this i...
(1) odpowiedzi
2017-03-25 05:03 Using test bench code from Practical Common Lisp »
In Practical Common Lisp Ch. 9, Peter Seibel provides a basic unit test bench for comparing expected with actual results of evaluating S-expressions. ...
(1) odpowiedzi
2017-03-25 00:03 Lisp SBCL declare a function argument to be a list of a certain type for type checking »
I am having a hard time figuring out how to tell the sbcl compiler that the &rest args to a function ought to be a list of TYPE. Basically, I wan...
(1) odpowiedzi
2017-03-22 00:03 Optimisation options sbcl »
How to set optimization options like "speed 3" for all functions? (declaim (optimize (speed 3) (debug 0) (safety 0)) Doesnt work( ...
(1) odpowiedzi
2017-03-21 22:03 How to declare the type of a loop variable »
I want to do some integer arithmetic and was checking if SBCL could gain more speed if I provide explicit information about the type of values I use. ...
(2) odpowiedzi
2017-03-20 23:03 Common Lisp equivalent to Racket's "module languages" »
I would like to create a DSL (domain-specific language) with a set of Common Lisp macros, and restrict parsing of the files written in the DSL. I have...
(1) odpowiedzi
2017-03-20 18:03 how to split a list recursively with using conditions in clisp »
I am trying to learn clisp and I have started learning how to manipulate lists recursively. I am unsure wether it is my logic or if I am just too unfa...
(1) odpowiedzi
2017-03-20 06:03 Lisp recursion for split-list »
(defun split-list (L) (if (endp L) '(nil nil) (let ((x (split-list (cdr L)))) (list (cons (car L) (cadr x))(car X)) ...
(1) odpowiedzi
2017-03-19 14:03 Common Lisp EVAL Function Quotations »
My question is rather simple (perhaps misleadingly so). In Common Lisp, when I run the following command, I get the corresponding results: (eval '''...
(3) odpowiedzi
2017-03-18 18:03 Choosing the appropriate coding expression for a given job »
Common Lisp provides many flexible coding options for achieving a given result. However, it is sometimes difficult to choose the best approach. For ex...
(1) odpowiedzi
2017-03-17 23:03 Reading Lisp objects from a string »
I am familiar with the basic template for collecting the Lisp objects from a file, as in: (with-open-file (stream "filename.lisp") (loop for obje...
(1) odpowiedzi
2017-03-17 13:03 Cannot locate my mistake in an algorithm involving Pythagorean triples and sets »
I'm trying to find the answer to "Given that L is the length of the wire, for how many values of L ≤ 1,500,000 can exactly one integer sided right a...
(0) odpowiedzi
2017-03-13 11:03 Lisp web tales: How to fix the blogdemo example (Chapter 4)? »
I came across Pavel's tutorial about writing a web app using CL and RESTAS as a frame work. While simple Hello, World! examples work. I am not able to...
(0) odpowiedzi
2017-03-12 23:03 Creating 2 files and writing to them different content from another file in Lisp »
I am trying to write in 2 different files content from another file. Procedure is that I have to write 10 lines of file_a in one file and the rest in ...
(1) odpowiedzi
2017-03-10 15:03 Is it possible to limit the number of calls to the cons function in the duplicate() function? »
I wrote the function double() that duplicate the items in a list as follows: (defun duplicate (l) (if (null l) nil (cons (car l) (cons ...
(3) odpowiedzi
2017-03-10 04:03 Why are this list's contents retained between function calls? »
I probably just don't understand Lisp scoping, but I'm struggling to understand what's going on in this tic-tac-toe game, which I've stubbed down to d...
(0) odpowiedzi
2017-03-07 17:03 Generalizing Lisp functions »
For rapid prototyping purposes, I would like to start building a library of generalized versions of some basic functions provided in Common Lisp, rath...
(1) odpowiedzi
2017-03-07 13:03 lisp Cons cell diagram for the list »
This is my trying code. (defun f (lst) (cond ((null lst) nil) ((listp (first lst)) nil (f (car lst))) (t (cons (f...
(1) odpowiedzi
2017-03-07 07:03 LISP programming »
(defun bubbleUp (n) (cond ((null n) nil) ((null (cdr n)) n) ((> (car n) (car (cdr n))) (append (list (car (cdr n))) ...
(1) odpowiedzi
2017-03-06 19:03 require doesn't load asdf system in ~/common-lisp/ subdirectories »
(require :your-system) doesn't load system but system exist in asdf standard directory ~/common-lisp/. CL-USER> (require :your-system) Don't know...
(2) odpowiedzi
2017-03-06 16:03 lisp swap list elements »
This is my lisp code. (defun f (lst) (append (subst (last lst) (first lst) (car lst)) (subst (first lst) (last lst) (...
(2) odpowiedzi
2017-03-06 10:03 Common Lisp: extract methods from generic function »
Is there a way to extract a list of methods from a generic function in Common Lisp? For example: (defmethod say ((self string)) ; method-0 (forma...
(1) odpowiedzi
2017-03-05 19:03 Common Lisp references to functions »
There seems to be a number of different ways of referring to a function in Common Lisp: via symbol, where the symbol appears (unquoted) as the car o...
(1) odpowiedzi
2017-03-05 04:03 How can the symbols in a Pandoric Macro be compiled out? »
I have read section 6.7 of LOL a few times now, and I still can't wrap my mind around the following. Bindings that were previously closed to outsi...
(2) odpowiedzi
2017-03-04 09:03 How many memory the bit-vector using in sbcl? »
How many memory the bit-vector using in sbcl? Does per bit spend 1 bit memory? Does per bit spend 1 byte memory? Does per bit spend 1 word memory? ...
(2) odpowiedzi