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:64
IndexNotFound exception constructor

Returns

IndexNotFound object with the given message, container and key fields
init(e:InstantiatingAbstractType, t:Type) Source: stdlib.ngs:91
Initializes InstantiatingAbstractType.
init(al:ArrLike, field:Str='items') Source: stdlib.ngs:649
ArrLike constructor

Parameters

fieldname of the field that holds the underlying array
init(hl:HashLike, h:Hash=null) Source: stdlib.ngs:753
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:775
Hook constructor.

Returns

Hook
init(e:CException, message:Str) Source: stdlib.ngs:996
CException constructor. In addition to storing message field, adds errno and errno_name fields.
init(e:CException, errno:Int, message:Str) Source: stdlib.ngs:1004
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:1029
Initialize LockFail exception.
init(l:Lock) Source: stdlib.ngs:1033
Initialize Lock. Creates and initializes pthread_mutex.
init(l:ReentrantLock) Source: stdlib.ngs:1082
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:1166
Range constructor. Throws InstantiatingAbstractType if r is exactly of type Range (not a sub-type).
init(b:FullBox, *args:Arr) Source: stdlib.ngs:2685
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:2698
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:2894
Initialize Success with the given value.
init(f:Failure, e:Exception) Source: stdlib.ngs:2897
Initialize Failure with the given value.
init(s:Stats, a:Arr) Source: autoload/Stats.ngs:20
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:3639
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:3660
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:3665
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:3670
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:3750
Initializes ExitException.
init(ee:ExitException, exit_code:Int=1) Source: stdlib.ngs:3754
Undocumented
init(p:Path, s:Str) Source: stdlib.ngs:3979
Path constructor

Parameters

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

Parameters

otherPath to duplicate
init(pipe:Pipe) Source: stdlib.ngs:4237
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:4249
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:4307
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:4313
Create File object from the given file descriptor.
init(f:File, path:Path) Source: stdlib.ngs:4317
Undocumented
init(r:Redir, fd:Any, marker:Any, datum:Any) Source: stdlib.ngs:4440
Initialize Redir object. Used internally for commands syntax.

Automatically called by NGS for syntax

$(my_prog >my_file)
init(p:Process, c:Command) Source: stdlib.ngs:4545
Process constructor. Initializes fields.
init(my:MatchY, matches:Arr) Source: stdlib.ngs:5261
Successful match constructor
init(mf:MatchFail, msg:Str, container:Any, pattern:Any) Source: stdlib.ngs:5297
Initialize MatchFail.
init(s:SubSeq, val:Any) Source: stdlib.ngs:5300
SubSec construcor
init(t:Time) Source: stdlib.ngs:5850
Initialize Time object with current time.
init(t:Time, epoch:Int) Source: stdlib.ngs:5855
Initialize Time object with the given epoch time.
init(t:Time, s:Str, format:Str) Source: stdlib.ngs:5859
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:758
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:847
Initialize Instance (ResDef) from kwargs
init(rd:AWS2::Zone, Name:Str) Source: autoload/AWS2.ngs:1344
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:16
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(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