 
 import Foundation
 
-let SwiftyJSONErrorDomain = "SwiftyJSONErrorDomain"
 //MARK:- Base
 public enum JSON {
     

            return array.description
        case .Mapping(let dictionary):
            return dictionary.description
        default:
            return "null"
        }

    public subscript(index: Int) -> JSON {
        get {
            switch self {
            case .Sequence(let array):
                if array.count > index {
                    return array[index]
                } else {
                    return .Null(NSError(domain: ErrorDomain, code:ErrorIndexOutOfBounds , userInfo: [NSLocalizedDescriptionKey: "Array[\(index)] is out of bounds"]))
                }
            default:
                return .Null(NSError(domain: ErrorDomain, code: ErrorWrongType, userInfo: [NSLocalizedDescriptionKey: "Wrong type, it is not an array"]))
            }
        }
    }
