g

G programming language. For random text generation.

View project on GitHub

Table Functions

**Coming in Version 0.2**

@append

Lazy

Inputs: table and an expression

@get

Inputs: a table and an index or label

Return the item in the table corresponding to the index or label.

>>>@a: @labeled(
...       a | A |
...       b | B |
...       c | C )
>>>@get(@a|a)
A
>>>@b: @table(a|b|c)
>>>@get(0)
a

@set

Inputs: three ordered arguments:

  1. a table
  2. an index or label
  3. the update value

Mutate the table with a given value.

>>>@a: @labeled(
...       a | A |
...       b | B |
...       c | C )
>>>@set(@a|a|B)
>>>@get(@a|a)
B