Created
June 12, 2018 12:09
-
-
Save toomasv/4eb4c6c673276ce309ff42437ab6ca22 to your computer and use it in GitHub Desktop.
Some incrementation funcs
This file contains 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 [ | |
Original-idea: "Dave Andersen" | |
Source: https://gitter.im/red/red?at=5a2a4fb9a2be46682876463d | |
] | |
inc: func ['val][set val (get val) + 1] | |
dec: func ['val][set val (get val) - 1] | |
incr: func ['val step][set val (get val) + step] | |
decr: func ['val step][set val (get val) - step] | |
++: make op! :incr | |
--: make op! :decr | |
increment: func ['val /by step][set val (get val) + any [step 1]] | |
decrement: func ['val /by step][set val (get val) - any [step 1]] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment