in reply to Re^6: Converting python list range expressions to perl
in thread Converting python list range expressions to perl
In the OP, a notation that looked like [x:y], where x or y could be blank, was given. I noted this equivalence:
| Python | Perl |
|---|---|
| [x:y] | splice ARRAY, x, y |
| [:y] | splice ARRAY, 0, y |
| [x:] | splice ARRAY, x |
| [:] | splice ARRAY, 0 |
I coded that and it passed all tests. I took all given tests, and their results, on face value. One exception is [:], which I added myself and was extrapolated from information already provided.
If the original data was wrong in some way, then I'm working from a false premise. If the tests are insufficient, further tests could show that the seen equivalence doesn't hold for other values.
I'm not trying to sell something here. I don't care what the OP uses for his "poetry" project — as already stated: "What you choose is entirely up to you.".
If you think that there's something wrong with the source, please take it up with the OP, not me.
— Ken
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^8: Converting python list range expressions to perl
by LanX (Saint) on Dec 05, 2022 at 20:15 UTC | |
by kcott (Archbishop) on Dec 05, 2022 at 20:25 UTC | |
|