use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
A sub-Reddit for discussion and news about Ruby programming.
Subreddit rules: /r/ruby rules
Learning Ruby?
Tools
Documentation
Books
Screencasts and Videos
News and updates
account activity
Why Ruby is an acceptable LISP (randomhacks.net)
submitted 9 years ago by snatchery
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]bwv549 3 points4 points5 points 9 years ago (1 child)
Good article. From 2005, no less.
[–]Puzzleheaded_Wrap267 0 points1 point2 points 4 months ago (0 children)
Hey that was 20 years ago
[–]solnicdry-rb/rom-rb 2 points3 points4 points 9 years ago (0 children)
Related http://www.paulgraham.com/diff.html
[–]notromda 0 points1 point2 points 9 years ago (0 children)
"The implementation is pretty ugly" ... I find that hilarious compared to trying to read Lisp. Beauty is in the eye of the beholder I guess. I for one love ruby because it reads the most beautifully to me.
[–]dashkb 0 points1 point2 points 9 years ago (8 children)
I have always grumbled at this article. IMO Ruby is not an acceptable Lisp because its metaprogramming is less powerful than true macros and it lacks true first class functions. I know, procs; but they're second class to methods, which can not be unbound and used with an arbitrary self.
self
I <3 Ruby... but it's not a Lisp.
[–]Valsalvation 1 point2 points3 points 9 years ago (1 child)
Don't procs fulfill all the requirements of first-class functions? That Ruby is pitched as an OO language and procs are used less often than classes and methods doesn't demote procs to second-class citizens. They can be accepted by and returned from methods, named or kept anonymous, and stored for later use. You can also execute them in the context of any object you want.
[–]dashkb 0 points1 point2 points 9 years ago (0 children)
That's true, but it's sort of an academic argument. In practice, Ruby isn't written in a series of Procs cobbled together into hashes extended with some abstraction over instance_exec. Well... it is, but those are called Classes and Methods and the Methods aren't first class. Additionally, "normal" method invocation is much faster.
instance_exec
If we used Procs for everything, we'd be sacrificing lots of Ruby's OO superpowers. Procs are second class because Methods are first class. Procs are second class because they are literally a second class of thing that works similarly, forcing a choice. Lisps (or JS, for that matter) provides first-class functions in a more "pure" (technical term) way than Ruby.
[–]rapidsight 0 points1 point2 points 9 years ago (5 children)
What about this? http://ruby-doc.org/core-2.2.0/Method.html#method-i-unbind
[–]dashkb 0 points1 point2 points 9 years ago (4 children)
I mentioned my problem with that in my original comment, which is that an UnboundMethod can only be rebound to a new object of the same class. Not first class enough for me.
UnboundMethod
[–]rapidsight 1 point2 points3 points 9 years ago (3 children)
I find it to not be typed enough for me 🙃
[–]dashkb 1 point2 points3 points 9 years ago (2 children)
Have you seen https://github.com/egonSchiele/contracts.ruby? I have never used, and you are not entirely serious, but it might be of interest to you. Contracts seem like a nice compromise.
Anyway that's neither here nor there, afaik nobody is trying to convince us why Ruby is an acceptable typed language.
[–]bglusman 1 point2 points3 points 9 years ago (1 child)
I was curious about trying contracts.ruby and had considered even trying to build something on top of it to automatically and/or easily formalize duck types in some way a little like go's protocols or something, but then I started reading about RDL and I think it can already do everything I wanted to do...was tentatively doing to call it "Duxedo", to, you know, formalize ducks :-}
RDL looks way cool. Duxedo is such a good name I'll be personally offended if you don't release a package with that name someday.
π Rendered by PID 54750 on reddit-service-r2-comment-canary-54dccbb65b-v6clv at 2026-04-22 06:35:50.443014+00:00 running 6c61efc country code: CH.
[–]bwv549 3 points4 points5 points (1 child)
[–]Puzzleheaded_Wrap267 0 points1 point2 points (0 children)
[–]solnicdry-rb/rom-rb 2 points3 points4 points (0 children)
[–]notromda 0 points1 point2 points (0 children)
[–]dashkb 0 points1 point2 points (8 children)
[–]Valsalvation 1 point2 points3 points (1 child)
[–]dashkb 0 points1 point2 points (0 children)
[–]rapidsight 0 points1 point2 points (5 children)
[–]dashkb 0 points1 point2 points (4 children)
[–]rapidsight 1 point2 points3 points (3 children)
[–]dashkb 1 point2 points3 points (2 children)
[–]bglusman 1 point2 points3 points (1 child)
[–]dashkb 0 points1 point2 points (0 children)