Arr type

Array - ordered list of items accessed by zero-based index

Example

x = ["first", "second", "third", "fourth"]

echo(x)
# Output:
#   [first,second,third,fourth]

echo(x.len())
# Output:
#   4

echo(x[1])
# Output:
#   second

echo(x[10])
# ... Exception of type IndexNotFound occurred ...

Direct parent types

Eachable1
Eachable which each() calls the callback with one argument
Direct subtypes: 16

Constructors

Arr(mm:MultiMethod)
Get methods of a MultiMethod

Returns

Arr
Arr() Source: stdlib.ngs:408
Make empty array

Returns

[]
Arr(al:ArrLike) Source: stdlib.ngs:1520
Get the underlying array
Arr(h:Hash) Source: stdlib.ngs:2854
Make Arr from Hash. Each key/value pair becomes two-items array.

Returns

Arr of form [[k1, v1], [k2, v2], ...]

Example

Arr({'x': 7, 'y': 8})  # [['x', 7], ['y', 8]]
Arr(something:Eachable1) Source: stdlib.ngs:2876
Convert Eachable1 (anything with "each" method that takes callback of one parameter) to an array

Example

Arr(1..3)   # [1,2]
Arr(1...3)  # [1,2,3]
Arr(arr:Arr) Source: stdlib.ngs:2884
Make Arr from Arr. A no-op.

Returns

arr
Arr(g:Doc::Group)
Get all items (children) of document elements group

Returns

Arr

Methods

"$*"(components:Arr) Source: stdlib.ngs:4724
String expansion handler. Called automatically for every double-quoted string that has $* components.

Automatically called by NGS for syntax

"abc$*{something}def"

Example

"$*{ENV.PATH.split(":")}/od".filter(File(X))  # Find out where in PATH is the "od" binary
*(arr:Arr, n:Int) Source: stdlib.ngs:3062
Repeat all elements in arr n times

Parameters

arrElements to repeat
nNumber of times to repeat the elements

Returns

Arr

Example

[10,20] * 2  # [10,20,10,20]
*(a:Arr, b:Arr) Source: stdlib.ngs:3072
Cartesian product

Returns

Arr of Arr[2]

Example

[10,20] * [30,40]  # [[10, 30], [10, 40], [20, 30], [20, 40]]
+(a:Arr, b:Arr)
Array concatenation.

Returns

Arr

Example

[1,2]+[3,4]  # [1,2,3,4]
-(a:Arr, b:Arr) Source: stdlib.ngs:2689
Filter out all values in a that are also in b

Returns

Arr

Example

[1,2,3] - [5,6,1]  # [2,3]
.(a:Arr, field:Str) Source: stdlib.ngs:2415
Return array made of given field of each element of given array. Will throw KeyNotFound if any of the elements does not have the desired field. Use get() to handle missing field differently.

Returns

Arr

Example

[{"x": 1}, {"x": 2}].x               # [1, 2]
[{"x": 1}, {"y": 2}].x               # KeyNotFound exception
[{"x": 1}, {"y": 2}].get("x")        # [1] - skip
[{"x": 1}, {"y": 2}].get("x", null)  # [1, null] - use default value
.=(t:Type, field:Str, a:Arr) Source: stdlib.ngs:1837
Undocumented

Automatically called by NGS for syntax

SUBTYPE_OF_NAMEDINSTANCES.NamedInstances = ['SOME', 'NAMES', ...]
.=(a:Arr, field:Str, e:Eachable1) Source: stdlib.ngs:2425
Set field of every element in array to corresponding item in e. Uses Iter(e) internally.

Returns

a

Example

a=[{"x": 1}, {"x": 2}]
a.y = [10, 20]
# a == [{"x": 1, "y": 10}, {"x": 2, "y": 20}]
<=(a:Arr, b:Arr) Source: stdlib.ngs:2509
Compare arrays, element-wise. If all elements are equal, the longest array considered to be the "big" one.

Returns

Bool

Example

 [1, 2] <= [1, 3]  # true
 [1] <= [1, 2]     # true
==(a:Arr, b:Arr) Source: stdlib.ngs:2494
Arrays equality test. True if arrays are of the same length and all elements are equal (==)

Returns

Bool
=~(x:Any, a:Arr, mc:MatchContext) Source: stdlib.ngs:924
Checks that 1. The x is Eachable1 but not Str or Int 2. Each element of x matches (=~) corresponding element in a (If number of elements does not match - there is no match)
>=(a:Arr, b:Arr) Source: stdlib.ngs:2526
Compare arrays, element-wise. If all elements are equal, the longest array considered to be the "big" one. Exactly the same as b <= a.

Returns

Bool
[](arr:Arr, range:NumRange)
Get array elements at specified indexes.

Returns

Arr
[](arr:Arr, idx:Int)
Get element at the given index or throw IndexNotFound if the index is out of range (element at the given index does not exist).

Returns

Any
[](arr:Arr, idx:Int) Source: stdlib.ngs:2895
Get array element by index from the end (negative indexes handler). Throws IndexNotFound if abs(idx) > len(arr).

Parameters

idxNegative index

Example

[10,20,30][-1]  # 30
[](arr:Arr, r:NumRange) Source: stdlib.ngs:2919
Get array elements at specified indexes. Indexes specified by NumRange.

Parameters

rNumRange with negative .end

Returns

Arr

Example

[10,20,30,40][1..-1]  # [20,30]
[](arr:Arr, r:PredRange) Source: stdlib.ngs:2967
Extract array elements between the element that matches r.start and the element that matches r.end . Starting and ending elements are optionally included, depending on r.include_start and r.include_end .

Example

%[a1 a2 b1 b2][/^a/../^b/]   # ['a2']
%[a1 a2 b1 b2][/^a/.../^b/]  # ['a1', 'a2', 'b1']
%[a1 a2 b1 b2][/^a/.../^x/]  # IndexNotFound exception
[](arr:Arr, indexes:Arr) Source: stdlib.ngs:3014
Get array elements at specified indexes.

Parameters

arrArray to pick items from
indexesIndexes of items to pick

Returns

Arr

Example

[10,20,30,40][[0,3]]  # [10, 40]
[]=(arr:Arr, range:NumRange, replacement:Arr)
Set array elements at specified indexes.

Returns

replacement
[]=(arr:Arr, idx:Int, v:Any)
Set element at the given index or throw IndexNotFound if the index is out of range.

Returns

v
[]=(arr:Arr, idx:Int, val:Any) Source: stdlib.ngs:2905
Set array element by index from the end (negative indexes handler). Throws IndexNotFound if abs(idx) > len(arr).

Parameters

idxNegative index

Example

a = [1, 2, 3]; a[-1] = 99  # [1, 2, 99]
[]=(arr:Arr, r:PredRange, replacement:Arr) Source: stdlib.ngs:2984
Replace array elements.

Parameters

arrArray to operate on.
rRange of elements to replace.
replacementNew elements.

Example

a = %[a1 a2 b1 b2]
a[/^a/.../^b/] = [7]  # a == [7, 'b2']
MARKERS = '# generated - start'..'# generated - end'
text[MARKERS] = newly_generated_content_lines
\(name:Str, attributes:Hash, children:Arr)experimental Source: stdlib.ngs:8023
Undocumented

Automatically called by NGS for syntax

\name attr1=val1 attr2=val2 ... [ ... ]
Argv(a:Arr)deprecated Source: stdlib.ngs:6202
Deprecated. Do not use!
assert_hash_keys(actual:Any, expected:Arr, title:Str='Must be a hash with keys')
Assert actual is a Hash and it has the expected keys. Throws TestFail.

Returns

actual

Example

assert_hash_keys({}, ['kk'])  # Throws TestFail.
assert_hash_keys({'kk': 7}, ['kk'])  # OK
Box(a:Arr, idx:Int) Source: stdlib.ngs:3847
Convert array value indexed by the given index

Parameters

idxkey to look in hash

Returns

Box. FullBox if the array has the element indexed by idx, EmptyBox otherwise.

Example

my_array = [10, 20]
my_array.Box(1).map(X*2).each(echo)
# output: 40
my_array.Box(5).map(X*2).each(echo)
# no output
c_execve(filename:Str, argv:Arr, envp:Arr)
Call EXECVE(2)
c_ffi_call(cif:c_ffi_cif, fn:CSym, argv:Arr)
Unfinished feature. Don't use!
c_ffi_prep_cif(rtype:c_ffi_type, atypes:Arr)
Unfinished feature. Don't use!
c_poll(fds_evs:Arr, timeout:Int)
Undocumented
calculate_num_cols_to_show(t:Table, max_columns_widths:Arr, available_cols:Int)
Internal method. Please do not use.
cell_display_width(x:Arr)
Calculate cell display width for an array
cell_display_width(x:Arr)
Calculate cell display width for an empty array
code(a:Arr) Source: stdlib.ngs:3221
Convert an array to NGS code that would produce the array when executed. Not fully functional yet.

