Data dodania Pytanie
2016-12-24 19:12 Common lisp: run shell command containing the string "\n" »
I'm trying to run something that simplifies to (trivial-shell:shell-command (concatenate 'string "echo -e " "one" "\n" "two")) And trying to get...
(2) odpowiedzi
2016-12-24 17:12 re-write without using set, setf or setq »
i need some help to re-write this function in common lisp without usin SET, SETF or SETQ (i can't also use loops), i hope some one can help me. here i...
(1) odpowiedzi
2016-12-23 19:12 Common lisp read from FIFO with timeout »
So I have some code like (let ((file (open cur-fifo :if-does-not-exist :create))) (format t "~A~%" (read-line file nil)) (close file)) Which as...
(1) odpowiedzi
2016-12-21 08:12 Difference between quote, list when used in equal »
I need to know what the difference between quote and a list. For example: cl-prompt> (equal (first (list * 1 2)) *) T cl-prompt> (equal (first...
(2) odpowiedzi
2016-12-20 20:12 Member function with multi-level list in Common Lisp »
I'm trying to understand how it works member function with list and list of lists. Here an example. (member '(A 6) '((A 7) (B 6) (E 6) (D 5)) :test...
(1) odpowiedzi
2016-12-20 08:12 Undefined function error inside LABELS in Common Lisp »
I have: (defun serve (&key (port 80) (handler #'IDENTITY)) (WITH-OPEN-SOCKET (socket :LOCAL-PORT port :LOCAL-HOST "localhost" :CONNECT :PASSIVE...
(2) odpowiedzi
2016-12-19 13:12 Minimum value of integer lisp »
I am tryin to retrieve the minimum value of integer in lisp. I found most-negative-fixnum variable that should represent the lowest possible numbe...
(2) odpowiedzi
2016-12-19 01:12 Behaviour of defparameter used with list »
So I encountered a rather strange behaviour that I couldn't explain/understand with what I googled so far nor the Gigamonkeys Book. I tracked my prob...
(0) odpowiedzi
2016-12-18 18:12 Common lisp workin with list »
my task is to count all element within a list, which have duplicates, eg ( 2 2 (3 3) 4 (3)) will result in 2 (because only 2 and 3 have duplicates) Se...
(1) odpowiedzi
2016-12-18 11:12 Strange results using quote, reversing a list with all sublists recursively »
I wrote a code to reverse a list and all its sublists recursively : (defun rev1( list final ) ( if ( eq list () ) final ( if ( atom...
(1) odpowiedzi
2016-12-18 01:12 How to create a macro with arbitrary parentheses which are asymetrical (not paired) »
I want to define a macro which encapsulates the frequent pattern below. The code is for FLI of lispworks. (fli:with-foreign-string ;; class name poin...
(0) odpowiedzi
2016-12-17 18:12 Mapping into a tree of nested sequences »
I've coded a function that aims to map into an arbitrary tree of nested proper lists, somewhat analogous to the common lisp function map-into: (defun...
(2) odpowiedzi
2016-12-17 17:12 Sorting a list of lists in Common Lisp »
I'm trying to write some function to sort this type of list: ((1 A) (2 E) (4 D)) I found the built-in function sort in Common Lisp, but I can't do...
(1) odpowiedzi
2016-12-15 16:12 How to communicate over sockets in Clozure Common Lisp? »
In one CCL REPL I enter: (WITH-OPEN-SOCKET (socket :LOCAL-PORT 6667 :LOCAL-HOST "localhost" :CO...
(1) odpowiedzi
2016-12-15 10:12 Recompiling a CL system as it is running »
I am running a common lisp project that fetches market data every 5 seconds. I made some tweaks to the code and want to update it on the production en...
(2) odpowiedzi
2016-12-15 05:12 how to avoid destructuring-bind ARG-COUNT-ERROR? »
I need to read a string of Common Lisp object from database. The object should be a list with two elements of double-float; "(1.0d0 2.0d0)" for exampl...
(3) odpowiedzi
2016-12-13 20:12 Is it possible to `inline` a `method`? »
I've done some cursory reading on inlining declamations and read up on the relevant CLHS pages, but can't easily see an explicit answer. Is it reason...
(1) odpowiedzi
2016-12-13 14:12 Lisp: TAGBODY issue »
I am a beginner in LISP programming and I am unsure how to use tagbody in order to read numbers from the keyboard until I reach a negative number. I t...
(2) odpowiedzi
2016-12-12 22:12 Difference between (apply #'somefunc args) and (somefunc args) »
While reading Paul Graham's On Lisp I found the following function in Chapter 4, Utility Functions. (defun symb (&rest args) (values (intern (a...
(3) odpowiedzi
2016-12-11 16:12 Not null lexical environment for eval »
How to evaluate some lisp code using eval in not null lexical environment ? I need this feature for proper interpolation functionality. ...
(1) odpowiedzi
2016-12-11 13:12 Custom sort in lisp »
I have a structure which represents a monomial like this: (M coefficient monomial-degree vars) So the following monomial 3 * x * y^2 should be ...
(0) odpowiedzi
2016-12-10 17:12 Sort polynomials Common Lisp »
I'm trying to sort a list of polynomials written in this format: (M [coefficient] [total degree] [Variable List]). example: ((M 1 1 ((V 1 A))) (M 1 ...
(1) odpowiedzi
2016-12-10 04:12 make-socket error in Clozure Common Lisp »
On CCL toplevel, running: (make-socket :LOCAL-PORT 6666 :LOCAL-HOST "127.0.0.1") OR (make-socket :LOCAL-PORT 6666 :LOCAL-HOST (lookup-hostname "lo...
(1) odpowiedzi
2016-12-09 19:12 Cannot do sum in lisp with do loop »
(defun suma (L) (setq var 0) (do ((i 0 (+ i 1))) ((= i (length L))) (+ var (nth i L))) var) Why does it always returns 0? Sh...
(2) odpowiedzi
2016-12-09 04:12 Member and structs in Lisp »
I know how to check if an item is in a list: (when (member item list :test #'equalp)). If I have a list of structs book : (defstruct book name a...
(1) odpowiedzi
2016-12-08 14:12 Lisp recursion not working fine »
I'm working on a Lisp project for a college class, so I'm just starting to code in this language. We were asked to implement a Lisp library to manage ...
(1) odpowiedzi
2016-12-07 23:12 Lisp unbound symbol »
I am learning lisp and i am trying to create simple function to sum arr. (defun sum( N ) ( if ( null N ) nil ( + (car N ) ( sum...
(1) odpowiedzi
2016-12-07 13:12 Clisp - translating pseudocode into actual lisp code »
I'm trying to define a A* search algorithm in lisp the pseudocode can be found here. this is what I have so far: ;;; A* (defun a* (problem) ;;;;;;;...
(1) odpowiedzi
2016-12-07 09:12 Sort list of sublists in lisp »
I'm trying to sort the elements of the following list by using the third element of each sublist: ((v 1 a) (v 3 d) (v 6 b) (v 2 c)) So the resu...
(1) odpowiedzi
2016-12-06 20:12 Compare lists of floats with decreased precision »
I am writing the test for a function that does heavy float numbers computations. Naturally when calculating floats you don't expect to get perfectly a...
(2) odpowiedzi
2016-12-06 07:12 Which solutions for background job processing exist for Common Lisp? »
I need a solution for background job processing. A task queue, where workers can be remote processes on different machines. I've searched over intern...
(1) odpowiedzi
2016-12-06 00:12 Defining and using functions in variables in Common Lisp »
I stumbled upon this article explaining the Y Combinator. The code is in Scheme, but I'm trying to work through it using Common Lisp. However, I'm ha...
(3) odpowiedzi
2016-12-05 22:12 write acces to function slot (other than defun) »
The defun macro "stores" a function object in the function slot of a symbol, e.g.: (defun f () "Hello.") The function that prints "Hello" is now sto...
(1) odpowiedzi
2016-12-05 20:12 symbols handling: cannot compare for identity »
I don't get why (setq a_sym 'abc) (print (eq a_sym 'abc)) (print (eq 'x 'x)) (print (eq (first '('x 2 3)) 'x)) prints T T NIL Why the symbol...
(2) odpowiedzi
2016-12-05 17:12 Accessing a nested structure slot »
I have the following structures: (defstruct track size env startpos endpositions) (defstruct state pos vel action ...
(1) odpowiedzi