replete-repl / replete-ios

ClojureScript REPL iOS app
Eclipse Public License 1.0
395 stars 25 forks source link

Save to disk / gist #122

Open lilactown opened 5 years ago

lilactown commented 5 years ago

Playing around with replete on my new iPad Pro, I'm very pleased! Glad to know I haven't completely lost the ability to write a quick snippet of code.

I think that adding support for saving a REPL session to disk / gist, along with https://github.com/mfikes/replete/issues/110, could allow Replete to be an interesting code notebook for small automation tasks (e.g. grabbing data from an API and doing some munging).

kwccoin commented 5 years ago

More basic is just let one copy all dialogue so we can experiment and edit later those useful part elsewhere and cut it back to replete ...

The current copy only one line at a time. Hard to use as notebook

*** yours after that

*** more advance

With iTunes export and import or if not allowed something like pythonista ... not sure too much to ask for but have a way

kwccoin commented 5 years ago

Finally get to a stage where you can use iTune sync doc and even self generation code to have code file stored, loaded and possibly amened. Not exactly pythonista but usable:

;; must use do to have more than 1 command 
(do
  (spit \"testdo-split1.clj\" \"(do (def x 333) (def y 444) (def z (str x))\") 
  (eval (reader/read-string (slurp \"testdo-split1.clj\"))) 
  (println x y z)
) 

This is a fuller example:

    (do ;; 
    ;; need to use quote not single quote for using require
    (require (quote [cljs.reader :as reader]) (quote [replete.core :refer [slurp spit]]) (quote [replete.io :as io])) 
    (spit "testdo-split1.clj" "(do (def x 333) (def y 444) (def z (str x)))") 
    (eval (reader/read-string (slurp "testdo-split1.clj"))) 
    (println x y z)

) ; x y z is in the env