"----|----|----|----|----|----|----|----|----|----|----|" +
"----|----|----|----|----|----|----|----|----|----|----|" +
"----|----|----|----|----|----|----|----|----|----|----|"
+var indent = String()
let kSymbolDef = MalSymbol(symbol: "def!")
let kSymbolDo = MalSymbol(symbol: "do")
// forms and function calls.
//
func EVAL(var ast: MalVal, var env: Environment) -> MalVal {
- var x = EVAL_Counter()
+ let x = EVAL_Counter()
if EVAL_level > EVAL_leval_max {
return MalError(message: "Recursing too many levels (> \(EVAL_leval_max))")
}
- let indent = INDENT_TEMPLATE.substringToIndex(
- advance(INDENT_TEMPLATE.startIndex, EVAL_level, INDENT_TEMPLATE.endIndex))
+ if DEBUG_EVAL {
+ indent = prefix(INDENT_TEMPLATE, EVAL_level)
+ }
while true {
if is_error(ast) { return ast }
"----|----|----|----|----|----|----|----|----|----|----|" +
"----|----|----|----|----|----|----|----|----|----|----|" +
"----|----|----|----|----|----|----|----|----|----|----|"
+var indent = String()
let kSymbolArgv = MalSymbol(symbol: "*ARGV*")
let kSymbolDef = MalSymbol(symbol: "def!")
// forms and function calls.
//
func EVAL(var ast: MalVal, var env: Environment) -> MalVal {
- var x = EVAL_Counter()
+ let x = EVAL_Counter()
if EVAL_level > EVAL_leval_max {
return MalError(message: "Recursing too many levels (> \(EVAL_leval_max))")
}
- let indent = INDENT_TEMPLATE.substringToIndex(
- advance(INDENT_TEMPLATE.startIndex, EVAL_level, INDENT_TEMPLATE.endIndex))
+ if DEBUG_EVAL {
+ indent = prefix(INDENT_TEMPLATE, EVAL_level)
+ }
while true {
if is_error(ast) { return ast }
"----|----|----|----|----|----|----|----|----|----|----|" +
"----|----|----|----|----|----|----|----|----|----|----|" +
"----|----|----|----|----|----|----|----|----|----|----|"
+var indent = String()
let kSymbolArgv = MalSymbol(symbol: "*ARGV*")
let kSymbolConcat = MalSymbol(symbol: "concat")
// forms and function calls.
//
func EVAL(var ast: MalVal, var env: Environment) -> MalVal {
- var x = EVAL_Counter()
+ let x = EVAL_Counter()
if EVAL_level > EVAL_leval_max {
return MalError(message: "Recursing too many levels (> \(EVAL_leval_max))")
}
- let indent = INDENT_TEMPLATE.substringToIndex(
- advance(INDENT_TEMPLATE.startIndex, EVAL_level, INDENT_TEMPLATE.endIndex))
+ if DEBUG_EVAL {
+ indent = prefix(INDENT_TEMPLATE, EVAL_level)
+ }
while true {
if is_error(ast) { return ast }
"----|----|----|----|----|----|----|----|----|----|----|" +
"----|----|----|----|----|----|----|----|----|----|----|" +
"----|----|----|----|----|----|----|----|----|----|----|"
+var indent = String()
let kSymbolArgv = MalSymbol(symbol: "*ARGV*")
let kSymbolConcat = MalSymbol(symbol: "concat")
// forms and function calls.
//
func EVAL(var ast: MalVal, var env: Environment) -> MalVal {
- var x = EVAL_Counter()
+ let x = EVAL_Counter()
if EVAL_level > EVAL_leval_max {
return MalError(message: "Recursing too many levels (> \(EVAL_leval_max))")
}
- let indent = INDENT_TEMPLATE.substringToIndex(
- advance(INDENT_TEMPLATE.startIndex, EVAL_level, INDENT_TEMPLATE.endIndex))
+ if DEBUG_EVAL {
+ indent = prefix(INDENT_TEMPLATE, EVAL_level)
+ }
while true {
if is_error(ast) { return ast }
"----|----|----|----|----|----|----|----|----|----|----|" +
"----|----|----|----|----|----|----|----|----|----|----|" +
"----|----|----|----|----|----|----|----|----|----|----|"
+var indent = String()
let kSymbolArgv = MalSymbol(symbol: "*ARGV*")
let kSymbolCatch = MalSymbol(symbol: "catch*")
// forms and function calls.
//
func EVAL(var ast: MalVal, var env: Environment) -> MalVal {
- var x = EVAL_Counter()
+ let x = EVAL_Counter()
if EVAL_level > EVAL_leval_max {
return MalError(message: "Recursing too many levels (> \(EVAL_leval_max))")
}
- let indent = INDENT_TEMPLATE.substringToIndex(
- advance(INDENT_TEMPLATE.startIndex, EVAL_level, INDENT_TEMPLATE.endIndex))
+ if DEBUG_EVAL {
+ indent = prefix(INDENT_TEMPLATE, EVAL_level)
+ }
while true {
if is_error(ast) { return ast }
"----|----|----|----|----|----|----|----|----|----|----|" +
"----|----|----|----|----|----|----|----|----|----|----|" +
"----|----|----|----|----|----|----|----|----|----|----|"
+var indent = String()
let kSymbolArgv = MalSymbol(symbol: "*ARGV*")
let kSymbolCatch = MalSymbol(symbol: "catch*")
// forms and function calls.
//
func EVAL(var ast: MalVal, var env: Environment) -> MalVal {
- var x = EVAL_Counter()
+ let x = EVAL_Counter()
if EVAL_level > EVAL_leval_max {
return MalError(message: "Recursing too many levels (> \(EVAL_leval_max))")
}
- let indent = INDENT_TEMPLATE.substringToIndex(
- advance(INDENT_TEMPLATE.startIndex, EVAL_level, INDENT_TEMPLATE.endIndex))
+ if DEBUG_EVAL {
+ indent = prefix(INDENT_TEMPLATE, EVAL_level)
+ }
while true {
if is_error(ast) { return ast }
"----|----|----|----|----|----|----|----|----|----|----|" + // malstep(5,6,7,8,9,A)
"----|----|----|----|----|----|----|----|----|----|----|" + // malstep(5,6,7,8,9,A)
"----|----|----|----|----|----|----|----|----|----|----|" // malstep(5,6,7,8,9,A)
+var indent = String() // malstep(5,6,7,8,9,A)
// malstep(5,6,7,8,9,A)
let kSymbolArgv = MalSymbol(symbol: "*ARGV*") // malstep(6,7,8,9,A)
let kSymbolCatch = MalSymbol(symbol: "catch*") // malstep(9,A)
return ast // malstep(1)
} // malstep(1)
func EVAL(var ast: MalVal, var env: Environment) -> MalVal { // malstep(2,3,4,5,6,7,8,9,A)
- var x = EVAL_Counter() // malstep(5,6,7,8,9,A)
+ let x = EVAL_Counter() // malstep(5,6,7,8,9,A)
if EVAL_level > EVAL_leval_max { // malstep(5,6,7,8,9,A)
return MalError(message: "Recursing too many levels (> \(EVAL_leval_max))") // malstep(5,6,7,8,9,A)
} // malstep(5,6,7,8,9,A)
// malstep(5,6,7,8,9,A)
- let indent = INDENT_TEMPLATE.substringToIndex( // malstep(5,6,7,8,9,A)
- advance(INDENT_TEMPLATE.startIndex, EVAL_level, INDENT_TEMPLATE.endIndex)) // malstep(5,6,7,8,9,A)
+ if DEBUG_EVAL { // malstep(5,6,7,8,9,A)
+ indent = prefix(INDENT_TEMPLATE, EVAL_level) // malstep(5,6,7,8,9,A)
+ } // malstep(5,6,7,8,9,A)
// malstep(5,6,7,8,9,A)
while true { // malstep(5,6,7,8,9,A)
if is_error(ast) { return ast } // malstep(2,3,4,5,6,7,8,9,A)