read-eval-print-loop

haskell repl in emacs

青春壹個敷衍的年華 提交于 2019-11-28 21:39:28
问题 Hi i am starting with haskell and trying to set up my emacs for its development. I have haskell-mod and ghc-mod latest in emacs 24.3.1 . GHC is 7.6.3 i have created a haskell file first.hs and when i do C-c C-l It asks : start a new project named haskell ? y or n my directory name is haskell. I press y Set the cabal directory I have tried with both ~/.cabal and my current directory named haskell Set the current directory Just pressed enter as it has haskell directory It shows error messages :

Is there a way to have node preserve command line history between sessions?

匆匆过客 提交于 2019-11-28 21:13:55
When I run node from the command line with no arguments, I enter an interactive shell. If I execute some commands, exit node, and restart node, the up arrow doesn't do anything (I'd like it scroll through my previous commands). Is there a way I can invoke node interactively such that it will remember my old commands? You could use rlwrap to store node.js REPL commands in a history file. First, install rlwrap (done easily with a package manager like apt-get or brew etc). Then add an alias for node: alias node='env NODE_NO_READLINE=1 rlwrap node' I'm on OSX so I add that alias to my ~/.bash

How to write multiple lines of code in Node REPL

孤者浪人 提交于 2019-11-28 20:51:02
问题 I would like to evaluate var foo = "foo"; console.log(foo); as a block, instead of evaluating line by line var foo = "foo"; undefined console.log(foo); foo undefined Is there a simple way to move the prompt to the next line? 回答1: Node v6.4 has an editor mode. At the repl prompt type .editor and you can input multiple lines. example $ node > .editor // Entering editor mode (^D to finish, ^C to cancel) const fn = there => `why hello ${there}`; fn('multiline'); // hit ^D 'why hello multiline' >

Is Lisp the only language with REPL?

£可爱£侵袭症+ 提交于 2019-11-28 20:20:24
问题 There are languages other than Lisp (ruby, scala) that say they use REPL (Read, Eval, Print, Loop), but it is unclear whether what is meant by REPL is the same as in Lisp. How is Lisp REPL different from non-Lisp REPL? 回答1: The idea of a REPL comes from the Lisp community. There are other forms of textual interactive interfaces, for example the command line interface . Some textual interfaces also allow a subset of some kind of programming language to be executed. REPL stands for READ EVAL

How do I access scala documentation from the repl?

混江龙づ霸主 提交于 2019-11-28 18:52:43
问题 First of all for the built in docs, and also for my own code. Specifically, I want to get information similar to how in python you can call help() on a method or object to get information on just that object printed into the repl. 回答1: Scaladocs are generated as HTML, so you don't want them appearing in the REPL window. You might want to load docs in a browser from the REPL, however. You can do that by creating your own method like so (this one takes an instance; you could have it take an

How to reload a class or package in Scala REPL?

僤鯓⒐⒋嵵緔 提交于 2019-11-28 18:34:55
问题 I almost always have a Scala REPL session or two open, which makes it very easy to give Java or Scala classes a quick test. But if I change a class and recompile it, the REPL continues with the old one loaded. Is there a way to get it to reload the class, rather than having to restart the REPL? Just to give a concrete example, suppose we have the file Test.scala: object Test { def hello = "Hello World" } We compile it and start the REPL: ~/pkg/scala-2.8.0.Beta1-prerelease$ bin/scala Welcome

Anders Hejlsberg's C# 4.0 REPL

六眼飞鱼酱① 提交于 2019-11-28 17:12:07
During the last 10 minutes of Ander's talk The Future of C# he demonstrates a really cool C# Read-Eval-Print loop which would be a tremendous help in learning the language. Several .NET4 related downloads are already available: Visual Studio 2010 and .NET Framework 4.0 CTP , Visual Studio 2010 and .NET Framework 4 Training Kit . Do you know what happened to this REPL? Is it somewhere hidden among examples? I know about mono repl. Please, no alternative solutions. The REPL demo was part of "what might happen next", i.e. after 4.0; in .NET 5.0 or something similar. This is not 4.0 functionality,

Is there a colored REPL for Clojure?

北战南征 提交于 2019-11-28 16:42:03
问题 I'd like to get a colored REPL for clojure code, similar to what you can do with IRB for Ruby. Are there any libraries or settings for user.clj that provide automatic coloring of the REPL? Example IRB: 回答1: I do not know of any way to have the basic Clojure REPL, as started by something like java -cp clojure.jar clojure.main , do syntax highlighting. If, however, you use Emacs & SLIME (the development environment of choice of a great part of the Clojure community!), then you can have the

REPL Environment for the Web [closed]

冷暖自知 提交于 2019-11-28 16:30:48
问题 I'm looking to find a REPL system that can be executed on a web page and that the server can react to. Is there anything out there (I'd assume it would have to be using Javascript/AJAX)? If there's a PHP implementation, it would be even more awesome, but for now I'm just looking for some kind of an implementation. 回答1: A JavaScript REPL: http://tech.einaregilsson.com/repl.html A PHP REPL developed at Facebook: http://www.phpsh.org/ A Python REPL: http://www.trypython.org/ A Ruby REPL: http:/

Clojure : loading dependencies at the REPL

回眸只為那壹抹淺笑 提交于 2019-11-28 16:22:11
I recently learned (thanks to technomancy) that, at the REPL --- This fails: user=> (:require [clojure.set :as set]) java.lang.ClassNotFoundException: clojure.set (NO_SOURCE_FILE:24) Whereas this succeeds : user=> (require '[clojure.set :as cs]) nil at loading the clojure.set class. Context: The former line was copied from a namespaced source file. My primary question is : What is the change we have made, by swapping the : and ' characters, which now allows for success of the latter command ? My 2nd question is , in general - what are the guidelines for doing things at the REPL --- as compared