> Mailing-List: contact [EMAIL PROTECTED]; run by ezmlm
> Date: Thu, 31 Oct 2002 14:07:34 -0800 (PST)
> From: Austin Hastings <[EMAIL PROTECTED]>
> Reply-To: [EMAIL PROTECTED]
> X-SMTPD: qpsmtpd/0.12, http://develooper.com/code/qpsmtpd/
> 
> 
> --- Damian Conway <[EMAIL PROTECTED]> wrote:
> > Austin Hastings wrote:
> > > traits = any ( ... )
> > > requirements = .. & ..
> > > if $requirements eq $traits
> > > 
> > > Should that be traits = all()?
> > 
> > No. Because later we say (effectively):
> > 
> >     print "True love\n"
> >         if all(@desiderata) eq any(@traits)
> > 
> > In other words we want *all* the desired characteristics to be
> > matched
> > by *some* trait. If the comparison was C<all(...) eq all(...)>, then
> > you're asking for every characteristic to be the same as every trait,
> > which obviously can't happen.
> > 
> > This is just a case where the "logic" of English phraseology has
> > several implicit assumptions that computational logic can't just
> > fudge over.
> 
> Does this imply some sort of "depth matching" is required for these
> expressions?
> 
> In this case, there's 
> 
> T = tall & dark & handsome
> D = (tall & dark & handsome) | (Australian) | (rich & old)
> 
> So when I say:
> 
> all(@desiderata)       # I hated that ^[!]() poem
> 
> does that implicitly "search down" until it finds a singleton
> (Australian) or a conjunction (old & rich)?
> 
> And likewise does saying 
> 
> any(@traits)
> 
> do some sort of implicit (de) construction looking for a singleton or a
> disjunction?
> 
> Obviously, yes.
> 
> So you're saying that the all() can't work at the a|b|c level, because
> that would be conjunctive disjunction.  (Doc, tell me straight: how
> long do I have?) So the evaluation alternates through the
> possibilities, looking for a chance to apply "all".

I think you've got it mixed up: all() and any() don't work with junk,
they _are_ junk.

any($a) is just $a
all($a) is just $a

It doesn't do matching, not unless it collapses right there.  So the
only time it does matching is when it collapses, which has nothing to
do with whether all() or any() are present.  It has to do with whether
a value is a junction.

    all(1, 2, 3) === 1 & 2 & 3
    any(1 & 2 & 3) is still just 1 & 2 & 3

It matches:

    all(1, 2, 3) < $x
    1 & 2 & 3    < $x

because the junction is forced to collapse there.  Understand?

Luke

> But on the other side, not all of the traits have to be "matched." It
> won't be fatal if the traits are
> 
> tall & dark & handsome & socialist
> old & rich & fat
> Australian & impotent
> 
> so long as some subset (ANY?) of the traits completely match ALL the
> desired bits.
> 
> 
> So I can't use "all(@traits)" because that would OVERSPECIFY.
> 
> But I don't feel right using "any(@traits)" because that feels like
> either saying 
> 
> "traits[x] == all-these-things"
> 
> which is wrong, or 
> 
> "traits was a list, like desiderata, which contains one of these"
> 
> which is wrong, too. It's right to say 
> 
> "there is SOME trait in @traits that matches each @desiderata"
> 
> But of course, SOME is "choose one", and that means "any".
> 
> (BTW: Will there be an alternate build of p6 that does NOT depend on
> the axiom of choice?)
> 
> Damian, your reward for this whole flexible values mess is to spend the
> rest of your life being retained by large companies to explain this
> stuff to blockheads like me. Welcome to hell.
> 
> =Austin
> 
> 
> 
> __________________________________________________
> Do you Yahoo!?
> HotJobs - Search new jobs daily now
> http://hotjobs.yahoo.com/
> 

Reply via email to