read-eval-print-loop

pass results to another command in redis

。_饼干妹妹 提交于 2019-12-05 16:03:59
Is there a way to pass the return value of one function to another in Redis? Of course, if you're using a language wrapper (like Ruby), it's easy — but what about from the CLI? e.g. something like this, bash style redis 127.0.0.1:6379> keys student* | mget or something like this redis 127.0.0.1:6379> mget(keys student*) keys student* will return a list of keys, but I've no idea how to fetch all the values for those keys. Thoughts? From the CLI, you just have to let the shell do its job. ./redis-cli --raw keys 'student:*' | awk '{printf "get %s\n", $1}' | ./redis-cli --raw Please note you are

CSharpRepl emacs integration?

送分小仙女□ 提交于 2019-12-05 14:47:15
I happen to know mono's CSharpRepl , are there emacs csharp mode that use this to run REPL in one window, and compile/run the C# code in the other window just like python mode? You could just create a lisp function to call the CSharpRepl and assign a key to call it when you're working on C# code. For example, you could put the following in your Emacs init file (assuming the CSharpRepl executable "csharp" is in your PATH): (defun csharp-repl () "Open a new side-by-side window and start CSharpRepl in it." (interactive) (split-window-side-by-side) (other-window 1) (comint-run "csharp")) (global

How is ScalaRunTime.stringOf(x) not failing when x.toString fails?

a 夏天 提交于 2019-12-05 12:03:35
Whilst trying to figure out some joda-time DateTime (timestamp formatting) issues I opened a REPL with scala -cp joda-time-2.3.jar and forgot to add the joda-convert jar, and eventually got a java.lang.AssertionError: assertion failed: org.joda.convert.ToString ( The entire stacktrace ) I was able to simplify this to: > scala -cp joda-time-2.3.jar Welcome to Scala version 2.11.0 (Java HotSpot(TM) 64-Bit Server VM, Java 1.8.0_05). Type in expressions to have them evaluated. Type :help for more information. scala> val dt = new org.joda.time.DateTime warning: Class org.joda.convert.FromString not

Run one Clojure test (not all tests in a namespace), with fixtures, from the REPL

ぃ、小莉子 提交于 2019-12-05 11:57:27
问题 How do I run one test (not a whole namespace) from the Clojure REPL? I've tried calling the function directly, e.g. (the-ns/the-test) but I need fixtures to run first. So I want to find a way to start the tests from clojure.test . This is close but not a match for what I want to do: https://stackoverflow.com/a/24337705/109618 I don't see any mention of how to do it from the clojure.test API. 回答1: There was a new function added in Clojure 1.6 to support this. clojure.test/test-vars will run

lein REPL server launch timed out

孤街醉人 提交于 2019-12-05 10:14:49
问题 in a liberator based clojure project we are using datomic as DB. After migrating our local dev DB to a S3 hosted one and adding the needed dependencies on our project.clj we cannot launch the REPL but the Liberator stack runs fine through lein run My guess is that the DB connection is messing things up, so, the question is, how can I somehow "debug" or figure out what's the reason of this lein repl timeout? My project.clj (defproject myproject "0.1.0-SNAPSHOT" :main myproject.core :jvm-opts [

How to run Python 3 in Sublime 2 REPL Mac

落爺英雄遲暮 提交于 2019-12-05 09:21:59
My question is the following, I have sublime 2 and sublime repl plugin installed all working fine, the only thing i need is to change the version of python that is running on the sublimerepl built in console. What I mean is, I have python 2.7.5 (which is pre installed with maveriks) running fine in sublime (via sublimerepl), and I have installed via the installer from python.org, python 3.3.3 , that I need to use, I want to run this version of python on the sublimerepl console but I don't know how. I know that there are alternatives to sublime but none of those are so beautiful as sublime is.

Why does REPL treat clojure.core/doc as a var?

邮差的信 提交于 2019-12-05 09:09:59
I'm trying to get documentation using the Clojure doc function, but can't get it recognized from the REPL (I'm using Emacs and SLIME). The following sequence describes what's going on (error message follows immediately after each line): gaidica.core> (doc first) ; Evaluation aborted. Unable to resolve symbol: doc in this context [Thrown class java.lang.Exception] gaidica.core> (clojure.core/doc first) ; Evaluation aborted. No such var: clojure.core/doc [Thrown class java.lang.Exception] user> (clojure.core/doc first) ; Evaluation aborted. No such var: clojure.core/doc [Thrown class java.lang

New console window when developing in the repl

混江龙づ霸主 提交于 2019-12-05 06:48:52
问题 If I'm developing, let's say, a console text editor, how could I call a new console frame from the lein repl? (or any repl) If it's called (main "file.txt") from the repl it would be 'popped' a new console window with the the file.txt content where I could edit. 来源: https://stackoverflow.com/questions/40961962/new-console-window-when-developing-in-the-repl

repl in webpage, best way to go about it?

送分小仙女□ 提交于 2019-12-05 06:39:33
问题 OK, so I am experimenting with a simple python repl in a browser. I want to put some python code in a text input, and then hit the 'send' button, then get back the result of evaluating it. I was using flask, with one route, which called the stdlib eval function, and then sends it back. I was also using zeroMQ with a simple server/client setup. I feel like I am missing something though... How is the standard way to go about doing this kind of thing? Projects like repl.it and skulpt are doing

Why and how do you use JShell?

一曲冷凌霜 提交于 2019-12-05 04:16:45
I went through a couple of tutorials for JShell and I still do not understand the most important part: why would I even use JShell? Here what Oracle says: "You can test individual statements, try out different variations of a method, and experiment with unfamiliar APIs within the JShell session". Yes, great, but for all those things I can just use an IDE. I do understand, that REPL should make code evaluation faster. However, testing a snippet of code in IDE in a dummy Hello World project with Sysout is for sure not slower? In fact, IDEs provide autocomplete, detect errors early and I can