Returns

Str
collector(a:Arr, body:Fun) Source: stdlib.ngs:2299
Defines collector { ... collect(...) ... } behaviour for arrays

Parameters

aInitial array
bodyThe body after collector keyword and possible initial value, wrapped in a function "collector THIS_CODE" or "collector/my_init THIS_CODE"

Returns

Constructed array

Example

items = collector {
  collect(10)
  for(i;2) collect(i)
  collect(20)
}
echo(items)  # Outputs: [10,0,1,20]

# Or start with few items:
items = collector/[100,200] {
  collect(10)
  for(i;2) collect(i)
  collect(20)
}
echo(items)  # Outputs: [100,200,10,0,1,20]
copy(arr:Arr)
Shallow copy of arr

Returns

Arr
created(rd:ResDef, resources:Arr, props:Hash)
Called by create() on new resources. Appends the new resources to the list and runs update(). Don't call directly.

Parameters

resourcesArr of Res
Diff(a:Arr, b:Arr, full:Bool=false) Source: stdlib.ngs:4089
Compare arrays. Warning: by default Hash is used so internal Hash keys comparison is used, not ==

Parameters

fullDo not use Hash, work slower but use == comparison.

Example

Diff([1,2], [2,3])  # .add = [3] .remove = [1]
Diff(a:Arr, b:Arr, eq:Fun)experimental Source: stdlib.ngs:4109
EXPERIMENTAL! Do not use! Compare arrays using eq as equality test. 2*n*m comparisons

Returns

ArrDiff
Diff(a:Arr, b:Arr, full:Bool=false) Source: stdlib.ngs:4125
Compare arrays. Warning: by default Hash is used so internal Hash keys comparison is used, not ==

Parameters

bArr[PartialPresence]
fullDo not use Hash, work slower but use == comparison.

Returns

ArrDiff

Example

Diff([1,2,3], [Present(1)])  # <ArrDiff add=[] remove=[]>
Diff([1,2,3], [Present(5)])  # <ArrDiff add=[5] remove=[]>
Diff([1,2,3], [Absent(1)])   # <ArrDiff add=[] remove=[1]>
Diff([1,2,3], [Absent(5)])   # <ArrDiff add=[] remove=[]>
Diff(["a", "b"], [Present("a"), Present("c"), Absent("b"), Absent("d")])  # <ArrDiff add=[c] remove=[b]>
Diff(a:Arr, b:Arr, full:Bool=false) Source: stdlib.ngs:4148
Compare arrays. Warning: by default Hash is used so internal Hash keys comparison is used, not ==. Calls Diff(a, b.map(get), full)

Parameters

bArr[ExactPresence]
fullDo not use Hash, work slower but use == comparison.

Returns

Diff
digest(a:Arr, chunk_size:Int, marker:Str='(...)') Source: stdlib.ngs:7321
Convert an array to a possibly shorter version, for displaying to human.

Parameters

chunk_sizenumber of elements to retain at the beginning and at the end.
markerhow to mark the cut elements in the middle.

Returns

Arr

Example

my_array = Arr(1...100)
digest(my_array, 2).each(echo)
# 1
# 2
# (...)
# 99
# 100
each(arr:Arr, cb:Fun) Source: stdlib.ngs:2600
Iterates over the elements of arr, passing each in turn to cb along with args: cb(ITEM)

Parameters

cbFunction to be called with values from arr

Returns

arr

Example

s=0
[1,2,3].each(F(i) { global s; s+=i })
echo(s)  # Outputs: 6
each(arr:Arr, n:Int, cb:Fun) Source: stdlib.ngs:2649
Process each N elements of an Array at a time. Throws InvalidArgument if number of items in arr is not divisible by n. cb is called as cb(eltI, ..., eltJ) where I is multiple of n and J is I+n-1

Parameters

arrItems to iterate in chunks of n
nNumber of items in chunk
cbFunction to be called with values from arr

Returns

arr

Example

[1,2,3,4].each(2, F(a, b) echo("$a - $b"))  # Outputs: "1 - 2" and on the next line "3 - 4"
each_idx_val(arr:Arr, cb:Fun) Source: stdlib.ngs:2622
Iterates over the elements of arr, passing each in turn to cb along with index and args: cb(INDEX, ITEM)

Returns

arr

Example

