github.com/lmorg/murex@v0.0.0-20240217211045-e081c89cd4ef/builtins/core/lists/mtac_doc.yaml (about)

     1  - DocumentID: mtac
     2    Title: >+
     3      `mtac`
     4    CategoryID: commands
     5    Summary: >-
     6      Reverse the order of an array
     7    Description: |-
     8      `mtac` takes input from STDIN and reverses the order of it.
     9  
    10      It's name is derived from a program called `tac` - a tool that functions
    11      like `cat` but returns the contents in the reverse order. The difference
    12      with the `mtac` builtin is that it is data-type aware. So it doesn't just
    13      function as a replacement for `tac` but it also works on JSON arrays,
    14      s-expressions, and any other data-type supporting arrays compiled into
    15      Murex.
    16    Usage: |-
    17      ```
    18      <stdin> -> mtac -> <stdout>
    19      ```
    20    Examples: |-
    21      ```
    22      » ja [Monday..Friday] -> mtac
    23      [
    24          "Friday",
    25          "Thursday",
    26          "Wednesday",
    27          "Tuesday",
    28          "Monday"
    29      ]
    30  
    31      # Normal output (without mtac)
    32      » ja [Monday..Friday]
    33      [
    34          "Monday",
    35          "Tuesday",
    36          "Wednesday",
    37          "Thursday",
    38          "Friday"
    39      ]
    40      ```
    41    Flags:
    42    Detail: |-
    43      Please bare in mind that while Murex is optimised with concurrency and
    44      streaming in mind, it's impossible to reverse an incomplete array. Thus all
    45      all of STDIN must have been read and that file closed before `mtac` can
    46      output.
    47  
    48      In practical terms you shouldn't notice any difference except for when
    49      STDIN is a long running process or non-standard stream (eg network pipe).
    50    Synonyms:
    51      - mtac
    52      - list.reverse
    53    Related:
    54      - a
    55      - ja
    56      - ta
    57      - count
    58      - 2darray
    59      - append
    60      - prepend
    61      - suffix
    62      - prefix
    63      - jsplit
    64      - msort
    65      - pretty
    66      - map