         }
     }
 
-    func dumpArray(to string: inout Swift.String, array: [JSON]) {
+    static func dump(array: [JSON], in string: inout Swift.String) {
         let comma : UnicodeScalar = ","
         let open : UnicodeScalar = "["
         let close : UnicodeScalar = "]"
         string.append(open)
         for child in array {
-            child.dump(to: &string)
+            dump(json: child, in: &string)
             string.append(comma)
         }
         // remove last comma

        return
    }

    func dumpObject(to string: inout Swift.String, object: [Swift.String : JSON]) {
        let comma : UnicodeScalar = ","
        let open : UnicodeScalar = "{"
        let close : UnicodeScalar = "}"
        let colon : UnicodeScalar = ":"
        string.append(open)
        for (k, v) in object {
            dumpString(to: &string, jsonString: k)
            string.append(colon)
            v.dump(to: &string)
            string.append(comma)
        }
        // remove last comma

extension JSON {
    public func dump() -> Swift.String {
        var result = ""
        JSON.dump(json: self, in: &result)
        return result
    }

    static func dump(json: JSON, in string: inout Swift.String) {
        switch json {
        case .Null : string.append("null")
        case .Boolean(let b) : dump(bool: b, in: &string)
        case .Number(let n) : dump(number: n, in: &string)
        case .String(let s) : dump(string: s, in: &string)
        case .Array(let a) : dump(array: a.array, in: &string)
        case .Object(let o) : dump(object: o.dict, in: &string)
        }
    }

    static func dump(bool: Bool, in string: inout Swift.String) {
        if bool {
            string.append("true")
        }
