My First Hello-World Program using LispWorks

I decided to use LispWorks for my AI coursework where we will program in Common Lisp. Here are the steps I went through until now to set up my environment and write my first program, I’m putting them here as a reference for any Lisp newby and for myself.

1. Work through Noran’s 3 Tutorials (Short Tutorials a friend of mine created)

2. To understand more how it works, read this starting with the paragraph entitled “Interactive Programming”

3. Download and Install LispWorks Personal Edition

4. Download Common Lisp Starter Pack

5. Run it and choose select all and continue until it terminates

6. Open LispWorks

7. Load Start.lsp from “My Documents/Lisp Libraries”

8. Create a new file using file->New (or Ctrl-N)

Enter the following into the editor:

(defun hello-world()

(format t “hello, world!”))

And don’t forget to add a new line at the end

9. Save as .lisp

10. Right Click – Definition – Compile (F7)

Something like the following should appear:

;;; Safety = 3, Speed = 1, Space = 1, Float = 1, Interruptible = 0

;;; Compilation speed = 1, Debug = 2, Fixnum safety = 3

;;; Source level debugging is on

;;; Source file recording is on

;;; Cross referencing is on

; (TOP-LEVEL-FORM 0)

;;;*** Warning in HELLO-WORLD: FORMAT assumed special

; HELLO-WORLD

;;; Compilation finished with 1 warning, 0 errors, 0 notes.

—- Press Space to continue, or press Return to view errors and warnings —-

Now press space to return again

11. Choose Windows->Tile Vertically

12. Choose Tools-Preferences-Emulation-Editor Keys Like Microsoft Windows

13. In Listener (the first window on the left): Call the function by typing:

(hello-world)

The following should appear:

hello, world!

Nil

14. Every time you run LispWorks, you will first have to run Start.lisp and then load the file you want to work on.

15. While still in the listener, Click F1 and then press B. This will show you all the bindings to the keys.

The most important key bindings for me are:

F7 Compile

F8 Evaluate

F1 Help

F11 Go to editor

F12 Go to listener

Ctrl-Shift-S Save all files

Ctrl+Up History Previous

Ctrl+Down History Next

Ctrl+U Uppercase Region

Ctrl+L Lowercase Region

F20 Kill Region


Originally Posted By Laila Hussein to Thoughts & Tips at 11/04/2008 01:47:00 AM

Advertisements

2 Responses to “My First Hello-World Program using LispWorks”

  1. tinyurl.Com Says:

    Very great post. I just stumbled upon your weblog and
    wished to say that I have really enjoyed browsing your blog posts.

    In any case I’ll be subscribing on your rss feed and I’m
    hoping you write again very soon!

  2. hoang van luc Says:

    To write the program word hello programming lisp.toi constructor heart had to go 2 days without any mat ket ear qua.ngay now I was glad I did because nay.xin guidance on cam admin


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: