Re: [Rest2web-develop] Changed all references to value "tests" into value "checks"...
Brought to you by:
mjfoord
From: Michael F. <mi...@pc...> - 2005-07-21 11:18:06
|
Nicola Larosa wrote: [snip..] >>I hope that enough of this makes sense. I think I can sort it out anyway >>- but sections still need to be indented by ``write`` as far as I can tell. > > > Please detach from the implementation for a moment, and look at the big > picture. > > Scalar values and (sub)sections at the same level MUST have the same > indent, it's too confusing otherwise. > > There are only two ways to get this, that I can see: > > 1) introduce a end-of-section header, like ZConfig does; now we're not > INI file format compatible anymore. Not good. > > 2) *only* allow scalar values *before* subsections in each section. Then > the end of the section is marked by the beginning of the next > (sub)section, or the end of the file. > > I think that 2) is an acceptable limitation to live with. After all, > grouping scalar values before *or* between *or* after sections, without > explicitly putting them into real sections, introduces a kind of implicit > sections that I don't like at all. Does that grouping have any meaning? Who > knows? > > I find 2) much preferable than having different indents for scalar values > and (sub)sections at the same level. Whatever you do, please don't do this. > I'm serious. > I think it makes the config files look more confusing. We use indentation for nesting sections. *so*, you either use what I have done so far, or you have to indent values *inside* a section. Mine (a section indented uniformly) : key = value key2 = value2 [section] key = value key2 = value2 [sub-section] key = value key2 = value2 [section2] key = value key2 = value2 Yours (values indented differently from their markers) : key = value [section] key = value # if you don't indent here key2 = value2 # there's no way to distinguish [sub-section] # this sub-section from section2 key = value key2 = value2 [section2] key = value key2 = value2 In your spec values have to be indented more than their section marker which is equally confusing. Added to which implementing your spec is *substantially* harder (for no gain IMHO). Hmm... this has been then *only* implementation I've done of this (as shown in the tests) - so it's a long way down the road to start discussing the basics. Regards, Fuzzy http://www.voidspace.org.uk/python |