Skip to content

v0.54.0

Choose a tag to compare

@github-actions github-actions released this 03 Dec 14:35
· 7 commits to master since this release
a82a975

Highlights

Masks by name, on anything that holds cells. Pass a mask first, straight to text, a list, a grid or a 3D list. ->grid() isn't needed first any more:

fn get_tree_count(input: string): number {
  return $input->shapes(Tree, rotated)->count()
}

$input->shapes([Block, Ell], rotated)        // several masks at once
$input->shapes(Block, square, of: '#')       // masks and built-in shapes together

rotated turns a mask every way the input allows: back to front along a row, four quarter turns in a grid, and all 24 orientations in 3D (where points also have a layer).

Masks are just pictures. Every layout character matches a cell holding the same character, so symbols only lists the exceptions, and any marks a cell that isn't part of the shape:

type Tree extends Mask {
  layout: ```text
    #.#
    ...
    #.#
    ```
  symbols: { '.': any }
}

A blank line in a layout starts the next layer. Hovering a mask's name draws its picture with a legend.

Cleaner suggestions in calls. An argument slot offers only what it can take: no stray variables after a comma, each flag once as its bare word (rotated, never rotated:), and nothing that's already written. Signature help stays open and highlights the parameter you're on, and ->shapes() shows one form at a time.

Breaking changes

  • like: is removed from ->shapes(). Write the mask first: ->shapes(like: Tree) becomes ->shapes(Tree). The quick fix rewrites the call.
  • null in a mask's symbols is now any, with a quick fix.
  • Mask members are written with :. layout = ... is an error with a fix.
  • New mask checks: an empty layout, a layout that's all any, a tab in the picture, layers of different heights, a symbol longer than one character, and a symbol listed twice are errors. KS6025 warns about a character mapped to itself, and KS6026 fades a symbol the layout doesn't use. Each comes with a fix.
  • of:, size:, radius: and distance: given beside only masks are errors, with a fix that removes them.

Run kscript update to get this release.

What's Changed

Full Changelog: v0.53.0...v0.54.0