Re: Tweaking junctions

2010-11-01 Thread Moritz Lenz
On 10/22/2010 06:16 AM, Damian Conway wrote: That is, a C$value is an eigenstate of a C$junction if-and-only-if: $value !~~ Junction$value ~~ $junction In general this definition makes it impossible to return a list of eigenstates from the junction. Just think of junctions containing

Re: Tweaking junctions

2010-11-01 Thread Damian Conway
Moritz wrote:     $value !~~ Junction    $value ~~ $junction In general this definition makes it impossible to return a list of eigenstates from the junction. Just think of junctions containing Code objects. Well, that's a deficiency in smartmatching: that Callable ~~ Code doesn't check for

Re: Tweaking junctions

2010-11-01 Thread Moritz Lenz
On 11/01/2010 12:41 PM, Damian Conway wrote: Moritz wrote: $value !~~ Junction$value ~~ $junction In general this definition makes it impossible to return a list of eigenstates from the junction. Just think of junctions containing Code objects. Well, that's a deficiency in

Re: Tweaking junctions

2010-11-01 Thread Moritz Lenz
Food for thought, a few non-junction solutions: On 10/22/2010 06:16 AM, Damian Conway wrote: # Find the list of common elements in two lists... sub intersection (@list1, @list2) { (any(@list1) any(@list2).eigenstates; } sub intersection(@list1, @list2) { uniq gather

Re: Tweaking junctions

2010-11-01 Thread Buddha Buck
On Mon, Nov 1, 2010 at 7:24 AM, Moritz Lenz mor...@faui2k3.org wrote: On 10/22/2010 06:16 AM, Damian Conway wrote: That is, a C$value is an eigenstate of a C$junction if-and-only-if:     $value !~~ Junction    $value ~~ $junction In general this definition makes it impossible to return a

Re: Tweaking junctions

2010-11-01 Thread Dave Whipp
Buddha Buck wrote: Is it too late in this discussion to point out that, in non-perl usage, eigenstates are associated with the operator, not with the value fed into the operator? [cut] So asking for the eigenstates of a quantum superposition is asking the wrong object for the property.

Re: Tweaking junctions

2010-10-29 Thread Martin D Kealey
On Thu, 28 Oct 2010, Damian Conway wrote: The apparent paradox ... is due to the assumption (employed in the second interpretation) that is identical to !=. Certainly that is true for simple scalar numbers, but not always for vector types such as tuples, sets, bags, complex numbers...or

Re: Tweaking junctions

2010-10-29 Thread Damian Conway
Martin D Kealey suggested: Well, I think returning or throwing an Unordered exception would be the appropriate way to handle those, both for complex numbers and for junctions. For complex numbers that might be true, because the order relationship between two complex numbers isn't expressible

Re: Tweaking junctions

2010-10-28 Thread Damian Conway
Martin D Kealey asked: Or do we not invert junctions, and run the risk of unexpected action-at-a-distance instead? I think our current approach is correct. That is: we invert junctions on operators that are themselves intrinsically inverted (such as !=, !~~, !), but do not invert on those that

Re: Tweaking junctions

2010-10-28 Thread Darren Duncan
Damian Conway wrote: If it's about parallel data handling, then we have to be prepared to (notionally) fork the entire rest of the runtime, even as far as having a definition of what return value the parent process sees (from exit) when those threads are implicitly collapsed at termination.

Re: Tweaking junctions

2010-10-27 Thread Martin D Kealey
I have to admit to feeling uneasy about the whole action-at-a-distance effect that junctions are capable of producing. They sit around pretending to be a scalar, only to pop up and wreak havoc with ones expectations of linearity when you're not expecting it. That unexpected-action-at-a-distance

Re: Tweaking junctions

2010-10-26 Thread Damian Conway
Jon Lang wrote: Personally, I don't think that it should be a public method: one thing about junctions is that you can use them interchangeably with ordinary scalars; giving them a public method breaks that.  In particular, code that makes use of a Junction public method would break if you

