github.com/lmorg/murex@v0.0.0-20240217211045-e081c89cd4ef/docs/commands/prepend.md (about)

     1  # `prepend`
     2  
     3  > Add data to the start of an array
     4  
     5  ## Description
     6  
     7  `prepend` a data to the start of an array.
     8  
     9  ## Usage
    10  
    11  ```
    12  <stdin> -> prepend: value -> <stdout>
    13  ```
    14  
    15  ## Examples
    16  
    17  ```
    18  » a [January..December] -> prepend: 'New Year'
    19  New Year
    20  January
    21  February
    22  March
    23  April
    24  May
    25  June
    26  July
    27  August
    28  September
    29  October
    30  November
    31  December
    32  ```
    33  
    34  ## Detail
    35  
    36  `prepend` and `append` are data type aware:
    37  
    38  ```
    39  » tout json [1,2,3] -> append 4 5 6 bob
    40  Error in `append` (1,22): cannot convert 'bob' to a floating point number: strconv.ParseFloat: parsing "bob": invalid syntax
    41  ```
    42  
    43  ## Synonyms
    44  
    45  * `prepend`
    46  * `list.prepend`
    47  
    48  
    49  ## See Also
    50  
    51  * [`[ Index ]`](../parser/item-index.md):
    52    Outputs an element from an array, map or table
    53  * [`[[ Element ]]`](../parser/element.md):
    54    Outputs an element from a nested structure
    55  * [`a` (mkarray)](../commands/a.md):
    56    A sophisticated yet simple way to build an array or list
    57  * [`addheading` ](../commands/addheading.md):
    58    Adds headings to a table
    59  * [`append`](../commands/append.md):
    60    Add data to the end of an array
    61  * [`cast`](../commands/cast.md):
    62    Alters the data type of the previous function without altering it's output
    63  * [`count`](../commands/count.md):
    64    Count items in a map, list or array
    65  * [`ja` (mkarray)](../commands/ja.md):
    66    A sophisticated yet simply way to build a JSON array
    67  * [`match`](../commands/match.md):
    68    Match an exact value in an array
    69  * [`msort`](../commands/msort.md):
    70    Sorts an array - data type agnostic
    71  * [`mtac`](../commands/mtac.md):
    72    Reverse the order of an array
    73  * [`regexp`](../commands/regexp.md):
    74    Regexp tools for arrays / lists of strings
    75  
    76  <hr/>
    77  
    78  This document was generated from [builtins/core/lists/append_doc.yaml](https://github.com/lmorg/murex/blob/master/builtins/core/lists/append_doc.yaml).