Created
February 14, 2018 00:52
-
-
Save mathewmariani/feb9c3c030bb0bc9939a1635ae7ce4a0 to your computer and use it in GitHub Desktop.
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
class Foo { | |
constructor() { | |
print("Foo has been constructed\n") | |
} | |
</ min = 0, max = 5 /> | |
function test(i) { | |
local min = Foo.getattributes("test").min | |
local max = Foo.getattributes("test").max | |
return i < min ? min : (i > max ? max : i) | |
} | |
} | |
local f = Foo() | |
for (local i = -2; i < 8; i++) { | |
print(f.test(i)+"\n") | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment