ja
(mkarray)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.
[[
(element): Outputs an element from a nested structure[
(index): Outputs an element from an array, map or table[
(range): Outputs a ranged subset of data from STDINa
(mkarray): A sophisticated yet simple way to build an array or listcount
: Count items in a map, list or arrayjson
: JavaScript Object Notation (JSON) (primitive)mtac
: Reverse the order of an arrayta
(mkarray): A sophisticated yet simple way to build an array of a user defined data-typeThis 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 Mon Feb 13 09:18:06 UTC 2023 against commit f339958f33995895c1d997efcdbb8408d2c8d45f8b5f934.
Current version is which has been verified against 13950 tests cases.