On Sat, 31 Jan 2009, Pascal J. Bourguignon wrote:
(def gensym(base = “com_informatimago_ruby_g”)
(@@gensym_counter = (@@gensym_counter + 1))
((base + (@@gensym_counter . to_s)) . to_sym)
I still don’t get the fake Lisp thing. Why write cryptic, unidiomatic,
turgid Ruby code, when Ruby provides a clean, clear syntax? It’s not
about understanding Ruby’s precedence rules; I’m sure you know what
x += 1
means, and don’t really need to write (x = (x + 1)) in order to
understand it, and likewise that you can figure out how to write:
(base + x.to_s).to_sym
without the added clutter.
I have an obscure feeling that you’re trying to send us a message
about Lisp being more serious, and Ruby only being worthwhile when
it’s made to look superficially like Lisp. But is that really doing
justice to either language? Is the chief lesson of studying Lisp
really that you should slap parentheses on as many expressions as
possible in other languages? It doesn’t make sense to me.
David A. Black / Ruby Power and Light, LLC
Ruby/Rails consulting & training: http://www.rubypal.com
Coming in 2009: The Well-Grounded Rubyist (http://manning.com/black2)
http://www.wishsight.com => Independent, social wishlist management!