Data dodania Pytanie
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-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-12 20:03 Is there a way to make a button in a Racket web application call a function defined within the file? »
I would like to know if it's possible to create a button that calls a function such as (define example (print "Hello")) when a user clicks a button - ...
(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-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 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-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-03 15:03 &optional parameter in lisp macros: Why does this variable behave like this? »
I'm trying to create a lisp macro that has an &optional parameter with a default value. Unfortunately the parameter is processed differently depen...
(1) odpowiedzi
2017-02-26 20:02 How do you detect key presses on a Racket web application? »
I've been through the documentation for web-servers and can't find anything on it. Here's my code for a basic web application: #lang racket (requir...
(1) odpowiedzi
2017-02-26 17:02 How is the defun macro implemented in lisp? »
I'd like to learn more about lisp macros and I want to create a simple implementation of the defun macro. I'm also interested in lisp's source code in...
(2) odpowiedzi
2017-02-26 09:02 Lisp- "[Function name] Is not a Number" »
So I have this simple expression to evaluate and list the two roots of a quadratic equation: (defun QUADRATIC (A B C) (list (/ (+ (- B) (sqrt(- (*...
(1) odpowiedzi
2017-02-24 03:02 Passing by parameters by value in lisp »
The problem I am having is that I can't get around the fact that lisp passes arrays by value not by reference. When I researched this problem, the so...
(1) odpowiedzi
2017-02-22 15:02 lisp different length two list »
I'm having difficulties with two lists of different lengths. (f '(8 1 2 3 23 12) '(2 9 4 6)) should return (1 2 3 4 6 8 9 12 23) This is my trying c...
(1) odpowiedzi
2017-02-21 07:02 What is the meaning of adoc mode? »
The adoc minor mode automatically appear whenever I open Common Lisp extension file *.lsp. I have done a search on Google, as well on Emacs help itse...
(1) odpowiedzi
2017-02-20 15:02 Lisp recursive square use one variables »
This is Trying code (defun f (a n) (if (zerop n) 1 (* a (f a (- n 1))))) (f 3) should return 27, (f 4) should return 256 I tri...
(5) odpowiedzi
2017-02-20 00:02 Advice on how to tackle this lisp function. »
I have written a function called my_rotate that takes a number from a user and creates a list up to five numbers. my_rotate then, pops off the first e...
(1) odpowiedzi
2017-02-19 01:02 Why is my lisp function giving me this output? »
I am writing a function that will take a list from a user and will flatten this list into one simplified list. The function seems to only return the f...
(1) odpowiedzi
2017-02-18 09:02 Number of atoms in a tree »
I don't understand the following paragraph: (COUNT-ATOMS ’(A (B) C)) should return five. A, B, and C and two NILs in the tree. Write a...
(2) odpowiedzi
2017-02-17 17:02 What is the best way of combining &key and &rest in a lisp macro's lambda list? »
I implemented Heap's algorithm using a macro. It's working OK, but I would like to tweak it so it will generate anaphoric or non-anaphoric code on dem...
(1) odpowiedzi
2017-02-17 13:02 Searching an item in a k-d tree »
I am developing a k-d tree in Lisp. I am writing a function that allows me to search a node in the k-d tree. This function is defined as follows: (de...
(3) odpowiedzi
2017-02-16 03:02 Why is Common Lisp's print output preceeded by a newline and followed by a space? »
The Common Lisp Hyperspec page for print mentions this: print is just like prin1 except that the printed representation of object is preceded by a...
(2) odpowiedzi
2017-02-13 21:02 Inconsistent behaviour of closures in Common Lisp »
When working on a personal project, I found what seems to be an inconsistent behaviour of closures. The idea in the codes below is to find the maximu...
(0) odpowiedzi
2017-02-13 00:02 Can't change/establish root binding of: [some-def] with set in Clojure »
I could not set my dynamic var's value to new one. (def *pop* true) (set! *pop* false) => IllegalStateException Can't change/establish root bind...
(2) odpowiedzi
2017-02-12 02:02 Error: Lambda list with dots are only allowed in macros, not here : LIST? »
I am writing a function called flatten that is supposed to take the list that have embedded list and returns a simplified version of it . When I try t...
(2) odpowiedzi
2017-02-11 23:02 Why is my lisp function returning 'NIL' »
I am writing a lisp function, that will determine if a word is a palindrome without using the 'reverse' function. I am fairly new to lisp and I am sti...
(1) odpowiedzi
2017-02-11 21:02 Comma is illegal outside of backquotes? »
I am writing a function that is supposed to take in two values. The first value is supposed to create a list up to five numbers, based on the value en...
(1) odpowiedzi
2017-02-11 02:02 Why am I getting variable 'list' has no value? »
I am trying to understand why I am getting this error, as I am fairly new to lisp. I want to create a function that takes a number n from the user and...
(2) odpowiedzi
2017-02-08 02:02 How does read-line work in Lisp when reaching eof? »
Context: I have a text file called fr.txt with 3 columns of text in it: 65 A #\A 97 a #\a 192 À #\latin_capital_letter_a_with_grave 224 ...
(1) odpowiedzi
2017-02-06 17:02 Lisp: IF condition using AND operator »
I making this function. (f 3 4) (sum = 7) (f 'a 'b) (not num!) My problem is how can I make if condition using and operator. I try.... (IF (a...
(1) odpowiedzi
2017-02-06 15:02 What is the difference between :foo, ::foo, ::bar/foo, and :bar/foo in Clojure? »
I came across those keywords: :foo, ::foo, ::bar/foo, and :bar/foo Could you explain differences with examples? ...
(2) odpowiedzi
2017-02-06 02:02 How can I run a lisp buffer in slime and see its output in emacs? »
I have the following code in a buffer (file ~/firsts.lsp): (defun firsts (l) (cond ((null l) ()) (T (cons (car (car l)) (firsts (cdr l)))))...
(1) odpowiedzi
2017-02-05 21:02 Is defun or setf preferred for creating function definitions in common lisp and why? »
What is the fundamental difference in the functions defined using defun and setf as below and is one method preferred over another outside of style co...
(1) odpowiedzi
2017-02-05 02:02 Find position of atom - return nil if not present »
I am trying to find the position of an atom in the list. Expected results: (position-in-list 'a '(a b c d e)) gives 0 (position-in-list 'b '(a b c ...
(3) odpowiedzi
2017-02-04 02:02 how are functions defined in the lisp dialect used in the little lisper 1974 edition »
The first function definition in the 1974 edition of the Little Lisper appears as follows: (ISLAT (LAMBDA (L) (COND ((NULL L) T) ((ATOM (...
(1) odpowiedzi