Return-Path: Delivered-To: new-httpd-archive@hyperreal.org Received: (qmail 16138 invoked by uid 6000); 21 Dec 1998 20:52:48 -0000 Received: (qmail 16130 invoked from network); 21 Dec 1998 20:52:47 -0000 Received: from crankshaft.bitmechanic.com (207.181.249.10) by taz.hyperreal.org with SMTP; 21 Dec 1998 20:52:47 -0000 Received: from localhost (ed@localhost) by crankshaft.bitmechanic.com (8.8.7/8.8.7) with SMTP id MAA28184 for ; Mon, 21 Dec 1998 12:52:15 -0800 Date: Mon, 21 Dec 1998 12:52:15 -0800 (PST) From: Ed Korthof X-Sender: ed@crankshaft To: new-httpd@apache.org Subject: Re: FW: general/3563: I want to allow the definition and use of macros within runtime configuration files. In-Reply-To: <199812211656.RAA26711@blonville.caii> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: new-httpd-owner@apache.org Precedence: bulk Reply-To: new-httpd@apache.org On Mon, 21 Dec 1998, Fabien COELHO wrote: > Hi, [snip] > Sure. You can address the meta problem, but I have just practical problems > right now that I needed to solve. I do not think that I'm the only one > with such problems, hence my request for adding the feature and sharing > it. [snip] > Another example with M4: > > define(`allowing',` > # let's define default access > Order deny,allow > Deny from all > Allow from dnl.ensmp.fr $1 > ') > > allowing(10.2.16.0/24) > > Looks good? No. It is broken because: > > (1) there is ' in the comment, so it is the end of the ` > - let us remove the ' > > (2) the define m4 keyword is used within a the comment. > - let us remove define Well, as you must know from the statement below, you could avoid this problem by commenting the line out properly via 'dnl'. You don't need many comments in the generated file -- you should be editing the .m4 file, not the generated one. > (3) the machine is named dnl... but this means "delete line" for m4. > - let us rename the machine;-) Or just: ----- # DO NOT EDIT THIS FILE!!! # edit foo.m4 and run make to generate foo.conf define (`allowing', ` dnl let's define default access Order deny,allow Deny from all Allow from `dnl'.ensmp.fr $1 ') allowing(10.2.16.0/24) ----- Which works fine. m4 definitely has it's weaknesses -- but so does every other language in existence. Trading it for a custom macro language wouldn't necessarily avoid ugliness -- it'd just trade one set for another. Save that the new set would be nonstandard. Ed