Closed trentgill closed 3 years ago
@tehn absolutely! i'll open a PR pulling all the new changes into norns when this all gets merged.
i'm mostly building stuff up in the PR list here so it's easier for me to track heh.
honestly more excited for this new stuff to work on norns than crow! it's really just fun lua magic :)
a set of new features, shortcuts & nice-to-haves in the sequins library:
a sequins of a string is converted into a sequins of a table of characters, eg:
printing a sequins, now prints a representation of the execution state & data. should be very helpful in terms of debugging and being able to introspect the current status of a sequins.
the
#
length operator is now meaningfully supported on sequins. it will return the count of items in the top-level table (ie nested tables are treated as length-of-1:add a new
:copy()
method so that sequins can be duplicated. this is useful if you want to have 2 duplicate sequins (or to make permutations) but maintain their table counters separately:the
:settable(t)
method is extended to handle nested sequins. if your sequins has the same structure (eg. element 3 is a sequins in both old & new tables) the execution state of the old table will be carried across. this means you can replace more complex sequences without restarting any nested elements. NB: does not copy flow-modifiers yet (eg.every
,count
etc).additionally, the 'table' argument to settable can now be a table or a sequins (to make the syntax a little more flexible):