init multimethod

Methods

init(e:Exception, message:Str) Source: bootstrap.ngs:7
Initialize an Exception.

Parameters

messageGoes into .message

Returns

Exception with .backtrace and .message
init(e:Exception, cause:Exception) Source: bootstrap.ngs:13
Initialize an Exception.

Returns

Exception with .backtrace and .cause
init(e:Exception, message:Str, cause:Exception) Source: bootstrap.ngs:19
Initialize an Exception.

Returns

Exception with .backtrace, .message, and .cause
init(h:Hash) Source: stdlib.ngs:31
Trivial initialization helper for init(o, ...) Sets object fields from the supplied parameters

Example

# sets t.a and t.b
F init(t:MyType, a, b) init(args())
init(e:IndexNotFound, message:Str, container:Any, key:Any) Source: stdlib.ngs:68
IndexNotFound exception constructor

Returns

IndexNotFound object with the given message, container and key fields
init(e:InstantiatingAbstractType, t:Type) Source: stdlib.ngs:95
Initializes InstantiatingAbstractType.
init(al:ArrLike) Source: stdlib.ngs:695
Undocumented
init(al:ArrLike, field:Str=null) Source: stdlib.ngs:705
Throws NotImplemented if field is specified

Parameters

fieldDEPRECATED name of the field that holds the underlying array.
init(al:ArrLike, arr:Arr) Source: stdlib.ngs:710
Undocumented
init(hl:HashLike, h:Hash=null) Source: stdlib.ngs:837
Create a HashLike.

Parameters

hIf provided, used as initial value.

Example

HashLike(%{a aha b bee}) # <HashLike a=aha b=bee>
init(hook:Hook) Source: stdlib.ngs:859
Hook constructor.

Returns

Hook
init(e:CException, message:Str) Source: stdlib.ngs:1115
CException constructor. In addition to storing message field, adds errno and errno_name fields.
init(e:CException, errno:Int, message:Str) Source: stdlib.ngs:1123
CException constructor. In addition to storing message field, adds errno and errno_name fields.
init(e:LockFail, op:Str, code:Int, msg:Str) Source: stdlib.ngs:1148
Initialize LockFail exception.
init(l:Lock) Source: stdlib.ngs:1152
Initialize Lock. Creates and initializes pthread_mutex.
init(l:ReentrantLock) Source: stdlib.ngs:1201
Initialize Lock. Creates and initializes PTHREAD_MUTEX_RECURSIVE pthread_mutex.
init(r:Range, start:Any, end:Any, include_start:Any=true, include_end:Any=false, step:Any=1) Source: stdlib.ngs:1295
Range constructor. Throws InstantiatingAbstractType if r is exactly of type Range (not a sub-type).
init(b:FullBox, *args:Arr) Source: stdlib.ngs:2824
Do not use directly! Helper constructor that throws InvalidArgument when FullBox is created with zero or more than one argument.
init(b:FullBox, val:Any) Source: stdlib.ngs:2837
FullBox constructor. Saves val into .val

Example

# Simplified code from the_one() method:
ret = EmptyBox()
something.each(F(elt) {
	if predicate(elt) {
		ret throws ElementNotFound("the_one() had more than one match")
		ret = FullBox(elt)
	}
})
not(ret) throws ElementNotFound("the_one() had no matches")
ret.val # Has the value
init(s:Success, v:Any) Source: stdlib.ngs:3036
Initialize Success with the given value.
init(f:Failure, e:Exception) Source: stdlib.ngs:3039
Initialize Failure with the given value.
init(s:Stats, a:Arr) Source: stdlib.ngs:3776
Makes Stats, with each element in the array counted as if push()ed

Example

Stats(['a', 'a', 'b']).Hash()  # {'a': 2, 'b': 1}
init(t:Thread, name:Str, f:Fun, arg:Any) Source: stdlib.ngs:3831
Creates and runs a thread. The code that the created thread runs is f, which is passed arg.
init(t:Thread, f:Fun, arg:Any) Source: stdlib.ngs:3852
Creates and runs a thread. The code that the created thread runs is f, which is passed arg.
init(t:Thread, f:Fun) Source: stdlib.ngs:3857
Creates and runs a thread. The code that the created thread runs is f without arguments.
init(t:Thread, name:Str, f:Fun) Source: stdlib.ngs:3862
Creates and runs a thread. The code that the created thread runs is f without arguments.
init(ee:ExitException, message:Str, exit_code:Int=1) Source: stdlib.ngs:3946
Initializes ExitException.
init(ee:ExitException, exit_code:Int=1) Source: stdlib.ngs:3950
Undocumented
init(p:Path, s:Str) Source: stdlib.ngs:4139
Path constructor

Parameters

