ArkScript
A small, lisp-inspired, functional scripting language
Procedure.cpp
Go to the documentation of this file.
1#include <Ark/VM/Value.hpp>
3
4#include <utility>
5
6namespace Ark
7{
8 Value Procedure::operator()(std::vector<Value>& args, VM* vm) const
9 {
10 return m_procedure(args, vm);
11 }
12
14 {
15 m_procedure = c_pointer;
16 }
17
18 bool Procedure::operator<(const Procedure&) const noexcept
19 {
20 return false;
21 }
22
23 bool Procedure::operator==(const Procedure&) const noexcept
24 {
25 return false;
26 }
27};
Wrapper object for user-defined functions.
Default value type handled by the virtual machine.
Storage class to hold custom functions.
Definition Procedure.hpp:26
bool operator==(const Procedure &other) const noexcept
Definition Procedure.cpp:23
CallbackType m_procedure
Definition Procedure.hpp:59
Value(*)(std::vector< Value > &, VM *) PointerType
Definition Procedure.hpp:28
Value operator()(std::vector< Value > &, VM *) const
Definition Procedure.cpp:8
bool operator<(const Procedure &other) const noexcept
Definition Procedure.cpp:18
Procedure(T &&cb)
Create a new procedure.
Definition Procedure.hpp:43
The ArkScript virtual machine, executing ArkScript bytecode.
Definition VM.hpp:46