Created
December 27, 2017 09:35
-
-
Save lepinekong/f543b7104adb1f328281b5db25cb2393 to your computer and use it in GitHub Desktop.
static variable in Red
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
static-function: function[ /local static-var][ | |
static-var: [] | |
; initialization | |
if empty? static-var [ | |
append static-var 0 | |
] | |
; cum | |
static-var/1: static-var/1 + 1 | |
print static-var/1 | |
] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment