Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Red[
- author: "Nędza Darek"
- ]
- str: "a1bcvcvba2mcbncva3z"
- find str "a"
- iterator: copy #()
- find-next: func [
- str candidate
- /local
- ][
- iterator/candidate: candidate
- iterator/__series: str
- iterator/value: find iterator/__series iterator/candidate
- iterator/next: func [][
- iterator/__series: next iterator/value
- iterator/value: find iterator/__series iterator/candidate
- iterator
- ]
- iterator
- ]
- probe it: find-next str "a"
- comment {
- #(
- candidate: "a"
- __series: "a1bcvcvba2mcbncva3z"
- value: "a1bcvcvba2mcbncva3z"
- next: func [][
- iterator/__series: next iterator/value
- iterator/value: find iterator/__series iterator/candidate
- iterator
- ]
- )
- }
- ; comment section has only changing part of the map
- probe it/next
- comment {
- __series: "1bcvcvba2mcbncva3z"
- value: "a2mcbncva3z"
- }
- probe it/next
- comment {
- __series: "2mcbncva3z"
- value: "a3z"
- }
Add Comment
Please, Sign In to add comment