What exactly is the Clojure REPL? What is the technology behind it? -


i know clojure repl does , how useful, not have information on how internals of works. program running in jvm? how internals of repl work?

the technology behind it:

  1. the tiny java entry point:

    https://github.com/clojure/clojure/blob/clojure-1.7.0/src/jvm/clojure/main.java

  2. the actual implementation of repl written in clojure:

    https://github.com/clojure/clojure/blob/clojure-1.7.0/src/clj/clojure/main.clj

the links 1.7.0 versions of files, being recent stable release of writing.

to summarize these do, clojure.main tiny java class main method serves entry point repl. (so, it's standard java program.) main method accepts arguments , hands them off function in clojure.main clojure namespace (using few simple calls methods in clojure.lang.rt class implements core details of clojure runtime @ function in question – well, strictly speaking var holds function). said function calls code reads user input, evaluates it, prints out result , loops around read more input again, until terminated c-d or other method, various complications setting var bindings , such (to allow user control on aspects of repl's operation , compiler settings).


Comments

Popular posts from this blog

ruby - Trying to change last to "x"s to 23 -

jquery - Clone last and append item to closest class -

c - Unrecognised emulation mode: elf_i386 on MinGW32 -