Boost logo

Boost :

From: Florian Stegner (FlSt_at_[hidden])
Date: 2005-08-10 12:13:07


Rob Stewart wrote:

>From: Florian Stegner <FlSt_at_[hidden]>
>
>
>>Rob Stewart wrote:
>>
>>
>>>From: Matthew Vogt <mattvogt_at_[hidden]>
>>>
>>>
>>>>Matthew Vogt wrote:
>>>>
>>>>
>>>>
>>>I've uploaded yet another revision of multivalues.zip. I decided
>>>to go with "some" for n_m/subrange/subset/i_j/a_z/x_y/etc
>>>
>>>
>>I aggree with it. But each_of is still confusing for me. You
>>implemented it as the negation of all_of: "( all_of( a ) > x ) != (
>>each_of( x ) > x )" is true for all a and x. each_of in your
>>implementation is equivalent to not_all_of in mine. not_all_of in your
>>implementation is the negation of one_of, what is ok. But each_of( a )
>>== x means that none or more but not all elements of a are equal to x.
>>There must be a better name as each_of. I had just a quick look on your
>>new implementation. I will post my results later.
>>
>>
>
>I just took a look at my implementation of all and each. At
>least in my latest version, it's worse than you describe. They
>are identical. Regardless of how I've implemented them, these
>are the intended semantics:
>
> all: all of the values must match *the same* other value
>
> each: all of the values must match *some* other value
>
>
I will try to summarize all types of multivalues:

any_of ( s ) <PRED> x -> is true if one or more elements of s satisfy
the test "element <PRED> x"
all_of( s ) <PRED> x -> is true all elements of s satisfy the test
"element <PRED> x"
none_of( s ) <PRED> x -> negation of any_of( a ): is false if one ore
more elements of s satisfy[...]
???_of( s ) <PRED> x-> negation of all_of( a ) ( in my implementation
not_all_of( a ) ): is false if all elements of s satisfy[...]. This is
still missing in your implementation. Your implementation of not_all is
the negation of any_of.

one_of( s ) <PRED> x -> is true if exact one element of s statisfy[...]
n_of( n, s ) <PRED> x -> is true if exact n elements of s satisfy[...]
some_of( n, m, s ) <PRED> x -> is true if more than n and less than m+1
elements of s satisfy[...]

 From your description of each_of: Your implementation of all_of() is
correct. I'm right? And each_of needs to refactored?

>>all_of( a ) [ _2 > _1 ] any_of( b )
>>
>>Then we would have no more problems with operator precendence. :-)
>>
>>
>That won't work. "all_of(a)::operator [](_2 > _1)" yields an
>object, but you end up with "result any_of(b)," where "result" is
>the object returned by operator [].
>
Ok you're right.

>>> - documentation
>>>
>>>
>>I will help you so good I can.
>>
>>
>
>I know it will be a challenge given that English isn't your
>native language. The Boolean logic is certainly one area I'll
>need your help. We can also discuss--privately, I think--the
>layout and outline.
>
Ok, good idea. And as I said in my private mail, I will rework my
pdf-file next weekend.

>>There is a boost-sandbox CVS. Now after we have a common version ( Now
>>it makes no sense develop my prototype further ) this would be a good
>>place for our library. Or is the stage to early?
>>
>>
>
>I think we should have some documentation first. Don't you
>agree?
>
I aggree.

Sincerely
  Florian


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk