HaloO, On Tuesday, 17. March 2009 10:25:27 David Green wrote: > > That is, it would return a Junction of Str, not a Str. So the > > question is how to get something that returns an expression to the > > effect of: > > 'any(' ~ $choice.eigenstates.«perl.join(',') ~ ')' > > say $choice.perl > > ...which will ultimately call (junction-of-.perl's).Str, and > Str(Junction:) is what produces the "any(XXX)" string. [Unless it > ends up being implemented some other way, of course!]
Note that this contradicts Larry's statement that .perl autothreads. I think it can't autothread because we expect it to put the junction constructor in front of the values or the right operator as infix. So .perl is junction aware! But it threads the .perl method through the eigenstates, of course. > > The other question is: given $choice as defined above, how do I find > > out which type of junction it is? > > I guess really Junctions need two public methods: .eigenstates for the > values, and, er, .eigenop(?!) to return how they're joined -- I'm > thinking it would return a code ref, i.e. &any, &all, etc. A simple solution is to have subtypes of Junction like AnyJunction, AllJunction, OneJunction and NoneJunction or perhaps like Junction::Any, Junction::All, Junction::One and Junction::None. Regards, TSa. -- "The unavoidable price of reliability is simplicity" -- C.A.R. Hoare "Simplicity does not precede complexity, but follows it." -- A.J. Perlis 1 + 2 + 3 + 4 + ... = -1/12 -- Srinivasa Ramanujan