[10,20,30].each_idx_val(F(idx, val) echo("Element #$idx equals to $val"))
echo_cli(a:Arr)experimental Source: stdlib.ngs:8236
Echo the value as a table before exiting the program, when the value is a result of evaluating the whole program. Only works with TTY and when each element of the array is a Hash and all elements have the same keys.
ensure(x:Arr, t:Type) Source: stdlib.ngs:1541
Undocumented

Parameters

tsubtype of ArrLike

Returns

of type t
exec(argv:Arr, env:Hash=ENV) Source: stdlib.ngs:6210
Call EXECVE(2)
exec(prog:Str, argv:Arr=[], env:Hash=ENV) Source: stdlib.ngs:6217
Call EXECVE(2)

Parameters

argvargv, without the program
finished_ok(p:Process, field_name:Str, ok:Arr)internal Source: stdlib.ngs:5941
Decide whether a process finished normally.

Example

$(ok:[0,1,2] ls no-such-file)
get(a:Arr, idx:Int, dflt:Any=null) Source: stdlib.ngs:2463
Get element at the given index or return dflt if the index is out of range (element at the given index does not exist)

Returns

Any

Example

[1,2,3].get(0, 10)    # 1
[1,2,3].get(5, 10)    # 10
[11].get(-1)          # 11
[10,20].get(-5, "X")  # "X"
Hash(arr:Arr) Source: stdlib.ngs:3486
Create a Hash from Arr of Arr[2]

Parameters

arrArray of Arrays. Each one of the sub-arrays must have exactly two elements.

Returns

Hash

Example

Hash([['a', 1], ['c', 3]])  # {'a': 1, 'c': 3}
Hash(keys:Arr, values:Arr) Source: stdlib.ngs:3522
Create a Hash from keys in "keys" and corresponding values in "values"

Parameters

keysKeys for the new Hash
valuesValues for the new Hash

Returns

Hash

Example

Hash(["a", "b", "c"], [1,2,3])  # {"a": 1, "b": 2, "c": 3}
in(x:Any, arr:Arr) Source: stdlib.ngs:2482
Checks whether element x is in array arr

Parameters

xNeedle
arrHaystack

Returns

Bool

Example

 1 in [1,2,3]  # true
10 in [1,2,3]  # false
index(arr:Arr, pattern:Any=method, start:Int=0, dflt:Any=block) Source: stdlib.ngs:2770
Find index of the first value that matches the pattern. TODO: Make it work on anything with each() method. In future, will throw exception if element is not found and default is not provided. Now returns null for backwards compatibility in this case.

Parameters

arrItems to look at
patternTest function or anything else acceptable by (=~), defaults to Bool.constructors
startIndex to start search at
dfltdefault value to return when element is not found

Returns

Int or dflt. Temporary also null, for backwards compatibility.

Example

[1,2,11,3,4].index(X>10)  # 2
indexes(arr:Arr, r:PredRange, dflt:Any=block) Source: stdlib.ngs:2936
Find the indexes of elements of the given PredRange. Throws IndexNotFound if there is no match between the elements of arr and r.

Returns

NumRange with .include_start=true and .include_end=false

Example

%[a1 a2 b1 b2 c1].indexes(/^a/../^b/)   # <NumRange 1..2 include_start=true include_end=false step=1>
%[a1 a2 b1 b2 c1].indexes(/^a/.../^b/)  # <NumRange 0..3 include_start=true include_end=false step=1>
init(ms:MatchSuccess, matches:Arr)deprecated Source: stdlib.ngs:750
Successful match constructor
init(ms:MatchSuccess, matches:Arr, pattern:Any) Source: stdlib.ngs:753
Successful match constructor
init(al:ArrLike, arr:Arr) Source: stdlib.ngs:1495
Undocumented
init(i:ArrIter, arr:Arr)
ArrIter constructor.

Example

i = ArrIter([10, 20, 30])
init(rd:AWS::SecGroup, anchor:Arr)deprecated
Initialize SecGroup from Arr of [name, vpc_id].
init(pmy:ParamsMatchY, args:Arr, kwargs:Hash)
Undocumented
init(ds:DelimStr, a:Arr, delim:Str=':')
DelimStr constructor
init(n:Doc::Node, name:Str, children:Arr=null, **attrs:Hash)
Initialize document node

Example

Doc::Node('span', class='inline-param') with [
	Doc::Text(param.name)
	Doc::Text(':')
	Doc::Text(param.type.name)
	...
]
init(g:Doc::Group, children:Arr=null, **attrs:Hash)
Initialize document nodes group

Example

Doc::Group() with [
	Doc::Text('something')
	...
]
init(t:Table, name:Any, rows_hashes:Arr)
Create named table containing provided rows

