lisp

Windows Scheme/Lisp Implementation

With the thousands of implementations of LISP and Scheme available I'm having a very hard time finding just the right one to use for Windows development. I learned these languages in school and found them to be very elegant, however, I don't seem to be able to find an implementation that would be suitable for developing code other than ...

In a long running Common Lisp application, what strategy should be used to manage garbage?

If I am hosting a long running application such as a web server within a Common Lisp image, what strategy should I use to manage the garbage collector? I'm assuming that, by default, the garbage collector is entitled to spend long periods of time sorting out the heap, at times I can't predict. This may impact a particular browser reques...

Have you read Let Over Lambda?

I have been searching for references of this book, but haven't found much. It seems that it is a pretty advanced book, and I believe SO to be one of the best sites to ask for a little review. The questions follow: Do you consider it, as some say, to be the continuation of On Lisp? Which book would you read first, this one or The Art of...

Emacs: getting readable keyboard-macros

When using insert-kbd-macro to save a named keyboard-macro I get "unreadable" lisp-code like (fset 'ppsql (lambda (&optional arg) "Keyboard macro." (interactive "p") (kmacro-exec-ring-item (quote ([134217788 134217765 44 return 44 17 10 return 33 134217765 102 102 backspace 114 111 109 return 17 10 102 111 109 backspace backspace 114...

Ant (or NAnt) in Lisp

In his article The Nature of Lisp, Slava Akhmechet introduces people to lisp by using Ant/NAnt as an example. Is there an implementation of Ant/NAnt in lisp? Where you can use actual lisp code, instead of xml, for defining things? I've had to deal with creating additions to NAnt, and have long for a way to bypass the xml system in the ...

In Emacs Lisp, how do I check if a variable is defined?

In Emacs Lisp, how do I check if a variable is defined? ...

Python Macros: Use Cases?

If Python had a macro facility similar to Lisp/Scheme (something like MetaPython), how would you use it? If you are a Lisp/Scheme programmer, what sorts of things do you use macros for (other than things that have a clear syntactic parallel in Python such as a while loop)? ...

How to write a scheme function that takes two lists and returns four lists

I have 2 lists of elements '(a b c) '(d b f) and want to find differences, union, and intersection in one result. Is that possible? How? I wrote a member function that checks if there is a car of the first list in the second list, but I can't throw a member to the new list. (define (checkResult lis1 lis2) (cond........... )) (checkr...

Can you provide an example of parsing HTML with your favorite parser?

This question is a lazy way of collecting examples of parsing HTML with a variety of languages and parsing libraries. Individual comments will be linked to in answers to questions about how to parse HTML with regexes as a way of showing the right way to do things (similar to how I use Can you provide some examples of why it is hard to p...

A Gentler Introduction to Functional Programming

I am trying to learn Haskell, and I really like it, but I can't wrap my head around most of it. Would Lisp, OCaml, etc. be a gentler introduction to functional programming? ...

Does anyone have an Emacs macro for indenting (and unindenting) blocks of text?

Does anyone have an Emacs macro for indenting (and unindenting) blocks of text? And I mean "indent" in the commonly-understood sense, not in Emacspeak. In other words, I want to mark a region, press C-u 2, run this macro, and have it add two spaces before every line in the region. Or press C-u -2 before running the macro and have it re...

How to set up MIT Scheme for 6.001 in Ubuntu 8.10

I play to self-study 6.001 with the video lectures and lecture handouts. However, I have some problems setting up MIT Scheme in Ubuntu (intrepid). I used package management and installed MIT-Scheme, but it's obviously the wrong version to use. It should be 7.5.1 instead of 7.7.90 I followed the instructions from this website (http://oc...

Unable to add a directory and all its subdirectories to load-path in Emacs

The question is similar to one. However, it differs in putting all subdirectories achievable in the folder too. Jouni's code which puts first level folders achievable (let ((base "~/Projects/emacs")) (add-to-list 'load-path base) (dolist (f (directory-files base)) (let ((name (concat base "/" f))) (when (and (file-direc...

What is lisp used for today and where do you think it's going ?

Never been a lisp user, so don't take me as too dense while reading this. But what is lisp used for today ? I know there are several variants of the language in existence, at least one which will keep it alive commercially for a while longer (AutoLisp, VisualLisp - pretty big support from Autodesk) ... but I don't meet everyday people ...

Drawing trees in common lisp

Hello all, This question probably has an embarrassingly simple answer, but is there a Right Way to format/draw trees in Common Lisp? I've tried a few books as well as googling about, but the problem seems to fall between the cracks of the search terms. Thanks in advance! ...

How can I spot subtle Lisp syntax mistakes?

I'm a newbie playing around with Lisp (actually, Emacs Lisp). It's a lot of fun, except when I seem to run into the same syntax mistakes again and again. For instance, here's something I've encountered several times. I have some cond form, like (cond ((foo bar) (qux quux)) ((or corge (grault warg)) (fred) (t xyzzy))) ...

Why use #' with lambda?

Why should I use #' together with lambda? It is usually written that way, so I guess it is good form. But these lines seem equal to me: > (mapcar #'(lambda (x) (+ x 1)) '(1 2 3)) (2 3 4) > (mapcar (lambda (x) (+ x 1)) '(1 2 3)) (2 3 4) Anyone care to enlighten a beginner about the difference? ...

Are there Lisp native code compilers?

Are there native code compilers for Lisp? To which extent can it even be compiled, with all it's dynamic nature, garbage collection, macros and what else? ...

Python equivalent of maplist?

What's the best Python equivalent of Common Lisp's maplist function? From the maplist documentation: maplist is like mapcar except that function is applied to successive sublists of the lists. function is first applied to the lists themselves, and then to the cdr of each list, and then to the cdr of the cdr of each list,...

What program can help a REPL shell remember and search history?

I'm playing with Paul Graham's arc, and it's getting really annoying that the up arrow inserts ^[[A instead of the previous command, and ^R doesn't work as in shell. I vaguely remember there being a simple way to run Arc's REPL in a program which will remember the input history - does anyone know what it is? ...