{"id":548,"date":"2009-07-07T21:21:32","date_gmt":"2009-07-08T04:21:32","guid":{"rendered":"http:\/\/xiehang.com\/blog\/?p=548"},"modified":"2009-07-07T21:23:30","modified_gmt":"2009-07-08T04:23:30","slug":"hello-world-from-clisp-on-windows","status":"publish","type":"post","link":"https:\/\/xiehang.com\/blog\/2009\/07\/07\/hello-world-from-clisp-on-windows\/","title":{"rendered":"Hello, world from CLisp on Windows"},"content":{"rendered":"

Now here are steps to build a Windows application as for “hello, world” \ud83d\ude42<\/p>\n

Create a message.lisp:<\/p>\n

(use-package \"FFI\")\r\n(def-call-out messagebox\r\n              (:name \"MessageBoxA\") (:library \"user32.dll\")\r\n              (:arguments (hwnd int) (text c-string) (capt c-string) (type uint))\r\n              (:return-type int)\r\n              (:language :stdc))\r\n\r\n(defun main()\r\n  (messagebox 0 \"Hello World!\" \"Message\" 0)\r\n  (quit))<\/pre>\n

then run:<\/p>\n

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\"<\/p><\/blockquote>\n

now we have a message.exe under the same directory, run it, you will get a standard Windows message box like this:<\/p>\n

Almost all stuffs mentioned here are coming from:<\/p>\n

http:\/\/www.frank-buss.de\/lisp\/clisp.html<\/a><\/p><\/blockquote>\n

except I added “:quiet t” to avoid CLisp’s welcome messages printed out in screen.<\/p>\n","protected":false},"excerpt":{"rendered":"

Now here are steps to build a Windows application as for “hello, world” \ud83d\ude42 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 […]<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[109,105,104,38],"_links":{"self":[{"href":"https:\/\/xiehang.com\/blog\/wp-json\/wp\/v2\/posts\/548"}],"collection":[{"href":"https:\/\/xiehang.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/xiehang.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/xiehang.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/xiehang.com\/blog\/wp-json\/wp\/v2\/comments?post=548"}],"version-history":[{"count":4,"href":"https:\/\/xiehang.com\/blog\/wp-json\/wp\/v2\/posts\/548\/revisions"}],"predecessor-version":[{"id":553,"href":"https:\/\/xiehang.com\/blog\/wp-json\/wp\/v2\/posts\/548\/revisions\/553"}],"wp:attachment":[{"href":"https:\/\/xiehang.com\/blog\/wp-json\/wp\/v2\/media?parent=548"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/xiehang.com\/blog\/wp-json\/wp\/v2\/categories?post=548"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/xiehang.com\/blog\/wp-json\/wp\/v2\/tags?post=548"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}