[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

[OT] config file formats



>>>>> Игорь Пашев <pashev.igor@gmail.com> writes:
>>>>> 2012/12/2 Vincent Lefevre <vincent@vinc17.net>:

 >> No, that's not sufficient. You may want relations between key-value
 >> pair. For instance, if you have a line with a key "foo", then a line
 >> with a key "bar" must also exist. Or a line with a key "number" must
 >> have a value that is a number (more generally matching some regexp).

 > For such configs general programming languages are good.

 > E. g. perl:

 > $foo = "wtf";

 > if ($foo && !$bar) {

[…]

	If and only if such “configuration files” will only /ever/ be
	read by Perl-enabled tools.  Which may pose a problem, e. g.,
	should a port of the software in question to a resource-limited,
	embedded system be considered at some point.

	The problem with programming languages is that one can't merely
	read a file in such a language, and extract some kind of result
	warranted to be sensible.  One has to /execute/ it instead.

	(Some extra care is likely to be required for the “privileges'
	gate” case as well.)

	The same applies to *roff and TeX, BTW.

-- 
FSF associate member #7257


Reply to: