Created
August 23, 2021 08:25
-
-
Save lyxal/e3e37a905792051cbc88d5b7980f5554 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
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: yes | |
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] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment