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 m_procedure(c_pointer)
15 {}
16
17 bool Procedure::operator<(const Procedure&) const noexcept
18 {
19 return false;
20 }
21
22 bool Procedure::operator==(const Procedure&) const noexcept
23 {
24 return false;
25 }
26};
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:22
CallbackType m_procedure
Definition Procedure.hpp:61
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:17
Procedure(T &&cb)
Create a new procedure.
Definition Procedure.hpp:44
The ArkScript virtual machine, executing ArkScript bytecode.
Definition VM.hpp:46