While nothingmuch and I are gutting junctions and trying to find the
right balance of useful/dangerous, I'm going to propose a new way to
do autothreading that doesn't use junctions at all.
First, let me show you why I think junctions aren't good enough:
I can't extract the information that the threaded call returns to me.
For instance, I want to say:
my ($val1, $val2, $val3) = map { foo("bar", $_, "baz") } 1,2,3
But without obscuring the nature of what I'm doing with that unsightly
"map". That is, I want the following (using pseudosyntax):
my ($val1 | $val2 | $val3) = foo("bar", 1|2|3, "baz")
But this is impossible using junctions, because the order is lost
before it comes back to my declaration.
So I propose a simple extension to the hyper syntax. The hyper meta
operator always points to the operator that is being hypered:
+<< @a # prefix
@a >>*<< @b # infix
@a >>++ # postfix
Now I'm going to propose a variant for circumfix:
foo(1, <<@a>>, 2);
Where the meta operator is pointing to the parentheses around the
call. Then it is easy to do my map above:
my ($val1, $val2, $val3) = foo("bar", <<1,2,3>>, "baz")
Luke