News for hackers. Stuff that matters.
Re:What's Special About Lisp? by adobriyan on Wednesday August 03, 2011 @07:19AM (#2840652)
> A ton of responses and no one mentions the one-word answer?

Statements like "You can easily do this is Ruby" hint that author understood exactly nothing and focused on some random uninteresting example code while missing big picture.

Does Ruby have COND?

If it doesn't, can one implement it using existing Ruby constructs?

If it does, can one implement it using existing Ruby constructs except COND?

Re:What's Special About Lisp? by lattepiu on Wednesday August 03, 2011 @08:49AM (#2840912)
I don't believe this is a good example. Ruby has case..when instead of COND, though it's a language construct, not a function; but I think COND can be trivially implemented in any language that has anonymous functions. In Ruby:

  def COND(*args)
      args.each_slice(2){ |s| return s[1].call if s[0].call }
  end

  COND(lambda{ false }, lambda{ "not this"}, lambda{ true }, lambda{ "this" })
(not a lisper, though, so I might be missing something).