Questions tagged [lisp]

Lisp is a family of general purpose programming languages, influenced by the lambda calculus, and with the ability to manipulate source code as a data structure.

Introduction

The name Lisp derives from "LISt Processor". It was originally created as a practical mathematical notation for computer programs. See Wikipedia for more information.

Hello World Program in Lisp

;;; Hello World in Common Lisp

(defun helloworld ()
  (print "Hello World!"))

Popular dialects

Free Lisp Programming Books

There is also a Stack Overflow chat room on Lisp.

6922 questions
35
votes
8 answers

Examples of what Lisp's macros can be used for

I've heard that Lisp's macro system is very powerful. However, I find it difficult to find some practical examples of what they can be used for; things that would be difficult to achieve without them. Can anyone give some examples?
Dimitri C.
  • 21,861
  • 21
  • 85
  • 101
35
votes
4 answers

Why are Python and Ruby so slow, while Lisp implementations are fast?

I find that simple things like function calls and loops, and even just loops incrementing a counter take far more time in Python and Ruby than in Chicken Scheme, Racket, or SBCL. Why is this so? I often hear people say that slowness is a price you…
ithisa
  • 752
  • 1
  • 8
  • 25
35
votes
3 answers

How is the `*var-name*` naming-convention used in clojure?

As a non-lisper coming to clojure how should I best understand the naming convention where vars get a name like *var-name*? This appears to be a lisp convention indicating a global variable. But in clojure such vars appear in namespaces as far as I…
Alex Stoddard
  • 8,244
  • 4
  • 41
  • 61
34
votes
6 answers

Lisp and Prolog for Artificial Intelligence?

Now since i've taken a class 3 years ago in A.I. im clearly proficient enough to ask this question......just kidding just kidding ;) but seriously, what is it about these languages that make them so popular for A.I. research. Even though A.I.…
user475353
34
votes
9 answers

Building a Texas Hold'em playing AI..from scratch

I'm interested in building a Texas Hold 'Em AI engine in Java. This is a long term project, one in which I plan to invest at least two years. I'm still at college, haven't build anything ambitious yet and wanting to tackle a problem that will hold…
andandandand
  • 21,946
  • 60
  • 170
  • 271
34
votes
4 answers

How can I simply "run" lisp files

Python When I learned Python I installed it on windows with a nice gui installer and all .py files would automatically run in python, from the command line or explorer. I found this very intuitive and easy, because I could instantly make plain text…
AnnanFay
  • 9,573
  • 15
  • 63
  • 86
34
votes
5 answers

Is there an equivalent to Lisp's "runtime" primitive in Scheme?

According to SICP section 1.2.6, exercise 1.22: Most Lisp implementations include a primitive called runtime that returns an integer that specifies the amount of time the system has been running (measured, for example, in microseconds). I'm using…
Bill the Lizard
  • 398,270
  • 210
  • 566
  • 880
34
votes
4 answers

Idiomatic clojure for progress reporting?

How should I monitor the progress of a mapped function in clojure? When processing records in an imperative language I often print a message every so often to indicate how far things have gone, e.g. reporting every 1000 records. Essentially this is…
34
votes
4 answers

scheme continuations for dummies

For the life of me, I can't understand continuations. I think the problem stems from the fact that I don't understand is what they are for. All the examples that I've found in books or online are very trivial. They make me wonder, why anyone would…
user2379016
  • 351
  • 3
  • 5
34
votes
1 answer

Mathematica: Unevaluated vs Defer vs Hold vs HoldForm vs HoldAllComplete vs etc etc

I'm bewildered by all the built-in Mathematica functions that purport to prevent evaluation in some way: Unevaluated, Defer, Hold, and over half a dozen of the form Hold*. The Mathematica documentation just explains each function in isolation…
dreeves
  • 26,430
  • 45
  • 154
  • 229
34
votes
5 answers

Lisp: list vs S-expression

I'm new to Lisp. I encountered 2 terms "list" and "S-expression". I just can't distinguish between them. Are they just synonyms in Lisp?
Dagang
  • 24,586
  • 26
  • 88
  • 133
33
votes
11 answers

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. However; 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…
Rook
  • 60,248
  • 49
  • 165
  • 242
33
votes
9 answers

How do the various ANSI CL implementations differ?

When I started learning CL from Practical Common Lisp, as is preached in the book, I started off with Allegro CL compiler. I stopped using it, since its commerical, yet free bit didn't impress me. It needed a connection to its remote server for some…
user59634
33
votes
4 answers

In Lisp (Clojure, Emacs Lisp), what is the difference between list and quote?

From reading introductory material on Lisp, I now consider the following to be identical: (list 1 2 3) '(1 2 3) However, judging from problems I face when using the quoted form in both Clojure and Emacs Lisp, they are not the same. Can you tell me…
neo
  • 333
  • 3
  • 4
33
votes
7 answers

What is the difference between 1 and '1 in Lisp?

I had never really thought about whether a symbol could be a number in Lisp, so I played around with it today: > '1 1 > (+ '1 '1) 2 > (+ '1 1) 2 > (define a '1) > (+ a 1) 2 The above code is scheme, but it seems to be roughly the same in Common…
Jason Baker
  • 192,085
  • 135
  • 376
  • 510