relatively large update, most types are now saved as objects rather than basic strings, which also means you get more info from them now. this change carries over to ADTs as well, where ADTs will always be "ADT": {"type": "__"}, with an optional "data": "..." pair if the given ADT has a _to_string method
function recursive_list()
local a
a = ["hello world", "this is a test"]
a.append(a)
return a
end function
sub when_green_flag_clicked
say stringify(recursive_list())
end sub
JSON.stringify would throw an error for circular structures like this.
It being stuck in an infinite loop is expected by the way, as we don't normally put lists inside itself so we don't cater for that. But for a truly complete stringifier, yeah, these must be checked for.