Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Re: I7: Comparing values of objects

2 views
Skip to first unread message
Message has been deleted

vaporware

unread,
Nov 12, 2009, 4:31:09 PM11/12/09
to
On Nov 12, 12:04 pm, Kellen Snook <ksn...@gmail.com> wrote:
> Hello all,
>
> I am new at this, so I apologize if this is an obvious answer.  I am
> having problems comparing values of objects.  For example, I want to
> see if the shirt worn by Bob is the same color as the pants worn by
> Bob, so I write:
>
> If the color of the shirt worn by Bob is the color of the pants worn
> by Bob:
>
> But it doesn't parse.  I am also trying to figure out how to compare
> it from tables:
>
> If the color of the shirt worn by Bob is the the color entry
> corresponding to a priority of 1 in the table 1:
>
> Any help would be appreciated.
> Thank you.

I believe the problem is "the shirt worn by Bob". This syntax isn't
supported, because Bob could conceivably be wearing any number of
shirts, including zero. Try something like:

<code>
if Bob is wearing a shirt (called the top) and Bob is wearing pants
(called the bottom) and the color of the top is the color of the
bottom:
</code>

If he does happen to be wearing multiple shirts or pants, this will
only check the first one of each. Presumably that won't happen, but if
it does and you need to handle that case, you could do something like
this:

<code>
Color-matching relates a thing (called X) to a thing (called Y) when
the color of X is the color of Y. The verb to color-match (it color-
matches, they color-match, it color-matched, it is color-matched, it
is color-matching) implies the color-matching relation.

[...]
if Bob is wearing a shirt that color-matches pants worn by Bob:
</code>

vw

Kellen Snook

unread,
Nov 14, 2009, 5:26:48 PM11/14/09
to

> I believe the problem is "the shirt worn by Bob". This syntax isn't
> supported, because Bob could conceivably be wearing any number of
> shirts, including zero.

Aha! That makes perfect sense. Thank you for clearing that up.

0 new messages