title: Puzzling results for Julia typeof
body: <p>I am puzzled by the following results of <code>typeof</code> in the Julia 1.0.0 REPL:</p>
  
  <pre><code># This makes sense.   
  julia&gt; typeof(10)
  Int64
  
  # This surprised me.
  julia&gt; typeof(function)
  ERROR: syntax: unexpected ")"
  
  # No answer at all for return example and no error either.
  julia&gt; typeof(return)
  
  # In the next two examples the REPL returns the input code.    
  julia&gt; typeof(in)
  typeof(in)
  
  julia&gt; typeof(typeof)
  typeof(typeof)
  
  # The "for" word returns an error like the "function" word.
  julia&gt; typeof(for)
  ERROR: syntax: unexpected ")"
  </code></pre>
  
  <p>The Julia 1.0.0 <a href="https://docs.julialang.org/en/v1/base/base/#Core.typeof" rel="noreferrer">documentation</a> says for <code>typeof</code> 
   "Get the concrete type of x."</p>
  
  <p>The <code>typeof(function)</code> example is the one that really surprised me.  I expected a <code>function</code> to be a first-class object in Julia and have a type.  I guess I need to understand types in Julia.</p>
  
  <p>Any suggestions?</p>
  
  <p><strong>Edit</strong></p>
  
  <p>Per some comment questions below, here is an example based on a small function:</p>
  
  <pre><code>julia&gt; function test() return "test"; end
  test (generic function with 1 method)
  
  julia&gt; test()
  "test"
  
  julia&gt; typeof(test)
  typeof(test)
  </code></pre>
  
  <p>Based on this example, I would have expected <code>typeof(test)</code> to return <code>generic function</code>, not <code>typeof(test)</code>.</p>