read-eval-print-loop

Is there a REPL for C programming? [closed]

假如想象 提交于 2019-11-28 15:37:58
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed last year . I am on osx. I found this http://neugierig.org/software/c-repl/ but the links on that page for code seem to be broken. 回答1: Seems like the code of c-repl can now be found at a Github repository. It seems to be a dead project, though (last commit was 3 years ago), so I'd suggest looking into alternatives as well:

How do I load a file into the python console?

怎甘沉沦 提交于 2019-11-28 15:07:48
I have some lines of python code that I'm continuously copying/pasting into the python console. Is there a load command or something I can run? e.g. load file.py John Machin For Python 2 (see other answers for Python 3) give this a try: execfile('file.py') Example usage: C:\junk>copy con execfile_example.py a = [9, 42, 888] b = len(a) ^Z 1 file(s) copied. C:\junk>\python27\python Python 2.7.1 (r271:86832, Nov 27 2010, 18:30:46) [MSC v.1500 32 bit (Intel)] on win32 Type "help", "copyright", "credits" or "license" for more information. >>> execfile('execfile_example.py') >>> a [9, 42, 888] >>> b

How to investigate objects/types/etc. from Scala REPL?

跟風遠走 提交于 2019-11-28 15:05:28
问题 I've been working with Scala for a while now and have written a 10,000+ line program with it, but I'm still confused by some of the inner workings. I came to Scala from Python after already having intimate familiarity with Java, C and Lisp, but even so it's been slow going, and a huge problem is the frustrating difficulty I've often found when trying to investigate the inner workings of objects/types/classes/etc. using the Scala REPL as compared with Python. In Python you can investigate any

Output difference between ipython and python

非 Y 不嫁゛ 提交于 2019-11-28 14:19:00
It was my understanding that python will print the repr of the output, but this is apparently not always the case. For example: In ipython: In [1]: type([]) Out[1]: list In [2]: set([3,1,2]) Out[2]: {1, 2, 3} In python: >>> type([]) <type 'list'> >>> set([3,1,2]) set([1, 2, 3]) What transformation does ipython apply on the output? Instead of repr or standard pprint module IPython uses IPython.lib.pretty.RepresentationPrinter.pretty method to print the output . Module IPython.lib.pretty provides two functions that use RepresentationPrinter.pretty behind the scenes. IPython.lib.pretty.pretty

Can rlwrap use a wrapped command's own TAB completion?

蹲街弑〆低调 提交于 2019-11-28 13:22:31
I want to use rlwrap with a custom erlang repl. It works perfectly if I run it as "rlwrap -a myrepl". The problem is that myrepl has builtin tab completion which gets trampled by rlwrap. I want to make rlwrap to release the TAB key You can't use rlwrap 's line editing/history and your repl's TAB completion at the same time. rlwrap provides line editing, history and (very simple) completion for commands that don't have it . A command that has something as fancy as TAB completion shouldn't need rlwrap to do its line editing, should it? The -a ( --always-readline ) option is a rather crude way to

Prevent Node.js repl from printing output

人走茶凉 提交于 2019-11-28 10:56:49
If the result of some javascript calculation is an array of 10,000 elements, the Node.js repl prints this out. How do I prevent it from doing so? Thanks Why don't you just append ; null; to your expression? As in new Array(10000); null; which prints null or even shorter, use ;0; Assign the result to a variable declared with var . var statements always return undefined . > new Array(10) [ , , , , , , , , , ] > var a = new Array(10) undefined Node uses inspect to format the return values. Replace inspect with a function that just returns an empty string and it won't display anything. require(

Why can't I print from background threads in Clojure Cider REPL in emacs?

醉酒当歌 提交于 2019-11-28 07:50:26
If I try to evaluate the following code in my emacs cider-repl, nil is returned, as expected, but none of the printing takes place in the repl buffer or console. How can I make this print out as intended? (dotimes [i 5] (.start (Thread. (fn [] (Thread/sleep (rand 500)) (println (format "Finished %d on %s" i (Thread/currentThread))))))) ;=> nil This works fine, however: (println (format "Finished 1 on %s" (Thread/currentThread))) ;=> Finished 1 on Thread[nREPL-worker-18,5,main] ----------- mini-buffer ----------------- nil The behavior of println is to use a dynamically bound var called *out*

Why does typing a variable (or expression) print the value to stdout?

亡梦爱人 提交于 2019-11-28 07:01:24
问题 Take this example: >>> 5+10 15 >>> a = 5 + 10 >>> a 15 How and why does Python do this without an explicit print statement? If I do the same thing in an IPython cell, only the last such value is actually printed on stdout in this way: In[1]: 5+10 1 Out[1]: 1 Why does this happen? 回答1: When Python is in "interactive" mode, it enables certain behaviors it doesn't have in non-interactive mode. For example, sys.displayhook, originally specified in PEP 217. If value is not None, this function

Assigning a value to single underscore _ in Python/IPython interpreter

不想你离开。 提交于 2019-11-28 05:10:37
I created this function in Python 2.7 with ipython : def _(v): return v later if I call _(somevalue) , I get _ = somevalue . in[3]: _(3) out[3]: 3 in[4]: print _ out[4]: 3 The function has disappeared! If I call _(4) I get: TypeError: 'int' object is not callable` Why? What's wrong with this function? The Python interpreter assigns the last expression value to _ . This behaviour is limited to the REPL interpreter only, and is intended to assist in interactive coding sessions: >>> import math >>> math.pow(3.0, 5) 243.0 >>> result = _ >>> result 243.0 The standard Python interpreter goes to some

Is there a way to view a function's source code from within the Racket REPL?

半城伤御伤魂 提交于 2019-11-28 04:34:41
问题 I'm currently trying to dive into Racket/Scheme a bit. I have an instance of the (X)REPL running next to my editor, which helps me immensely to explore the language. However, I can't seem to find an XREPL command or macro (or whatever) which would show me the source code of a function. All the needed parts seem to be there: XREPL's describe command knows the file: -> ,describe string-join ; `string-join' is a bound identifier, ; defined in racket/string.rkt ; required directly and get