On Mon, Oct 7, 2019 at 5:04 PM Lassi Kortela <xxxxxx@lassi.io> wrote:

2) Many S-expressions merged into one:
(foo alpha bravo)
(foo charlie delta)
becomes the alist ((foo alpha bravo charlie delta))

On the whole I think you should omit all talk of merging and just say that it's legitimate for multiple entries in the result to have the same key.  That means you can't use assq to search for such keys, but again I don't think it makes much difference, and it simplifies life in C.
 
By contrast, every time a shell script wants to get another property it 
has to do a separate grep|sed run on the output.

Hardly.  Bash has had arrays since forever, and hash tables since 2009.  It's true that not everyone's sh is bash, but that doesn't mean they don't *have* bash, unless we are in a busybox environment or something.


All of those would have
to have `| head -n 1` added. I don't even know how to do it in awk; use
a counter variable or call exit()? Are those portable?

Yes, quite standard.
 

Since the merging doesn't depend on any particular S-expression being
multi-line, we could remove the multi-line support. But that would
complicate things for Scheme, where `read` happily reads multi-line
sexprs by default and you have to work harder to block those.

You don't have to block them in the reader, just say that it's not supported to write them.  Scheme won't introduce newlines by default unless you actually call a prettyprinter, which makes no sense here.

BTW, you might need to allow \n in strings, though perhaps semantically it's not useful.


John Cowan          http://vrici.lojban.org/~cowan        xxxxxx@ccil.org
"Repeat this until 'update-mounts -v' shows no updates.
You may well have to log in to particular machines, hunt down
people who still have processes running, and kill them."