but what is $^code?
It's a positional parameter of block that is passed to map.
The block could also have been written as { $_(|$c) } or -> $code { $code(|$c) }
What is a reasonable value for the $c?
To clarify, this method is called when you try to invoke a Junction like a subroutine or codeblock. Which of course only makes sense if the Junction contains callable eigenstates. $c holds the parameter list that was passsed to this call. IT can be empty, if you like that:
$ perl6 -e 'any({say 42}, {say 23}).()' 42 23 # with arguments: $ perl6 -e 'any({say $^x }, { say 40 + $^x }).(2)' 2 42
My hope is that there is a way to alter a Junction object. In Sudoku, every cell begins with the potential to be any digit
You are trying to abuse junctions as sets, which is explicitly discouraged.
I know the excitement when learning about junctions, but after experimenting a bit them I'm firmly convinced that using them for everything but simple matchers is a broad over-use, and makes your program hard to write, read and understand.
In reply to Re: Perl6 junctions and postcircumflex
by moritz
in thread Perl6 junctions and postcircumflex
by TomDLux
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |