diff --git a/src/core/inttypes.c b/src/core/inttypes.c index 8ae7b3df..6c90eb0a 100644 --- a/src/core/inttypes.c +++ b/src/core/inttypes.c @@ -91,7 +91,8 @@ static const JanetAbstractType it_s64_type = { int64_unmarshal, it_s64_tostring, janet_int64_compare, - janet_int64_hash + janet_int64_hash, + NULL }; static const JanetAbstractType it_u64_type = { @@ -104,7 +105,8 @@ static const JanetAbstractType it_u64_type = { int64_unmarshal, it_u64_tostring, janet_uint64_compare, - janet_int64_hash + janet_int64_hash, + NULL }; int64_t janet_unwrap_s64(Janet x) { diff --git a/src/core/io.c b/src/core/io.c index 7110491d..ee4e4721 100644 --- a/src/core/io.c +++ b/src/core/io.c @@ -52,6 +52,7 @@ JanetAbstractType cfun_io_filetype = { NULL, NULL, NULL, + NULL, NULL }; diff --git a/src/core/math.c b/src/core/math.c index 49b45ec0..d2e507af 100644 --- a/src/core/math.c +++ b/src/core/math.c @@ -62,7 +62,8 @@ static JanetAbstractType JanetRNG_type = { janet_rng_unmarshal, NULL, NULL, - NULL + NULL, + NULL, }; JanetRNG *janet_default_rng(void) { diff --git a/src/core/parse.c b/src/core/parse.c index 90bcb8dc..b4edc2cc 100644 --- a/src/core/parse.c +++ b/src/core/parse.c @@ -743,6 +743,7 @@ static JanetAbstractType janet_parse_parsertype = { NULL, NULL, NULL, + NULL, NULL }; diff --git a/src/core/peg.c b/src/core/peg.c index c8298898..41dbafb6 100644 --- a/src/core/peg.c +++ b/src/core/peg.c @@ -1214,6 +1214,7 @@ static const JanetAbstractType peg_type = { peg_unmarshal, NULL, NULL, + NULL, NULL }; diff --git a/src/core/thread.c b/src/core/thread.c index 449df4ae..14a4f4e9 100644 --- a/src/core/thread.c +++ b/src/core/thread.c @@ -402,6 +402,7 @@ static JanetAbstractType Thread_AT = { NULL, NULL, NULL, + NULL, NULL }; diff --git a/src/core/typedarray.c b/src/core/typedarray.c index ee290607..f4178d73 100644 --- a/src/core/typedarray.c +++ b/src/core/typedarray.c @@ -121,6 +121,7 @@ static const JanetAbstractType ta_buffer_type = { ta_buffer_unmarshal, NULL, NULL, + NULL, NULL }; @@ -287,6 +288,7 @@ static const JanetAbstractType ta_view_type = { ta_view_unmarshal, NULL, NULL, + NULL, NULL }; diff --git a/src/core/util.c b/src/core/util.c index 919e4e4a..46b38cd9 100644 --- a/src/core/util.c +++ b/src/core/util.c @@ -427,6 +427,7 @@ static const JanetAbstractType type_wrap = { NULL, NULL, NULL, + NULL, NULL }; diff --git a/src/core/value.c b/src/core/value.c index a516f811..fff30ac7 100644 --- a/src/core/value.c +++ b/src/core/value.c @@ -87,6 +87,12 @@ Janet janet_next(Janet ds, Janet key) { } break; } + case JANET_ABSTRACT: { + JanetAbstract abst = janet_unwrap_abstract(ds); + const JanetAbstractType *at = janet_abstract_type(abst); + if (NULL == at->next) break; + return at->next(abst, key); + } } return janet_wrap_nil(); } diff --git a/src/include/janet.h b/src/include/janet.h index a7394264..d411bc29 100644 --- a/src/include/janet.h +++ b/src/include/janet.h @@ -907,6 +907,7 @@ struct JanetAbstractType { void (*tostring)(void *p, JanetBuffer *buffer); int (*compare)(void *lhs, void *rhs); int32_t (*hash)(void *p, size_t len); + Janet(*next)(void *p, Janet key); }; struct JanetReg {