A peer-to-peer stack for code collaboration
Make 'repl' a rad command. (#614)
Julian Arni19028f50a71a
diff --git a/bin/rad-repl b/bin/rad-replnew file mode 100755index 0000000..0a440a6--- /dev/null+++ b/bin/rad-repl@@ -0,0 +1,25 @@+#!/usr/bin/env radicle+(load! (find-module-file! "prelude.rad"))+(import prelude/machine '[eval] :unqualified)++(def help+ "Default help text."+ "Radicle REPL++Type (apropos!) for a list of functions in scope.+Type (doc! '<name>) for further documentation of <name>.")++(def read-line-or-exit!+ (fn []+ (def line (get-line!))+ (if (eq? line nil)+ (exit! 0)+ (read-many-annotated "[read-line-or-exit!]" line))))++(put-str! help)+(def repl+ {:name "repl"+ ;; Parse errors are thrown here+ :getter read-line-or-exit!})++(subscribe-to! repl (fn [xs] (map print! xs)))diff --git a/rad/repl.rad b/rad/repl.raddeleted file mode 100644index b8b10f0..0000000--- a/rad/repl.rad+++ /dev/null@@ -1,22 +0,0 @@-(load! (find-module-file! "prelude.rad"))-(import prelude/machine '[eval] :unqualified)--(def help- "Default help text."- (fn []- "radicle is a LISP-like language intended for programming chains, and interacting with those chains.-- Type (doc '<name>) for further documentation of <name>."))--(def read-line-or-exit! (fn []- (def line (get-line!))- (if (eq? line nil)- (exit! 0)- (read-many-annotated "[read-line-or-exit!]" line))))--(def repl- {:name "repl"- ;; Parse errors are thrown here- :getter read-line-or-exit!})--(subscribe-to! repl (fn [xs] (map print! xs)))diff --git a/rad/repl.rad b/rad/repl.radnew file mode 120000index 0000000..79599b5--- /dev/null+++ b/rad/repl.rad@@ -0,0 +1 @@+../bin/rad-repl\ No newline at end of file