/* [ʞ] util-gn.h
 *  ~ lexi hale <lexi@hale.su>
 *  🄯 AGPLv3
 *  ? convenience functions for janet
 */

#pragma once
#include <janet.h>

static inline void
jnu_table_inherit(Janet tbl, Janet proto) {
	auto t = janet_unwrap_table(tbl);
	auto p = janet_unwrap_table(proto);
	t -> proto = p;
}

static inline JanetTable*
jnu_table_extend(JanetTable* p, size_t sz) {
	auto t = janet_table(sz);
	t -> proto = p;
	return t;
}
