lisp

Lisp warning: xx is neither declared nor bound, it will be treated as if it were declared SPECIAL

I am new to lisp and am writing a few simple programs to get more familiar with it. One of the things I am doing is writing a recursive and iterative version of a factorial method. However, I have come across a problem and can't seem to solve it. I saw a similar error at http://stackoverflow.com/questions/1187262/lisp-char-is-neither...

Lisp soap client

It was very easy to use Apache CXF to develop a client for a SOAP web service. All I had to do was call wsdl2java and all the required classes were present. Is there such a client for lisp? If not, what can I do to write a soap client for lisp? The only restriction is that I don't have access to commercial implementations such as franz/l...

Simple issue with subseq (LISP)

I just started using LISP, coming from a background in C. So far its been fun, although with an incredible learning curve (I'm an emacs newbie too). Anyway, I'm having a silly issue with the following code to parse include statements from c source - if anyone can comment on this and suggest a solution, it would help a lot. (defun inclu...

How do I iterate through a directory in Common Lisp?

I'm using OpenMCL on Darwin, and I'd like to do something like: (loop for f in (directory "somedir") collect (some-per-file-processing f)) But I can't get directory to return anything other than NIL, and I can't seem to find any good explanation online (other than "its different for each system"). Any pointers? ...

Using string object as a hash key in Common Lisp

Hi folks, I'm trying to create a "dictionary" type - ie hash table with a string as a key. Is this possible or wise in Lisp? I noticed that this works as expected: > (setq table (make-hash-table)) #<HASH-TABLE :TEST EQL size 0/60 #x91AFA46> > (setf (gethash 1 table) "one") "one" > (gethash 1 table) "one" However, the following does ...

Is Clojure closer to Scheme or Common Lisp from a beginner's perspective?

If I want to learn Clojure, should I start by learning Scheme or Common Lisp? Or is Clojure different enough from both of these, that I should just start learning Clojure by itself? ...

Why Clojure over other JVM Lisps: Kawa, Armed Bear or SISC?

The JVM already had three Lisps before Clojure arrived on the scene: Kawa, Armed Bear and SISC. What gap does Clojure fill that was left by those Lisps? ...

Unnesting parentheses in Lisp

I want to write code (using recursive function) to unnest the parentheses in a LIST in Lisp language. Example: (unnest '(1 (2 (3)) (4 5))) ==> (1 2 3 4 5) Thanks. Any help is appreciated! ...

What is the difference between '(a b c) and (list 'a 'b 'c)?

I am reading "On lisp" and encounter this code (I simplified a bit). CL-USER> (defun foo () '(a b c)) FOO CL-USER> (foo) (A B C) ...

LISP: multi-level recursive reverse function

How to reverse a list such that every sublist is also reversed? This is what I have so far: (defun REV (L) (cond ((null L) nil) ((listp L) (append (REV (cdr L)) (list (car L)))) (t (append (REV (cdr L)) (list (car L)))))) ...

LISP check if list is symmetrical without reverse

Anyone have any ideas on how to do this... reverse is too slow, and I want to avoid using the function. Basically I want to be able to return true if something like '(a b b a) comes up or '(a b c d c b a) and false for something not symmetrical ...

In CL Postmodern what :col-type to use for Many to Many field?

When defining a database access object for use in cl-postmodern, what should the :col-type be for a Many to Many field? ...

A beautifier for lisp?

Are there any beautifiers for (e)lisp? Online preferred ...

scheme list equivalence comparison

Hello I need to check if two lists have same elements in same order but I wasn't able to achieve as it seems like scheme eq? and eqv? checks by reference so giving false to such: > (eq? (list 1 2 3) (list 1 2 3)) #f > (eqv? (list 1 2 3) (list 1 2 3)) #f How to achieve this ? ...

Python generators in various languages

How do you emulate Python style generators in your favorite language? I found this one in Scheme. It must be interesting to see other implementations, especially in those languages that don't have first-class continuations. ...

How do I tell if the value of a variable is a symbol bound to a procedure in Scheme?

I am familiar with Common Lisp and trying to learn some Scheme, so I have been trying to understand how I'd use Scheme for things I usually code in Common Lisp. In Common Lisp there's fboundp, which tells me if a symbol (the value of a variable) is bound to a function. So, I would do this: (let ((s (read))) (if (fboundp s) (app...

strtotime for Emacs Lisp

Is there any functionality in Emacs Lisp that behaves similar to PHP's strtotime function? (Actually AFAIK it implements relative items of the GNU date input formats.) In PHP I can write echo strtotime("+2 months"); //1258891352 echo strtotime("-3 months +2 weeks"); //1246952239 which return the corresponding UNIX timestamps. ...

What language could I use for fast execution of this database summarization task?

So I wrote a Python program to handle a little data processing task. Here's a very brief specification in a made-up language of the computation I want: parse "%s %lf %s" aa bb cc | group_by aa | quickselect --key=bb 0:5 | \ flatten | format "%s %lf %s" aa bb cc That is, for each line, parse out a word, a floating-point number, an...

Besides Logo and Emacs Lisp, what are other pure dynamically scoped languages?

What are some examples of a dynamically scoped language? And what are the reasons for choosing that design? Is it because it is easy to implement? ...

What is the exact definition of a Metacircular Interpreter?

Is it legal to call a C compiler written in C or a PHP interpreter written in PHP metacircular? Is this definition valid only for languages of a specific type, like Lisp? In short, what are the conditions that an interpreter should satisfy for being called Metacircular? ...