>>17
But I need a guestbook to store hate mails about how I butchered LISP and misunderstood concepts of Haskell. I also want to provide access for exectuing code directly from browser, so people I troll wont have to install SBCL beforehand or trust that my code wont mess their system.
>>33
I tried `=`, but it made code look a bit messy. That is why I decided to use `->` for maps and `//` for comments, because `--` just didnt stand on its own and `;;` is way better as a delimiter.
Name:
Anonymous2011-02-05 17:33
Though I still use `=` for sorted list construction and modification. For example:
[x=1 y=2 @xs]
adds to `xs` keys `x` and `y` with their respectively values.
Name:
Anonymous2011-02-05 17:34
>>1
Haskell: factorial = factorial'
factorial' isn't built in you say? Neither is your whoredsl.
>>50
He obviously doesn't want to post his code since he's ashamed of it for some reason, so he'll give all kinds of excuses. If he wanted to publish his code for people to see, it would be incredibly easy and wouldn't take more than a few minutes to pack it up and upload anywhere.
Name:
Anonymous2011-02-05 19:26
>>52
Pasting Lisp code to this lowly PHP site would be a disgrace.
>>57
It was just little snippet. But if you host Lisp compiler on a PHP site, that would be a little strange as it would imply that your language is so useless, that it cant host even its own distribution. Of course this dont apply to Haskell, as Haskell is an ongoing research project, not a practical language, so its site is in PHP...
$ telnet haskell.org 80
Trying 78.46.100.180...
Connected to haskell.org.
Escape character is '^]'.
GET / HTTP/1.1
Host: haskell.org
HTTP/1.1 307 Temporary Redirect
Date: Tue, 21 Dec 2010 23:38:48 GMT
Server: Apache/2.2.9 (Debian) PHP/5.2.6-1+lenny9 with Suhosin-Patch
This is even garbage collector-friendly. (define (memoize f)
(let ((c (make-weak-hash)))
(λ x
(hash-ref c x(λ () (let ((y (apply f x))) (hash-set! c x y) y))))))
(define fib
(memoize
(λ (x)
(if (< x 2) x
(+ (fib (- x 1))
(fib (- x 2)))))))
Name:
Anonymous2011-02-06 14:28
>>79
You dont need memoization to program video games.
But you do need side effects and maps to easily code stuff like
cursors =:
["human"=
["point" =[ 3 2 (loadSprite 28 32 "ui/human/cursors/point.png")]
"invalid" =[ 3 2 (loadSprite 31 32 "ui/human/cursors/invalid.png")]
"ch-green" =[15 15 (loadSprite 32 32 "ui/human/cursors/ch-green.png")]
"ch-yellow"=[15 15 (loadSprite 32 32 "ui/human/cursors/ch-yellow.png")]
"ch-red" =[15 15 (loadSprite 32 32 "ui/human/cursors/ch-red.png")]]
"orc"=
["point" =[ 3 2 (loadSprite 26 32 "ui/orc/cursors/point.png")]
"invalid" =[ 3 2 (loadSprite 28 32 "ui/orc/cursors/invalid.png")]
"ch-green" =[15 15 (loadSprite 32 32 "ui/orc/cursors/ch-green.png")]
"ch-yellow"=[15 15 (loadSprite 32 32 "ui/orc/cursors/ch-yellow.png")]
"ch-red" =[15 15 (loadSprite 32 32 "ui/orc/cursors/ch-red.png")]]
]
Imagine a giant cudder flying towards your dotted pair, and there's nothing you can do about it. And you're like "Oh man, I'm gonna have to cons this thing", and you brace yourself to cons this giant cudder. But then, at the last moment, it changes trajectory and hits you in the car. You think to yourself "Well, at least I got that out of the way", but then the giant cudder rears back and gets assigned to the car again, and again, and again. Eventually, this giant car is penetrating your dotted pair, and you begin to lose control over your memory management. That's when the giant cudder foldrs into a single value, causing your stack to overflow. Unable to move and at your most vulnerable, the giant cudder finally lodges itself in your list, where it rests uncomfortable for 4, maybe 5 hours. That's what using Lisp is like.