Forked from lyxal/Vyxal Element Documentation Draft.txt
Last active
August 23, 2021 08:29
-
-
Save pxeger/87aaa359f6ba6991b4b3090b67a89f43 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
- element: '+' | |
name: add | |
arity: 2 | |
description: adds the top two items on the stack | |
num-num: a + b | |
num-str: str(a) + b | |
str-num: a + str(b) | |
str-str: a + b | |
vectorise: true | |
tests: | |
- [1, 1] -> 2 | |
- [0, -5] -> -5 | |
- ["abc", 5] -> "abc5" | |
- [5, "abc"] -> "5abc" | |
- ["Hello, ", "World!"] -> "Hello, World!" | |
- [[1,2,3], 4] -> [5, 6, 7] | |
- [[1,2,3], [4,5,6]] -> [5, 7, 9] | |
- element: '-' | |
name: subtract | |
# ... |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment