anchor.diff:                            ])) |> Unrepeated          
         ]
   
  +    SubSection("Other collections")
  +    ItemsBlock
  +      [
  +        ! @"Each container ill then store its own reference to a collection, plus the current iterated element"
  +        ! @"The plumbing is quite obvious per container"
  +        ! @"We obviously cannot show them all"
  +      ]
       SubSection("The iterator in literature")
       VerticalStack
         [
           ItemsBlockWithTitle("The iterator in literature")
             [
  -            ! @"In literature it is often the case to see our Iterator as an interface containing the following signatures"
  +            ! @"In the literature we often find another formulation"
             ]
           CSharpCodeBlock(TextSize.Tiny,
  -                        (GenericInterfaceDef (["T"], "UnsafeIterator", [typedSig "MoveNext" [] "void"
  -                                                                        typedSig "HasNext" [] "bool"
  -                                                                        typedSig "GetCurrent" [] "T"])) 
  +                        (GenericInterfaceDef (["T"], "TraditionalIterator", [typedSig "MoveNext" [] "void"
  +                                                                             typedSig "HasNext" [] "bool"
  +                                                                             typedSig "GetCurrent" [] "T"])) 
                            >> endProgram) |> Unrepeated
           ItemsBlock
             [
  -            ! @"The main big difference now is that whenever we need to move throughout our collection we have to coordinate \texttt{GetCurrent}, \texttt{HasNext}, and \texttt{MoveNext}"
  -            ! @"As we can see, this adds a layer of complexity to the iteration and is error prone, since now we have to \textit{carefully} manipulate three methods (instead of one as for \texttt{Iterator<T>})"
  -            ! @"In what follows we show how to make \texttt{UnsafeIterator} safe!"
  -          ]
  -      ]
  -    SubSection("Improving the UnsafeIterator<T> safeness")
  -    VerticalStack
  -      [
  -        ItemsBlockWithTitle("Improving the UnsafeIterator<T> safeness")
  -          [
  -            ! @"Adapting our \texttt{UnsafeIterator} will require us to define an adapter \texttt{AdapterIterator} that implements our \texttt{Iterator}"
  -            ! @"The \texttt{AdapterIterator} takes as input an \texttt{UnsafeIterator} and whenever the \texttt{GetNext} method is called it calls \texttt{GetCurrent} and \texttt{MoveNext} accordingly"
  +            ! @"As we can see, this is less safe, since now we have to \textit{carefully} manipulate three methods (instead of one as for \texttt{Iterator<T>})"
  +          ]
  +      ]
  +    SubSection("Improving the TraditionalIterator<T> safeness")
  +    VerticalStack
  +      [
  +        ItemsBlockWithTitle("Improving the TraditionalIterator<T> safeness")
  +          [
  +            ! @"Adapting our \texttt{TraditionalIterator} will require us to define an adapter \texttt{MakeSafe} that implements our \texttt{Iterator} by coordinating method calls to an underlying \texttt{Iterator}\footnote{Adapter allows to automatically convert back/forth between iterators}"
             ]
           CSharpCodeBlock( TextSize.Tiny,
                           (genericClassDef ["T"]
  -                          "AdapterIterator" 
  +                          "MakeSafe" 
                             [
                               implements "Iterator<T>"
  -                            typedDecl "iterator" "UnsafeIterator<T>" |> makePrivate
  -                            typedDef "AdapterIterator" ["UnsafeIterator<T>","iterator"] "" (("this.iterator" := var"iterator") >> endProgram) |> makePublic
  -                            typedDef "GetNext" [] "IOption<int>" (Code.If(MethodCall("iterator","HasNext",[]),
  +                            typedDecl "iterator" "TraditionalIterator<T>" |> makePrivate
  +                            typedDef "MakeSafe" ["TraditionalIterator<T>","iterator"] "" (("this.iterator" := var"iterator") >> endProgram) |> makePublic
  +                            typedDef "GetNext" [] "IOption<int>" (Code.If(MethodCallInline("iterator","HasNext",[]),
                                                                              ((MethodCall("iterator" , "MoveNext", [])) >>
                                                                               (Code.New("Some<int>",[MethodCall("iterator" , "GetCurrent", [])]) |> ret)),
  -                                                                           (Code.New("None<T>",[]) |> ret)))])) |> Unrepeated
  -      ] 
  -    SubSection("Iterating an IOption<T>")
  -    VerticalStack
  -      [
  -        ItemsBlockWithTitle("Iterating an IOption<T>")
  -          [
  -            ! @"We could also make our \texttt{IOption<T>} iterable"
  -            ! @"To do so, we have to return \texttt{Some} only the first time we it and \texttt{None} for all successive iterations"
  -            ! @"Note, if we iterate a \texttt{None} entity we return \texttt{None}"
  -          ]
  -        CSharpCodeBlock( TextSize.Tiny,
  -                        (genericClassDef ["T"]
  -                          "IOptionAdapter" 
  -                          [
  -                            implements "Iterator<T>"
  -                            typedDecl "option" "IOption<T>" |> makePrivate
  -                            typedDeclAndInit "visited" "bool" (constBool(false)) |> makePrivate
  -                            typedDef "IOptionAdapter" ["IOption<T>","option"] "" (("this.option" := var"option") >> endProgram) |> makePublic
  -                            typedDef "GetNext" [] "IOption<int>" (Code.If(var ("visited"),
  -                                                                           (Code.New("None<T>",[]) |> ret),
  -                                                                           (("visited" := ConstBool(true)) >>
  -                                                                            (MethodCall("option" , "Visit<IOption<T>>", 
  -                                                                                       [(Code.GenericLambdaFuncDecl([], Code.New("None<T>", []) |> ret) )
  -                                                                                        (Code.GenericLambdaFuncDecl(["t"], Code.New("Some<T>", [var "t"]) |> ret) )]) |> ret))))])) |> Unrepeated
  -      ] 
  +                                                                            (Code.New("None<T>",[]) |> ret)))])) |> Unrepeated
  +      ]
  +    
       Section("Conclusions")
       SubSection("Conclusions")
       ItemsBlock
         [
  -        ! @"Iterating collections is a time consuming, error-prone, activity, since collections come with different implementations each with its own complexity"
  +        ! @"Iterating collections is a time consuming, error-prone activity, since collections come with different implementations each with its own complexity"
           ! @"Iterators are a mechanism that hides the complexity of a collection and provides a clean interaction surface to iterate them"
           ! @"This mechanism not only reduces the amount of code to write (achieving then the DRY principle), but also reduces the amount of coupling"
         ]
  -
  -
  -  ]
  +  ]
positive.code:     SubSection("Implementing the Iterator<T>")
      ItemsBlock
          [
            ! @"We now show a series of collections implementing such interface"
          ]
      SubSection("Natural numbers")
      VerticalStack
  
negative.code:         ItemsBlockWithTitle("Behavioral patterns")
            [
              ! @"Are design patterns for identifying the fundamental communication behavior between entities"
              ! @"Among such patterns we find:"
            ]
          ItemsBlock
            [
  