[PATCH][RFC] Support for keyword expansion

Jan Hudec bulb at ucw.cz
Thu Sep 22 03:48:42 CDT 2005


On Wed, Sep 21, 2005 at 18:46:07 +0200, Goffredo Baroncelli wrote:
> c1) create a wrawpper class or a wrapper functions which manage the filtering and the
> keyword expansion
>   cons:
> 	- every wwread/wwrite  have to be changed in the new style call
> 	- the simple model of filtering is moved to a higher level
>   pro:
> 	- the different layers don't exchange too much information
> 	- is clear to the programmer that it is performed a more sophisticated
> 	function than a simple write/read
> 
> c2) same as c1, but the filter code still be in the wread/wwrite function; instead the
> keyword expansion code is managed with a function/class wrapper; it is similar to my old
> patch
>   cons:
> 	- every wwread/wwrite  have to be changed in the new style call
>   pro:
> 	- the different layers don't exchange too much information
> 	- is clear to the programmer that is performed a more sophisticated
> 	function than a simple write/read
> 	- the simple model of filtering is hide at the low level
> 
> 
> b) is the worse solution; I prefer the c2: to separate the keyword expansion and the filtering; 
> in fact I think that the keyword expansion need some information that the filter _don't have_ 
> to manage, so the two layer have to be separated.
> 
> Comments are welcome.

I'd say that keyword expansion is a case of filtering and should not be
treated specially. That means c1 is a bit cleaner IMHO.

Other filters also may want to know some additional information,
although I can't find a useful example now. Maybe some day someone will
write keword substitution into OpenDocuments, which would be pretty
complex and might benefit from all filters being on one level (it would
probably make calls to some other filters and such).

--
						 Jan 'Bulb' Hudec <bulb at ucw.cz>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
Url : http://www.selenic.com/pipermail/mercurial/attachments/20050922/5061e9ca/attachment-0001.pgp


More information about the Mercurial mailing list