Jul 072009
 

Now here are steps to build a Windows application as for “hello, world” ๐Ÿ™‚

Create a message.lisp:

(use-package "FFI")
(def-call-out messagebox
              (:name "MessageBoxA") (:library "user32.dll")
              (:arguments (hwnd int) (text c-string) (capt c-string) (type uint))
              (:return-type int)
              (:language :stdc))

(defun main()
  (messagebox 0 "Hello World!" "Message" 0)
  (quit))

then run:

clisp -M “C:\Program Files\clisp-2.47\base\lispinit.mem” -x “(load \”message.lisp\”)(ext:saveinitmem \”message\” :init-function #’main :executable t :norc t :quiet t)”helloworld

now we have a message.exe under the same directory, run it, you will get a standard Windows message box like this:

Almost all stuffs mentioned here are coming from:

http://www.frank-buss.de/lisp/clisp.html

except I added “:quiet t” to avoid CLisp’s welcome messages printed out in screen.

Jul 072009
 

Since I don’t have much to do this week and I cannot go anywhere, I decided to learn some Lisp stuffs as it does not need too much online resource, well, sort of.

Jul 032009
 

While I was trying to dig out how to play with lisp, especially how to create an executable from it, I came across this message posted to c.l.l:

http://groups.google.com/group/comp.lang.lisp/msg/a8ffbb6d53f6b3db

pretty much what I want ๐Ÿ™‚ I’ve managed to created a executable on my Windows box and it runs just fine, well, with some tweaks, and actually a follow up describe the Windows dll problem:

http://groups.google.com/group/comp.lang.lisp/msg/71544781ad46b5c3