Tilted Forum Project Discussion Community

Tilted Forum Project Discussion Community (https://thetfp.com/tfp/)
-   Tilted Technology (https://thetfp.com/tfp/tilted-technology/)
-   -   Lisp (https://thetfp.com/tfp/tilted-technology/41638-lisp.html)

kel 01-15-2004 07:40 PM

[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.

juanvaldes 01-15-2004 07:46 PM

stay away from Scheme while your at it.

Check out SubEthaEdit, it has a lisp syntax package.

cheerios 01-15-2004 07:58 PM

there's also DRScheme for OS X... that's what i used... it's got syntax colors at least...

kel 01-15-2004 08:09 PM

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

pta200 01-16-2004 02:27 PM

Scheme is very powerfull and a pretty cool language. Like anything just takes some time and practice. Think recursively!

ChipX86 01-17-2004 12:00 AM

It looks less ugly when formatted better. Multi-line statements and smart indenting are your friends.

cheerios 01-17-2004 03:18 PM

welcome, I think kel :)

manalone 01-17-2004 06:17 PM

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.

HFrankenstein 01-19-2004 08:01 PM

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.

JimmyTheHutt 01-20-2004 08:27 PM

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

mr_mcrafe 01-20-2004 09:40 PM

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.

kel 01-21-2004 05:06 AM

Lisp is provably no more powerful then any other language...

JimmyTheHutt 01-21-2004 10:15 AM

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

cheerios 01-21-2004 04:31 PM

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.

kel 01-21-2004 07:24 PM

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.

JimmyTheHutt 01-21-2004 09:01 PM

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

kel 01-27-2004 06:23 PM

Let me reiterate that I think Lisp represents everything you can do wrong with a programming language...

manalone 02-07-2004 04:52 AM

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?

JimmyTheHutt 02-07-2004 09:00 AM

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

CSflim 02-12-2004 02:00 PM

no dissing BASIC, you philistines!

froseph 02-16-2004 04:40 PM

lisp builds character.

kel 04-21-2004 05:18 PM

Man I wish I were working in scheme :-(
Partial order planning, yum yum.


All times are GMT -8. The time now is 11:18 AM.

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