From: Neil Stevens Date: 2005-12-15T11:47:41+09:00 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