1 //******************************************************************************
3 //******************************************************************************
4 // This file is automatically generated from templates/step.swift. Rather than
5 // editing it directly, it's probably better to edit templates/step.swift and
6 // regenerate this file. Otherwise, your change might be lost if/when someone
7 // else performs that process.
8 //******************************************************************************
12 // Parse the string into an AST.
14 private func READ(str: String) -> String {
18 // Walk the AST and completely evaluate it, handling macro expansions, special
19 // forms and function calls.
21 private func EVAL(ast: String) -> String {
25 // Convert the value into a human-readable string for printing.
27 private func PRINT(exp: String) -> String {
31 // Perform the READ and EVAL steps. Useful for when you don't care about the
34 private func RE(text: String) -> String {
40 // Perform the full READ/EVAL/PRINT, returning a printable string.
42 private func REP(text: String) -> String {
47 // Perform the full REPL.
51 if let text = _readline("user> ") {