Re: Is this a bug?

2016-09-19 Thread Aaron Sherman
Thank you. Silly me, thinking "this is so simple I don't need to run it through the command-line to test it." :-) Anway, yeah, say $_ for reverse lines Aaron Sherman, M.: P: 617-440-4332 Google Talk, Email and Google Plus: a...@ajs.com Toolsmith, developer, gamer and life-long student.

Re: Is this a bug?

2016-09-19 Thread Parrot Raiser
It may make it clearer if I explain the broader objective. I'm trying to learn P6 thoroughly by developing training courses to teach it from scratch. (Fans of Gerald Weinberg may recognise the idea.) Obviously, while doing so, I want to explore pathological cases, both to clarify the concepts and

Re: Is this a bug?

2016-09-19 Thread Timo Paulssen
On 19/09/16 16:02, Aaron Sherman wrote: > I'm guessing that what you meant was "say as a function was what I > meant to > use there." In which case: > > say for reverse lines > > or > > for reverse lines { say } > > These are both valid ways of asking for each element of the iterable > thing

Re: This seems to be wrong

2016-09-19 Thread Timo Paulssen
On 19/09/16 15:56, Aaron Sherman wrote:> You can also use map, but it's slightly clunkier: > > "for @inputs.map: .Int -> $i { ... }" This also needs to have "*.Int" or "{ .Int }" otherwise you'll pass $_.Int as the argument to map rather than telling map to call .Int on things.

Re: Is this a bug?

2016-09-19 Thread Aaron Sherman
I'm guessing that what you meant was "say as a function was what I meant to use there." In which case: say for reverse lines or for reverse lines { say } These are both valid ways of asking for each element of the iterable thing returned from lines to be printed with a newline. But remember

Re: This seems to be wrong

2016-09-19 Thread Aaron Sherman
"for @inputs.map( .prefix:<+> ) {...}" That's spelled: "for @inputs>>.Int -> $i { ... }" You can also use map, but it's slightly clunkier: "for @inputs.map: .Int -> $i { ... }" Aaron Sherman, M.: P: 617-440-4332 Google Talk, Email and Google Plus: a...@ajs.com Toolsmith, developer, gamer