nk 1.0.0
C++ Numerical Computing Runtime
Loading...
Searching...
No Matches
nk::Environment Class Reference

Public Member Functions

 Environment (Environment *parent=nullptr, Environment *globalsEnv=nullptr)
 Environment (std::shared_ptr< Environment > owningParent, Environment *globalsEnv)
void set (const std::string &name, Value val)
Value * get (const std::string &name)
bool has (const std::string &name) const
void setLocal (const std::string &name, Value val)
Value * getLocal (const std::string &name)
Value * getLocalFast (const std::string &name)
void setLocalFast (const std::string &name, Value val)
void declareGlobal (const std::string &name)
bool isGlobal (const std::string &name) const
const std::unordered_set< std::string > & globalNames () const
Environment * globalsEnv () const
void forEachLocal (const std::function< void(const std::string &, const Value &)> &fn) const
std::shared_ptr< Environment > snapshot (std::shared_ptr< Environment > newParent, Environment *gs) const
void remove (const std::string &name)
void clearAll (bool keepImports=false)
void reset (Environment *parent, Environment *gs)
std::vector< std::string > localNames () const
void pushImport (Import imp)
const std::vector< Import > & activeImports () const
void clearImports ()
Environment * parentForImports () const

Detailed Description

Definition at line 25 of file environment.hpp.

Member Function Documentation

◆ activeImports()

const std::vector< Import > & nk::Environment::activeImports ( ) const
inline

Definition at line 81 of file environment.hpp.

◆ clearImports()

void nk::Environment::clearImports ( )
inline

Definition at line 82 of file environment.hpp.

◆ globalNames()

const std::unordered_set< std::string > & nk::Environment::globalNames ( ) const
inline

Definition at line 57 of file environment.hpp.

◆ globalsEnv()

Environment * nk::Environment::globalsEnv ( ) const
inline

Definition at line 59 of file environment.hpp.

◆ parentForImports()

Environment * nk::Environment::parentForImports ( ) const
inline

Definition at line 83 of file environment.hpp.

◆ pushImport()

void nk::Environment::pushImport ( Import imp)
inline

Definition at line 80 of file environment.hpp.


The documentation for this class was generated from the following file: