trying to run LISP code in LispIDE

Discussion of Common Lisp
Post Reply
gib65
Posts: 8
Joined: Thu Jul 28, 2011 1:24 pm

trying to run LISP code in LispIDE

Post by gib65 » Fri Aug 05, 2011 2:46 pm

First of all, I know nothing about Common Lisp or any kind of Lisp. I am just begining to learn.

So I downloaded LispIDE in order to have an environment in which I can experiment. I wrote a very simple program:

(* 2 (cos 0) (+ 4 6))

which, according to this website, should print out 20.0.

Well, I'm able to save the file (as a .lisp) but I don't seem to be able to run it. I can't find a compile or run function anywhere in the IDE. I would also try compiling/running it from a command prompt but I'm not sure what to type for that.

Paul
Posts: 106
Joined: Tue Jun 02, 2009 6:00 am

Re: trying to run LISP code in LispIDE

Post by Paul » Fri Aug 05, 2011 5:13 pm

gib65 wrote:First of all, I know nothing about Common Lisp or any kind of Lisp. I am just begining to learn.

So I downloaded LispIDE in order to have an environment in which I can experiment. I wrote a very simple program:

(* 2 (cos 0) (+ 4 6))

which, according to this website, should print out 20.0.

Well, I'm able to save the file (as a .lisp) but I don't seem to be able to run it. I can't find a compile or run function anywhere in the IDE. I would also try compiling/running it from a command prompt but I'm not sure what to type for that.
You're supposed to just type it directly at the "command prompt" (read-eval-print loop), not put it in a file: it doesn't print anything, it just returns a value, so if you "run it" from a file it won't do anything. You can wrap (print ...) around it to make it print the value, if you want. I don't know LispIDE, so can't help you with that.

Indecipherable
Posts: 47
Joined: Fri Jun 03, 2011 5:30 am
Location: Behind you.
Contact:

Re: trying to run LISP code in LispIDE

Post by Indecipherable » Sun Aug 07, 2011 11:00 am

gib65 wrote:First of all, I know nothing about Common Lisp or any kind of Lisp. I am just begining to learn.

So I downloaded LispIDE in order to have an environment in which I can experiment. I wrote a very simple program:

(* 2 (cos 0) (+ 4 6))

which, according to this website, should print out 20.0.

Well, I'm able to save the file (as a .lisp) but I don't seem to be able to run it. I can't find a compile or run function anywhere in the IDE. I would also try compiling/running it from a command prompt but I'm not sure what to type for that.
Go to Settings => Set Lisp Path and navigate to your CL implementation. Choose the .exe file. Click open.
There's a sign at the top showing an exclamation mark. Press on that - it will now restart lisp and should load your CL implementation.
You will notice that at the top of LispIDE there's a symbol with two parentheses (). When you have written your code, scroll to the end of the code and press on the symbol. It sends everything in the selected body () to the REPL.

What implementation and OS are you using?
Don't take the FUN out of DEFUN !

gib65
Posts: 8
Joined: Thu Jul 28, 2011 1:24 pm

Re: trying to run LISP code in LispIDE

Post by gib65 » Mon Aug 08, 2011 1:03 pm

Paul wrote:You're supposed to just type it directly at the "command prompt"
I don't know how to start Lisp from the command prompt.
Indecipherable wrote:Go to Settings => Set Lisp Path and navigate to your CL implementation. Choose the .exe file.
The only .exe files I get are LispIDE.exe and unins000.exe. If I choose LispIDE.exe it tells me "Please do not select LispIDE itself but your Lisp console executable." If I select unins000.exe it asks me if I want to uninstall LispIDE. All this is found in C:\Program Files\LispIDE. I'm not sure what a Lisp console executable is.
Indecipherable wrote:When you have written your code, scroll to the end of the code and press on the symbol.
I do that but it doesn't do anything. Is there a way of seeing the output of the REPL?
Indecipherable wrote:What implementation and OS are you using?
I'm using LispIDE v20100318.07 and Windows XP.

edgar-rft
Posts: 226
Joined: Fri Aug 06, 2010 6:34 am
Location: Germany

Re: trying to run LISP code in LispIDE

Post by edgar-rft » Mon Aug 08, 2011 2:47 pm

I have never worked with LispIDE and have no Windows here to test it but as far as I understand the text on the LispIDE website:
The LispIDE seems not to include a Lisp implementation, instead you have to install an external Lisp implementation and then tell LispIDE where to find it. This means IMO that as long as you haven't installed a Lisp impementation on your computer, LispIDE will not be able to execute any code because it's only a text editor.

I will try to test this later on a Windows machine.

P.S.: Free Common Lisp implementations known to run on Windows are:
  • SBCL - Steel Bank Common Lisp
  • CCL - Clozure Common Lisp
  • CLISP
- edgar

gib65
Posts: 8
Joined: Thu Jul 28, 2011 1:24 pm

Re: trying to run LISP code in LispIDE

Post by gib65 » Tue Aug 09, 2011 10:07 am

I guess you're right, it doesn't include an implementation. Fortunately, I had another lisp download in another folder, and after a bit of trial and error, I found an .exe in that folder that brings up an command line lisp interpreter. I actually realized I could just run this .exe without having to start the lisp IDE. I've played around with it and got it to work. So thanks for all your help (everyone).

Post Reply