             // is an Objective-C value, even when it is wrong, and ends up here.
             //
             // As a conclusion: let's apologize.
-            //
-            // TODO: document caveat with something like:
-            //
-            // If GRMustache.BoxAnyObject was called from your own code, check
-            // the type of the value you provide. If not, it is likely that an
-            // Objective-C collection like NSArray, NSDictionary, NSSet or any
-            // other Objective-C object contains a value that is not an
-            // Objective-C object. GRMustache does not support such mixing of
-            // Objective-C and Swift values.
             NSLog("Mustache.BoxAnyObject(): value `\(object)` does not conform to the ObjCMustacheBoxable protocol, and is discarded.")
             return Box()
         }

  // Renders "<firstName:Freddy, lastName:Mercury,>"
  let dictionary: [String: String] = ["firstName": "Freddy", "lastName": "Mercury"]
  let rendering = template.render(Box(["dictionary": dictionary]))!
*/
public func Box<T: MustacheBoxable>(dictionary: [String: T]?) -> MustacheBox {
    if let dictionary = dictionary {

    */
    public override var mustacheBox: ObjCMustacheBox {
        return ObjCMustacheBox(Box(self as String))
    }
}

extension NSDictionary : ObjCMustacheBoxable {
    
    /**
    Let NSDictionary feed Mustache templates.
    
    ::
    
      let template = Template(string: "{{name}} is {{age}}.")!
    
      // Renders "Arthur is 36."
      let dictionary = ["name": "Arthur", "age": 36] as NSDictionary
      template.render(Box(dictionary))!
    
    
    The genuine Mustache won't let you iterate over the key/value pairs of a
    dictionary. Yet GRMustache ships with an `each` filter that performs that
    very job:
    
    ::
    
      // Attach StandardLibrary.each to the key "each":
      let template = Template(string: "<{{# each(dictionary) }}{{@key}}:{{.}}, {{/}}>")!
      template.registerInBaseContext("each", Box(StandardLibrary.each))
    
      // Renders "<name:Arthur, age:36, >"
      let dictionary = ["name": "Arthur", "age": 36] as NSDictionary
      let rendering = template.render(Box(["dictionary": dictionary]))!

    */
    public override var mustacheBox: ObjCMustacheBox {
        return ObjCMustacheBox(MustacheBox(
            value: self,
            converter: MustacheBox.Converter(
                dictionaryValue: {
                    return reduce(GeneratorSequence(NSFastGenerator(self)), [:] as [String: MustacheBox]) { (var boxDictionary, key) in
                        if let key = key as? String {
                            let item = (self as AnyObject)[key] // Cast to AnyObject so that we can access subscript notation.
                            boxDictionary[key] = BoxAnyObject(item)
                        }
                        return boxDictionary
                    }
            }),
            keyedSubscript: { (key: String) in
                let item = (self as AnyObject)[key] // Cast to AnyObject so that we can access subscript notation.
                return BoxAnyObject(item)
        }))
    }
}

