-
-
Save xnuk/f24d4b46d640b859addd 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
| //specific type | |
| int funca int a, char, string b [ | |
| int d = a + b.length + \1 // char \1 | |
| return d | |
| ] | |
| //non-specific type | |
| funcb a, var, c [ | |
| var d = a + c.length,c + \1 // var \1 | |
| // -> if c.length is null then use c | |
| return d | |
| ] | |
| //launch function | |
| funca 1, 'a', 'abcd' //returns 0x5a | |
| funca 3, "b", "vfcdd" //returns 0x8b | |
| funca 3, "bf", "vfcdd" //returns 0x8b ("bf" as char -> "b") | |
| funca 3, "v", "vfcdd" //throws cast error | |
| funcb 1, 'a', 'abcd' //returns "5a" | |
| funcb 3, "b", "vfcdd" //returns "8b" | |
| funcb 3, "bf", "vfcdd" //returns "8bf" | |
| funcb 3, "v", "vfcdd" //returns "8v" | |
| for 1 [int i] 10 skip 4 [i] 7 [ | |
| console.log i //would log when i == 1, 2, 3, 8, 9, 10 | |
| ].extract[i, [ | |
| console.log i //would be 11 | |
| ] | |
| ] | |
| console.log i //would be undefined |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment