Ticket #1170 (closed bug: fixed)
/docs/book/pir/ch04_variables.pod: Iterator does not work as documented
Reported by: | jkeenan | Owned by: | jkeenan |
---|---|---|---|
Priority: | minor | Milestone: | |
Component: | docs | Version: | 1.7.0 |
Severity: | low | Keywords: | |
Cc: | Language: | ||
Patch status: | applied | Platform: |
Description
Based on /docs/book/pir/ch04_variables.pod -- or page 34 of the PIR book, I created and ran this file:
[study] 518 $ cat iter.pir .sub main :main $P2 = new "ResizablePMCArray" $P2[0] = 10 $P2[1] = 20 $P1 = iter $P2 $P5 = shift $P1 say $P5 .end [study] 519 $ ./parrot iter.pir 10
Based on the same source, I then created and ran this file, but running it produced an error:
[study] 520 $ cat xiter.pir .sub main :main $P2 = new "ResizablePMCArray" $P2[0] = 10 $P2[1] = 20 $P1 = new "Iterator", $P2 $P5 = shift $P1 say $P5 .end [study] 521 $ ./parrot xiter.pir Direct creation of Iterator current instr.: 'main' pc 11 (xiter.pir:6)
Am I doing something wrong? Is this merely a documentation error? Or does new "Iterator", $P2 not work as documented?
Thank you very much.
kid51
Change History
Note: See
TracTickets for help on using
tickets.