title: invalid recursive type in a struct in go
body: <p>I am new to the Go programming language and I have an assignment to create and interpreter but I am running into the following problem:</p>
  
  <p>I want to define an Environment as:</p>
  
  <pre><code>type Environment struct{
      parent Environment
      symbol string
      value RCFAEValue
  }
  
  func (env Environment) lookup(lookupSymbol string) RCFAEValue{
      if lookupSymbol == env.symbol{
          return env.value
      } //if parent != nill {
          return env.parent.lookup(lookupSymbol)
  }
  </code></pre>
  
  <p>But I get the error "invalid recursive type Environment".  Based on my research I changed the parent to type *Environment. But now when I need to create a new Environment with a var of type Environment it get the error "cannot use fun_Val.ds (type Environment) as type *Environment in field value".  I am creating the Environment as follows:</p>
  
  <pre><code>Environment{fun_Val.ds,fun_Val.param,exp.arg_exp.interp(env)}
  </code></pre>
  
  <p>I am trying to keep the amount of code in this post to a limit but if you need more, or have other questions please let me know.</p>