title: How to do lazy evaluation of Ruby arguments
body: <p>I have a code to do a check of nil in ruby. So what I want to achieve is this:
  for example, if I call <code>get_score_value(nil,(nil-1))</code>. I want ruby to delay the evaluation of <code>nil-1</code> till it reaches the <code>get_score_value</code> function, instead of evaluate it before it got passed in the function. In another word, I want to pass a mathematical expression as an argument into a method. 
  What is the most elegant way to do this in ruby? Thanks very much <br></p>
  
  <pre><code>def get_score_value(value,value2)
      value.nil? ? "NULL" : value2.round(2)
  end
  </code></pre>
  
  <p><b>UPDATE:</b></p>
  
  <p>I just realized this question is actually related to the topic of lazy and strict evaluation. ( the following is from this great site:
  <a href="http://www.khelll.com/blog/ruby/ruby-and-functional-programming/" rel="nofollow noreferrer">http://www.khelll.com/blog/ruby/ruby-and-functional-programming/</a></p>
  
  <blockquote>
    <p>Strict versus lazy evaluation</p>
    
    <blockquote>
      <p>Strict evaluation always fully evaluates function arguments before invoking the function. Lazy evaluation does not evaluate function arguments unless their values are required to be evaluated. One use of Lazy evaluation is the performance increases due to avoiding unnecessary calculations.</p>
      
      <p>However as the following example shows, Ruby use Strict evaluation strategy:</p>
      
      <p>print length([2+1, 3*2, 1/0, 5-4])
      =>ZeroDivisionError: divided by 0</p>
      
      <p>The third parameter of the passed array contains a division by zero operation and as Ruby is doing strict evaluation, the above snippet of code will raise an exception.</p>
    </blockquote>
  </blockquote>