read-eval-print-loop

Installation of cider-nrepl

血红的双手。 提交于 2019-11-29 11:09:10
问题 I've installed CIDER 0.7.0 and now when I start it inside of Emacs (via M-x cider-jack-in RET ), I get the following warning: WARNING: CIDER's version (0.7.0) does not match cider-nrepl's version (not installed) I've downloaded cider-nrepl and found out that it consists of closure code, not emacs lisp code. Since I've started exploring Clojure world just today, and there is no installation instructions on the project page, could you tell me how can I install cider-nrepl? 回答1: You need to put

In the Node.js REPL, why does this happen?

人盡茶涼 提交于 2019-11-29 10:30:34
So I was playing around with the Node.js REPL and the Underscore library when I noticed something very strange. If I require("underscore") , the variable _ is set globally (obviously). Then when I attempt to run a simple command like console.log(_.isEmpty) it prints [Function] (again, obviously). However, upon running console.log(_) right after, it prints [Function] because the variable _ was set to _.isEmpty . Why does this do this? If I run the same code from a js file this doesn't happen. Is this a normal Node thing or is this a total bug? FYI: Node v0.10.10 Node's REPL always sets _ to the

Start up script for node.js repl

倖福魔咒の 提交于 2019-11-29 06:07:37
问题 Is there a way configure node.js's repl? I want to require jquery and underscore automatically whenever the repl starts. Is there a file (noderc?) that node.js loads when it starts the repl? The equivalent in Python is to edit ~/.ipython/ipy_user_conf.py with: import_mod('sys os datetime re itertools functools') 回答1: I don't know of any such configuration file, but if you want to have modules foo and bar be available in a REPL, you can create a file myrepl.js containing: var myrepl = require(

Pretty print by default in Python REPL

爷,独闯天下 提交于 2019-11-29 05:55:58
问题 How can i enable pretty print on the REPL by default? Currently I do it by using pprint.pprint() function. >>> pprint.pprint(data) {'SHIP_CATEGORY': '', 'SHIP_QUANTITY': 1, 'SHIP_SEPARATELY': 0, 'SHIP_SUPPLEMENT': 0, 'SHIP_SUPPLEMENT_ONCE': 0, 'THUMBNAIL': ''} But I want pretty print by default >>> data {'SHIP_CATEGORY': '', 'SHIP_QUANTITY': 1, 'SHIP_SEPARATELY': 0, 'SHIP_SUPPLEMENT': 0, 'SHIP_SUPPLEMENT_ONCE': 0, 'THUMBNAIL': ''} What have I tried? I searched on google. Didn't found anything

How to see docstrings and other symbol information in Common Lisp REPL?

只愿长相守 提交于 2019-11-29 05:24:30
问题 I'm completely new to CL, and I'd like to learn how to read documentation strings and get other help information from the REPL. Something like help(symbol) in Python, or symbol? in iPython, or :t and :i in Haskell's GHCi. So, given a symbol name, I'd like to be able to know: what kind of value it is bound to, if any (a function, a variable, none at all) if it is a function or a macro, then what are its positional arguments if it has a docstring, show it what package or file it is coming from

Import multiple packages in Scala REPL

久未见 提交于 2019-11-29 03:54:00
In Scala, I frequently have to import multiple packages worth of implicits and other utilities, particularly on the REPL: import scala.collection.JavaConversions._ import scala.collection.{mutable => mut} import com.myapp.db._ import com.orm._ val con = connectDb(...) ... I understand there's no way to import multiple packages in Scala (though package object scopes can help a bit), but what about from the REPL? Is there any way to do this from the REPL without lots of copying and pasting? I also tried using :load, but things imported/created there don't get introduced into the REPL's scope

What command opens Ruby's REPL?

人走茶凉 提交于 2019-11-29 02:47:15
What command opens Ruby's REPL? In Python, you simply open python without any arguments. There are several REPLs for Ruby. The standard library ships with a REPL called IRb (for Interactive Ruby ), which installs a program named irb , but since it is just a Ruby library, it can also be invoked from Ruby code and not just from the shell. On Rubinius , IRb can also be invoked by just calling the rbx program without arguments, just like in CPython. There is also a very nice REPL called Pry , which installs a program named pry , but since it is just a Ruby library, it can also be invoked from Ruby

scala.tools.nsc.IMain within Play 2.1

醉酒当歌 提交于 2019-11-29 02:04:23
I googled a lot and am totally stuck now. I know, that there are similar questions but please read to the end. I have tried all proposed solutions and none did work. I am trying to use the IMain class from scala.tools.nsc within a Play 2.1 project (Using Scala 2.10.0). Controller Code This is the code, where I try to use the IMain in a Websocket. This is only for testing. object Scala extends Controller { def session = WebSocket.using[String] { request => val interpreter = new IMain() val (out,channel) = Concurrent.broadcast[String] val in = Iteratee.foreach[String]{ code => interpreter

How can I load optimized code in GHCI?

↘锁芯ラ 提交于 2019-11-29 01:00:03
问题 I am writing a module that relies on optimization. I want to test this module in ghci. But starting ghc in --interactive mode automatically disables optimization; if I compile the module with -O and then try to load it in an interactive session, ghc insists on loading it in interpreted mode. For a simple test case to distinguish optimized and unoptimized modules, isOptimized below evaluates to True with optimization on, but False with optimization off: isOptimized :: Bool isOptimized = g g ::

One REPL to bind them all?

丶灬走出姿态 提交于 2019-11-29 00:00:13
问题 I'd like to know if there is a REPL which is not language-specific. I spend a lot of time dipping in and out of REPLs (mainly for Clojure, Scala and Haskell), and the bundled ones all frustrate me to a greater or lesser extent. It seems like the job of a REPL is quite generic in that they: Read: take user input Evaluate: pass the input to some runtime for processing Print: print the results to the screen Loop: wait for the next user input I don't see why there shouldn't be some language