Parameters

namename of the table for display and for configuration purposes
rows_hashesrows, each row is a Hash
init(t:Table, rows_hashes:Arr)
Create unnamed table containing provided rows
inspect(path:Arr, val:Any)internal Source: stdlib.ngs:475
Internal method. Please do not use. Inspect any value.

Returns

Arr with exactly one Str of the form <TYPE_NAME ...>
inspect(path:Arr, e:Eachable1)internal Source: stdlib.ngs:488
Internal method. Please do not use. Inspect Eachable1

Returns

Arr of Str
inspect(path:Arr, x:Any)internal Source: stdlib.ngs:537
Internal method. Please do not use. For Type, NativeMethod, UserDefinedMethod

Returns

Arr of Str
inspect(path:Arr, mm:MultiMethod)internal Source: stdlib.ngs:546
Internal method. Please do not use. Inspect MultiMethod

Returns

Arr of Str
inspect(path:Arr, s:Str)internal Source: stdlib.ngs:553
Internal method. Please do not use. Inspect Str

Returns

Arr of Str
inspect(path:Arr, h:Any)internal Source: stdlib.ngs:560
Internal method. Please do not use. Inspect Hash and similar data structures

Returns

Arr of Str
inspect(path:Arr, cp:CommandsPipeline)internal Source: stdlib.ngs:573
Internal method. Please do not use. Inspect CommandsPipeline

Returns

Arr of Str
inspect(path:Arr, a:Set) Source: stdlib.ngs:1773
Inspect Set

Returns

Arr of Str
intersperse(a:Arr, delim:Any) Source: stdlib.ngs:3196
Insert delimiter element between each two elements in an array

Returns

Arr

Example

[1,2,3].intersperse(0)  # [1,0,2,0,3]
Iter(arr:Arr)
Calls ArrIter constructor.

Returns

ArrIter

Example

i = Iter([10, 20, 30])
join(arr:Arr, s:Str)
Join strings using s as glue

Parameters

arrArr of Str
join(a:Arr, sep:Arr) Source: stdlib.ngs:2837
EXPERIMENTAL! Do not use!

Parameters

aArray of arrays to join
sepSeparator elements

Example

[[1,2], [3,4]].join([10,20])  # [1,2,10,20,3,4]
join(a:Arr, s:Str) Source: stdlib.ngs:3098
Join non-strings. Converts a elements to string first, then uses built-in join().

Parameters

aArray to join
sDelimiter

Returns

Str

Example

[1,2,3].join("::")  # The string 1::2::3
join(threads:Arr) Source: stdlib.ngs:4874
Joins threads.

Parameters

threadsArr of Thread.

Returns

Arr, the results from threads, in order.
JsonData(arr:Arr) Source: stdlib.ngs:2887
Convert Arr into JSON compatible data structure - array
len(arr:Arr)
Get number of elements in the array

Returns

Int
limit(a:Arr, l:Int) Source: stdlib.ngs:3025
Truncate an array if necessary so it would have maximum l elements.

Parameters

aArray to (possibly) truncate.
lMaximum elements

Returns

Either a or new Arr of length l

Example

[10,11,12].limit(2)   # [10,11]
[10,11,12].limit(10)  # [10,11,12]
lines(f:File, lines_:Arr) Source: stdlib.ngs:5819
Write given lines to the file. Overwrites the file.

Returns

Arr of Str
map(arr:Arr, n:Int, mapper:Fun) Source: stdlib.ngs:2670
Map each N elements of an Array at a time. mapper is called as cb(eltI, ..., eltJ) where I is multiple of n and J is I+n-1 Throws InvalidArgument if number of items in arr is not divisible by n. mapper is called as mapper(eltI, ..., eltJ) where I is multiple of n and J is I+n-1

Parameters

arrItems to iterate in chunks of n
nNumber of items in chunk
mapperFunction to be called with values from arr

Returns

Arr

Example

[1,2,3,4].map(2, F(a,b) "$a=$b").join("&")  # Outputs: 1=2&3=4
merge_sorted(a:Arr, b:Arr, lte:Fun) Source: stdlib.ngs:3108
Merge sorted arrays.

Parameters

lteLess-then-or-equal function to use for comparison of items in a and b

Returns

Arr

Example

merge_sorted([1,3,10], [0, 7], (<=))  # [0, 1, 3, 7, 10]
MultiMethod(methods:Arr)
Construct MultiMethod from the given methods

Returns

