Indeed, the latest ECMAscript standards require that in JavaScript objects are order preserving., recognizing the unfortunate-but-true fact that people do communicate information by the order of keys.  Fortunately for us, alists are too; you may need to reverse the alist before making it available.

On Tue, Jan 21, 2020 at 9:47 AM Amirouche Boubekki <> wrote:
Le mar. 21 janv. 2020 à 14:31, Duy Nguyen <> a écrit :
> On Tue, Jan 21, 2020 at 8:00 PM Duy Nguyen <> wrote:
> >
> > On Tue, Jan 21, 2020 at 5:38 PM Amirouche Boubekki
> > <> wrote:
> > >
> > > Le sam. 18 janv. 2020 à 22:52, John Cowan <> a écrit :
> > > >
> > > > I propose that json-stream-writer be added.  This accepts a port/accumulator and returns a procedure.  The contract for this procedure is the same as the procedure passed to json-stream-reader.  Any attempt to violate JSON rules of construction will signal an error satisfied by json-error?.
> > >
> > > Oh, that will allow to write a possibly bigger than memory JSON text?
> >
> > For me, that would allow me to customize the output (I hope) to print
> > json with indentation.

I did not include sort-keys or indent keywords as of yet, for two reasons:

a) It seems like the favorite way to provide keywords to a procedure
in a portable fashion will be SRFI-177
( but it is not advancing (/me
winks at Lassi K.)

b) I do not know how much interest there is in sorted keys and
indentation in json-write (or json-stream-write).  Basically, those
features are features for humans.  I quickly checked ActivityPub
standard and they do not require sorted keys, there is apparently no
standards that use sorted keys (or indentation).  That leads me to
think that is it (only) a feature to make it easier to read JSON
configuration files and there is jq [0] command line tool for that.


That is, if there is a strong interest, I can add it provided we can
agree on a way to pass the keyword / optional arguments (or use