Less Lua Table Shift
Jake Russo
Quarrel DesignerJust moments ago, I came upon a possible alternative route that I can take in the syntax. This route would lead to a schism in one area and a new unification in another. Perhaps the piece left alone is better that way. The two unified, well, that's a whole 'nother story...
It came to me while I was thinking about the table key'd values. I didn't really like how I had to mix positional semantics with named semantics. I think that it's fair to say, this is cognitively dissonant.
Then as I was imagining what other way we could do it, it dawned on me: the routine pattern => body
syntax is sort of "adjacent" to hash lookup. It's also been something I've wanted to support; where you can actually allow a routine's pattern to be a lookup value. So, it almost seems like the perfect place to put the hash-table semantics.
So what kind of syntax? We have <...>
available but I didn't want to use it for anything that is multi-line as I don't think it looks "correct" when you have a declaration separated over multiple lines.
So after a few days of soul-searching, I think I've arrived at a nice compromise that adds an extra symbol (but many of Quarrel's operators are multi-symbol) and allows for a differentiation between what I am currently calling "data maps" and "routine maps".
#
MapsMaps are a new feature for Quarrel that allows you to implement a common paradigm in programming. Often called, associative arrays
One of the hardest challenges with designing syntax (especially in this fashion of thoughtful aesthetic and mnemonic review), is not using a symbol in two separate places that would be in "contact" with each other. Keeping them separated (in usage) will help ensure that they are definitively different in the user's head. Meaning, when someone looks at a chunk of code, the use of a symbol doesn't require too much mental wrangling to separate what usage is displayed. For lack of better words: so that it "feels right".
#
Pattern BracketsHere, we have a rewrite of the Elixir queue example:
Here we have the D version:
#
Syndicate State MachineWondering if the <{...}>
circumfix operator could be used for defining actors:
When condition's context is internal to an instance of a Baz contract which allows \argname
access to the parametere names.
Fields use the named argument/parameter syntax.