[Ur] How to design JSON interface?

Adam Chlipala adamc at impredicative.com
Thu Dec 2 13:03:17 EST 2010


Marc Weber wrote:
> Eg this is what PHP is doing:
>    $a = array();
>    $a['dict'] =&  $a; // be careful and assign a reference. = would make a copy!
>    echo json_encode($a);
>
>    || Warning: json_encode(): recursion detected in /home/marc/test.php on line 5
>    || {"dict":{"dict":null}}
>    

This isn't the kind of recursion I meant.  In the world of type theory, 
a "recursive type" is a type defined in terms of itself.  Lists are a 
recursive type family, and they are built into JSON.  Various tree types 
are other examples with less clear JSON status.



More information about the Ur mailing list