![]() |
ArkScript
A small, lisp-inspired, functional scripting language
|
#include <Dict.hpp>
Public Member Functions | |
| Dict ()=default | |
| void | set (const Value &key, const Value &value) |
| Assign a key to a value inside the dict. | |
| const Value & | get (const Value &key) |
| Try to get a value from a given key. If no value is found, return Nil. | |
| bool | contains (const Value &key) const |
| Check that a key exists. | |
| void | remove (const Value &key) |
| Remove an entry from the dict via its key. | |
| Value::List_t | keys () |
| Get a list of the dict keys. | |
| std::size_t | size () const |
| Compute the number of (key, value) pairs in the dict. | |
| std::string | toString (VM &vm) const |
| Convert the dictionary to a string for pretty printing. | |
Private Attributes | |
| ankerl::unordered_dense::map< Value, Value > | m_dict |
Friends | |
| bool | operator== (const Dict &A, const Dict &B) |
|
default |
References Ark::internal::operator==().
|
nodiscard |
| Value::List_t Ark::internal::Dict::keys | ( | ) |
| void Ark::internal::Dict::remove | ( | const Value & | key | ) |
Assign a key to a value inside the dict.
| key | |
| value |
Definition at line 9 of file Dict.cpp.
References m_dict.
Referenced by Ark::VM::unsafeRun().
|
nodiscard |
Compute the number of (key, value) pairs in the dict.
Definition at line 40 of file Dict.cpp.
References m_dict.
Referenced by Ark::VM::unsafeRun().
| std::string Ark::internal::Dict::toString | ( | VM & | vm | ) | const |
Definition at line 90 of file Dict.hpp.
Referenced by contains(), get(), keys(), remove(), set(), size(), and toString().