diff --git a/src/core/core.janet b/src/core/core.janet index 5f58c7a2..de17cf4b 100644 --- a/src/core/core.janet +++ b/src/core/core.janet @@ -891,7 +891,7 @@ value, one key will be ignored." [xs] (flatten-into @[] xs)) -(defn dict-seq +(defn kvs "Takes a table or struct and returns and array of key value pairs like @[k v k v ...]. Returns a new array." [dict] @@ -1408,6 +1408,6 @@ value, one key will be ignored." (some uqs? x) (tuple tuple.slice (tuple.prepend (map uqs x) array.concat)) (apply tuple tuple (map qq x))) :array (apply array (map qq x)) - :struct (apply struct (map qq (dict-seq x))) - :table (apply table (map qq (dict-seq x))) + :struct (apply struct (map qq (kvs x))) + :table (apply table (map qq (kvs x))) x)) diff --git a/src/core/string.c b/src/core/string.c index 356b485c..fd9fd767 100644 --- a/src/core/string.c +++ b/src/core/string.c @@ -505,7 +505,7 @@ static void janet_pretty_one(struct pretty *S, Janet x) { Janet seenid = janet_table_get(&S->seen, x); if (janet_checktype(seenid, JANET_INTEGER)) { janet_buffer_push_cstring(S->buffer, "buffer, janet_unwrap_integer(x)); + integer_to_string_b(S->buffer, janet_unwrap_integer(seenid)); janet_buffer_push_u8(S->buffer, '>'); return; } else {