swift4: exit on EOF/Ctrl-D.
authorJoel Martin <github@martintribe.org>
Wed, 8 May 2019 04:53:40 +0000 (23:53 -0500)
committerJoel Martin <github@martintribe.org>
Tue, 7 May 2019 21:43:12 +0000 (16:43 -0500)
swift4/Sources/step0_repl/main.swift
swift4/Sources/step1_read_print/main.swift
swift4/Sources/step2_eval/main.swift
swift4/Sources/step3_env/main.swift
swift4/Sources/step4_if_fn_do/main.swift
swift4/Sources/step5_tco/main.swift
swift4/Sources/step6_file/main.swift
swift4/Sources/step7_quote/main.swift
swift4/Sources/step8_macros/main.swift
swift4/Sources/step9_try/main.swift
swift4/Sources/stepA_mal/main.swift

index ef79a76..f725a99 100644 (file)
@@ -21,5 +21,7 @@ while true {
     print("user> ", terminator: "")
     if let input = readLine(strippingNewline: true) {
         print(rep(input))
+    } else {
+        exit(0);
     }
 }
index 120a820..187cbae 100644 (file)
@@ -27,5 +27,7 @@ while true {
         } catch let error as MalError {
             print(error.info())
         }
+    } else {
+        exit(0);
     }
 }
index be9680a..e2f4fd2 100644 (file)
@@ -74,5 +74,7 @@ while true {
         } catch let error as MalError {
             print(error.info())
         }
+    } else {
+        exit(0);
     }
 }
index 582ce41..159cba0 100644 (file)
@@ -90,5 +90,7 @@ while true {
         } catch let error as MalError {
             print(error.info())
         }
+    } else {
+        exit(0);
     }
 }
index 6b8ac01..51dc7c0 100644 (file)
@@ -104,5 +104,7 @@ while true {
         } catch let error as MalError {
             print(error.info())
         }
+    } else {
+        exit(0);
     }
 }
index 248d025..5c29f06 100644 (file)
@@ -133,5 +133,7 @@ while true {
         } catch let error as MalError {
             print(error.info())
         }
+    } else {
+        exit(0);
     }
 }
index d67fa88..48a8ef6 100644 (file)
@@ -132,5 +132,7 @@ while true {
         } catch let error as MalError {
             print(error.info())
         }
+    } else {
+        exit(0);
     }
 }
index dc29d6f..8c1d408 100644 (file)
@@ -154,5 +154,7 @@ while true {
         } catch let error as MalError {
             print(error.info())
         }
+    } else {
+        exit(0);
     }
 }
index 7f116be..e4bc7ef 100644 (file)
@@ -185,5 +185,7 @@ while true {
         } catch let error as MalError {
             print(error.info())
         }
+    } else {
+        exit(0);
     }
 }
index 6e1610d..26624f7 100644 (file)
@@ -203,5 +203,7 @@ while true {
         } catch let error as MalError {
             print((pr_str(error.info(), print_readably: false)))
         }
+    } else {
+        exit(0);
     }
 }
index 9b9e61f..82bc595 100644 (file)
@@ -209,5 +209,7 @@ while true {
         } catch let error as MalError {
             print((pr_str(error.info(), print_readably: false)))
         }
+    } else {
+        exit(0);
     }
 }