Decker 1.34
Decker 1.34 overhauls Lil's "insert" syntax, and includes some minor bugfixes and new features.
Fixes (Web and Native)
- Corrected crashes when attempting to make or manipulate a 0x0 font; the minimum size for a font is now 1x1.
New Features
- The "writexml[]" function now treats Array Interfaces as "transparent": their contents will be directly appended to the parent node without applying entity escaping. This provides a mechanism for gluing together XML or HTML containing arbitrary entities or strings of pre-assembled XML.
- All of Decker's documentation is now rendered with a custom Markdown processor (written in Lil, naturally), allowing Lil examples to be displayed with proper syntax highlighting. This also removes Decker's prior dependency on MultiMarkdown, mildly simplifying building from source.
- The RText interface now includes "rtext.replace[table keys replacements]", for performing reasonably efficient textual find-and-replace operations on rich text. In combination with "rtext.string[]", this can even be handy for general string find-and-replace.
Breaking Changes
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.
Migration
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.
Files
Get Decker
Decker
A multimedia sketchbook
Status | In development |
Category | Tool |
Author | Internet Janitor |
Tags | 1-bit, decker, ditherpunk, Game engine, HyperCard, Painting, zine |
Accessibility | Color-blind friendly, High-contrast, Interactive tutorial |
More posts
- Decker 1.5126 days ago
- Decker 1.5054 days ago
- Decker 1.4975 days ago
- Decker 1.4896 days ago
- Decker 1.47Jul 26, 2024
- Decker 1.46Jul 05, 2024
- Decker 1.45Jun 28, 2024
- Decker 1.44Jun 07, 2024
- Decker 1.43May 24, 2024
- Decker 1.42May 10, 2024
Comments
Log in with itch.io to leave a comment.
How do you do that syntax highlighting of lil code?
The entrypoint to the Lil syntax highlighter is the "highlight_to_html[]" function in lildoc.lil:
https://github.com/JohnEarnest/Decker/blob/main/scripts/lildoc.lil