From: Neville Burnell Date: 2005-12-15T11:57:55+09:00 Subject: Re: LISP to Ruby translation I think that's the first time I have seen an emoticon in ruby code :-) -----Original Message----- From: Neil Stevens [mailto:neil@hakubi.us] Sent: Thursday, 15 December 2005 1:48 PM To: ruby-talk ML Subject: Re: LISP to Ruby translation Douglas Livingstone wrote: > Jut a quick one, how do you translate this: > > ((if (zero? 0) + -) 3 4) > => 7 > > to Ruby? Well, these kind of questions are rarely helpful; translating an idiomatic expression out of context from one language is often useless, because in a greater context the ruby code might be doing something completely different to begin with. But, if you want a one-liner... 3.method(0.zero? ? :+ : :-).call(4) -- Neil Stevens - neil@hakubi.us 'A republic, if you can keep it.' -- Benjamin Franklin