@@ -36,7 +36,7 @@
36#include <string>
36#include <string>
37#include <array>
37#include <array>
38#include <deque>
38#include <deque>
39−#include <unordered_map>
39+#include <map>
40#include <utility>
40#include <utility>
41#include <stdexcept>
41#include <stdexcept>
42#include <iso646.h> // mostly for MS Visual Studio compiler
42#include <iso646.h> // mostly for MS Visual Studio compiler
@@ -119,7 +119,6 @@ class any {
119 static constexpr as_thunk unthunk = as_thunk{};
119 static constexpr as_thunk unthunk = as_thunk{};
121 using dict_pair = std::pair<const Private::Symbol, const any>;
121 using dict_pair = std::pair<const Private::Symbol, const any>;
123 template <size_t N>
122 template <size_t N>
124 using dict = std::array<const dict_pair, N>;
123 using dict = std::array<const dict_pair, N>;
@@ -127,7 +126,14 @@ class any {
127 using data = std::array<const any, N>;
126 using data = std::array<const any, N>;
129 using array = std::deque<any WITH_ALLOCATOR(any)>;
128 using array = std::deque<any WITH_ALLOCATOR(any)>;
131+ auto operator ()(const char *, const char *) const -> bool;
133+ using record = std::map<const char *,
130− using record = std::unordered_map<std::string, any WITH_ALLOCATOR_PAIR(std::string, any)>;
136+ WITH_ALLOCATOR_PAIR(const char *, any)>;
132 using fn = auto (*)(const any&) -> any;
138 using fn = auto (*)(const any&) -> any;
133 using eff_fn = auto (*)() -> any;
139 using eff_fn = auto (*)() -> any;
@@ -332,7 +338,7 @@ class any {
332 operator const record&() const;
338 operator const record&() const;
334 auto operator[](const size_t) const -> const any&;
340 auto operator[](const size_t) const -> const any&;
335− auto at(const std::string&) const -> const any&;
341+ auto at(const char *) const -> const any&;
336 auto size() const -> size_t;
342 auto size() const -> size_t;
337 auto empty() const -> bool;
343 auto empty() const -> bool;
338 auto contains(const Private::Symbol) const -> bool;
344 auto contains(const Private::Symbol) const -> bool;
@@ -411,6 +417,16 @@ namespace Private {
411 template <typename T, typename U=void>
417 template <typename T, typename U=void>
412 struct TagHelper {};
418 struct TagHelper {};
421+ struct TagHelper<string> {
422+ static constexpr any::Tag tag = any::Tag::String;
426+ struct TagHelper<const char *> {
427+ static constexpr any::Tag tag = any::Tag::String;
414 template <size_t N>
430 template <size_t N>
415 struct TagHelper<any::dict<N>> {
431 struct TagHelper<any::dict<N>> {
416 static constexpr any::Tag tag = any::Tag::Dictionary;
432 static constexpr any::Tag tag = any::Tag::Dictionary;
@@ -421,6 +437,16 @@ namespace Private {
421 static constexpr any::Tag tag = any::Tag::Data;
437 static constexpr any::Tag tag = any::Tag::Data;
441+ struct TagHelper<any::array> {
442+ static constexpr any::Tag tag = any::Tag::Array;
446+ struct TagHelper<any::record> {
447+ static constexpr any::Tag tag = any::Tag::Record;
424 template <typename T>
450 template <typename T>
425 struct TagHelper<T> {
451 struct TagHelper<T> {
426 static constexpr any::Tag tag = any::Tag::Pointer;
452 static constexpr any::Tag tag = any::Tag::Pointer;