When I hear Bash/Perl/Ruby/Java/C/ML/Erlang/Smalltalk/etc I know what I'm dealing with, I know what they are good for and when to use them, but what about List? Don't get me wrong, I like Lisp, I just don't see for what I could use it.
So, what are you doing with Lisp and why exactly Lisp over any other PL?
Name:
Anonymous2007-07-26 10:33 ID:AYkKzNh1
More examples
I'm supposing you EXPERT PROGRAMMERS have used the Win32 API before.
Here's something that pisses me off. Pairs of functions that must be called as such. I.e. one that allocates, and one that deallocates.
(Sorry if there are any errors in the code, although there shouldn't be because I kick ass.)
For some of you, that may not seem too bad. But I'm guessing you've at least written on big graphical app and it starts to get messy the more objects you create, use, free and besides from being difficult to follow, it looks like shit and takes ages to code.
I mean, it certainly looks better. It's structured. You can see clearly how everything happens. But it starts to span across the screen. And I'm still sick of typing EndFoo, DeleteFoo, SelectFoo, CloseFoo, etc.
In C++, another "solution" (fucking horrible hack) is to rely on lexical scoping (see: wikipedia- RAII):
Using templates, one can do something when the objects are created, and then automatically do the EndFoo, DeleteFoo, etc. when it is destroyed.
In Lisp, using macros, one can simply have:
(begin-paint hwnd (hdc ps)
(with-new-brush (rgb 255 255 255)
(select-brush hdc
;; do painting here
)))
It's important to remember that we are using syntactic abstractions as well as semantic abstractions. In C, well, forget any of that. In C++, welcome to object and template hell. In Lisp, welcome to Satori.