Interactive Nim Shell / REPL / Playground
Ctrl-C
no longer exits INim, now it breaks/clears the current statement (similar to ipython / bpython). Use exit
or quit()
insteadfmt"{var}"
(import strformat)import
or -s
display more of the stack tracesrc/embedded.nim
contains code copied into user's REPL session, possibly use this for special commandsnim>
, indentation symbol changed to ....
, both alignedinim>
Issues solved:
./inim -h
Usage:
main [optional-params]
inim interpreter
Options(opt-arg sep :|=|spc):
-h, --help write this help to stdout
-n=, --nim= string "nim" path to nim compiler
-s=, --srcFile= string "" nim script to run
--showHeader bool true show program info startup
--showHeader:false
is useful to use inim as a cmd line tool:
echo 'import os; echo os.findExe("dmd")' | ./inim --showHeader:false /Users/timothee/homebrew//bin/../Cellar/dmd/HEAD-81082d5/bin/dmd
--nim
is useful to allow using a custom nim binary, eg nim_temp produced by ./koch temp
>>> x
Supports any expression, returns its value instead of having a discarded error message.>>> 2.5 * 2.5
6.25 : float
>>> "hello".replace("he", "HEEEE")
HEEEEllo : string
import
your local modules (access to exported* symbols. Use inim myfile.nim
to access non-exported symbols)inim myfile.nim
(@cavariux)rdstdin
from stdlib for input: now support arrow keys to navigate on last commands (up/down) and line navigation (left/right)