Posted December 01, 2023 by Internet Janitor
Decker 1.34 overhauls Lil's "insert" syntax, and includes some minor bugfixes and new features.
The Lil "insert" query form required declaring values in a somewhat awkward column-wise fashion, which seriously undermined its utility and essentially made it a less flexible version of "select":
The "insert" statement's syntax has been reworked entirely to be row-oriented instead. Delimiters like the list concatenation operator "," are no longer necessary between elements, making table declarations less verbose and visually noisy, as well as improving runtime efficiency and making it far less error-prone to declare columns of lists, dictionaries, or tables. The "into 0" idiom for creating a new table from scratch was often confusing, so the new syntax permits terminating an insert statement with a simple "end" as an alternative.
All the relevant reference documentation has been updated to reflect the new syntax and describes it in more detail. Decker's Listener and the Lilt REPL will now prettyprint nested tables using "insert ... with ... end" syntax.
All instances of the "insert" form will need to be rearranged into the new syntax, which will often simplify and shorten code. If any table declarations are clearer in the old column-oriented format, they can be changed from "insert" statements into equivalent "select" statements, as shown in the first figure. Any instances of the phrase "into 0" can be replaced with "end". The "with" keyword was already reserved (but unused), so its use in the new "insert" syntax shouldn't cause any problems.
I hope that having a less verbose, more convenient "table literal" syntax will make tables appealing in more situations and thus enhance the value of the rest of Lil's query-oriented features.