Data dodania Pytanie
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
2016-12-04 23:12 Efficient hash table access with constructed keys »
Common Lisp allows any lisp object to serve as a hash table key. But what if you only want to use part of an object as the key. For example, in (defs...
(0) odpowiedzi
2016-12-04 17:12 clisp positive number founder »
I am trying to return a list which contains non-negative numbers from function parameter list using clisp. (defun recursive (L) (setq ret (list))...
(4) odpowiedzi
2016-12-04 01:12 Translating macro from Common Lisp to Clojure »
I'm trying to translate the Common Lisp code in the original "Calendrical Calculations" paper by Derhowitz and Reingold to Clojure. In this paper ther...
(2) odpowiedzi
2016-12-03 08:12 create board and show in vertical position »
I have a doubt in showing on vertical form a board with n x m dimension in order to facilitate operations between lists ;;represents the global varia...
(0) odpowiedzi
2016-12-02 19:12 Passing list as a function parameter and returning list from a function »
I have the following code: (defun read_coords (in) (setq x (read-line)) (if (equalp x "0") in (progn (append in (...
(2) odpowiedzi
2016-12-02 00:12 SETF neither terminates nor reports an error »
I'm a Common Lisp beginner and came across this piece of code: (let ((foo (list 42))) (setf (rest foo) foo)) The REPL seem to just loop forever ...
(1) odpowiedzi
2016-12-01 23:12 Struggling with cipher »
I'm writing a common lisp program to encrypt and decrypt lists. My problem is when I input: (encode '((Computer)(Science)) 5) It'll only output...
(2) odpowiedzi
2016-12-01 07:12 How to do dynamic load (Load) in common lisp »
My following code snippets will give SB-INT:SIMPLE-READER-PACKAGE-ERROR; I know it is because package "quicklisp-quickstart" is not defined yet while ...
(1) odpowiedzi
2016-12-01 05:12 View or Extract the text definitions entered into the top level REPL, ideally for Clozure Common Lisp (CCL) »
When working in a top level REPL, I sometimes forget what definitions I've entered into the running lisp system. I use Clozure CL and it provides t...
(4) odpowiedzi
2016-11-30 10:11 LISP: Get all slot names from an class instance »
I need to make a window with the properties of a class (its slot-values). It would be something like describe function. My question is: How do I get...
(1) odpowiedzi
2016-11-30 06:11 Displaying a List of Strings Instead of a Displaying One String »
This is just a Caesar Cipher in Common Lisp with a rotation key set to 5. I have a few restrictions The input must be read and processed recursi...
(1) odpowiedzi
2016-11-30 03:11 Nested loop in common LISP »
I'm trying to created a player that would solve the game Mastermind in LISP. I tried using the following nested loop in a helper function (defparamet...
(1) odpowiedzi
2016-11-29 23:11 Calculating Grade Point Average and Class Average in Lisp »
I am working on a problem that calls for me to compute the grade point average for each student in a class. The input is a lisp file with the follow...
(3) odpowiedzi
2016-11-29 21:11 Error Checking for a User Input File »
I've written (and mostly debugged) a program that processes a user input file made up of macro calls. I'd like to now add thorough error checking on t...
(1) odpowiedzi
2016-11-28 12:11 Package agnostic symbol comparison »
I have two packages each containing the same symbol: (make-package "package1") (make-package "package2") (intern "SYMBOL" (find-package "PACKAGE1")) ...
(1) odpowiedzi
2016-11-28 05:11 How to declare a function before its definition in common lisp? »
I will get an undefined function warning about f2 in SBCL with following code sample. Is it possible that I can declare f2 first, like in C, to avoid...
(4) odpowiedzi
2016-11-27 17:11 how to add and play audio file in Lisp Work? »
I am using Lisp Work Personal edition 6.1.1 using capi GUI , I want to add an audio file and play it when clicked on a button. ...
(0) odpowiedzi
2016-11-27 07:11 Merge list of lists and return in a loop »
I am trying to merge all list of lists into one. Here is my code so far: (DEFUN DESCRIPTION (BLOCK) (loop initially (setf result '()) fo...
(1) odpowiedzi
2016-11-25 21:11 Nested Loops Using Loop Macro in Common Lisp »
I am trying to implement a basic nested loop in CL, but the Loop macro is resisting this. Basically, I would like to find all possible products of 3-d...
(1) odpowiedzi
2016-11-25 19:11 Displaced multidimensional arrays in common lisp »
So I have some code that needs a subset of a multidimensional array in such a way that it works a bit more like taking a subsection of a matrix, ideal...
(3) odpowiedzi
2016-11-24 21:11 Remove-if-not in Racket »
In Common Lisp there is a famous built-in function called remove-if-not. I could not find this on Racket`s documentation. Did I miss something? Does...
(1) odpowiedzi
2016-11-24 17:11 Is there an equivalent of Common Lisp's push in Racket? »
In Commons Lisp there is the command "push": (define (push x a-list) (set-box! a-list (cons x (unbox a-list)))) It allows you to put elements fir...
(1) odpowiedzi
2016-11-24 16:11 Iterate through a list and check each element with your own condition? »
For an homework, I am trying to iterate through the list and make an if statement to each of the elements I encounter in Common Lisp. Most of my probl...
(1) odpowiedzi
2016-11-23 19:11 How to print numbers as floats with a specified format? »
An arbitrary number can be readily converted to float with some number of decimals. For example, using (format nil "~,2f" 6) gives "6.00". But is ther...
(2) odpowiedzi
2016-11-22 21:11 Find Prime Factor Too Slow or Crashes »
I am currently learning LISP by going through some of the problems on ProjectEuler site. One of the problems asks this: The prime factors of 13195...
(3) odpowiedzi
2016-11-22 18:11 Unexpected Behavior From Defun and Setf in Common LISP »
The following code gives unexpected behavior: (defun my-make-list () '(5 5 5)) (setf my-list (my-make-list)) (setf (car my-list) 3) (my-make-list)...
(0) odpowiedzi
2016-11-22 13:11 Is there a way to get the slots of a class? »
I have a class like this one (defclass shape () ((color :initform :black) (thickness :initform 1) (filledp :initform nil) (window :initform nil))...
(1) odpowiedzi
2016-11-20 19:11 Lisp vs. Common Lisp »
I've read that Common Lisp is a dialect of Lisp. Does this mean Lisp is a programming language and Common Lisp is a separate programming language that...
(1) odpowiedzi
2016-11-19 14:11 Is there a way in hunchentoot to get the part of the url before the path »
If a client makes a request for proto://hostname:port/path I would like to get proto://hostname:port. I could have missed something but right now th...
(1) odpowiedzi
2016-11-18 17:11 Is there a github markdown language identifier for Common Lisp on Atom? »
I'm trying to write some code blocks in Common-Lisp using GitHub Markdown on Atom, but if I write ```common-lisp ```cl it doesn't highlight the sy...
(1) odpowiedzi
2016-11-18 16:11 SBCL: Fixnum Optimizations »
I'm trying to get more speed out of a little quadratic solver by using optimizations and fixnums. Here's my code: 1: (defun solve-x (d) 2: (decla...
(2) odpowiedzi
2016-11-18 10:11 Are functions mutable in multiple dispatch systems? »
Have I understood correctly that in (most? some?) multiple dispatch languages each method gets added to the function at some point in time of program'...
(4) odpowiedzi
2016-11-17 18:11 ANDing a boolean and a list »
I've noticed in Scheme, Racket, and Clojure that the expression (using Clojure here) (and true '()) evaluates to (), and (and '() true) evaluates to t...
(3) odpowiedzi