common-lisp

Struggling with common lisp libraries

I've learned scheme and quickly mastered a lot of it, then did a project in it just fine. Literally took me days to finish. I'm now trying to learn common lisp to get a feel for that and now I'm just really really struggling with trying to learn asdf. It seems to be common knowledge how to use it with libraries but I'm baffled. I guess i...

How to make and use library with lisp (clisp)?

In C/C++, I can make a library, and make it static one or dll using #include "" in source code, and -labc when linking. How do I have the same feature in lisp? As an example of util.lisp in directory A. I define a library function hello. (defpackage "UTIL" (:use "COMMON-LISP") (:nicknames "UT") (:export "HELLO")) (in-package ut...

How to go about learning Common Lisp and Emacs Lisp?

The last few months I've been using Emacs extensively as my main development environment and I've now come to a point at which I'd like to learn it's own Emacs Lisp to write my own little stuff for Emacs and extend it to my personal needs. Having said that I've also wanted to learn Common Lisp for a while now, to play around with and ex...

What is WITH-STANDARD-IO-SYNTAX macro for?

The Practical Common Lisp page 25, explains the WITH-STANDARD-IO-SYNTAX as follows. "It ensures that certain variables that affect the behavior of PRINT are set to their standard values". The usage is as follows. (with-open-file (...) (with-standard-io-syntax (print ... Should (print) be used in this macro? If not, what ...

Help with installing ECL (Embeddable Common Lisp) via mingw32 or mingw-64 on Win7-64

I'm trying to compile ECL 10.4.1 on my Win7 64-bit box, but am having issues. I've attempted the build with both mingw32/MSYS and mingw-w64/MSYS, using the exact packages linked to here. Both have failed. With mingw32: ./configure passes, make fails as follows: gcc -DECLDIR="\"/usr/local/lib/ecl-10.4.1\"" -I. -Ic:/my_home/ecl-10.4.1/...

Increase Minimum Stack Overflow Size in Mac Common Lisp 5.0

Hi, I'm relatively new to Lisp (I just know the very basics) and I'm currently trying to run an algorithmic composition program created by David Cope. It runs in MCL 5.0, and I keep getting the following error: Error in process play: Stack overflow on value stack. To globally increase stack space, increase *minimum-stack-overflow-...

Opening an HTML page in a browser from Common Lisp

My Common Lisp program writes out an HTML file. I then want to launch this file in the user's default browser. Is there a way of doing this in Common Lisp? Moreover, is there an OS-independent way of doing this? ...

How do I create variables in sequence in common Lisp?

I have the following code inside a function that is reading in a file which is a map. I get an error that *numrows* is an illegal dimension. I think this is because lisp is processing these variables in parallel. How can I fix this? (setq *numrows* (read map)) (setq *numcols* (read map)) (setq *map* (make-array '(*numrows* *numcols*) :i...

What is the difference between an atom and a symbol in Common Lisp?

Are there any differences between what in Common Lisp you'd call an atom, and a symbol? Do these differences extend to other languages in the Lisp family? (I'm aware that atom has a different meaning in Clojure, but I'm interested in the boundaries of what is a symbol.) ...

setq and defvar in lisp

I see that the Practical Common Lisp uses (defvar *db* nil) for setting up global variable. Isn't it OK to use setq for the same purposes? What's the advantages/disadvantages of using defvar vs setq? ...

Lisp's apply and funcall vs Python's apply

Lisp's apply is for Lisp's APPLY is for calling functions with computed argument lists stored in lists.(Modified from Rainer's comment) For example, the following code changes (list 1 2 3) to (+ 1 2 3). (apply #'+ '(1 2 3)) However, Python's apply does what Lisp's funcall does, except for some minor differences (input is given as t...

In Lisp, how do I fix "Warning: Assumed Special?"

In this file I get 9 warnings of "assumed special". They are ;;;*** Warning in CHECK-ROW: CHECKARRAY assumed special in SETQ ;;;*** Warning in CHECK-ROW: RESULT assumed special in SETQ ;;;*** Warning in CHECK-ROW: CHECKARRAY assumed special ;;;*** Warning in CHECK-ROW: CHECKARRAY assumed special ;;;*** Warning in CHECK-ROW: CHECKARRAY a...

When do you use APPLY and when FUNCALL?

The Common Lisp HyperSpec says in the FUNCALL entry that (funcall function arg1 arg2 ...) == (apply function arg1 arg2 ... nil) == (apply function (list arg1 arg2 ...)) so at some level they're the same thing. So when would you use APPLY, and when FUNCALL? ...

defmacro with defclass

Hi, I have a class in Common Lisp: (defclass my-cool-class() ((variable1 :initarg :variable1 :accessor variable1 :initform (error "Must supply value to variable1")) (variable2 :initarg :variable2 :accessor variable2 :initform (error "Must supply value to variable2")) I wanted to create a macro that would ...

Are there easy way of installing lisp library such as rubygem(ruby) or easy_install(python)?

I find easy_install extremely useful for programming with Python, and the same as rubygem with Ruby. Does Lisp have similar feature? I understand that there are many Lisp implementations (clisp, sbcl, clozure cl ...), but I just wanted to know what would Lispers do when they need to find and use Lisp library functions. ...

Critique my Lisp, please.

Dear all, I have created a nice little routine: (defun unzip (seq) "Takes an even-length list and breaks it apart by evens/odd index" (let ((oddresult '()) (evenresult '())) (loop for n from 0 to (- (length seq) 1) do (if (oddp n) (push (nth n seq) oddresult) (push (nth n seq) evenresult))) (list...

Fixing GC error in Mac Common Lisp 5.0

Hi all, I'm fairly new to Lisp, and I'm trying to run an algorithmic music application on the original MCL 5.0 (not the RMCL version). The program works by incrementally inputting textual representations of music, and learning from the user via an association net. Unfortunately, shortly after I begin inputting the text, I begin to see t...

Hashing with ironclad and flexi-streams

I'm trying to hash some strings in a Common Lisp app I'm working on. The sd-sha1 package seems to be unsupported, and has been for some time judging by the CLiki page, which suggests using Ironclad instead. Fair enough, => (require 'ironclad) NIL Ironclad doesn't do string digests though; this is stated on its project page as an inte...

Is there a way to get the CLISP compiled with dynamic FFI support on Mac OS?

I use clisp 2.48 (2009-07-28) on Mac OS X 10.6.4. I downloaded the clisp with 'sudo port install clisp'. After installing quick lisp, I installed some packages, and most of them are OK. However, when I tried to install "sqlite", I got the following error. [1]> (ql:quickload "sqlite") To load "sqlite": Load 1 ASDF system: sql...

Is cl-opengl glut mature?

I want to create my own editor to code in, at first I was going to use ncurses to make a terminal editor. Not working, the library has no documentation and it's mail list is completely empty. I'm probably going to make it with a gui library instead. I'm thinking of just using glut from cl-opengl, but I can't find any info on how develope...