title: Writing a function that always returns the value "1" in R and in C++
body: <p>I wish to make a very simple function that takes no arguments and always
  returns the integer 1 in R and C++ respectively.</p>
  
  <p>R:</p>
  
  <pre><code> oneR &lt;- function() 1L 
  </code></pre>
  
  <p>But when I write 'oneR' the console returns <code>function() 1L</code> and not <code>1</code>.</p>
  
  <p>Even when I write <code>oneR(3)</code> (or some other number) I don't get <code>1</code> but an error saying that <code>Error in oneR(10) : unused argument (10)</code></p>
  
  <p>The C++ equavalent is</p>
  
  <pre><code>cppFunction('
  int oneCpp() { # C++ function
  return 1;
  }')
  </code></pre>
  
  <p>My problem is just the R function.</p>