4 ms·
Lisp Tips
- cleverjake 13y agotoo bad it hasn't been updated in a half a year :/ I would really like to find an active version of something like this
- fat0wl 13y agoheh just start it & post a link back to this one as an homage. it's a commitment though, i know
- deleted 13y ago[deleted]
- zachbeane 13y agoI ran out of tips! I've been collecting a few more to post in the future, but my bag of tricks has been mostly laid bare on the site.
- chaitanya 13y agoI submitted a tip a while back (a small reader macro trick for DO/DO*) -- don't know if you ever got it.
- likerbd14 13y agonot bad
- davexunit 13y agoSomeone should make a Scheme tips site.
- UNIXgod 13y agoI saw one in the form of a wiki awhile back. schemers cookbook maybe. The venerable (lambda-the-ultimate) and readscheme still excellent. We can always use more lisp and scheme oriented sites.
- mck- 13y agoHere's a SLIME tip I recently found out: C-c I -- this will give you an inspector that is much better than using (inspect foo)
- vinceguidry 13y agoI went through HtDP awhile back. Mind-blowing, changed the way I approached programming, yada yada. Scheme held a special place in my heart for years after. Back then I would have loved to have found a job where I could have used it. I settled for Ruby. After a year of using Ruby seriously, I started to wonder again about using Scheme, so I took a look at some of the available options. Naturally, like everyone else in this situation, I ran into the brick wall of just not having the community support Ruby has, so it's very difficult to justify using it on any project except purely personal projects, and even then, it's more about exploring a domain rather than exploring a programming paradigm, so I never did get to do anything serious in Lisp. Clojure's nice and all, but the JVM is turning into quite the bit of baggage, hard to justify using it over Ruby. That's when I took another look at Ruby and realized it did pretty much everything I needed, meta-programming-wise, why bother with continuations and macros when you can use composition and module mixins to achieve practically the same thing? (environment tracking and easy DSL creation) Sure it's not as mathematically pretty as Lisp is, but Ruby syntax is still much prettier than Lisp's. After awhile I realized that the HtDP way of solving problems and the OO/SOLID way work equally well. You'd just use one with a language like Ruby and the other with a more functional paradigm like Lisp. OO is plenty flexible if you avoid listening to the zealots. One focuses on the functions/data and the other focuses on the classes/objects. Screw that, I say focus on the domain. Make that logic as tight as you can, then introduce interfaces to it. With that model, Ruby works Just Fine.
- klibertp 13y ago> Ruby syntax is still much prettier than Lisp's No. Lisps have no syntax at all. You write your programs in AST form. It's not possible to compare this to writing Ruby or Python. For the comparison to be fair you'd have to write Python like this: Module(body=[ Expr(value=Call(func=Name(id='map', ctx=Load()), args=[Lambda(args=arguments(args=[Name(id='x', ctx=Param())], vararg=None, kwarg=None, defaults=[]), body=BinOp(left=Name(id='x', ctx=Load()), op=Pow(), right=Num(n=2))), Call(func=Name(id='range', ctx=Load()), args=[Num(n=100)], keywords=[], starargs=None, kwargs=None)], keywords=[], starargs=None, kwargs=None)) ]) And I believe that in this case something like this: (map (lambda (x) (sqr x)) (in-range 100)) Wins hands down in beauty, readability and any other "metric" :)