Moved some input stream words to library.
[forth.jl.git] / src / lib_3_input.4th
diff --git a/src/lib_3_input.4th b/src/lib_3_input.4th
new file mode 100644 (file)
index 0000000..735a879
--- /dev/null
@@ -0,0 +1,12 @@
+\ Input stream definitions
+
+: SOURCE-ID
+    SOURCE-ID-VAR @ ;
+
+: QUERY-INPUT
+    SOURCE-ID ?DUP 0= IF
+        QUERY
+    ELSE
+        QUERY-FILE
+    THEN
+;