01-15-2004, 07:40 PM | #1 (permalink) |
WARNING: FLAMMABLE
Location: Ask Acetylene
|
[LISP]Lisp
WHY WHY WHY?
Why create such a sadistic and evil language? I am taking a course in AI and it is the language everything is done in. Look at this garbage! Code:
(setq lista (cons 'a (cons 'b (cons 'c (cons 'd nil))))) (setq listb (cons 'c (cons 'd (cons 'e (cons 'f nil))))) (defun is_in (x y) (if(equalp y ()) () (if(equalp x (car y)) (car y) (is_in x (c dr y))))) (defun intersection (x y) (if (equalp x ()) () (if(not(equalp (is_in(car x) y) ( )) ) (cons (car x) (intersection (cdr x) y)) (intersection (cdr x) y) ))) (defun difference (x y) (if(equalp x ()) () (if(equalp (is_in (car x) y) ()) (co ns (car x) (union (cdr x) y)) (union (cdr x) y)) ) ) (defun union (x y) (if(equalp y ()) () (if(equalp x ()) (cons (car y) (union(x ( cdr y) )) (if(equalp (car x) (is_in (car x) y)) (difference (cdr x) y ) (cons (c ar x) (difference (cdr x) y))))))) (defun subset (x y) (if(equalp x ()) '(y) (if(is_in (car x) y) (subset (cdr x) y ) () ) )) (defun reverse (x) (if(equalp x ()) () (append (reverse (cdr x)) (list (car x) ) ))) (defun remove (x y) (if(equalp y ()) () (if(equalp x (car y)) (remove x (cdr y)) (cons (car y) (remove x (cdr y)))))) (defun replaceall (x y z) (if(equalp (car z) ()) () (if (equalp x (car z)) (cons y (replaceall x y (cdr z))) (cons (car z) (replaceall x y (cdr z)))))) And I still haven't gotten union to work. Someone please explain it to me. And does anyone know of a GUI editor that will work in OS X that can balance these blasted parens? Emacs is out because it is just to annoying to use.
__________________
"It better be funny" Last edited by kel; 01-16-2004 at 04:39 PM.. |
01-15-2004, 08:09 PM | #4 (permalink) |
WARNING: FLAMMABLE
Location: Ask Acetylene
|
Woo!
Thanks, I have been doing it in VI and it hasn't been fun. One click parentheses checking ;-) Cheerios I can use Drscheme for another language theory course I am doing that is based in scheme, right now I have been using scheme48 + VI
__________________
"It better be funny" |
01-17-2004, 06:17 PM | #8 (permalink) |
Once upon a time...
|
I really like lisp. It's cleverly built, particularly if you consider its age. you may wish to find a pretty-printer for it.
The main issue in lisp is that some of the stock functions are backwards wrt to other parameretisations, which is annoying.
__________________
-- Man Alone ======= Abstainer: a weak person who yields to the temptation of denying himself a pleasure. Ambrose Bierce, The Devil's Dictionary. |
01-20-2004, 08:27 PM | #10 (permalink) | |
Psycho
Location: Hell (Phoenix AZ)
|
Quote:
Veritas en Lux! Jimmy The Hutt
__________________
Think Jabba, only with more hair and vestigal legs.... "This isn't a nightmare, its real. Nightmare's end." -ShadowDancer |
|
01-20-2004, 09:40 PM | #11 (permalink) |
Banned
Location: auckland, nz
|
Taking a quick read through it, to me it looks pretty horrible, with brackets absolutely everywhere. Then again it looks like it's pretty strict and once you're used to it it could be great. It just doesn't look like any code I've seen before.
|
01-21-2004, 10:15 AM | #13 (permalink) | |
Psycho
Location: Hell (Phoenix AZ)
|
Quote:
Veritas en Lux! Jimmy The Hutt
__________________
Think Jabba, only with more hair and vestigal legs.... "This isn't a nightmare, its real. Nightmare's end." -ShadowDancer |
|
01-21-2004, 07:24 PM | #15 (permalink) |
WARNING: FLAMMABLE
Location: Ask Acetylene
|
Lisp qualifies as more powerful in ease of use in RARE situations that don't come up in the majority of applications. Pretty much any web related or OS programming is Lisp free. Even in mathematical data processing it is frequently easier to use a C style language.
Sure, you can make a few code examples that are shorter and cleaner in Lisp, but there is a reason Lisp is relegated to academics.
__________________
"It better be funny" Last edited by kel; 01-21-2004 at 07:43 PM.. |
01-21-2004, 09:01 PM | #16 (permalink) | |
Psycho
Location: Hell (Phoenix AZ)
|
Quote:
Veritas en Lux! Jimmy The Hutt
__________________
Think Jabba, only with more hair and vestigal legs.... "This isn't a nightmare, its real. Nightmare's end." -ShadowDancer |
|
02-07-2004, 04:52 AM | #18 (permalink) | |
Once upon a time...
|
Quote:
__________________
-- Man Alone ======= Abstainer: a weak person who yields to the temptation of denying himself a pleasure. Ambrose Bierce, The Devil's Dictionary. |
|
02-07-2004, 09:00 AM | #19 (permalink) | |
Psycho
Location: Hell (Phoenix AZ)
|
Quote:
Veritas en Lux! Jimmy The Hutt
__________________
Think Jabba, only with more hair and vestigal legs.... "This isn't a nightmare, its real. Nightmare's end." -ShadowDancer |
|
Tags |
lisp |
|
|