REPL
Para mas información ¿Qué es REPL?
REPL
Para mas información ¿Qué es REPL?
El última línea es un indicador, señalando que el REPL está listo para que se ingrese una instrucción. Si escribe una línea de código y presiona Enter, la REPL muestra el resultado:
kons-9 is that it combines the power of a software development IDE with the visual tools of 3D graphics authoring system. It does this by being implemented in Common Lisp, an object-oriented dynamic language which provides powerful facilities for exploratory development and rapid prototyping within a live interactive software environment
IDE + 3D + Lisp = Unique features:: * software development IDE with visual toold of 3d graphics authoring system * unlimited extensibility (no distinction between developers and end users)
REPL-based
Read-Eval-Print Loop and is a software programming environment that allows developers to interactively execute their code
So transcriptor aims to do less, and impose the bare minimum of cognitive load needed to convert a REPL interaction into a test. The entire API is four functions:
https://en.wikipedia.org/wiki/Read%E2%80%93eval%E2%80%93print_loop
aliases: interactive toplevel, language shell
read-eval-print loop (REPL)
Dev Environments Built for the Cloud.
Free
<Playground> ```html filename=index.html
> (square: (x: y: square x + square y) 3 7) (x: x*x)58
This can be written up in many other forms, plus the possibility of currying deserves to be pointed out:
$ nix repl
nix-repl> (sq: (x: y: sq y + sq x) 2 7) (x: x*x)
53
nix-repl> (sq: (x: y: sq y + sq x)) (x: x*x)
«lambda @ (string):1:11»
nix-repl> (sq: (x: y: sq y + sq x)) (x: x*x) 2
«lambda @ (string):1:14»
nix-repl> (sq: (x: y: sq y + sq x)) (x: x*x) 2 7
53
nix-repl> (sq: x: y: sq y + sq x) (x: x*x) 2 7
53
Re-open libraries for exploration I use in-ns to jump into library namespaces and re-define their vars. I insert bits of println statements to help understand how data flows through a library. These monkey-patches only exist in the running REPL. I usually put them inside a comment form. On a REPL restart, the library is back at its pristine state. In this example below, I re-open clj-http.headers to add tracing before the header transformation logic: [source] ;; set us up for re-opening libraries (require 'clj-http.headers) (in-ns 'clj-http.headers) (defn- header-map-request [req] (let [req-headers (:headers req)] (if req-headers (do (println "HEADERS: " req-headers) ;; <-- this is my added print (-> req (assoc :headers (into (header-map) req-headers) :use-header-maps-in-response? true))) req))) ;; Go back to to the user namespace to test the change (in-ns 'user) (require '[clj-http.client :as http]) (http/get "http://www.example.com") ;; This is printed in the REPL: ;; HEADERS: {accept-encoding gzip, deflate} An astute observer will notice this workflow is no different from the regular clojure workflow. Clojure gets out of your way and allows you to shape & experiment in the code in the REPL. You can use this technique to explore clojure.core too!
explore library code in the repl in-ns and the redefinition
Unmap namespaces during experimentation I use ns-unmap and ns-unalias to remove definitions from my namespace. These are the complementary functions of require and def. While exploring, you namespace will accrue failed experiments, especially around naming. Instead of using a giant hammer [tools.namespace], you can opt for finer-grained tools like these. Example: (require '[clojure.string :as thing]) (ns-unalias *ns* 'thing) ; *ns* refers to the current namespace
cleaning up the namespace fro repl experimentation
repl.it - Web programming environment for several languages: C, C++, Java, C#, F#, Go, Python, Ruby, Lua, Scheme, PHP, Forth, APL
https://github.com/replit<br> https://twitter.com/amasad<br> https://twitter.com/HayaOdeh