- DocumentID: a
  Title: >+
    `a` (mkarray)
  CategoryID: commands
  Summary: >-
    A sophisticated yet simple way to build an array or list
  Description: |-
    Pronounced "make array", like `mkdir` (etc), Murex has a pretty sophisticated
    builtin for generating arrays. Think like bash's `{1..9}` syntax:

    ```
    a: [1..9]
    ```

    Except Murex also supports other sets of ranges like dates, days of the week,
    and alternative number bases.
  Usage: |-
    {{ include "gen/includes/mkarray-range-usage.inc.md" }}
  Examples: |-
    ```
    » a: [1..3]
    1
    2
    3

    » a: [3..1]
    3
    2
    1

    » a: [01..03]
    01
    02
    03
    ```
  Flags:
  Detail: |-
    ### Advanced Array Syntax

    The syntax for `a` is a comma separated list of parameters with expansions
    stored in square brackets. You can have an expansion embedded inside a
    parameter or as it's own parameter. Expansions can also have multiple
    parameters.

    ```
    » a: 01,02,03,05,06,07
    01
    02
    03
    05
    06
    07
    ```

    ```
    » a: 0[1..3],0[5..7]
    01
    02
    03
    05
    06
    07
    ```
    
    ```
    » a: 0[1..3,5..7]
    01
    02
    03
    05
    06
    07
    ```
    
    ```
    » a: b[o,i]b
    bob
    bib
    ```

    You can also have multiple expansion blocks in a single parameter:

    ```
    » a: a[1..3]b[5..7]
    a1b5
    a1b6
    a1b7
    a2b5
    a2b6
    a2b7
    a3b5
    a3b6
    a3b7
    ```

    `a` will cycle through each iteration of the last expansion, moving itself
    backwards through the string; behaving like an normal counter.

    ### Creating JSON arrays with `ja`

    As you can see from the previous examples, `a` returns the array as a
    list of strings. This is so you can stream excessively long arrays, for
    example every IPv4 address: `a: [0..254].[0..254].[0..254].[0..254]`
    (this kind of array expansion would hang bash).

    However if you needed a JSON string then you can use all the same syntax
    as `a` but forgo the streaming capability:

    ```
    » ja: [Monday..Sunday]
    [
        "Monday",
        "Tuesday",
        "Wednesday",
        "Thursday",
        "Friday",
        "Saturday",
        "Sunday"
    ]
    ```

    This is particularly useful if you are adding formatting that might break
    under `a`'s formatting (which uses the `str` data type).

    ### Smart arrays

    Murex supports a number of different formats that can be used to generate
    arrays. For more details on these please refer to the documents for each format

    {{ include "gen/includes/autogenerated.mkarray.inc.md" }}
  Synonyms:
  Related:
  - parser/create-array
  - range
  - count
  - index
  - element
  - mtac
  - ja
  - ta
  - types/str


- DocumentID: ja
  Title: >+
    `ja` (mkarray)
  CategoryID: commands
  Summary: >-
    A sophisticated yet simply way to build a JSON array
  Description: |-
    Murex has a pretty sophisticated builtin for generating JSON arrays.
    It works a little bit like Bash's `{1..9}` syntax but includes a few
    additional nifty features.

    **Please note that while this builtin is not marked for deprecation, it has
    been superseded by the `%[]` tokens.** ([read more](../parser/create-array.md))
  Usage: |-
    ```
    ja: [start..end] -> <stdout>
    ja: [start..end.base] -> <stdout>
    ja: [start..end,start..end] -> <stdout>
    ja: [start..end][start..end] -> <stdout>
    ```
  Examples: |-
    ```
    » ja: [1..5]
    [
        "1",
        "2",
        "3",
        "4",
        "5"
    ]
    ```

    ```
    » ja: [Monday..Sunday]
    [
        "Monday",
        "Tuesday",
        "Wednesday",
        "Thursday",
        "Friday",
        "Saturday",
        "Sunday"
    ]
    ```

    Please note that as per the first example, all arrays generated by `ja` are
    arrays of strings - even if you're command is ranging over integers.
  Flags:
  Detail: |-
    Please read the documentation on `a` for a more detailed breakdown on of
    `ja`'s supported features.
  Synonyms:
  Related:
  - parser/create-array
  - range
  - count
  - index
  - element
  - mtac
  - a
  - ta
  - types/json


- DocumentID: ta
  Title: >+
    `ta` (mkarray)
  CategoryID: commands
  Summary: >-
    A sophisticated yet simple way to build an array of a user defined data-type
  Description: |-
    Murex has a pretty sophisticated builtin for generating arrays. It works
    a little bit like Bash's `{1..9}` syntax but includes a few additional nifty
    features and the output format is user defined.
  Usage: |-
    ```
    ta: data-type [start..end] -> <stdout>
    ta: data-type [start..end.base] -> <stdout>
    ta: data-type [start..end,start..end] -> <stdout>
    ta: data-type [start..end][start..end] -> <stdout>
    ```
  Examples: |-
    ```
    » ta: json [1..5]
    [
        "1",
        "2",
        "3",
        "4",
        "5"
    ]
    ```

    ```
    » ta: json [Monday..Sunday]
    [
        "Monday",
        "Tuesday",
        "Wednesday",
        "Thursday",
        "Friday",
        "Saturday",
        "Sunday"
    ]
    ```

    Please note that as per the first example, all arrays generated by `ta` are
    arrays of strings - even if you're command is ranging over integers. Also
    if you are only creating arrays in JSON then you could use `ja` instead.
  Flags:
  Detail: |-
    Please read the documentation on `a` for a more detailed breakdown on of
    `ta`'s supported features.
  Synonyms:
  Related:
  - parser/create-array
  - range
  - count
  - index
  - element
  - mtac
  - a
  - ja