Re: Tweaking junctions

2010-10-26 Thread Todd Olson
On 2010-Oct-25, at 15:14, Damian Conway wrote: Yes, Ted Z. pointed out to me that, as the name of this construct, every has ambiguity and synonym issues. Other possibilities are: select(@values) one(3..7) those(@values) one(3..7) whichever(@values) one(3..7)

Re: Tweaking junctions

2010-10-25 Thread Ben Goldberg
On Oct 22, 6:41 pm, dam...@conway.org (Damian Conway) wrote: Dave Whipp wrote: When this issue has been raised in the past, the response has been that junctions are not really intended to be useful outside of the narrow purpose for which they were introduced. Hmm. There are

Re: Tweaking junctions

2010-10-25 Thread Damian Conway
Ben Goldberg asked: I'm probably missing something, but wouldn't it have been easier to write that module by using eval STRING to create all of those infix operators? Sure. But the module is already slow to start up. I was concerned that it would get even slower with an embedded eval. But, in

Re: Tweaking junctions

2010-10-25 Thread Dave Whipp
Damian Conway wrote: So I'm going to go on to propose that we create a fifth class of Junction: the transjunction, with corresponding keyword Cevery. [...] say (^10 G[] one(3,7)); 3 4 5 6 which could also be: say every(^10) one(3,7); # Every value up to 10 that's greater than 3

Re: Tweaking junctions

2010-10-25 Thread Damian Conway
Dave Whipp noted: I think that the two proposals are equivalent, in the sense that either can be trivially implemented using the other. Agreed. However, I am a little concerned that the transjunction magically changes an operator that returns a Boolean value into one that returns a list.

Re: Tweaking junctions

2010-10-25 Thread Dave Whipp
Damian Conway wrote: Yes, Ted Z. pointed out to me that, as the name of this construct, every has ambiguity and synonym issues. Other possibilities are: select(@values) one(3..7) those(@values) one(3..7) whichever(@values) one(3..7) itemize(@values) one(3..7)

Re: Tweaking junctions

2010-10-23 Thread Brandon S Allbery KF8NH
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 10/22/10 13:00 , Dave Whipp wrote: Damian Conway wrote: I've been thinking about junctions, and I believe we may need a small tweak to (at least) the jargon in one part of the specification. When this issue has been raised in the past, the

Re: Tweaking junctions

2010-10-23 Thread Damian Conway
Brandon mused: It occurs to me:  If their purpose is that narrow, why are they wasting conceptual space in the core language? Well, mainly because their purpose isn't narrow at all: it's parallelized data comparisons (all(@values) $threshold), and multiway comparisons (all(@values) ~~

Re: Tweaking junctions

2010-10-23 Thread yary
In general I like where this is going but need a little hand holding here- I'm not an expert on junctions or anything perl6- So I'm going to go on to propose that we create a fifth class of Junction: the transjunction, with corresponding keyword Cevery. It seems that by these definitions every

Re: Tweaking junctions

2010-10-23 Thread Damian Conway
In general I like where this is going but need a little hand holding here- I'm not an expert on junctions or anything perl6- So I'm going to go on to propose that we create a fifth class of Junction: the transjunction, with corresponding keyword Cevery. It seems that by these definitions

Re: Tweaking junctions

2010-10-22 Thread Dave Whipp
Damian Conway wrote: I've been thinking about junctions, and I believe we may need a small tweak to (at least) the jargon in one part of the specification. When this issue has been raised in the past, the response has been that junctions are not really intended to be useful outside of the

Re: Tweaking junctions

2010-10-22 Thread Damian Conway
Dave Whipp wrote: When this issue has been raised in the past, the response has been that junctions are not really intended to be useful outside of the narrow purpose for which they were introduced. Hmm. There are intentions, and then there are intentions. I know what I intended when I