Brad Bowman wrote:
 my $a = rand();   # runtime variable
 my $result = one(any( sub { $a+1}, sub { $a-1} ),sub { $a+3 }).();
 say $result.perl;

If $a was 0.5 I'd guess $result = one(any(1.5, 0.5), 3.5) is this the case?

IIRC the .perl method produces a string from which an equal value can be recreated, so e.g. $result == eval( $result.perl ). This forces a once through evaluation of the junction. So, yes I think your result is one of the possible 4. The other three are the two numbers in the any() swapped and the number and the any() of the one() swapped.

OTOH, the junctions will be stored before the .perl call as e.g.
one(any(Ref of Sub, Ref of Sub), Ref of Sub) with the three subs
beeing mutually different. The .perl method might then just be
propagated down to give e.g. 'sub { $a + 1 }' and not call the subs.
But I've no idea how a closed over value is printed. So it could
also be 'sub { \0.5 + 1 }' or 'sub { $Full::Path::To::a + 1 }'.
This is coupled with the questions how references work and how they
are printed.

What I don't like of the Junctive Debates is that many people think about
junctions as specific forms of list. And I haven't managed to understand
the relation between MMD and the code warping needed to get autothreaded
junctions.
--
TSa (Thomas Sandlaß)




Reply via email to