Skip to content

Instantly share code, notes, and snippets.

@ryanlaws
Created October 27, 2021 23:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ryanlaws/9fde5f72d561c5667bc45ef7b262ff64 to your computer and use it in GitHub Desktop.
Save ryanlaws/9fde5f72d561c5667bc45ef7b262ff64 to your computer and use it in GitHub Desktop.
-- 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