anchor.diff:              ilGen.Emit(OpCodes.Ldloc,local)
           with
           | :? KeyNotFoundException -> failwithf "Symbol %A not bound." name
  +and private genApply (funcName : string) (context : Context) (typeBuilder : TypeBuilder) (ilGen : ILGenerator) (argList: SExp list) : unit =
  +    let func = context.functions.[funcName]
  +    generateBody context typeBuilder ilGen argList
  +    ilGen.Emit(OpCodes.Call, func)
  +
  +let private prologue (ilGen : ILGenerator) =
  +    ilGen.BeginScope()
  +
  +let private epilogue context typeBuilder (ilGen : ILGenerator) =
  +    (* let argGetter = typeof<Value>.GetMethod "get_EmptyList"
  +    let isAtomGetter = typeof<SExp>.GetMethod "get_IsAtom"
  +    let atomItemGetter = typeof<SExp>.GetNestedType("Atom").GetMethod "get_Item"
  +    let isNumberGetter = typeof<Value>.GetMethod "get_IsNumber"
  +    let numberItemGetter = typeof<Value>.GetNestedType("Number").GetMethod "get_Item" *)
  +
  +    //ilGen.Emit(OpCodes.Call, argGetter)
  +    genApply "main" context typeBuilder ilGen ([Atom (Object 0)])
  +    (*
  +    // Analyze value returned from main:
  +    let sexp = ilGen.DeclareLocal(typeof<SExp>)
  +    let value = ilGen.DeclareLocal(typeof<Value>)
  +
  +    let returnZero = ilGen.DefineLabel()
  +    let ``return`` = ilGen.DefineLabel()
  +    
  +    // Get SExp:
  +    ilGen.Emit(OpCodes.Castclass, typeof<SExp>)
  +    ilGen.Emit(OpCodes.Stloc, sexp.LocalIndex)
  +
  +    // Check whether SExp is SExp.Atom:
  +    ilGen.Emit(OpCodes.Ldloc, sexp.LocalIndex)
  +    ilGen.Emit(OpCodes.Call, isAtomGetter)
  +    ilGen.Emit(OpCodes.Brfalse, returnZero)
  +
  +    // Cast SExp to SExp.Atom:
  +    ilGen.Emit(OpCodes.Ldloc, sexp.LocalIndex)
  +    ilGen.Emit(OpCodes.Castclass, typeof<SExp>.GetNestedType("Atom"))
  +    
  +    // Get Value:
  +    ilGen.Emit(OpCodes.Call, atomItemGetter)
  +    ilGen.Emit(OpCodes.Stloc, value.LocalIndex)
  +    
  +    // Check whether Value is Number:
  +    ilGen.Emit(OpCodes.Ldloc, value.LocalIndex)
  +    ilGen.Emit(OpCodes.Call, isNumberGetter)
  +    ilGen.Emit(OpCodes.Brfalse, returnZero)
  +    
  +    // Cast Value to Number:
  +    ilGen.Emit(OpCodes.Ldloc, value.LocalIndex)
  +    ilGen.Emit(OpCodes.Castclass, typeof<Value>.GetNestedType("Number"))
  +    
  +    // Get float64 value:
  +    ilGen.Emit(OpCodes.Call, numberItemGetter)
  + 
  +    // Convert to int32:
  +    ilGen.Emit(OpCodes.Conv_I4)
  +    ilGen.Emit(OpCodes.Br, ``return``)
  +    
  +    ilGen.MarkLabel returnZero
  +    ilGen.Emit(OpCodes.Ldc_I4, 0)
  +
  +    ilGen.MarkLabel ``return``
  +    *)
  +    ilGen.Emit OpCodes.Ret
  +    ilGen.EndScope()
   
   let compile (source : string) (assemblyName : string) (fileName : string) : unit =
       let assemblyName = new AssemblyName(assemblyName)
  
positive.code:     let sexp = Reader.parse source
      generate context typeBuilder ilGenerator sexp
  
      epilogue context ilGenerator
  
      typeBuilder.CreateType()
      |> ignore
  
negative.code: 
  open Context
  
  //TODO: Split this to generate_if, generate_let, generate_etc
  let rec private generate (context : Context) (typeBuilder : TypeBuilder) (ilGen : ILGenerator) (form : SExp) =
      match form with
  