Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
asarhaddon committed Nov 8, 2024
1 parent a2f5708 commit 94f7f30
Show file tree
Hide file tree
Showing 12 changed files with 12 additions and 15 deletions.
4 changes: 2 additions & 2 deletions impls/swift3/Sources/step2_eval/main.swift
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ func READ(_ str: String) throws -> MalVal {
}

// eval
func eval_ast(_ ast: MalVal, _ env: Dictionary<String, MalVal>) throws -> MalVal {
func EVAL(_ ast: MalVal, _ env: Dictionary<String, MalVal>) throws -> MalVal {
/* print("EVAL: " + PRINT(ast)) */
switch ast {
case MalVal.MalSymbol(let sym):
Expand All @@ -25,7 +25,7 @@ func eval_ast(_ ast: MalVal, _ env: Dictionary<String, MalVal>) throws -> MalVal

let raw_args = lst[1..<lst.count]
switch try EVAL(lst[0], env) {
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)
default:
Expand Down
4 changes: 2 additions & 2 deletions impls/swift3/Sources/step3_env/main.swift
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ func READ(_ str: String) throws -> 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:
Expand Down Expand Up @@ -45,7 +45,7 @@ func eval_ast(_ ast: MalVal, _ env: Env) throws -> MalVal {
default:
let raw_args = lst[1..<lst.count]
switch try EVAL(lst[0], env) {
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)
default:
Expand Down
4 changes: 2 additions & 2 deletions impls/swift3/Sources/step4_if_fn_do/main.swift
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ func READ(_ str: String) throws -> 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:
Expand Down Expand Up @@ -67,7 +67,7 @@ func eval_ast(_ ast: MalVal, _ env: Env) throws -> MalVal {
default:
let raw_args = lst[1..<lst.count]
switch try EVAL(lst[0], env) {
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)
default:
Expand Down
2 changes: 1 addition & 1 deletion impls/swift3/Sources/step5_tco/main.swift
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ func EVAL(_ orig_ast: MalVal, _ orig_env: Env) throws -> MalVal {
default:
let raw_args = lst[1..<lst.count]
switch try EVAL(lst[0], env) {
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, _, _):
Expand Down
2 changes: 1 addition & 1 deletion impls/swift3/Sources/step6_file/main.swift
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ func EVAL(_ orig_ast: MalVal, _ orig_env: Env) throws -> MalVal {
default:
let raw_args = lst[1..<lst.count]
switch try EVAL(lst[0], env) {
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, _, _):
Expand Down
2 changes: 1 addition & 1 deletion impls/swift3/Sources/step7_quote/main.swift
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ func EVAL(_ orig_ast: MalVal, _ orig_env: Env) throws -> MalVal {
default:
let raw_args = lst[1..<lst.count]
switch try EVAL(lst[0], env) {
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, _, _):
Expand Down
2 changes: 1 addition & 1 deletion impls/swift3/Sources/step8_macros/main.swift
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,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, _, _):
Expand Down
2 changes: 1 addition & 1 deletion impls/swift3/Sources/step9_try/main.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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, _, _):
Expand Down
2 changes: 1 addition & 1 deletion impls/swift3/Sources/stepA_mal/main.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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, _, _):
Expand Down
1 change: 0 additions & 1 deletion impls/swift4/Sources/step2_eval/main.swift
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ func EVAL(_ ast: MalData, env: [String: MalData]) throws -> MalData {
default:
return ast
}
}
}

func PRINT(_ input: MalData) -> String {
Expand Down
1 change: 0 additions & 1 deletion impls/swift4/Sources/step3_env/main.swift
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@ func EVAL(_ ast: MalData, env: Env) throws -> MalData {
default:
return ast
}
}
}

func PRINT(_ input: MalData) -> String {
Expand Down
1 change: 0 additions & 1 deletion impls/swift4/Sources/step4_if_fn_do/main.swift
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,6 @@ func EVAL(_ ast: MalData, env: Env) throws -> MalData {
default:
return ast
}
}
}

func PRINT(_ input: MalData) -> String {
Expand Down

0 comments on commit 94f7f30

Please sign in to comment.