Data dodania Pytanie
2017-09-11 00:09 New to lisp. I was wondering why I get this error. "1 is not of type LIST." »
(defun fizzbuzz(lst emptyList) (if (= (mod (car lst) 3) 0) (fizzbuzz (cdr lst) (append emptyList (list(append (car lst) '(fizz))))) ) ...
(1) odpowiedzi
2017-09-10 19:09 Difference between nil and (nil) in LISP »
I've just begun learning LISP and was trying to solve the following problem: (I've tried solving the problem until the point I got this doubt and got ...
(2) odpowiedzi
2017-09-10 18:09 A different list merging into a new list in Lisp »
I would like to ask how can I merge 2 different lists of numbers to a new list keeping the "common points" between them in Common Lisp. Example list...
(2) odpowiedzi
2017-09-09 15:09 I can (asdf:load-system :foo), but asdf still complains that '"foo" doesn't designate a package' »
Trying to finally start using asdf for my lisp doodles, I tried setting up a simple example. The files are ; contents of example.asd (asdf:defsystem ...
(1) odpowiedzi
2017-09-04 20:09 How to use Clozure CL on IPv6 only network? »
I've tried to replace SBCL with Clozure CL when working in IPv6 only network, but encountered an error like that: MIGRATIONS> (ignore-errors (ccl:...
(2) odpowiedzi
2017-09-04 19:09 REPL unresponsive after closing window created by SDL 2 (using cl-sdl2) »
I am trying to create a window using cl-sdl2. My code works - it creates a window for 2 seconds, and then closes it: (defun main () (sdl2:with-ini...
(0) odpowiedzi
2017-09-04 08:09 If valid forms must start with a symbol than what is ((lambda (a) (+ 1 a)) 1) »
I've read and understood that not all s-exps are necessarily valid forms. In particular, valid list forms must start with a symbol that will be evalua...
(0) odpowiedzi
2017-09-03 14:09 Executing lisp program »
I am new to lisp. I wrote a simple lisp program in notepad and saved it with extension .lisp. Kindly guide me how to execute this program in lisp inte...
(0) odpowiedzi
2017-09-03 13:09 sbcl: list all valid character encodings »
To get the list of all valid encodings for sbcl, I do this: (let (encoding-list) (let (symbol-list) (do-external-symbols (s :keyword) (pu...
(1) odpowiedzi
2017-09-02 18:09 sbcl: end-of-line format specification »
In clisp, I can do something like this: (with-open-file (fred "fred-unix" :direction :output :if-exists :supersed...
(0) odpowiedzi
2017-09-02 05:09 Mixed case tag names in cl-who »
I'm using cl-who to generate svg, and it is working fine up until I need a mixed case tag: (with-html-output (*standard-output*) (:defs (:|radi...
(3) odpowiedzi
2017-08-31 21:08 Error: Package :Queues does not exist »
I'm new to Lisp and use Allegro CL Free Express Edition 10.1. I try to use queues package and type the following codes into debug window. (in-packag...
(0) odpowiedzi
2017-08-31 19:08 SBCL timeouts can go past handler-case if there are signals in body »
It's an obvious pattern to put sb-ext:with-timeout into handler-case to perform some operation in case the code under the timeout timeouts. However, i...
(0) odpowiedzi
2017-08-30 19:08 Merging two lists of numbers using Lisp »
I would like to ask how can I merge 2 different lists of numbers to a new list keeping the "common points" between them in Common Lisp. Example ...
(0) odpowiedzi
2017-08-27 00:08 Undefined variable in function declaration while it is clearly defined »
I'm working on a function that will let you measure the run-time of a passed function run-n-time. It's not close to finished, because while writing th...
(1) odpowiedzi
2017-08-26 15:08 Suppress style-warning on make-instance in sbcl »
I have two packages with a class defined in each. The second class inherits from the first but has a slot of the same name. The intention is indeed to...
(2) odpowiedzi
2017-08-25 14:08 How to manage recursion in Common Lisp macros »
I need to write a Common Lisp macro that take a symbol and a list. The list is composed by lists of two elements: a symbol and a string, like this: (...
(3) odpowiedzi
2017-08-24 15:08 Is it foolish to make alexandria:curry not necessarily use funcall? »
Currently a function curried with Alexandria's curry must be called with funcall. However it is possible to set the new function's symbol-function so ...
(1) odpowiedzi
2017-08-24 13:08 Nested mapcars in common lisp »
I want to combine all posible combinations of two lists and for that I use mapcar CL-USER> (mapcar #'(lambda (x) (mapcar #'(lambda (y) (list x y)...
(1) odpowiedzi
2017-08-23 18:08 How to print roman numerals greater than 3,999? »
I want to print several numbers as roman numerals but (format t "~@R~%" 4000) leads to the following error in SBCL 1.3.20 and a similar one using c...
(1) odpowiedzi
2017-08-23 17:08 Shadowing parts of a dynamic variable »
Maybe I'm trying to be too creative here. Is it possible to extend the concept of dynamic binding to SETFable places of a dynamic variable, so that I...
(1) odpowiedzi
2017-08-21 20:08 Call finish-output from format »
I noticed that there is no format directive which would call force-output/finish-output. Why? It does seem to be useful in user interaction, cf. Lis...
(1) odpowiedzi
2017-08-21 14:08 Common Lisp: avoid evaluation of a symbol in a function »
I have a trivial problem in Common Lisp. I need to write a function that takes a symbol as a parameter (i.e. a name of a function or a name of a varia...
(3) odpowiedzi
2017-08-19 09:08 How can I get the Lisp garbage collector to remove foreign c++ allocated memory in my class slots? »
My class looks like this: (defclass matrix () ((rows :initarg :rows :initform 2) (cols :initarg :cols :initform 2) (matrix :accessor matrix))...
(1) odpowiedzi
2017-08-17 10:08 Common Lisp, asdf, tests, compile system with different optimization levels »
What I really want is the in-source tests definitions: Let's suppose I have an asdf system: (defsystem simple-system :serial t :components ((:mo...
(3) odpowiedzi
2017-08-17 09:08 Fastest way to convert an arbitrarily deep hash table to list »
Edit: Just to be clear, this is just for fun, i've been using arbitrary dimension'd hashtables as matrices in a rnn lib I wrote in lisp to get max spe...
(0) odpowiedzi
2017-08-15 12:08 slime-inspector-eval: how to get bindings in the inspector? »
Long story: motivation I have a CL code that breaks on SORT or MAPCAR with some error that a number (let's say, 25) is not a list. This tells me some...
(1) odpowiedzi
2017-08-15 10:08 function (OccurencesOfPrimes < list >) which counts the number of primes in a (possibly nested) list »
I am working on problem to get the occurence of Prime in a list in lisp. Input: Write a function (OccurencesOfPrimes < list >) which counts the ...
(1) odpowiedzi
2017-08-14 02:08 In Common Lisp, when do you need to use eval-when, and how do you know? »
A required use of eval-when is to ensure that functions which a macro depends on are available at the time the macro is compiled and is used. However,...
(1) odpowiedzi
2017-08-13 20:08 Is there a tco pattern with two accumulating variables? »
Just for fun (Project Euler #65) I want to implement the formula n_k = a_k*n_k-1 + n_k-2 in an efficient way. a_k is either 1 or (* 2 (/ k 3)), dep...
(1) odpowiedzi
2017-08-13 02:08 Get nth cdr of a list without using nthcdr »
I'm a Common Lisp beginner struggling with one of my assignment... One of my CS assignment is to create a function which basically works as the built...
(1) odpowiedzi
2017-08-11 21:08 Why do many Common Lisp systems use a single packages.lisp file? »
Many of the commonly used libraries I see use a single packages.lisp file to declare all of the packages in the library (system) in one place. Since ...
(1) odpowiedzi
2017-08-11 21:08 Why won't can't I read from my usocket using usocket::socket-receive? »
I'm learning common-lisp, and I'm trying to write a dumb chat program using a client and server tcp socket connection using the usocket library. Below...
(0) odpowiedzi
2017-08-11 00:08 easy-acceptor ignoring :document-root option; not serving static files »
I am trying to serve static files with Hunchentoot, from the www directory inside my project. My acceptor is defined as: (defvar *acceptor* (make-in...
(1) odpowiedzi
2017-08-10 00:08 Endpoint defined with define-easy-handler returns 404 »
I have defined a simple system in helloworld.asd: (asdf:defsystem #:helloworld :description "helloworld" :author "Duncan Bayne <duncan@bayne.i...
(1) odpowiedzi