common-lisp

Connecting .NET to Common Lisp

I have a fairly involved LispWorks Common Lisp module that sits atop some .NET modules via RDNZL. It has come up that I need to expose some of its functionality to some other .NET applications, and I'm not sure the best (shortest) way to approach this without re-writing the module in C#. I know there are a few CLR Lisp implementations b...

Please explain some of Paul Graham's points on Lisp

I need some help understanding some of the points from Paul Graham's article http://www.paulgraham.com/diff.html A new concept of variables. In Lisp, all variables are effectively pointers. Values are what have types, not variables, and assigning or binding variables means copying pointers, not what they point to. A symbol type. Symbol...

Common lisp gray streams

Is there a tutorial on how to use gray streams? I want to create a class that reads from a file while looking for a specific set of bytes. My initial thought was to use gray streams, but could not find any starting information. ...

LISP: Keyword parameters, supplied-p

At the moment I'm working through "Practical Common Lisp" from Peter Seibel. In the chapter "Practical: A Simple Database" (http://www.gigamonkeys.com/book/practical-a-simple-database.html) Seibel explains keyword parameters and the usage of a supplied-parameter with the following example: (defun foo (&key a (b 20) (c 30 c-p)) (list...

Consecutive calls/evaluations in a form?

Hey guys, simple question... Working with XLISP to write a program, but I've seemed to run into a simple fundamental problem that I can't seem to work around: perhaps someone has a quick fix. I'm trying to write an if statement who's then-clause evaluates multiple forms and returns the value of the last. In example: (setq POSITION 'D...

CLIM tutorial, where?

I am thinking of using McClim for an application, where can I find a tutorial that covers buttons, keyboard/mouse I/O, drawing images, etc. STFW for mcclim tutorial and clim tutorial didn't help much. Any pointers? If such a tutorial doesn't exist, please point that out and I'll try to RTFM (maybe eventually write such a tutoriial) ...

How to write (simple) macro?

I need to write a macro (with-hooks (monster method who what) &body body) for a game I'm writing. Monster is a CLOS object, method and who are strings and what is a function (#' notation). The macroexpansion would be something to the effect of (add-hook monster method who what) ,@body (remove-hook monster method who) I have absolutely...

How to setup a webserver in common lisp?

Several months ago, I was inspired by the magnificent book ANSI Common Lisp written by Paul Graham, and the statement that Lisp could be used as a secret weapon in your web development, published by the same author on his blog. Wow, that is amazing. That is something that I have been looking for long time. The author really developed a s...

How can I stop a running operation in the SLIME REPL?

Is there a way to stop a running operation in the SLIME REPL? The Clojure SLIME folks apparently have some way to do this, so how about in ordinary Common Lisp? Thanks /Erik ...

Vector Calculations in LISP

How can I perform vector calculations in lisp, such as magnitude of a vector, norm of a vector, distance (between two points), dot product, cross product, etc. Thanks. ...

member and defparameter

In the following Lisp REPL interaction: CL-USER> (defparameter *unison* 0) *UNISON* CL-USER> (member *unison* '(*unison*)) NIL why is nil returned? ...

Call function based off of a string in Lisp

I am passing in command line arguments to my Lisp program and they are formatted like this when they hit my main function: ("1 1 1" "dot" "2 2 2") I have a dot function (which takes two vectors as arguments) and would like to call it directly from the argument, but this isn't possible because something like (funcall (second args)...) r...

Common Lisp condition system for transfer of control

I'll admit right up front that the following is a pretty terrible description of what I want to do. Apologies in advance. Please ask questions to help me explain. :-) I've written ETLs (Extract, Transform, Load) in other languages that consist of individual operations that look something like: // in class CountOperation IEnumerable<...

What's a good unit test framework for Common Lisp projects?

I need to write a unit test suite for a project I am developing in my spare time. Being a CL newbie I was overwhelmed by the amount of choices for a CL implementation, I spent quite some time to choose one. Now I am facing exactly the same thing with unit test frameworks. A quick glance at http://www.cliki.net/test%20framework shows 20 ...

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 Lisp and Clojure as well. Is there any difference between 1 and quoted 1? ...

Test if a class is a subclass of another class in common lisp

How do I see if one CLOS class is a subclass of another CLOS class? ...

Is there any limit to recursion in lisp?

I enjoy using recursion whenever I can, it seems like a much more natural way to loop over something then actual loops. I was wondering if there is any limit to recursion in lisp? Like there is in python where it freaks out after like 1000 loops? Could you use it for say, a game loop? Testing it out now, simple counting recursive functi...

Parsing a key out of a key code

I am getting key events that contain asci key codes and I was wondering if there was any easy way to convert these to the actual key or character in common lisp. I am using the ccl implementation which does not include int-char (which may or may not have worked for this task). ...

Any good lisp gui library?

Is there any easy to set up Common Lisp gui libraries? I've been trying to install many but I always come up with errors. The only one I got to fully work is Ltk but I hear there's problems with that, especially on windows. LispBuilder-sdl was the easiest library to install but non of the others will work? I'm really confused about this?...

Can getf use equal for comparison instead of eq? (common lisp)

I am wondering if there a way that I can force getf to compare using equal instead of eq? I am using the ccl implementation of common lisp. ...