MultiMethod
pop(arr:Arr)
Pop item from an array. Removes last item in array and returns it. Throws EmptyArrayFail.

Returns

Any

Example

a=[1,2]; a.pop()  # 2, a is now [1]
push(arr:Arr, v:Any)
Append item to an array.

Returns

arr

Example

a=[1,2]; a.push(3)  # a is now [1,2,3]
push(t:Table, row_arr:Arr)
Append given row to the table

Returns

t
rand(a:Arr) Source: stdlib.ngs:7715
Pick one random element from array

Returns

Any
reverse(arr:Arr) Source: stdlib.ngs:2808
Make new array which is a reversed given array

Returns

Arr

Example

[1,2,3].reverse()  # [3,2,1]
shift(arr:Arr)
Get the first element and remove it from the array. Throws EmptyArrayFail if there are no elements in the array.

Returns

Any
shift(arr:Arr, dflt:Any)
Get the first element and remove it from the array. Returns dlft if there are no elements in the array.

Returns

Any
sort(a:Arr, lte:Fun=method) Source: stdlib.ngs:3137
Sort an array.

Parameters

lteLess-then-or-equal function to use for comparison of the items in a

Returns

Arr

Example

sort([0,5,3,-1], (<=))  # [-1, 0, 3, 5]
sort(a:Arr, field:Str, lte:Fun=method) Source: stdlib.ngs:3150
Sort an array based on field value

Parameters

lteLess-then-or-equal function to use for comparison of the items' fields

Returns

Arr

Example

[{'x': 1}, {'x': 5}, {'x': 3}].sort('x')  # [{'x': 1}, {'x': 3}, {'x': 5}]
stdlib_aws_straighten_tags(a:Arr) Source: stdlib.ngs:6699
Do not use directly. Subject to change. Convert "Tags" array in each element of AWS resources (typically returned by AWS CLI) into Hash. Makes "Tags" much more usable.
Str(a:Arr) Source: stdlib.ngs:4330
Convert Arr to string

Returns

Str
subset(smaller:Arr, larger:Arr) Source: stdlib.ngs:2584
Undocumented
tr(x:Any, a:Arr, tc:TrContext)
Match / transform x using the pattern in a

Returns

Lit or TrCommand
Type(t:Str, doc:Any, ns:Any, parents:Arr) Source: stdlib.ngs:78
Create a new type. Do not use directly.

Automatically called by NGS for syntax

type MyType2([MyParent1, MyParent2, ...])
unshift(arr:Arr, elt:Any) Source: stdlib.ngs:2826
Prepend one element to the given array

Returns

Modified arr

Example

x=[1,2]
x.unshift(3)
echo(x)  # Outputs: [3,1,2]
~(arr:Arr, r:PredRange) Source: stdlib.ngs:2995
Check whether the array contains the given range. Finds first match.

Returns

MatchResult

Example

a = %[a1 a2 b1 b2]
m = a ~ /^a/../^b/ # Exclusive range
# m.matches == [['a2']]
# m.before == ['a1']
# m.after == ['b1', 'b2']
~(argv:Arr, udm:UserDefinedMethod)
Please do not use directly! Tries to match command line arguments with closure parameters.

Parameters

argvCommand line arguments, typically ARGV
udmUserDefinedMethod to match with

Returns

Match (ParamsMatchY on success, ParamsMatchN on failure). If ParamsMatchY is returned it has "matches" field with values in suitable order to call c. If ParamsMatchN is returned, it has "message" field explaining why there was no match. Currently it's not printed anywhere.

Example

ArgvMatcher; (["--b", "B", "A", "C"] ~ F(a,b,c) 7).matches  # %[A B C]
(["A", "C", "D", "--b", "B"] ~ ArgvMatcher("positionals", "a") do F(a,b) 7).matches  # %[%[A C D] B]
AWS::util::world_open_port(port:Arr, proto:Str='tcp')
Undocumented
AWS::util::world_open_ip_proto(proto:Arr)
Undocumented
AWS2::regions(cb:Fun, regs:Arr=[])
Call cb in parallel threads, each with AWS region name as argument.

Parameters

cbMust return an array. regions() sets ._Region in the result and flattens the results

Returns

Arr

Example

ins = AWS2::regions({ ``aws ec2 describe-instances --region $A $*filters`` })
AWS2::regions(cp:CommandsPipeline, regs:Arr=[])
Undocumented
Doc::transform(dps:Arr, transformer:Any)
Undocumented
Doc::visit(p:Doc::Part, cb:Fun, parents:Arr=[])
Undocumented