Data dodania Pytanie
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
2017-02-02 20:02 How to access :cause, :via and :trace keys of an exception in Clojure? »
I could not find a way to access :cause, :via and :trace keys of an exception. Here is the code: (try (throw (IllegalArgumentException. "1")) (c...
(1) odpowiedzi
2017-02-02 05:02 Error: "Should be a lambda expression" »
I am new to Lisp and this is the first function I have written. I am trying write a lisp function (without using the remove lisp function) that takes ...
(0) odpowiedzi
2017-02-01 11:02 using COND on optional arguments in common lisp »
I'm having some problem writing a LISP function. The function is defined as (defun foo (arg1 &optional cont)) (cond ((null arg1) nil) ...
(1) odpowiedzi
2017-01-27 03:01 LISP function to print out fibonacci sequence up to N amount of numbers »
I have to write code that computes N Fibonacci numbers (where N is the function parameter). I'm new to LISP and am struggling with the syntax. This is...
(3) odpowiedzi
2017-01-25 04:01 Flattening lists (while removing 'nil' and keeping atoms after " . ") in lisp »
I want to create a function that would flatten a list and remove all potential nil inside. Expected behavior, example 1: (myfunc '(a (b (c) (d)) (e ...
(1) odpowiedzi
2017-01-23 21:01 Common lisp: How to implement reduce »
I've been looking for this for days, basically I need to implement a function that does the same thing that the system function reduce does. This is w...
(2) odpowiedzi
2017-01-22 23:01 Clisp "Program stack overflow. RESET" on a (cadr). How? »
I'm (still) porting code from Franz Lisp to Common LISP. Now I seem to have pushed the interpreter into a strange corner where it blows up. [11]>...
(1) odpowiedzi
2017-01-21 01:01 Why do some lisps put the function name outside of the argument list in a function definition? »
common lisp and clojure do (defn function-name (arg1 arg2) (body)) racket/scheme does (defn (function-name arg1 arg2) (body)) The latter makes m...
(3) odpowiedzi
2017-01-19 03:01 Franz LISP to Common LISP conversion 2 - macros which generate macros »
I'm reviving an old LISP program from the early 1980s. (It's the Nelson-Oppen simplifier, an early proof system. This version was part of the Ford Pas...
(2) odpowiedzi
2017-01-19 01:01 how to remove an element from a nested list lisp »
could you please help me to solve a tricky homework about nested list? Basically anytime the predicate evenp is true , I should remove the element fr...
(1) odpowiedzi
2017-01-18 20:01 Why doesn't my network server on Racket receive data more than once? »
I'm trying to create a network server on Racket that receives data and does something with the data it receives. The issue that I'm having is that t...
(1) odpowiedzi
2017-01-18 16:01 LISP FUNCTION - Return the count of numbers of the list that are bigger of the first element »
I want to solve a lisp function that returns a NUMBER(count) of numbers which are greater than the first number in the list.The list is a linear list ...
(2) odpowiedzi
2017-01-17 08:01 Why Doesn't Clojure provide standard library after creating new namespace? »
I came across this problem after creating a new namespace. Here is the code: (create-ns 'my-new-ns) => #object[clojure.lang.Namespace 0x7c7c8359 ...
(4) odpowiedzi
2017-01-16 18:01 Futures never resolve and deliver to promise »
I am reading a book to teach myself Clojure called Clojure for the Brave and True. Chapter 9 covers basic concurrent programming including delays, fu...
(1) odpowiedzi
2017-01-14 17:01 How to define a function locally in lisp? »
I need to define a function inside a let and be able to immediately use it, like this: (let ((test (lambda () (print "ha")))) (test)) However,...
(3) odpowiedzi
2017-01-13 09:01 CLISP Terminal error: Invalid byte sequence »
i have a problem while loading my source file inside terminal using clisp. if i execute the following command to load the file: (load #p "filename.l...
(1) odpowiedzi
2017-01-12 17:01 Exercise about substitution in nested lisp »
Morning everyones!!! I'm actually trying to make an exercise in Common Lisp but I have no idea of how to do it only using recursion. This is the pr...
(0) odpowiedzi
2017-01-12 04:01 Is there anyone who has completed all the exercises in the "Common Lisp - An Interactive Approach" book? »
Here’s the link to the book. I’m stuck in the exercises of the “Recursion on Trees” chapter (Pg 148, Prob 18.25). It involves redefining two...
(0) odpowiedzi
2017-01-11 22:01 Delete the first element of each sublist »
I am supposed to write a function which will delete the first element of each sublist. So if we are given (1 (2 (3 4) 5) 6), my function should retu...
(1) odpowiedzi
2017-01-11 04:01 Same results as "member" without using it (lisp) »
To complete an exercise, I need to check if an element is in a list or not. I know that there is the function member in lisp, but our instructor is ve...
(1) odpowiedzi
2017-01-10 14:01 Conditional "assignment" in functional programming »
I am programming something that doesn't have side-effects, but my code is not very readable. Consider the following piece of code: (let [csv_data (if...
(4) odpowiedzi
2017-01-09 14:01 How to transform this Prolog program into Lisp? »
I'm trying to learn Common Lisp, and I want to know how to make a parser similar to the Prolog for as-monomial and do not know where to start. as_mon...
(2) odpowiedzi