in multimethod

Methods

in(symbol:Str, lib:CLib)
Unfinished feature. Don't use!
in(field:Str, obj:NormalTypeInstance)
Check whether NormalType (a type that is typically defined by user) instance has the given field.

Automatically called by NGS for syntax

field in obj

Returns

Bool

Example

type T; t=T(); t.x=1; "x" in t  # true
in(x:Any, h:Hash)
Check key presence in a Hash

Returns

Bool

Example

"a" in {"a": 1}  # true
"b" in {"a": 1}  # false
in(x:Any, e:Eachable1) Source: stdlib.ngs:1786
Checks whether element x is in Eachable1

Parameters

xNeedle
eHaystack

Returns

Bool

Example

 1 in [1,2,3].Iter()  # true
10 in [1,2,3].Iter()  # false
in(k:Any, hl:HashLike) Source: stdlib.ngs:2025
Check whether k is in the HashLike

Returns

Bool
in(x:Any, s:Set) Source: stdlib.ngs:2205
Check if the value is in the set

Returns

Bool
in(n:Int, r:NumRange) Source: stdlib.ngs:2670
Check whether the number is in range 10 in 10..20 # true 1 in 10..20 # false
in(x:Any, arr:Arr) Source: stdlib.ngs:2910
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
in(needle:Str, haystack:Str) Source: stdlib.ngs:4787
Determine if needle substring occurs at least once in haystack

Parameters

needleThe string to find
haystackThe string to search in

Returns

Bool

Example

"bc" in "abcd"
"x" not in "abcd"
in(k:Str, mp:MethodParams)
Check whether named parameter exists.