 }
 
 
+/// Swift code for auto-prefixed arguments
+public func codeFor(argument a: GIR.Argument) -> String {
+    let prefixedname = a.prefixedArgumentName
+    let type = a.argumentType
+    let code = "\(prefixedname): \(type)"
+    return code
+}
+
+
 /// Swift code for methods
-public func argumentCode(_ arg: GIR.Argument) -> String {
-    let prefixedname = arg.prefixedArgumentName
-    let type = arg.argumentType
-    let code = "\(prefixedname): \(type)"
+public func codeFor(argument a: GIR.Argument, prefix: String) -> String {
+    let name = a.argumentName
+    let type = a.argumentType
+    let code = "\(prefix) \(name): \(type)"
     return code
 }
 

            let instance = $0.instance || $0.isInstanceOf(record)
            if instance { hadInstance = true }
            return !instance
        } .map(argumentCode).joined(separator: ", ")

        let deprecated = method.deprecated != nil ? "@available(*, deprecated) " : ""
        let code = swiftCode(method, indentation + "\(deprecated)public func \(name.swift)(" +

            let fname = override ? (method.cname.afterFirst() ?? (record.name + name.capitalised)) : name
            let deprecated = method.deprecated != nil ? "@available(*, deprecated) " : ""
            let consPrefix = constructorPrefix(method)
            let prefix = consPrefix == firstArgName?.swift ? nil : consPrefix
            let fact = factory ? "static func \(fname.swift)(" : "\(conv)init("
            let code = swiftCode(method, indentation + "\(deprecated)public \(fact)" +
                constructorParam(method, prefix) + ")\(returnDeclaration(method)) {\n" +
                    doubleIndent + call(method) +
                    indentation  + ret(method)  +
                "}\n", indentation: indentation)