spath
init(p:Path, other:Path) Source: stdlib.ngs:4145
Path constructor. Duplicates other Path.

Parameters

otherPath to duplicate
init(pp:ProcessesPipeline, cp:CommandsPipeline) Source: stdlib.ngs:4321
Undocumented
init(pr:ProcessRedir, cr:CommandRedir) Source: stdlib.ngs:4328
Undocumented
init(pr:ProcessRedir, fd:Any, marker:Any, datum:Any) Source: stdlib.ngs:4333
Undocumented
init(pipe:Pipe) Source: stdlib.ngs:4437
Pipe constructor. Create UNIX pipe using PIPE(2). Throws PipeCreateFail if pipe can not be created.

Example

p = Pipe()
init(pipe:Pipe, other:Pipe) Source: stdlib.ngs:4449
Initializes Pipe, copying read_fd and write_fd from another Pipe.

Example

my_pipe = ...
second_pipe = Pipe(my_pipe)
init(f:File, path:Str) Source: stdlib.ngs:4507
Create File object from the given path. The file is not open.

Example

f = File('/tmp/myfile')
init(f:File, fd:Int) Source: stdlib.ngs:4513
Create File object from the given file descriptor.
init(f:File, path:Path) Source: stdlib.ngs:4517
Undocumented
init(r:CommandRedir, fd:Any, marker:Any, datum:Any) Source: stdlib.ngs:4640
Initialize CommandRedir object. Used internally for commands syntax.

Automatically called by NGS for syntax

$(my_prog >my_file)
init(p:Process, c:Command) Source: stdlib.ngs:4809
Process constructor. Initializes fields.
init(ms:MatchSuccess, matches:Arr) Source: stdlib.ngs:5550
Successful match constructor
init(mf:MatchFailure, data:Any, pattern:Any) Source: stdlib.ngs:5554
Unsuccessful construtcor
init(s:SubSeq, val:Any) Source: stdlib.ngs:5592
SubSec construcor
init(lines:Lines, s:Str) Source: autoload/Lines.ngs:11
Split s to strings using end-of-line separators. UNIX and Windows line endings supported (Windows - not tested yet). Warning: Max OS <= 9 line separation of CR (\r) is not supported

Example

"xx\nyy".lines()  # %[xx yy]
init(lines:Lines, backtrace:Backtrace, parent_backtrace:Any=null) Source: stdlib.ngs:6089
Convert Backtrace to human-readable format

Example

Lines(bt).echo()
init(t:Time) Source: stdlib.ngs:6232
Initialize Time object with current time.
init(t:Time, epoch:Int) Source: stdlib.ngs:6237
Initialize Time object with the given epoch time.
init(t:Time, s:Str, format:Str) Source: stdlib.ngs:6241
Undocumented
init(rd:ResDef, anchor:Any) Source: autoload/Res.ngs:8
Undocumented
init(rd:ResDef) Source: autoload/Res.ngs:25
Creates resource definition with empty Hash anchor.
init(i:MapIter, upstream_iter:Iter, mapper:Fun) Source: autoload/Iter.ngs:111
EXPERIMENTAL! Do not use!
init(i:FilterIter, upstream_iter:Iter, predicate:Any, invert_predicate:Bool=false) Source: autoload/Iter.ngs:129
EXPERIMENTAL! Do not use!
init(i:FunIter, f:Fun) Source: autoload/Iter.ngs:193
Undocumented
init(i:ConstIter, val:Any) Source: autoload/Iter.ngs:225
Constant iterator constructor.

Parameters

valthe constant value to use in next() and peek()
init(i:RangeIter, r:NumRange) Source: autoload/Iter.ngs:248
Initialize RangeIter. Will throw NotImplemented if r.start or r.step are not Int
init(i:ArrIter, arr:Arr) Source: autoload/Iter.ngs:296
ArrIter constructor.

Example

i = ArrIter([10, 20, 30])
init(i:HashIter, h:Hash) Source: autoload/Iter.ngs:336
HashIter constructor.

Example

i = HashIter({"a": 1, "b": 2})
init(r:Res, def:ResDef, props:Hash) Source: autoload/Res.ngs:124
Stores def and props in r
init(rd:AWS::ResDef, **kw:Hash) Source: autoload/AWS.ngs:168
Initialize ResDef from kw. Defaults: null for .regions and empty hash for .Tags
init(rd:AWS::ResDef, _ngs_name:Str) Source: autoload/AWS.ngs:180
Initialize ResDef from _ngs_name. Sets .regions to null, .Tags to empty hash and .Name to _ngs_name.
init(rd:AWS::ResDef, _ngs_tags:Hash) Source: autoload/AWS.ngs:183
Initialize ResDef from _ngs_tags. Sets .regions to null and .Tags to _ngs_tags.
init(rd:AWS::SecGroup, anchor:Arr)deprecated Source: autoload/AWS.ngs:496
Initialize SecGroup from Arr of [name, vpc_id].
init(rd:AWS::SecGroup, Name:Str, VpcId:Any) Source: autoload/AWS.ngs:503
Initialize SecGroup from security group name and vpc.

