read-eval-print-loop

Using Node.js with JS-comint in Emacs

╄→гoц情女王★ 提交于 2020-01-09 07:14:31
问题 I use Emacs 24.2. I've installed js-comint and js-mode from MELPA, executed run-js , and now in REPL instead of > sign i have this gibberish: ^[[1G> ^[[0K^[[3G The REPL itself in Inferior Javascript mode works just fine, just the > sign is changed. If you enter unfinished expression, it even prints ^[[1G... ^[[0K^[[5G . The ^[ are system characters, that are not copied with copy-paste, i add them for you to have an idea. In my init-file: (require 'js-comint) (setq inferior-js-program-command

How do I limit the node repl's access to internal node modules?

半城伤御伤魂 提交于 2020-01-06 08:09:31
问题 In a previous question I figured out how to eliminate unwanted global variables from the repl context. However, I figured out that the repl automatically has access to ALL internal node modules without the use of require . I have no idea how to disable this. I even tried overriding the module variables in the repl itself and it doesn't work. > fs = "test"; > fs It still displays fs original value. This is very unfortunate because I'm trying to expose a public repl but it gives them access to

Keeping track of history in ghci

你说的曾经没有我的故事 提交于 2020-01-04 07:13:18
问题 How does history management work in GHCI or other Haskell-based REPLs? Since Haskell is a pure language, I guess it's implemented using a monad, perhaps the state monad. Kindly note I'm a beginner in Haskell, so please provide a detailed explanation rather than just linking to the source. 回答1: This is a simplified example of how a program might keep a history of commands entered by the user. It basically has the same structure as the number guessing game, so once you understand that you

Keeping track of history in ghci

半腔热情 提交于 2020-01-04 07:11:29
问题 How does history management work in GHCI or other Haskell-based REPLs? Since Haskell is a pure language, I guess it's implemented using a monad, perhaps the state monad. Kindly note I'm a beginner in Haskell, so please provide a detailed explanation rather than just linking to the source. 回答1: This is a simplified example of how a program might keep a history of commands entered by the user. It basically has the same structure as the number guessing game, so once you understand that you

Ways to start Clojure REPL?

女生的网名这么多〃 提交于 2020-01-04 06:29:17
问题 Name the ways you know to start the Clojure REPL. What is your favourite ? Does it highlight things for you ? I know of : 1. NetBeans IDE with the Enclojure plugin, and 2. the Leiningen shell script : lein repl No favorite for me so far, and I'd certainly like some colors. What else ? 回答1: Syntax-highlighted Clojure REPL is entirely possible in Emacs -- I wrote the necessary code in response to a very old question here on SO: Is there a colored REPL for Clojure? I have since tweaked it to

How do I start a CoffeeScript repl from within a CoffeeScript script?

隐身守侯 提交于 2020-01-02 05:21:10
问题 If I do repl = require 'repl' repl.start {useGlobal: true} It starts a Node repl. How do I start a CoffeeScript repl instead? Thanks 回答1: Nesh is a project to try and make this a bit easier and extensible: http://danielgtaylor.github.com/nesh/ It provides a way to embed a REPL with support for multiple languages like CoffeeScript as well as providing an asyncronous plugin architecture, support to execute code in the context of the REPL on startup, etc. For example: nesh = require 'nesh' nesh

How can I start an interactive console for VBS?

五迷三道 提交于 2020-01-01 11:49:10
问题 Very similar to this question: How can I start an interactive console for Perl? I just want to be able to start entering VBS statements, one at a time, and have them evaluated straight away, like Python's IDLE. 回答1: I wrote this a couple years ago. It's based on this blog post (archived here), but with a couple enhancements. Essentially it's a REPL (Read, Execute, Print, Loop) using the Execute statement: Do While True WScript.StdOut.Write(">>> ") line = Trim(WScript.StdIn.ReadLine) If LCase

How can I use a javascript library on the server side of a NodeJS app when it was designed to run on the client?

你离开我真会死。 提交于 2020-01-01 09:36:06
问题 I'm diving into NodeJS and Express (it's sooo complicated to me) to build a real-time web app. At the moment, I'm trying to understand how I can use an existing javascript library on the server side. The problem is the library appears to be designed to run on the client side and, as a result, the instructions only show you how to use it on the client side. The library I'm talking about can be found here... https://github.com/replit/jsrepl Questions: Since a NodeJS web app is built on

Why can I not paste the output of Pythons REPL without manual-editing?

北慕城南 提交于 2020-01-01 05:46:29
问题 A huge amount of example Python code shows the output of the Python REPL, for example: >>> class eg(object): ... def __init__(self, name): ... self.name = name ... def hi(self): ... print "Hi %s" % (self.name) ... >>> greeter = eg("Bob") >>> greeter.hi() Hi Bob >>> Now, the obvious thing you want to do is run the above code.. so, I run "python" and paste the above text in.. >>> >>> class eg(object): File "<stdin>", line 1 >>> class eg(object): ^ SyntaxError: invalid syntax >>> ... def __init_

`Error creating target Swift AST context: (null)` in REPL

坚强是说给别人听的谎言 提交于 2020-01-01 04:33:05
问题 I've seen several (well, not that many, but a few) questions here on SO dealing with this error, but none of the proposed solutions worked for me. This is what I get $ swift Welcome to Apple Swift version 2.1.1 (swiftlang-700.1.101.15 clang-700.1.81). Type :help for assistance. warning: Swift error in module repl_swift: Error creating module Swift AST context: couldn't get a ClangImporter Debug info from this module will be unavailable in the debugger. warning: Swift error in module dyld: