summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorBen Morrison <ben@gbmor.dev>2019-05-22 03:24:58 -0400
committerBen Morrison <ben@gbmor.dev>2019-05-22 03:24:58 -0400
commit8e3bef29c6127b9ff33bb8d6f0481780f8a3568f (patch)
tree19807c02c9c5863c52cb29f6093c27765006b245
parent37bf8b04e76ea1cce678238af48ac8097348e655 (diff)
downloadgetwtxt-8e3bef29c6127b9ff33bb8d6f0481780f8a3568f.tar.gz
updated deps
-rw-r--r--go.mod2
-rw-r--r--go.sum2
2 files changed, 3 insertions, 1 deletions
diff --git a/go.mod b/go.mod
index 51db9ad..ac24743 100644
--- a/go.mod
+++ b/go.mod
@@ -5,7 +5,7 @@ go 1.11
 require (
 	github.com/BurntSushi/toml v0.3.1 // indirect
 	github.com/fsnotify/fsnotify v1.4.7
-	github.com/getwtxt/registry v0.0.0-20190521225739-b578f6a875b3
+	github.com/getwtxt/registry v0.0.0-20190522061646-f6f39419c495
 	github.com/gorilla/handlers v1.4.0
 	github.com/gorilla/mux v1.7.1
 	github.com/spf13/pflag v1.0.3
diff --git a/go.sum b/go.sum
index f6ededa..7b4aa5d 100644
--- a/go.sum
+++ b/go.sum
@@ -22,6 +22,8 @@ github.com/getwtxt/registry v0.0.0-20190521224220-3b3c30d8d5fc h1:M6hMpp1w2xHhs4
 github.com/getwtxt/registry v0.0.0-20190521224220-3b3c30d8d5fc/go.mod h1:BGSIALOFqIRj+ACLB8etWGUOgFAKN8oFDpCsw6YOdYQ=
 github.com/getwtxt/registry v0.0.0-20190521225739-b578f6a875b3 h1:fc/zPwk0Z5m4r4WkAU/1gB47ZEgMheREbtVQajjJXVc=
 github.com/getwtxt/registry v0.0.0-20190521225739-b578f6a875b3/go.mod h1:BGSIALOFqIRj+ACLB8etWGUOgFAKN8oFDpCsw6YOdYQ=
+github.com/getwtxt/registry v0.0.0-20190522061646-f6f39419c495 h1:QrgF2UddI9IsimmTSAGiQOqorPHvKqPbI9Md1D0Kxpc=
+github.com/getwtxt/registry v0.0.0-20190522061646-f6f39419c495/go.mod h1:BGSIALOFqIRj+ACLB8etWGUOgFAKN8oFDpCsw6YOdYQ=
 github.com/golang/protobuf v1.2.0 h1:P3YflyNX/ehuJFLhxviNdFxQPkGK5cDcApsge1SqnvM=
 github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
 github.com/golang/snappy v0.0.0-20180518054509-2e65f85255db h1:woRePGFeVFfLKN/pOkfl+p/TAqKOfFu+7KPlMVpok/w=
388 } /* Name.Builtin */ .highlight .nc { color: #bb0066; font-weight: bold } /* Name.Class */ .highlight .no { color: #003366; font-weight: bold } /* Name.Constant */ .highlight .nd { color: #555555 } /* Name.Decorator */ .highlight .ne { color: #bb0066; font-weight: bold } /* Name.Exception */ .highlight .nf { color: #0066bb; font-weight: bold } /* Name.Function */ .highlight .nl { color: #336699; font-style: italic } /* Name.Label */ .highlight .nn { color: #bb0066; font-weight: bold } /* Name.Namespace */ .highlight .py { color: #336699; font-weight: bold } /* Name.Property */ .highlight .nt { color: #bb0066; font-weight: bold } /* Name.Tag */ .highlight .nv { color: #336699 } /* Name.Variable */ .highlight .ow { color: #008800 } /* Operator.Word */ .highlight .w { color: #bbbbbb } /* Text.Whitespace */ .highlight .mb { color: #0000DD; font-weight: bold } /* Literal.Number.Bin */ .highlight .mf { color: #0000DD; font-weight: bold } /* Literal.Number.Float */ .highlight .mh { color: #0000DD; font-weight: bold } /* Literal.Number.Hex */ .highlight .mi { color: #0000DD; font-weight: bold } /* Literal.Number.Integer */ .highlight .mo { color: #0000DD; font-weight: bold } /* Literal.Number.Oct */ .highlight .sa { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Affix */ .highlight .sb { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Backtick */ .highlight .sc { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Char */ .highlight .dl { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Delimiter */ .highlight .sd { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Doc */ .highlight .s2 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Double */ .highlight .se { color: #0044dd; background-color: #fff0f0 } /* Literal.String.Escape */ .highlight .sh { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Heredoc */ .highlight .si { color: #3333bb; background-color: #fff0f0 } /* Literal.String.Interpol */ .highlight .sx { color: #22bb22; background-color: #f0fff0 } /* Literal.String.Other */ .highlight .sr { color: #008800; background-color: #fff0ff } /* Literal.String.Regex */ .highlight .s1 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Single */ .highlight .ss { color: #aa6600; background-color: #fff0f0 } /* Literal.String.Symbol */ .highlight .bp { color: #003388 } /* Name.Builtin.Pseudo */ .highlight .fm { color: #0066bb; font-weight: bold } /* Name.Function.Magic */ .highlight .vc { color: #336699 } /* Name.Variable.Class */ .highlight .vg { color: #dd7700 } /* Name.Variable.Global */ .highlight .vi { color: #3333bb } /* Name.Variable.Instance */ .highlight .vm { color: #336699 } /* Name.Variable.Magic */ .highlight .il { color: #0000DD; font-weight: bold } /* Literal.Number.Integer.Long */
title:Lil Quick Reference

Lil Quick Reference
===================
Types
-----
| `typeof`     | False      | Examples                              |
| :----------- | :--------- | :------------------------------------ |
| `"number"`   | `0`        | `42` `37.5` `-29999`                  |
| `"string"`   | `""`       | `"foo\nbar"`                          |
| `"list"`     | `()`       | `11,22,33` `list 3`                   |
| `"dict"`     | `()dict()` | `("a","b") dict 11,22`                |
| `"table"`    | n/a        | `table range 2` `insert a with 1 end` |
| `"function"` | n/a        | `on x y do x+y end`                   |

Primitives
----------
| Valence | Purpose    |                                                                              |
| :------ | :--------- | :--------------------------------------------------------------------------- |
| monad   | arithmetic | `-` `!` `floor` `cos` `sin` `tan` `exp` `ln` `sqrt` `mag` `unit` `heading`   |
| monad   | reducers   | `count` `first` `last` `sum` `prod` `min` `max` `raze`                       |
| monad   | data       | `range` `keys` `list` (enlist) `rows` `cols` `table` `typeof` `flip`         |
| dyad    | arithmetic | `+` `-` `*` `/` `%` (y mod x) `^` (pow) `&` (min) `|` (max)                  |
| dyad    | logical    | `<` `>` `=` (conforming equal) `~` (match) `unless` (x if y is `0`)          |
| dyad    | string     | `fuse` `split` `parse` `format` `like`                                       |
| dyad    | data       | `,` (concat) `@` (index each right) `dict` `take` `drop` `limit` `in`        |
| dyad    | joins      | `join` (natural join/zip) `cross` (cross join/cartesian product)             |

Flow
----
- `if bool ... end`
- `if bool ... else ... end`
- `if bool ... elseif bool ... else ... end` (etc)
- `each val key index in x ... end`
- `while bool ... end`
- `send name[args]`

Queries
-------
- `select  exprs clauses from y` reorder, compute, or filter a table
- `update  exprs clauses from y` modify rows/columns of a table in place
- `extract exprs clauses from y` like select, but yields non-tabular values
- `insert  c1 c2 with "A" 11 "B" 22 end` create a new table
- `insert  c1 c2 with "A" 11 "B" 22 into d` append to a table

- `exprs` can be any number of expressions in the forms:
	- an implicitly named bare expression (`id`, `2*index`)
	- an explicitly named expression (`ident:id`, `dogyears:7*age`)
	- a quoted name, for invalid identifiers (`"not a lil id":foo`)
	- if no expressions are provided, all columns will be returned, like `select *` in SQL

- `clauses` can be any sequence of the following, evaluated right to left:
	- `by a`: group rows by the unique values of column b
	- `where a`: filter rows by a boolean column a
	- `orderby a asc`/`orderby a desc`: sort rows, comparing values of column a as by `<`/`>`

- special columns/values available when computing any column expression:
	- `index`: magic column of original row numbers
	- `gindex`: magic column of current row number within group (or all rows if ungrouped)
	- `group`: magic column of row's group, by appearance (or `0` if ungrouped)
	- `column`: dictionary of the entire group's columns (or all rows if ungrouped)

Formatting
----------
A format is `%[name]*-0N.DX`: `*` skip, `0` pad, `N` width.
`-` is invert char class (`ro`) or left justify.
`.D` is decimal places (`fc`), size of char class (`ro`), or truncate to `D` characters.

| `X`       | Purpose  |                                                                                                |
| :-------- | :------- | :--------------------------------------------------------------------------------------------- |
| `%nmz`    | Parsing  | literal `%`, number of chars read, matches? matches to end?                                    |
| `ro`      | Matching | repeat (0 or more in char class), optional (0 or 1 in char class)                              |
| `sula`    | String   | string, uppercase string, lowercase string, ASCII chars                                        |
| `bficChH` | Number   | bool, float, int, currency (`-$1.23`), plain currency (`-1.23`), hex lowercase, hex uppercase  |
| `jep`     | Misc.    | JSON, unix epoch, time-parts {`year`, `month`, `day`, `hour`, `minute`, `second`}              |
| `qv`      | Lil      | quoted Lil string literal, Lil variable name                                                   |

Glob patterns for `like`:

- `.`: any single character.
- `#`: any single digit 0-9.
- `*`: 0 or more of any character.
- backtick escapes a subsequent special character.