help-make
[Top][All Lists]
Advanced

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

Re: trouble with order rules in implicit rules


From: Boris Kolpackov
Subject: Re: trouble with order rules in implicit rules
Date: Fri, 16 Apr 2004 18:32:43 +0000 (UTC)
User-agent: nn/6.6.5+RFC1522

Noel Yap <address@hidden> writes:

> > I am planning to implement a "shortest stem" matching for equally 
> > applicable implicit rules. Do you think that would be good definition
> > of a "better-matching"?
> 
> How is "shortest stem" defined?

Literally. Here is the algorithm I have in mind:

1. For each otherwise equally applicable implicit rule extract the
   stem (i.e. what % matched).

2. Find the shortest stem and use corresponding rule.

This would mean that the most "specialized" or "restricted" rule will 
be used which is what you usually want. For example:

/foo/%:

/foo/bar/%:



When you try to match "/foo/bar/baz" against those rules the second
one is chosen.

hth,
-boris






reply via email to

[Prev in Thread] Current Thread [Next in Thread]