Ammonite API
The Ammonite API consists in instances of several classes, that are created
by Ammonite or almond, and allow you to interact with the REPL. These instances
are accessible either by their name, from the REPL, like interp
,
or via implicits, like implicitly[ammonite.interp.InterpAPI]
.
The following instances are available:
interp
, which is aammonite.interp.InterpAPI
,repl
, which is aammonite.repl.ReplAPI
.
InterpAPI
InterpAPI
allows to
- load new dependencies or compiler plugins,
- add repositories for dependencies,
- add exit hooks,
- configure compiler options.
Load dependencies
???
Load compiler plugins
???
Add repositories
???
Add exit hooks
???
Configure compiler options
???
ReplAPI
ReplAPI
allows to
- access the latest thrown exception,
- access the command history,
- request the compiler instance to be re-created,
- get the current compiler instance,
- get the current imports,
- evaluate code from strings or files, and lastly
- get the class names and byte code of the code entered during the current session.
Latest thrown exception
???
Command history
???
Refresh compiler instance
???
Get compiler instance
???
Get current imports
???
Evaluate code
???
Byte code of REPL inputs
???