Last active
September 1, 2017 18:04
-
-
Save rebolek/dd336a859c8b1277d2a316484a17c017 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Red[] | |
| reduce+: func [ | |
| "Reduce with unset!, error! -> none! conversion" | |
| block | |
| /local value new-block | |
| ][ | |
| new-block: block | |
| collect [ | |
| until [ | |
| set/any 'value try [do/next block 'new-block] | |
| keep case [ | |
| equal? block new-block [ | |
| new-block: next block | |
| none | |
| ] | |
| not value? 'value [none] | |
| true [value] | |
| ] | |
| block: new-block | |
| tail? block | |
| ] | |
| ] | |
| ] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment