     return res
   }
   
-  /// Compile expression `expr` in environment `env`. Parameter `tail` specifies if `expr`
-  /// is located in a tail position. This allows compile to generate code with tail calls.
-  public func expand(_ expr: Expr, in env: Env) throws -> Expr {
+  /// Expand expression `expr` in environment `env`.
+  private func expand(_ expr: Expr, in env: Env) throws -> Expr? {
     switch expr {
       case .pair(.symbol(let sym), let cdr):
         let cp = self.checkpointer.checkpoint()
         switch self.lookupLocalValueOf(sym, in: env) {
           case .success:
-            return expr
+            return nil
           case .globalLookupRequired(let lexicalSym, let environment):
             if let value = self.checkpointer.fromGlobalEnv(cp) ??
                            value(of: lexicalSym, in: environment) {

                      return expanded
                  }
                default:
                  return expr
              }
            } else {
              return expr
            }
          case .macroExpansionRequired(let transformer):
            let expanded =

    if localDefine {
      loop: while i < exprs.count {
        guard case .pair(.symbol(let fun), let binding) = exprs[i],
              fun.interned == self.context.symbols.define,
              env.isImmutable(fun) else {
          break loop
        }
        // Distinguish value definitions from function definitions
