On Wed, Apr 01, 2009 at 08:40:12AM -0700, Dave Whipp wrote: > That said, the semantics of a chained relop really should work correctly > for this. If you only reference a junction once in an expression, then > it should behave as such: {a<b<c} !=== {a<b && b<c}.
Yes, that is the intent. I consider a chained "1 < $x < 2" to be a single function from the standpoint of autothreading, something like chained(1, &infix:«<», $x, &infix:«<», 2); and the semantics would fall out of that naturally, more or less. Something similar could also work for the blocks of conditionals if we were to treat the conditional as a function that autothreads consistently over both its condition and its blocks; this implies the junction autothreader must be given enough access to the scope of the block in question to temporarily override the value of $x within the block to its autothreaded value somehow. The tricky bit is that autothreading is setting up extra scopes around variant captures without explicit blocks. That alone is reason enough to keep the mechanism all internal. If we do give access to universe of values the junction is interested in, it should probably just be via a coercion to Set. There would have to be some caveats about using that as the universe of values, however, since none() junctions define a set outside of the eigenstates. For that reason I'd still prefer people to track their universe of values outside the junctions rather than rely on junctions for that. And of course, a Set in list context is its members, so any(%set) isn't a problem going the other direction. Larry