ja
)A sophisticated yet simply way to build a JSON array
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)
ja [start..end] -> <stdout>
ja [start..end.base] -> <stdout>
ja [start..end,start..end] -> <stdout>
ja [start..end][start..end] -> <stdout>
» 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.
Please read the documentation on a
for a more detailed breakdown on of ja
’s supported features.
count
): Count items in a map, list or arrayta
): A sophisticated yet simple way to build an array of a user defined data-type[ ..Range ]
: Outputs a ranged subset of data from stdin[ Index ]
): Outputs an element from an array, map or table[[ Element ]]
): Outputs an element from a nested structuremtac
): Reverse the order of an arraya
): A sophisticated yet simple way to stream an array or list (mkarray)%[]
Array Builder: Quickly generate arraysjson
: JavaScript Object Notation (JSON)This document was generated from builtins/core/mkarray/array_doc.yaml.
This site's content is rebuilt automatically from murex's source code after each merge to the master
branch. Downloadable murex binaries are also built with the website.
Last built on Wed Sep 18 21:18:57 UTC 2024 against commit c037883c03788357164e9846c84d9f777251495d9452a8e.
Current version is 6.3.4225 (develop) which has been verified against tests cases.