;; Wouldn't it be cool if GameDev had a Lisp interpreter?
(defun in-soviet-russia (noun verb)
(concatenate 'string "In Soviet Russia, " noun "s " verb "YOU!"))
;; Calculate any factorial (even 43044!) AT COMPILE TIME!!
(defmacro fac (n)
(do ((i 1 (1+ i))
(x 1))
((> i n) x)
(setf x (* x i))))
;; So then you just need to do...
(proclaim '(optimize speed))
(defun my-huge-number () (fac 43044))
(compile 'my-huge-number)
Silly/fun/cool Lisp code snippets!!
Lisp is such a crazy language and it's so concise that you can do fun stuff in only a few lines. Post some Lisp!!
Ok guys, go crazy...
I'm not quite thure I underthand what you're on about thur.
It'th not nithe to make fun of people with thpeetth impedimenth!
It'th not nithe to make fun of people with thpeetth impedimenth!
Quote:Original post by benryvesI believe that joke dates back to ancient Egyptian times. [wink]
I'm not quite thure I underthand what you're on about thur.
It'th not nithe to make fun of people with speeth impedimenth!
Quote:Original post by benryves*ahem*
I'm not quite thure I underthand what you're on about thur.
It'th not nithe to make fun of people with speeth impedimenth!
thpeetth.
Quote:Original post by C-JunkieQuote:Original post by benryves*ahem*
I'm not quite thure I underthand what you're on about thur.
It'th not nithe to make fun of people with speeth impedimenth!
thpeetth.
It'th late [sad]
Possible Lisp Workflow...
- Know your domain
- Write a program using an optimal but not yet in existence mini-language that works effectively in your domain
- Use Lisp defmacros to massage your mini-language into actual Lisp statements
(defun gheyify (str) (let ((result "")) (dotimes (i (length str) result) (setf result (concatenate 'string result "<font color=\"" (if (= 0 (mod i 2)) "red" "green") "\">" (string (char str i)) "</font>")))))
that's pretty gay, don't you think?
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement