Re: Suggested dual human/binary interface for proc/devfs

From: Jamie Lokier (lk@tantalophile.demon.co.uk)
Date: Mon Apr 10 2000 - 06:06:38 EST


Russ Allbery wrote:
> > group0 {
> > item1=x;
> > item2=y;
> [...]
> > };
>
> > Is the same as:
>
> > group0{item1=x;item2=y;subgroup1{item1=a;item2=b};item3=c;};group1{item1=z;};
>
> > You can just ignore whitespace completely.
>
> I understand the theory, and it makes sense from the perspective of making
> it C-like, but like I said having to put the semicolons in there and
> realizing that they're not part of the value, escaping semicolons where
> necessary, and so forth I've found to be confusing to non-programmers who
> are trying to work with those configuration files. C programmers don't
> have a problem for the most part, but a lot of folks who aren't C
> programmers have to edit the config files.

Especially the semicolon after "}". Even C isn't consistent about
that, and it can be confusing even to C programmers.

I propose that newline be viewed as _equivalent_ to a semicolon. That
way, semicolon is seen as a separator, and of course never appears in
machine generated files. Quoting isn't a problem -- you probably should
always quote "=" and "{" anyway if they're in a string value or a label.
So the principle of quote-if-unsure applies when writing files. Like a
lot of computer languages.

> It doesn't matter as much for a /proc format, since there are very few
> writers and the average user only has to read.

You say that there aren't many writers _now_... :-)
May as well use a format that would be just as useful
for non-kernel config files. Just for consistency, you know.

-- Jamie

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Sat Apr 15 2000 - 21:00:13 EST