Skip to content

Commit

Permalink
first bunch of CI fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
asarhaddon committed Oct 10, 2024
1 parent f9f0006 commit 4de2c13
Show file tree
Hide file tree
Showing 10 changed files with 46 additions and 46 deletions.
2 changes: 1 addition & 1 deletion impls/io/step2_eval.io
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ eval_ast := method(ast, env,

EVAL := method(ast, env,

# "EVAL: " .. PRINT(ast)) println
// "EVAL: " .. PRINT(ast) println

(ast type) switch(
"MalSymbol", return(env at(ast val) ifNil(Exception raise("'" .. (ast val) "' not found"))),
Expand Down
8 changes: 4 additions & 4 deletions impls/scala/step2_eval.scala
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import types.{MalList, _list_Q, MalVector, MalHashMap, MalFunction}
import types.{MalList, _list_Q, MalVector, MalHashMap, Func}

object step2_eval {
// read
Expand All @@ -7,7 +7,7 @@ object step2_eval {
}

// eval
def eval_ast(ast: Any, env: Map[Symbol,Any]): Any = {
def EVAL(ast: Any, env: Map[Symbol,Any]): Any = {

// println("EVAL: " + printer._pr_str(ast,true))

Expand All @@ -32,10 +32,10 @@ object step2_eval {
// function call
EVAL(first, env) match {
case fn: Func => {
el = rest.map(EVAL(_, env))
val el = rest.map(EVAL(_, env))
return fn(el)
}
case _ => {
case f => {
throw new Exception("attempt to call non-function: " + f)
}
}
Expand Down
12 changes: 6 additions & 6 deletions impls/scala/step3_env.scala
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import types.{MalList, _list_Q, MalVector, MalHashMap, MalFunction}
import types.{MalList, _list_Q, MalVector, MalHashMap, Func}
import env.Env

object step3_env {
Expand All @@ -8,10 +8,10 @@ object step3_env {
}

// eval
def eval_ast(ast: Any, env: Env): Any = {
def EVAL(ast: Any, env: Env): Any = {

if (env.find(Symbol("DEBUG-EVAL"))) {
dbgeval = env.get(Symbol("DEBUG-EVAL"))
if (env.find(Symbol("DEBUG-EVAL")) != null) {
val dbgeval = env.get(Symbol("DEBUG-EVAL"))
if (dbgeval != null && dbgeval != false) {
println("EVAL: " + printer._pr_str(ast,true))
}
Expand Down Expand Up @@ -48,10 +48,10 @@ object step3_env {
// function call
EVAL(first, env) match {
case fn: Func => {
el = rest.map(EVAL(_, env))
val el = rest.map(EVAL(_, env))
return fn(el)
}
case _ => {
case f => {
throw new Exception("attempt to call non-function: " + f)
}
}
Expand Down
10 changes: 5 additions & 5 deletions impls/scala/step4_if_fn_do.scala
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ object step4_if_fn_do {
}

// eval
def eval_ast(ast: Any, env: Env): Any = {
def EVAL(ast: Any, env: Env): Any = {

if (env.find(Symbol("DEBUG-EVAL"))) {
dbgeval = env.get(Symbol("DEBUG-EVAL"))
if (env.find(Symbol("DEBUG-EVAL")) != null) {
val dbgeval = env.get(Symbol("DEBUG-EVAL"))
if (dbgeval != null && dbgeval != false) {
println("EVAL: " + printer._pr_str(ast,true))
}
Expand Down Expand Up @@ -67,10 +67,10 @@ object step4_if_fn_do {
// function call
EVAL(first, env) match {
case fn: Func => {
el = rest.map(EVAL(_, env))
val el = rest.map(EVAL(_, env))
return fn(el)
}
case _ => {
case f => {
throw new Exception("attempt to call non-function: " + f)
}
}
Expand Down
10 changes: 5 additions & 5 deletions impls/scala/step5_tco.scala
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ object step5_tco {
var ast = orig_ast; var env = orig_env;
while (true) {

if (env.find(Symbol("DEBUG-EVAL"))) {
dbgeval = env.get(Symbol("DEBUG-EVAL"))
if (env.find(Symbol("DEBUG-EVAL")) != null) {
val dbgeval = env.get(Symbol("DEBUG-EVAL"))
if (dbgeval != null && dbgeval != false) {
println("EVAL: " + printer._pr_str(ast,true))
}
Expand Down Expand Up @@ -72,15 +72,15 @@ object step5_tco {
// function call
EVAL(first, env) match {
case fn: MalFunction => {
el = rest.map(EVAL(_, env))
val el = rest.map(EVAL(_, env))
env = fn.gen_env(el)
ast = fn.ast // continue loop (TCO)
}
case fn: Func => {
el = rest.map(EVAL(_, env))
val el = rest.map(EVAL(_, env))
return fn(el)
}
case _ => {
case f => {
throw new Exception("attempt to call non-function: " + f)
}
}
Expand Down
10 changes: 5 additions & 5 deletions impls/scala/step6_file.scala
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ object step6_file {
var ast = orig_ast; var env = orig_env;
while (true) {

if (env.find(Symbol("DEBUG-EVAL"))) {
dbgeval = env.get(Symbol("DEBUG-EVAL"))
if (env.find(Symbol("DEBUG-EVAL")) != null) {
val dbgeval = env.get(Symbol("DEBUG-EVAL"))
if (dbgeval != null && dbgeval != false) {
println("EVAL: " + printer._pr_str(ast,true))
}
Expand Down Expand Up @@ -72,15 +72,15 @@ object step6_file {
// function call
EVAL(first, env) match {
case fn: MalFunction => {
el = rest.map(EVAL(_, env))
val el = rest.map(EVAL(_, env))
env = fn.gen_env(el)
ast = fn.ast // continue loop (TCO)
}
case fn: Func => {
el = rest.map(EVAL(_, env))
val el = rest.map(EVAL(_, env))
return fn(el)
}
case _ => {
case f => {
throw new Exception("attempt to call non-function: " + f)
}
}
Expand Down
10 changes: 5 additions & 5 deletions impls/scala/step7_quote.scala
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,8 @@ object step7_quote {
var ast = orig_ast; var env = orig_env;
while (true) {

if (env.find(Symbol("DEBUG-EVAL"))) {
dbgeval = env.get(Symbol("DEBUG-EVAL"))
if (env.find(Symbol("DEBUG-EVAL")) != null) {
val dbgeval = env.get(Symbol("DEBUG-EVAL"))
if (dbgeval != null && dbgeval != false) {
println("EVAL: " + printer._pr_str(ast,true))
}
Expand Down Expand Up @@ -115,15 +115,15 @@ object step7_quote {
// function call
EVAL(first, env) match {
case fn: MalFunction => {
el = rest.map(EVAL(_, env))
val el = rest.map(EVAL(_, env))
env = fn.gen_env(el)
ast = fn.ast // continue loop (TCO)
}
case fn: Func => {
el = rest.map(EVAL(_, env))
val el = rest.map(EVAL(_, env))
return fn(el)
}
case _ => {
case f => {
throw new Exception("attempt to call non-function: " + f)
}
}
Expand Down
10 changes: 5 additions & 5 deletions impls/scala/step8_macros.scala
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,8 @@ object step8_macros {
var ast = orig_ast; var env = orig_env;
while (true) {

if (env.find(Symbol("DEBUG-EVAL"))) {
dbgeval = env.get(Symbol("DEBUG-EVAL"))
if (env.find(Symbol("DEBUG-EVAL")) != null) {
val dbgeval = env.get(Symbol("DEBUG-EVAL"))
if (dbgeval != null && dbgeval != false) {
println("EVAL: " + printer._pr_str(ast,true))
}
Expand Down Expand Up @@ -123,16 +123,16 @@ object step8_macros {
if (fn.ismacro) {
ast = fn(rest) // continue loop (TCO)
} else {
el = rest.map(EVAL(_, env))
val el = rest.map(EVAL(_, env))
env = fn.gen_env(el)
ast = fn.ast // continue loop (TCO)
}
}
case fn: Func => {
el = rest.map(EVAL(_, env))
val el = rest.map(EVAL(_, env))
return fn(el)
}
case _ => {
case f => {
throw new Exception("attempt to call non-function: " + f)
}
}
Expand Down
10 changes: 5 additions & 5 deletions impls/scala/step9_try.scala
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,8 @@ object step9_try {
var ast = orig_ast; var env = orig_env;
while (true) {

if (env.find(Symbol("DEBUG-EVAL"))) {
dbgeval = env.get(Symbol("DEBUG-EVAL"))
if (env.find(Symbol("DEBUG-EVAL")) != null) {
val dbgeval = env.get(Symbol("DEBUG-EVAL"))
if (dbgeval != null && dbgeval != false) {
println("EVAL: " + printer._pr_str(ast,true))
}
Expand Down Expand Up @@ -144,16 +144,16 @@ object step9_try {
if (fn.ismacro) {
ast = fn(rest) // continue loop (TCO)
} else {
el = rest.map(EVAL(_, env))
val el = rest.map(EVAL(_, env))
env = fn.gen_env(el)
ast = fn.ast // continue loop (TCO)
}
}
case fn: Func => {
el = rest.map(EVAL(_, env))
val el = rest.map(EVAL(_, env))
return fn(el)
}
case _ => {
case f => {
throw new Exception("attempt to call non-function: " + f)
}
}
Expand Down
10 changes: 5 additions & 5 deletions impls/scala/stepA_mal.scala
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,8 @@ object stepA_mal {
var ast = orig_ast; var env = orig_env;
while (true) {

if (env.find(Symbol("DEBUG-EVAL"))) {
dbgeval = env.get(Symbol("DEBUG-EVAL"))
if (env.find(Symbol("DEBUG-EVAL")) != null) {
val dbgeval = env.get(Symbol("DEBUG-EVAL"))
if (dbgeval != null && dbgeval != false) {
println("EVAL: " + printer._pr_str(ast,true))
}
Expand Down Expand Up @@ -144,16 +144,16 @@ object stepA_mal {
if (fn.ismacro) {
ast = fn(rest) // continue loop (TCO)
} else {
el = rest.map(EVAL(_, env))
val el = rest.map(EVAL(_, env))
env = fn.gen_env(el)
ast = fn.ast // continue loop (TCO)
}
}
case fn: Func => {
el = rest.map(EVAL(_, env))
val el = rest.map(EVAL(_, env))
return fn(el)
}
case _ => {
case f => {
throw new Exception("attempt to call non-function: " + f)
}
}
Expand Down

0 comments on commit 4de2c13

Please sign in to comment.