|
Boost-Build : |
From: Vladimir Prus (ghost_at_[hidden])
Date: 2003-06-18 08:06:28
David Abrahams wrote:
> >> > So, property-set.create would do something smarter than just sorting
> >> > all properties. But it would have to sort some properties --- else
> >> > much more property-set instance will be created.
> >>
> >> I don't see why. It's easy to detect that two Jam lists have equal
> >> contents without ever sorting anything. Reasonably quickly, too.
> >
> > Suppose you end up with two property sets. One contains
> >
> > <define>FOO <define>BAR
> >
> > and the other contains
> >
> > <define>BAR <define>FOO
> >
> > Semantically, they are the same. If you've processed the first set, you
> > can cache the results and do nothing about the second. If you compare
> > them as strings: well, they are different.
>
> Yes. To check for set equality you do:
>
> if $(a) in $(b) && $(b) in $(a) ...
But.... say you have several already-created property-sets. With sorting, to
see if property-set for a certain raw property list exists, you sort the
list, join all elements and use the result as a key in a cache. With the
comparison you propose, you'd have to iterate over all existing
property-sets. And now sure that's such a performance issue, though.
>
> > I fact, property-set modules desperately lacks comments. The story
> > is simple: I wrote it, added nice comments and accidentaly removed
> > it. The rewritten version soon appeared, but I had no time for
> > commenting for the second time :-(
>
> Seems like it's still up to you, then :-?
Oh... well. Will try to do it.
- Volodya
Boost-Build list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk