read-eval-print-loop

Cannot run Swift REPL without it barfing a bunch of dylib warnings

杀马特。学长 韩版系。学妹 提交于 2019-12-21 03:32:34
问题 I just installed Xcode 8.2 and attempted to run the Swift REPL. I'm running into the following warnings. How do I resolve? Note that this is on a brand new MBP with Sierra. Xcode is one of a very few applications that are currently installed aside from the standard set. Welcome to Apple Swift version 3.0.2 (swiftlang-800.0.63 clang-800.0.42.1). Type :help for assistance. warning: Swift error in module repl_swift. Debug info from this module will be unavailable in the debugger. warning: Swift

How to clear the REPL in cider-mode?

跟風遠走 提交于 2019-12-20 12:39:07
问题 I am not meaning cleaning up the text output of REPL; I mean cleaning up all evaluated results in REPL. During developing, repeatedly C-c C-q and C-c M-j is low efficiency. UPDATE There may be some bad debug behaviour of mine. I am not sure how other people develop progs with CIDER, but I really need the functionality mentioned above. I guess other developers also encounter same problems as mine. For example, at the top of a clojure prog unit, I use declare to declare a function foo , which

Clojure namespace management - Is there a way to save and restore the state of clojure repl namespaces, imports etc.?

泄露秘密 提交于 2019-12-20 10:39:40
问题 Clojure has a large number functions/macros for working with namespaces and java package imports. To my (limited) understanding the set up of namespaces can be considered state in a clojure process (repl). When working iteratively at a REPL session, especially when source files are (re)-loaded, I can find it easy to get confused - often when I make a mistake or syntax error in namespace configuration. Other times I want to try out refactoring namespaces/aliases/reference filters but can't

Clojure namespace management - Is there a way to save and restore the state of clojure repl namespaces, imports etc.?

笑着哭i 提交于 2019-12-20 10:39:13
问题 Clojure has a large number functions/macros for working with namespaces and java package imports. To my (limited) understanding the set up of namespaces can be considered state in a clojure process (repl). When working iteratively at a REPL session, especially when source files are (re)-loaded, I can find it easy to get confused - often when I make a mistake or syntax error in namespace configuration. Other times I want to try out refactoring namespaces/aliases/reference filters but can't

Embedded Scala REPL Interpreter example for 2.10

喜你入骨 提交于 2019-12-20 10:29:14
问题 Please give a code example of how to create an embedded Scala REPL interpreter programmatically, that works in Scala 2.10. (I added this Q&A after spending hours combing various code scraps to get a working interpreter) 回答1: Example Repl.scala : import scala.tools.nsc.interpreter._ import scala.tools.nsc.Settings object Repl extends App { def repl = new ILoop { override def loop(): Unit = { intp.bind("e", "Double", 2.71828) super.loop() } } val settings = new Settings settings.Yreplsync.value

Print whole result in interactive Scala console

有些话、适合烂在心里 提交于 2019-12-20 10:24:08
问题 When I type something into the Scala interactive console, the console prints the result of the statement. If the result is too long, the console crops it (scroll right to see it): scala> Array.fill[Byte](5)(0) res1: Array[Byte] = Array(0, 0, 0, 0, 0) scala> Array.fill[Byte](500)(0) res2: Array[Byte] = Array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,

Attach a clojure / scala repl to a running JVM

左心房为你撑大大i 提交于 2019-12-20 09:23:53
问题 I have a java web application running under tomcat in a Sun java 6 JVM. Is there a way to attach a scala or clojure REPL to the running JVM ? Once the webapp is up and running, the context in which the calls are to be made is already setup in the running VM. Hence, this can be really helpful in invoking arbitrary java method calls for incremental, exploratory development and for debugging. 回答1: Copied over the answer from the other question as per your request: liverepl: Connect a Clojure

Temporarily disable tab completion in Scala Repl

喜欢而已 提交于 2019-12-20 02:27:50
问题 I occasionally work with code that has hard tabs instead of spaces. Is there any repl command to instruct the interpreter to process the tabs as normal whitespace at least temporarily - along the lines of :paste ? 回答1: Indeed :paste sounds like a good option but if you really want to override keybindings you can provide your own settings file like this: scala -Djline.keybindings=myfile The format of the file that I looked up from default scala jar is like this: from file scala/tools/jline

Node REPL throws SyntaxError: Unexpected identifier

佐手、 提交于 2019-12-20 01:39:41
问题 I am very newbie to node.js. In the node REPL everything was working fine. But something changed. When I try to execute a file it shows this... D:\Projects-2015\uniqueva>node />node module.js SyntaxError: Unexpected identifier at Object.exports.createScript (vm.js:44:10) at REPLServer.defaultEval (repl.js:117:23) at bound (domain.js:254:14) at REPLServer.runBound [as eval] (domain.js:267:12) at REPLServer.<anonymous> (repl.js:279:12) at REPLServer.emit (events.js:107:17) at REPLServer

Why is UInt64 max equal -1 in Swift?

百般思念 提交于 2019-12-19 20:49:14
问题 Using Swift, wether in terminal or playground, when I enter the following on a new line: UInt64.max I get a result value of -1. Is this a bug? Edit: Examples $ xcrun swift Welcome to Swift! Type :help for assistance. 1> UInt64.max / 2 $R1: UInt64 = 9223372036854775807 2> UInt64.max / 2 + 1 $R2: UInt64 = -9223372036854775808 3> UInt64.max $R3: UInt64 = -1 4> println(UInt64.max / 2) 9223372036854775807 5> println(UInt64.max / 2 + 1) 9223372036854775808 6> println(UInt64.max)