Tilted Forum Project Discussion Community  

Go Back   Tilted Forum Project Discussion Community > Interests > Tilted Technology


 
 
LinkBack Thread Tools
Old 01-15-2004, 07:40 PM   #1 (permalink)
kel
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))))))
Is that not the ugliest thing you have every seen? It was easier to do it this way then to use the languages weird implementation of for loops.

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..
kel is offline  
Old 01-15-2004, 07:46 PM   #2 (permalink)
Banned
 
Location: shittown, CA
stay away from Scheme while your at it.

Check out SubEthaEdit, it has a lisp syntax package.
juanvaldes is offline  
Old 01-15-2004, 07:58 PM   #3 (permalink)
Banned
 
Location: 'bout 2 feet from my iMac
there's also DRScheme for OS X... that's what i used... it's got syntax colors at least...
cheerios is offline  
Old 01-15-2004, 08:09 PM   #4 (permalink)
kel
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"
kel is offline  
Old 01-16-2004, 02:27 PM   #5 (permalink)
Insane
 
Scheme is very powerfull and a pretty cool language. Like anything just takes some time and practice. Think recursively!
pta200 is offline  
Old 01-17-2004, 12:00 AM   #6 (permalink)
Tilted
 
It looks less ugly when formatted better. Multi-line statements and smart indenting are your friends.
ChipX86 is offline  
Old 01-17-2004, 03:18 PM   #7 (permalink)
Banned
 
Location: 'bout 2 feet from my iMac
welcome, I think kel
cheerios is offline  
Old 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.
manalone is offline  
Old 01-19-2004, 08:01 PM   #9 (permalink)
Crazy
 
Location: New Jersey / Delaware
A lot of people also don't like it 'cause it's so high-level. They feel dirty when they use it. *shrug* I like having someone else pick up my garbage, personally.
__________________
When in doubt, sauerkraut.
HFrankenstein is offline  
Old 01-20-2004, 08:27 PM   #10 (permalink)
Psycho
 
JimmyTheHutt's Avatar
 
Location: Hell (Phoenix AZ)
Quote:
Originally posted by pta200
Scheme is very powerfull and a pretty cool language. Like anything just takes some time and practice. Think recursively!
My Principles of Programming Languages teacher said that every time he made us do something in Scheme/Lisp that it wasn't meant to do. Like making it OO for one thing. Without using any of the stuff that other people created to do it. WIth in heritence. God I hate that language.

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
JimmyTheHutt is offline  
Old 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.
mr_mcrafe is offline  
Old 01-21-2004, 05:06 AM   #12 (permalink)
kel
WARNING: FLAMMABLE
 
Location: Ask Acetylene
Lisp is provably no more powerful then any other language...
__________________
"It better be funny"
kel is offline  
Old 01-21-2004, 10:15 AM   #13 (permalink)
Psycho
 
JimmyTheHutt's Avatar
 
Location: Hell (Phoenix AZ)
Quote:
Originally posted by kel
Lisp is provably no more powerful then any other language...
But it does manage to be more annoying than any other language...

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
JimmyTheHutt is offline  
Old 01-21-2004, 04:31 PM   #14 (permalink)
Banned
 
Location: 'bout 2 feet from my iMac
kel: when we're talking about powerful as in "things that can be accomplished" that's true. when we're talking EASE of accomplishment, and time it takes to do things, I might argue with you.
cheerios is offline  
Old 01-21-2004, 07:24 PM   #15 (permalink)
kel
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..
kel is offline  
Old 01-21-2004, 09:01 PM   #16 (permalink)
Psycho
 
JimmyTheHutt's Avatar
 
Location: Hell (Phoenix AZ)
Quote:
Originally posted by kel
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.
So it can torture poor students.


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
JimmyTheHutt is offline  
Old 01-27-2004, 06:23 PM   #17 (permalink)
kel
WARNING: FLAMMABLE
 
Location: Ask Acetylene
Let me reiterate that I think Lisp represents everything you can do wrong with a programming language...
__________________
"It better be funny"
kel is offline  
Old 02-07-2004, 04:52 AM   #18 (permalink)
Once upon a time...
 
Quote:
Originally posted by kel
Let me reiterate that I think Lisp represents everything you can do wrong with a programming language...
really? worse than BASIC? death of a thousand young minds?
__________________
--
Man Alone
=======
Abstainer: a weak person who yields to the temptation of denying himself a pleasure.
Ambrose Bierce, The Devil's Dictionary.
manalone is offline  
Old 02-07-2004, 09:00 AM   #19 (permalink)
Psycho
 
JimmyTheHutt's Avatar
 
Location: Hell (Phoenix AZ)
Quote:
Originally posted by manalone
really? worse than BASIC? death of a thousand young minds?
At least BASIC is semi-readable.

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
JimmyTheHutt is offline  
Old 02-12-2004, 02:00 PM   #20 (permalink)
Sky Piercer
 
CSflim's Avatar
 
Location: Ireland
no dissing BASIC, you philistines!
__________________
CSflim is offline  
Old 02-16-2004, 04:40 PM   #21 (permalink)
Tilted
 
lisp builds character.
__________________
sometimes it just takes a cat
froseph is offline  
Old 04-21-2004, 05:18 PM   #22 (permalink)
kel
WARNING: FLAMMABLE
 
Location: Ask Acetylene
Man I wish I were working in scheme :-(
Partial order planning, yum yum.
__________________
"It better be funny"
kel is offline  
 

Tags
lisp


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT -8. The time now is 05:41 PM.

Tilted Forum Project

Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Search Engine Optimization by vBSEO 3.6.0 PL2
© 2002-2012 Tilted Forum Project

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360