Example

AWS::SecGroup("https-server", AWS::Vpc(...))
init(rd:AWS::Instance, **kwargs:Hash) Source: autoload/AWS.ngs:759
Initialize Instance (ResDef) from kwargs
init(rd:AWS2::ResDef, **kw:Hash) Source: autoload/AWS2.ngs:175
Initialize ResDef from kw. Defaults: null for ._Region and empty hash for .Tags
init(rd:AWS2::ResDef, _ngs_tags:Hash) Source: autoload/AWS2.ngs:187
Initialize ResDef from _ngs_tags. Sets ._Region to null and .Tags to _ngs_tags.
init(p:AWS2::Parameter, res_type:Type, param_name:Str, param_value:Any) Source: autoload/AWS2.ngs:227
Undocumented
init(rd:AWS2::SecGroup, GroupName:Str, VpcId:Any) Source: autoload/AWS2.ngs:607
Initialize SecGroup from security group name and vpc.

Example

AWS::SecGroup("https-server", AWS::Vpc(...))
init(rd:AWS2::Instance, **kwargs:Hash) Source: autoload/AWS2.ngs:848
Initialize Instance (ResDef) from kwargs
init(rd:AWS2::Zone, Name:Str) Source: autoload/AWS2.ngs:1340
Undocumented
init(pmy:ParamsMatchY, args:Arr, kwargs:Hash) Source: autoload/ArgvMatcher.ngs:15
Undocumented
init(ds:DelimStr, s:Str, delim:Str=':') Source: autoload/DelimStr.ngs:9
DelimStr constructor
init(ds:DelimStr, a:Arr, delim:Str=':') Source: autoload/DelimStr.ngs:15
DelimStr constructor
init(n:Doc::Node, name:Str, children:Arr=null, **attrs:Hash) Source: autoload/Doc.ngs:50
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) Source: autoload/Doc.ngs:60
Initialize document nodes group

Example

Doc::Group() with [
	Doc::Text('something')
	...
]
init(t:Doc::Textual, txt:Str) Source: autoload/Doc.ngs:67
Initialize text fragment of a document

Example

Doc::Text(':')
init(s:Set) Source: autoload/Set.ngs:7
Initialize a set
init(s:Set, e:Eachable1) Source: autoload/Set.ngs:12
Convert array to set
init(t:Table, name:Any=null) Source: autoload/Table.ngs:33
Initialize rows to an empty array
init(t:Table, name:Any, rows_hashes:Arr) Source: autoload/Table.ngs:47
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) Source: autoload/Table.ngs:59
Create unnamed table containing provided rows
init(tf:TestFail, message:Str) Source: autoload/test.ngs:10
Initialize TestFail.
init(tr:TestsResults) Source: autoload/TestsResults.ngs:7
Undocumented
init(mp:MethodParams, f:Fun) Source: autoload/MethodParams.ngs:7
Undocumented
init(mp:MethodParam, h:Hash) Source: autoload/MethodParam.ngs:23
Initialize MethodParam from params() array element
init(tvi:ThisVersionIndex)
Undocumented
init(md:MarkdownDescription, tvi:ThisVersionIndex, output_name:Str, file_path:Path)
Undocumented
init(nd:NamespaceDescription, namespace:Hash)
Undocumented
init(nd:NamespaceDescription, containing_nd:NamespaceDescription, name:Str, namespace:Hash)
Undocumented
init(gnd:GlobalNamespaceDescription, this_version_index:Any)
Undocumented
init(td:TypeDescription, containing_nd:NamespaceDescription, name:Str, type:Type)
Undocumented
init(mmd:MultiMethodDescription, containing_nd:NamespaceDescription, name:Str, multimethod:MultiMethod)
Undocumented
init(md:MethodDescription, method:Fun)
Undocumented
init(md:MethodDescription, containing_nd:NamespaceDescription, name:Str, mmd:MultiMethodDescription, method:Fun)
Undocumented
init(md:MethodDescription, containing_nd:NamespaceDescription, name:Str, method:Fun)
Undocumented
init(t:Terminal, fd_in:Int, fd_out:Int) Source: autoload/Terminal.ngs:31
Undocumented
init(t:Terminal) Source: autoload/Terminal.ngs:37
Undocumented
init(at:AnsiTerminal, *args:Arr) Source: autoload/AnsiTerminal.ngs:8
Undocumented
init(it:ItermTerminal, *args:Arr) Source: autoload/ItermTerminal.ngs:40
Undocumented