read-eval-print-loop

Accessing command history in QPython console for Android

ⅰ亾dé卋堺 提交于 2019-12-01 15:33:13
问题 Is it possible to access previously entered commands in QPython's console/REPL? Up and down arrows just display escape sequences. I tried switching the Terminal type option between screen , linux , and vt100 , but this doesn't seem to help. A related question didn't specify it was referring to QPython's console, and got an answer that is not relevant. 回答1: No, it' not possible. The feature hasn't been implemented. But if you can use Python3's syntax instead of Python 2.7, you can use QPython3

Does SML (Poly) have a CL-like REPL?

一世执手 提交于 2019-12-01 07:34:47
Here's a quote from Ron Garret's "Lisping at JPL": "Debugging a program running on a $100M piece of hardware that is 100 million miles away is an interesting experience. Having a read-eval-print loop running on the spacecraft proved invaluable in finding and fixing the problem." As a beginner trying to decide where to jump in, I am leaning towards ML because a former prof raved about and I'm finding many books that integrate Lambda Calculus discussions with ML and ML looks fairly sane. (I'm eventually going to teach this.) So, does ML have a REPL where, like Lisp, you can just "add more code"

How to configure IPython to execute cell blocks the same way as a plain Python REPL does?

感情迁移 提交于 2019-12-01 06:50:44
Vanilla Python REPL: >>> 'na' 'na' >>> for i in range(4): ... f'{_+_}' ... else: ... 'batman' ... 'nana' 'nananana' 'nananananananana' 'nananananananananananananananana' 'batman' >>> IPython REPL with same interpreter: >>> 'na' 'na' >>> for i in range(4): ... f'{_+_}' ... else: ... 'batman' ... >>> _ 'na' This difference is apparently related to the mode in which IPython compiles code , and unrelated to the display hook . Is it possible to configure IPython to compile/exec cell blocks as a plain Python REPL does? I'd prefer if IPython would not interfere or modify such underlying runtime

IPython and REPL behave differently when displaying data without the print function

*爱你&永不变心* 提交于 2019-12-01 06:11:10
Note that all experiments have been performed on Python3.4.3 and IPython 5.1.0 (for python3). Consider a function that returns the identity: def my_func(): return 1 Now, this function is called from a loop inside a REPL session. for _ in range(3): my_func() On, IPython, nothing is displayed. In [96]: for _ in range(3): ...: my_func() ...: In [97]: But, on the REPL, something is: >>> for _ in range(3): ... my_func() ... 1 1 1 >>> Why is there a difference? Is it because of something IPython does? I've examined the bytecode and in either case, they're identical. So, it has nothing to do with the

PhantomJS: page.open() does not respond when running in REPL

十年热恋 提交于 2019-12-01 05:04:25
问题 I'm trying to run some phantomJS by sending it in via Standard Input, but my webpage open does not respond. Here is the javascript I'm trying to execute: require('webpage').create().open('http://google.com', function() { console.log('done'); phantom.exit(); }); Pretty straight forward, right? Put that in a file.js, and use phantomjs.exe file.js and it works, but execute it via REPL phantomjs.exe phantomjs> require('webpage').create().open('http://google.com', function() { console.log('done');

How to resolve promises when using app with REPL

北城余情 提交于 2019-12-01 04:41:09
I've got a basic Node webserver (Koa.js + a ORM). I like to start it with a REPL meaning I can use my app like a CLI-tool. All my queries return Promises but I don't know how I can resolve them in the REPL. How can I resolve them? For example the following code (fetch() queries the database and returns a promise) gives only this output Promise {_bitField: 4325376, _fulfillmentHandler0: undefined, _rejectionHandler0: undefined …} Transaction.where('reference', '1').fetch().then((res) => return res) Update: Node.js now does this by default and resolves promises Old answer: You can't resolve them

IPython and REPL behave differently when displaying data without the print function

倾然丶 夕夏残阳落幕 提交于 2019-12-01 04:12:42
问题 Note that all experiments have been performed on Python3.4.3 and IPython 5.1.0 (for python3). Consider a function that returns the identity: def my_func(): return 1 Now, this function is called from a loop inside a REPL session. for _ in range(3): my_func() On, IPython, nothing is displayed. In [96]: for _ in range(3): ...: my_func() ...: In [97]: But, on the REPL, something is: >>> for _ in range(3): ... my_func() ... 1 1 1 >>> Why is there a difference? Is it because of something IPython

Does SML (Poly) have a CL-like REPL?

梦想与她 提交于 2019-12-01 04:08:08
问题 Here's a quote from Ron Garret's "Lisping at JPL": "Debugging a program running on a $100M piece of hardware that is 100 million miles away is an interesting experience. Having a read-eval-print loop running on the spacecraft proved invaluable in finding and fixing the problem." As a beginner trying to decide where to jump in, I am leaning towards ML because a former prof raved about and I'm finding many books that integrate Lambda Calculus discussions with ML and ML looks fairly sane. (I'm

How to use members with default (package) or private access level in REPL?

主宰稳场 提交于 2019-12-01 02:52:53
问题 I was trying to add some interactivity to my test/debug cycle, so I tried playing around with my classes from the Scala REPL. This works great but has the disadvantage that I cannot access package- and private-level members, that can be tested from a unit test (if the test is in the same package). Can I "set" the package "context" of the Scala REPL? I guess I could use reflection to access the members, but that's so much typing it would defeat the purpose of using the REPL in the first place.

If a Julia script is run from the command line, does it need to be re-compiled every time?

大憨熊 提交于 2019-11-30 21:20:26
I've read through quite some documentation and questions but I'm still confused about this. In the Profiling section of the documentation it's suggested to first run the target function in the REPL once, so that it's already compiled before being profiled. However, what if the script is fairly complicated and is inteded to be run in the command line, taking arguments? When the julia process finishes and I run the script the second time, is the compilation performed again? Posts like https://stackoverflow.com/a/42040763/1460448 , Julia compiles the script every time? give conflicting answers.