v0.0.10 Release Notes
Eager Operators
We introduced the eager operators facility to further reduce the number of parenthesis pairs needed for expressing simple and thus possibly common structures. For example until now a labelled list needed parens around the list itself since Label was just an ordinary operator and tried to bind to its immediate neighbour.
a: (1 2 3) >> this was necessary to make the Label belong to the list
a: 1 2 3 >> now this is the standard notation for the same tree
Of course the example at the first line still works and produces the exact same result, but as you will see the renderer doesn't output the parens anymore, as it's just noise with the new syntax.
Generally speaking, eager operators try to grab entire lists as their arguments, whenever it's possible, instead of trying to bind to their immediate neighbours.
We have three eager operators at the moment: Label, Eval and Graft.
They all allow the forming of implicit lists in the directions of their
arguments, or directionality for short. Labels support chainging, so for example
a: 1 2 b: 3 4 is a List of two labelled lists.
Of course this means that the syntax has changed in a breaking way as earlier version would parse this input as a List of four elements with two labeled elements in it. Here are some examples to showcase how explicit grouping requirements changes:
(a: 1) 2 (b: 3) 4 >> list of four elements, two labeled in it
1 2 3 => >> now evaluates the tree instead of the last element
1 2 (3 =>) >> evaluates only the last element
_+_ <- 1 2 >> grafts 1 2 onto the stem
In all these cases eager operators create implicit lists or imps around themselves for their arguments. When the exact rules and exceptions settle a bit, I will include the precise details and ruleset of imping in the specification.
Imping and New Parser Architecture
To be able to properly implement imping, we separated tokenization and binding into two separate passes in the parser. Tokenization converts the stream input tokens into Idea objects, while creating an unbinded tree hierarchy out of them at the same time. The unbinded tree creation is controlled by the explicit parenthesises and eager operators present in the line. Explicit parens always overrule implicit list creation attempts, that allows overriding default behavior in intuitive ways.
This modularized and thus more flexible design has the added benefit, that now binding happens on an actual tree. This separates binding from string processing, and offers the possibility of partial unbinding and rebinding, which will be important later.
Demo
Please check out the belonging demo video .