Arr type
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: 17
Constructors
- Arr(mm:MultiMethod)
Get methods of a MultiMethod Returns
Arr
- Arr() Source: stdlib.ngs:467
Make empty array Returns
[]
- Arr(al:ArrLike) Source: stdlib.ngs:1915
Get the underlying array
- Arr(h:Hash) Source: stdlib.ngs:3282
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:3304
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:3312
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:5136
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:3491
Repeat all elements in arr n times Parameters
arr Elements to repeat n Number of times to repeat the elements Returns
ArrExample
[10,20] * 2 # [10,20,10,20]
- *(a:Arr, b:Arr) Source: stdlib.ngs:3501
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
ArrExample
[1,2]+[3,4] # [1,2,3,4]
- -(a:Arr, b:Arr) Source: stdlib.ngs:3117
Filter out all values in a that are also in b Returns
ArrExample
[1,2,3] - [5,6,1] # [2,3]
- .(a:Arr, field:Str) Source: stdlib.ngs:2843
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
ArrExample
[{"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:2311
Undocumented Automatically called by NGS for syntax
SUBTYPE_OF_NAMEDINSTANCES.NamedInstances = ['SOME', 'NAMES', ...]
- .=(a:Arr, field:Str, e:Eachable1) Source: stdlib.ngs:2853
Set field of every element in array to corresponding item in e. Uses Iter(e) internally. Returns
aExample
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:2937
Compare arrays, element-wise. If all elements are equal, the longest array considered to be the "big" one. Returns
BoolExample
[1, 2] <= [1, 3] # true [1] <= [1, 2] # true
- ==(a:Arr, b:Arr) Source: stdlib.ngs:2922
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:1265
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:2954
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:3323
Get array element by index from the end (negative indexes handler). Throws IndexNotFound if abs(idx) > len(arr). Parameters
idx Negative index Example
[10,20,30][-1] # 30
- [](arr:Arr, r:NumRange) Source: stdlib.ngs:3347
Get array elements at specified indexes. Indexes specified by NumRange. Parameters
r NumRange with negative .end Returns
ArrExample
[10,20,30,40][1..-1] # [20,30]
- [](arr:Arr, r:PredRange) Source: stdlib.ngs:3396
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:3443
Get array elements at specified indexes. Parameters
arr Array to pick items from indexes Indexes of items to pick Returns
ArrExample
[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:3333
Set array element by index from the end (negative indexes handler). Throws IndexNotFound if abs(idx) > len(arr). Parameters
idx Negative index Example
a = [1, 2, 3]; a[-1] = 99 # [1, 2, 99]
- []=(arr:Arr, r:PredRange, replacement:Arr) Source: stdlib.ngs:3413
Replace array elements. Parameters
arr Array to operate on. r Range of elements to replace. replacement New 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:8663
Undocumented Automatically called by NGS for syntax
\name attr1=val1 attr2=val2 ... [ ... ]
- Argv(a:Arr)deprecated Source: stdlib.ngs:6644
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
actualExample
assert_hash_keys({}, ['kk']) # Throws TestFail. assert_hash_keys({'kk': 7}, ['kk']) # OK
- Box(a:Arr, idx:Int) Source: stdlib.ngs:4331
Convert array value indexed by the given index Parameters
idx key 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:3650
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:2751
Defines collector { ... collect(...) ... } behaviour for arrays Parameters
a Initial array body The body after collector keyword and possible initial value, wrapped in a function "collector THIS_CODE" or "collector/my_init THIS_CODE" Returns
Constructed arrayExample
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
resources Arr of Res
- Diff(a:Arr, b:Arr, full:Bool=false) Source: stdlib.ngs:4499
Compare arrays. Warning: by default Hash is used so internal Hash keys comparison is used, not == Parameters
full Do 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:4519
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:4535
Compare arrays. Warning: by default Hash is used so internal Hash keys comparison is used, not == Parameters
b Arr[PartialPresence] full Do not use Hash, work slower but use == comparison. Returns
ArrDiffExample
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:4558
Compare arrays. Warning: by default Hash is used so internal Hash keys comparison is used, not ==. Calls Diff(a, b.map(get), full) Parameters
b Arr[ExactPresence] full Do not use Hash, work slower but use == comparison. Returns
Diff
- digest(a:Arr, chunk_size:Int, marker:Str='(...)') Source: stdlib.ngs:7911
Convert an array to a possibly shorter version, for displaying to human. Parameters
chunk_size number of elements to retain at the beginning and at the end. marker how to mark the cut elements in the middle. Returns
ArrExample
my_array = Arr(1...100) digest(my_array, 2).each(echo) # 1 # 2 # (...) # 99 # 100
- each(arr:Arr, cb:Fun) Source: stdlib.ngs:3028
Iterates over the elements of arr, passing each in turn to cb along with args: cb(ITEM) Parameters
cb Function to be called with values from arr Returns
arrExample
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:3077
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
arr Items to iterate in chunks of n n Number of items in chunk cb Function to be called with values from arr Returns
arrExample
[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:3050
Iterates over the elements of arr, passing each in turn to cb along with index and args: cb(INDEX, ITEM) Returns
arrExample
[10,20,30].each_idx_val(F(idx, val) echo("Element #$idx equals to $val"))
- echo_cli(a:Arr)experimental Source: stdlib.ngs:8916
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:1936
Undocumented Parameters
t subtype of ArrLike Returns
of type t
- exec(argv:Arr, env:Hash=ENV) Source: stdlib.ngs:6652
Call EXECVE(2)
- exec(prog:Str, argv:Arr=[], env:Hash=ENV) Source: stdlib.ngs:6659
Call EXECVE(2) Parameters
argv argv, without the program
- fields(e:Eachable2, patterns:Arr) Source: stdlib.ngs:3943
Same as e.fields(AnyOf(patterns)) In some other languages, similar functionality is called "project". Example
{"a": 1, "b": 2}.fields(["a", "a2"]) # {"a": 1}
- finished_ok(p:Process, field_name:Str, ok:Arr)internal Source: stdlib.ngs:6383
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:2891
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
AnyExample
[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:3969
Create a Hash from Arr of Arr[2] Parameters
arr Array of Arrays. Each one of the sub-arrays must have exactly two elements. Returns
HashExample
Hash([['a', 1], ['c', 3]]) # {'a': 1, 'c': 3}
- Hash(keys:Arr, values:Arr) Source: stdlib.ngs:4006
Create a Hash from keys in "keys" and corresponding values in "values" Parameters
keys Keys for the new Hash values Values for the new Hash Returns
HashExample
Hash(["a", "b", "c"], [1,2,3]) # {"a": 1, "b": 2, "c": 3}
- in(x:Any, arr:Arr) Source: stdlib.ngs:2910
Checks whether element x is in array arr Parameters
x Needle arr Haystack Returns
BoolExample
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:3198
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
arr Items to look at pattern Test function or anything else acceptable by (=~), defaults to Bool.constructors start Index to start search at dflt default 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:3364
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=falseExample
%[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, pattern:Any) Source: stdlib.ngs:1008
Successful match constructor
- init(al:ArrLike, arr:Arr) Source: stdlib.ngs:1890
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
name name of the table for display and for configuration purposes rows_hashes rows, each row is a Hash
- init(t:Table, rows_hashes:Arr)
Create unnamed table containing provided rows
- init(tv:TableView, name:Any=null, view_name:Str=null, columns:Arr=null)
Undocumented
- init(t:Table, name:AnyOf(Str, Null), rows_hashes:Arr)
Create named table containing provided rows Parameters
name name of the table for display and for configuration purposes rows_hashes rows, 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:539
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:552
Internal method. Please do not use. Inspect Eachable1 Returns
Arr of Str
- inspect(path:Arr, x:Any)internal Source: stdlib.ngs:602
Internal method. Please do not use. For Type, NativeMethod, UserDefinedMethod Returns
Arr of Str
- inspect(path:Arr, mm:MultiMethod)internal Source: stdlib.ngs:617
Internal method. Please do not use. Inspect MultiMethod Returns
Arr of Str
- inspect(path:Arr, s:Str)internal Source: stdlib.ngs:624
Internal method. Please do not use. Inspect Str Returns
Arr of Str
- inspect(path:Arr, h:Any)internal Source: stdlib.ngs:631
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:644
Internal method. Please do not use. Inspect CommandsPipeline Returns
Arr of Str
- inspect(path:Arr, a:Set) Source: stdlib.ngs:2247
Inspect Set Returns
Arr of Str
- intersperse(a:Arr, delim:Any) Source: stdlib.ngs:3625
Insert delimiter element between each two elements in an array Returns
ArrExample
[1,2,3].intersperse(0) # [1,0,2,0,3]
- Iter(arr:Arr)
Calls ArrIter constructor. Returns
ArrIterExample
i = Iter([10, 20, 30])
- join(arr:Arr, s:Str)
Join strings using s as glue Parameters
arr Arr of Str
- join(a:Arr, sep:Arr) Source: stdlib.ngs:3265
EXPERIMENTAL! Do not use! Parameters
a Array of arrays to join sep Separator elements Example
[[1,2], [3,4]].join([10,20]) # [1,2,10,20,3,4]
- join(a:Arr, s:Str) Source: stdlib.ngs:3527
Join non-strings. Converts elements to string first, then uses native join(). Parameters
a Array to join s Delimiter Returns
StrExample
[1,2,3].join("::") # The string 1::2::3
- join(threads:Arr) Source: stdlib.ngs:5293
Joins threads. Parameters
threads Arr of Thread. Returns
Arr, the results from threads, in order.
- JsonData(arr:Arr) Source: stdlib.ngs:3315
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:3454
Truncate an array if necessary so it would have maximum l elements. Parameters
a Array to (possibly) truncate. l Maximum elements Returns
Either a or new Arr of length lExample
[10,11,12].limit(2) # [10,11] [10,11,12].limit(10) # [10,11,12]
- lines(f:File, lines_:Arr) Source: stdlib.ngs:6261
Write given lines to the file. Overwrites the file. Returns
Arr of Str
- map(arr:Arr, n:Int, mapper:Fun) Source: stdlib.ngs:3098
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
arr Items to iterate in chunks of n n Number of items in chunk mapper Function to be called with values from arr Returns
ArrExample
[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:3537
Merge sorted arrays. Parameters
lte Less-then-or-equal function to use for comparison of items in a and b Returns
ArrExample
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
AnyExample
a=[1,2]; a.pop() # 2, a is now [1]
- push(arr:Arr, v:Any)
Append item to an array. Returns
arrExample
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
- push(t:Table, row_arr:Arr)
Append given row to the table Returns
t
- rand(a:Arr) Source: stdlib.ngs:8332
Pick one random element from array Returns
Any
- reverse(arr:Arr) Source: stdlib.ngs:3236
Make new array which is a reversed given array Returns
ArrExample
[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:3566
Sort an array. Parameters
lte Less-then-or-equal function to use for comparison of the items in a Returns
ArrExample
sort([0,5,3,-1], (<=)) # [-1, 0, 3, 5]
- sort(a:Arr, field:Str, lte:Fun=method) Source: stdlib.ngs:3579
Sort an array based on field value Parameters
lte Less-then-or-equal function to use for comparison of the items' fields Returns
ArrExample
[{'x': 1}, {'x': 5}, {'x': 3}].sort('x') # [{'x': 1}, {'x': 3}, {'x': 5}]
- stdlib_aws_straighten_tags(a:Arr) Source: stdlib.ngs:7181
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:4740
Convert Arr to string Returns
Str
- subset(smaller:Arr, larger:Arr) Source: stdlib.ngs:3012
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:82
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:3254
Prepend one element to the given array Returns
Modified arrExample
x=[1,2] x.unshift(3) echo(x) # Outputs: [3,1,2]
- ~(arr:Arr, r:PredRange) Source: stdlib.ngs:3424
Check whether the array contains the given range. Finds first match. Returns
MatchResultExample
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
argv Command line arguments, typically ARGV udm UserDefinedMethod 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
cb Must return an array. regions() sets ._Region in the result and flattens the results Returns
ArrExample
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