В письме от 27 сентября 2013 17:07:55 пользователь Ondrej Zajicek написал: > It is documented: > > Special operators include <cf/˜/ for "is element of a set" > operation - it can be used on element and set of elements of the same > type (returning true if element is contained in the given set), ... > or on clist and pair/quad set (returning true if there is an element of > the clist that is also a member of the pair/quad set) >
Yes, really. But is not clear to me how to use this to test for community/ext community is non-empty. > Well, that was my first idea w.r.t. the original problem with reconfigure, > but having nonsensical '<' offends my algebraic sense ;-) and there is no > good reason to imlement some consistent arbitrary ordering on such objects. > > Good solution would be to have val_same(), which would work on all types > (and would be used where equality is tested), while val_compare would only > work on ordered objects. > > You are right that pm_path_compare() already returns some nonsense. > Thats my first idea. See [PATCH 03/12] in series. > Well, these constants are not documented on purpose, as they are more > like ad-hoc constants for testing purposes, not much needed when you > have X.empty operator. Sure, no problem with ad-hoc constants, let them be *internal*. I just fix comparison/assignment with these constants in [PATCH 03/12]. > X.empty operator could be documented, i wanted to do it already, > the only problem i have with it is its name. When i see 'X.empty', > i would think that 'empty' mainly as adjective (predicate > for emptiness-testing), not as verb (operator of emptying). > > Having some predicate that would return true/false whether the > path/list/set is empty would be useful, but both cannot be named > 'empty'. Perhaps name the former 'reset'? Or keep current 'empty' and > use some other name for the predicate? Any comments on this? No problem with name 'reset', but I think we should leave 'empty' for extended attributes for compatibility and document only 'reset'. This was done in [PATCH 06/12]. To determine if clist or eclist is empty, I suggest to use 'len' operator as this currently implemented for bgppath type, which is done in [PATCH 05/12]. I start new patch series based on this thread with changes to filtering code. I hope BIRD developers and community found useful these patches. -- SP5474-RIPE Sergey Popovich