diff --git a/impls/swift3/Sources/step2_eval/main.swift b/impls/swift3/Sources/step2_eval/main.swift index bf67b3fd02..421eacef1f 100644 --- a/impls/swift3/Sources/step2_eval/main.swift +++ b/impls/swift3/Sources/step2_eval/main.swift @@ -6,7 +6,7 @@ func READ(_ str: String) throws -> MalVal { } // eval -func eval_ast(_ ast: MalVal, _ env: Dictionary) throws -> MalVal { +func EVAL(_ ast: MalVal, _ env: Dictionary) throws -> MalVal { /* print("EVAL: " + PRINT(ast)) */ switch ast { case MalVal.MalSymbol(let sym): @@ -25,7 +25,7 @@ func eval_ast(_ ast: MalVal, _ env: Dictionary) throws -> MalVal let raw_args = lst[1.. MalVal { } // eval -func eval_ast(_ ast: MalVal, _ env: Env) throws -> MalVal { +func EVAL(_ ast: MalVal, _ env: Env) throws -> MalVal { switch try! env.find(MalVal.MalSymbol("DEBUG-EVAL")) { case MalVal.MalFalse, MalVal.MalNil: default: @@ -45,7 +45,7 @@ func eval_ast(_ ast: MalVal, _ env: Env) throws -> MalVal { default: let raw_args = lst[1.. MalVal { } // eval -func eval_ast(_ ast: MalVal, _ env: Env) throws -> MalVal { +func EVAL(_ ast: MalVal, _ env: Env) throws -> MalVal { switch try! env.find(MalVal.MalSymbol("DEBUG-EVAL")) { case MalVal.MalFalse, MalVal.MalNil: default: @@ -67,7 +67,7 @@ func eval_ast(_ ast: MalVal, _ env: Env) throws -> MalVal { default: let raw_args = lst[1.. MalVal { default: let raw_args = lst[1.. MalVal { default: let raw_args = lst[1.. MalVal { default: let raw_args = lst[1.. MalVal { switch try EVAL(lst[0], env) { case MalVal.MalFunc(let fn, _, _, _, let macro, _): ast = try fn(args) // TCO - case MalVal.MalFunc(let fn, nil, _, _, _, _): + case MalVal.MalFunc(let fn, nil, _, _, _, _): let args = raw_args.map { try EVAL($0, env) } return try fn(args) case MalVal.MalFunc(_, let a, let e, let p, _, _): diff --git a/impls/swift3/Sources/step9_try/main.swift b/impls/swift3/Sources/step9_try/main.swift index 4553602919..0502011e40 100644 --- a/impls/swift3/Sources/step9_try/main.swift +++ b/impls/swift3/Sources/step9_try/main.swift @@ -162,7 +162,7 @@ func EVAL(_ orig_ast: MalVal, _ orig_env: Env) throws -> MalVal { switch try EVAL(lst[0], env) { case MalVal.MalFunc(let fn, _, _, _, let macro, _): ast = try fn(args) // TCO - case MalVal.MalFunc(let fn, nil, _, _, _, _): + case MalVal.MalFunc(let fn, nil, _, _, _, _): let args = raw_args.map { try EVAL($0, env) } return try fn(args) case MalVal.MalFunc(_, let a, let e, let p, _, _): diff --git a/impls/swift3/Sources/stepA_mal/main.swift b/impls/swift3/Sources/stepA_mal/main.swift index 76f13bafa0..d920751d0b 100644 --- a/impls/swift3/Sources/stepA_mal/main.swift +++ b/impls/swift3/Sources/stepA_mal/main.swift @@ -162,7 +162,7 @@ func EVAL(_ orig_ast: MalVal, _ orig_env: Env) throws -> MalVal { switch try EVAL(lst[0], env) { case MalVal.MalFunc(let fn, _, _, _, let macro, _): ast = try fn(args) // TCO - case MalVal.MalFunc(let fn, nil, _, _, _, _): + case MalVal.MalFunc(let fn, nil, _, _, _, _): let args = raw_args.map { try EVAL($0, env) } return try fn(args) case MalVal.MalFunc(_, let a, let e, let p, _, _): diff --git a/impls/swift4/Sources/step2_eval/main.swift b/impls/swift4/Sources/step2_eval/main.swift index 19aa260360..08b61a54bf 100644 --- a/impls/swift4/Sources/step2_eval/main.swift +++ b/impls/swift4/Sources/step2_eval/main.swift @@ -33,7 +33,6 @@ func EVAL(_ ast: MalData, env: [String: MalData]) throws -> MalData { default: return ast } - } } func PRINT(_ input: MalData) -> String { diff --git a/impls/swift4/Sources/step3_env/main.swift b/impls/swift4/Sources/step3_env/main.swift index 852e575811..fd01e32912 100644 --- a/impls/swift4/Sources/step3_env/main.swift +++ b/impls/swift4/Sources/step3_env/main.swift @@ -57,7 +57,6 @@ func EVAL(_ ast: MalData, env: Env) throws -> MalData { default: return ast } - } } func PRINT(_ input: MalData) -> String { diff --git a/impls/swift4/Sources/step4_if_fn_do/main.swift b/impls/swift4/Sources/step4_if_fn_do/main.swift index 4e364c7997..53f68b803e 100644 --- a/impls/swift4/Sources/step4_if_fn_do/main.swift +++ b/impls/swift4/Sources/step4_if_fn_do/main.swift @@ -72,7 +72,6 @@ func EVAL(_ ast: MalData, env: Env) throws -> MalData { default: return ast } - } } func PRINT(_ input: MalData) -> String {