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
5
votes
2 answers

Suppress output from print function in Lisp

I'm fairly new to Lisp, and I've run into a printing issue. I have one function which does printing to the standard output (among other things). I want to then run this function through another function where it still runs the same but instead…
Nyles
  • 185
  • 9
5
votes
2 answers

Is LISP's code-as-data ideology basically the same thing as higher order functions?

So, I've been trying to wrap my head around the idea of clojure's code-as-data approach and it is definitely a bit confusing. It seems a lot like they are simply higher order functions of the sort. Is there a difference between these two concepts?
patrickbarker
  • 393
  • 1
  • 4
  • 13
5
votes
1 answer

Genetic Programming in Haskell

There is GenProg (http://hackage.haskell.org/package/genprog) for example, but that only deals with numerical optimization, in this case finding an equation that describes the data. But I require for loops, if statements, when statements, Boolean…
Robotijn
  • 86
  • 6
5
votes
1 answer

lisp efficient linear algebra library

Does anybody know of an efficient and reliable linear algebra library for lisp? I've been googling a little but wasn't satisfied with what I found. I need to do matrix operations for developing predictive algorithms. I've been using octave/matalab…
Luca
  • 123
  • 1
  • 5
5
votes
3 answers

Install CLSQL on Mac OS X

I have SBCL installed (via macports/darwinports) on my Intel Core 2 Duo Macbook running 10.5.8. I've installed several libraries like this: (require 'asdf) (require 'asdf-install) (asdf-install:install 'cl-who) But when I tried to install CLSQL…
Ken
  • 2,886
  • 20
  • 11
5
votes
2 answers

How to install CL-Opengl with SBCL?

So I was just wondering how to install opengl for SBCL? I'm on a 64-bit Windows 8 notebook. I did use quicklisp and quickload but when I actually use it in a program I get an error like this: ; compilation unit finished ; Undefined functions: ; …
Fderal
  • 457
  • 1
  • 6
  • 11
5
votes
2 answers

No value returned by Common Lisp function

I've read that every form in Common Lisp returns something when evaluated. However, recently I've been playing with ASDF API and found a function that returns nothing: CL-USER> (asdf:clear-output-translations) ; No value How is this possible and…
Mark Karpov
  • 7,499
  • 2
  • 27
  • 62
5
votes
1 answer

Insert string every nth element in a list of strings

I'm new to Clojure. I'm developing a tic tac toe game I'm trying to make a function that "formats" the board, which is a map with the number of the position as key and the keywords :x :o and :e for values (:e stands for empty). I want to insert a…
Nick Tchayka
  • 563
  • 3
  • 14
5
votes
1 answer

continuation in common lisp by macros -- regarding an implemetation in OnLisp

In On Lisp, p. 267, Paul Graham provides an implementation of continuation passing macros: (setq *cont* #'identity) (defmacro =lambda (parms &body body) `#'(lambda (*cont* ,@parms) ,@body)) (defmacro =defun (name parms &body body) (let ((f…
5
votes
2 answers

Difference between 1st and 2nd version of "How to Design Programs" (HTDP)

i searched the internet for hours, but didn't find a satisfying answer to what's the difference between the first and second version of HTDP (How to design programs)? Why should I start with the second version, instead of the first one? As the…
cobby
  • 484
  • 3
  • 18
5
votes
1 answer

How to make serve with more threads with Hunchentoot

I am using Hunchentoot for a web app to be a high traffic db driven app, also depends on web sockets protocol and http ajax requests. When I benchmark my app with apache benchmark as ab -c 50 -n 1000 connection is reset prompt is shown. for unto…
sçuçu
  • 2,960
  • 2
  • 33
  • 60
5
votes
2 answers

Trying to understand setf + aref "magic"

I now have learnt about arrays and aref in Lisp. So far, it's quite easy to grasp, and it works like a charme: (defparameter *foo* (make-array 5)) (aref *foo* 0) ; => nil (setf (aref *foo* 0) 23) (aref *foo* 0) ; => 23 What puzzles me is the aref…
Golo Roden
  • 140,679
  • 96
  • 298
  • 425
5
votes
1 answer

Cocoa equivalent of the Carbon method getPtrSize

I need to translate the a carbon method into cocoa into and I am having trouble finding any documentation about what the carbon method getPtrSize really does. From the code I am translating it seems that it returns the byte representation of an…
Mike2012
  • 7,629
  • 15
  • 84
  • 135
5
votes
5 answers

What is the exact difference between NULL and NIL in Common Lisp?

As far as I understood, NIL is a symbol for many things: empty lists, or the boolean false. So far so good, but why there is sometimes NULL showing up in the output? clisp> (type-of NIL) NULL clisp> (type-of t) BOOLEAN clisp> (type-of (not…
math
  • 8,514
  • 10
  • 53
  • 61
5
votes
3 answers

Why does TCO require support from the VM?

Some VMs, most notably the JVM, are said to not support TCO. As a result, language like Clojure require the user to use loop recur instead. However, I can rewrite self-tail calls to use a loop. For example, here's a tail-call factorial: def…
Wilfred Hughes
  • 29,846
  • 15
  • 139
  • 192