6#include <fmt/ostream.h>
20 m_value = std::string();
60 m_type(
ValueType::Dict), m_value(std::make_shared<Dict_t>(std::move(value)))
69 list().emplace_back(value);
74 list().emplace_back(std::move(value));
82 return fmt::format(
"{}", number());
88 return fmt::format(
"Function@{}", pageAddr());
95 std::string out =
"[";
96 for (
auto it = constList().begin(), it_end = constList().end(); it != it_end; ++it)
99 out +=
"\"" + it->toString(vm) +
"\"";
101 out += it->toString(vm);
102 if (it + 1 != it_end)
109 return closure().toString(vm);
112 return fmt::format(
"{}", fmt::streamed(usertype()));
115 return dict().toString(vm);
130 if (reference() !=
this)
131 return reference()->toString(vm);
135 return fmt::format(
"Instruction@{}", pageAddr());
145 if (A.m_type != B.m_type)
152 return A.dict() == B.dict();
154 return A.m_value == B.m_value;
Define how dictionaries are handled.
Wrapper object for user-defined functions.
Default value type handled by the virtual machine.
Storage class to hold custom functions.
A class to be use C++ objects in ArkScript.
The ArkScript virtual machine, executing ArkScript bytecode.
Value() noexcept
Construct a new Value object.
void push_back(const Value &value)
Add an element to the list held by the value (if the value type is set to list)
std::string toString(VM &vm) const noexcept
std::vector< Value > List_t
bool operator==(const Namespace &A, const Namespace &B)