On Tue, 09 May 2017 10:41:57 -0700, c...@zoffix.com wrote: > When looking up something with `[...]` postcircumfix, you can add more > postcircumfixes to index the result: > > $ perl6 -e 'dd <a b c>[*][1]' > "b" > > But this silently gives wrong results if adverbs are present as well: > > $ perl6 -e 'dd <a b c>[*]:p[1]' > (0 => "a", 1 => "b", 2 => "c") > $ perl6 -e 'dd <a b c>[*]:v[1]' > ("a", "b", "c") > $ perl6 -e 'dd <a b c>[*]:exists[1]' > (Bool::True, Bool::True, Bool::True) > $ perl6 -e 'dd <a b c>[*]:p[10000000000000000000000000000000000]' > (0 => "a", 1 => "b", 2 => "c") > > $ perl6 -e 'dd <a b c>[*]:delete[1]' > (Failure.new(exception => X::AdHoc.new(payload => "Can not remove > elements from a List"), backtrace => Backtrace.new), > Failure.new(exception => X::AdHoc.new(payload => "Can not remove > elements from a List"), backtrace => Backtrace.new), > Failure.new(exception => X::AdHoc.new(payload => "Can not remove > elements from a List"), backtrace => Backtrace.new)) >
Everything works right. I was just too deep into list adverbs and the fact that `:p[1]` is the syntax for array pair slipped my mind :)