On Fri, 14 Mar 2008, Ned Freed wrote:
...
>> > First of all, the specification says that any test against an unknown
>> > item must fail unconditionally. This provides a simple way to check and
>> > see if a given item is available:
>> >
>> > if environment :matches "item" {...}
>
>> There's a pattern missing there.
>
> Right, sorry about that.
>
>> Regardless, the empty substring test is
>> probably more efficient:
>> if environment :contains "item" "" { ... }
>
> This almost always works, but not in the case where the environment
> item has the null string as a possible return value.
Ummm, what? Are you saying that there exists some case where
if environment :matches "item" "*" { ... }
and
if environment :contains "item" "" { ... }
would return different results?
Sorry, my mistake, I was thinking of :is.
If that's not what you meant, then I don't understand what you're saying.
I strongly believe that <<:matches "*">> and <<:contains "">> MUST have
the same result with *any* combination of test and comparator.
Certainly should be true of all tests and any comparator we've defined so far,
not entirely sure it will extend to all future comparators.
Ned