Created
October 27, 2021 23:48
-
-
Save ryanlaws/9fde5f72d561c5667bc45ef7b262ff64 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
-- an imaginary verbose REPL | |
-- ------------------ | |
-- inspired by the ii help in crow/druid | |
-- most examples based on https://gist.github.com/trentgill/84ec5b68816eb03508566addb5a41dd4 | |
s = sequins | |
-- comments below are hypothetical log output (via e.g. print() or a REPL) | |
cs = s"abcd" | |
-- > created new 4-element sequins from string. | |
s1 = s{1,2,3} | |
-- > created new 3-element sequins from table. | |
s2 = s1:copy() | |
-- > created copy of 3-element sequins. | |
s4 = s2 + 1 | |
-- > created new sequins by adding 1 to 3-element sequins. | |
s8 = s2 % 5 | |
-- > created new sequins by performing modulo of 5 on 3-element sequins. | |
s9 = s{1, s{2,3}} | |
-- > created new 2-element sequins from table. | |
-- ... OR (probably expensive) ... | |
-- > created new 2-element sequins from table, | |
-- > with 1 nested 2-element sequins from table. | |
s9:settable{1, s{4,5}} | |
-- > (updated/replaced) element 2 of sequins with 2-element sequins. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment