Dict
@Js
const mixin Dict
Dict is an immutable map of name/value pairs.
Return string for debugging only
Get the value for the given name or null if name not mapped
Return if the there are no name/value pairs
Return true if this dictionary does not contain given name
Return true if this dictionary contains given name
Get the id tag as a Ref or raise CastErr/UnknownNameErr
Get the value mapped by the given name
Iterate through the name/value pairs until the given function returns non-null, then break the iteration and return resulting object
Iterate through the name/value pairs
Get display string for the dict
virtual Str dis()
Get display string for the dict. The default routes to Etc.dictToDis or fallback on toStr.
abstract Void each(|Obj,Str| f)
Iterate through the name/value pairs
abstract Obj? eachWhile(|Obj,Str->Obj?| f)
Iterate through the name/value pairs until the given function returns non-null, then break the iteration and return resulting object. Return null if function returns null for every name/value pair.
@Operator
abstract Obj? get(Str name)
Get the value for the given name or null if name not mapped
abstract Bool has(Str name)
Return true if this dictionary contains given name
virtual Ref id()
Get the id tag as a Ref or raise CastErr/UnknownNameErr
abstract Bool isEmpty()
Return if the there are no name/value pairs
abstract Bool missing(Str name)
Return true if this dictionary does not contain given name
virtual Str toStr()
Return string for debugging only
abstract Obj? trap(Str name, Obj?[]? args)
Get the value mapped by the given name. If it is not mapped to a non-null value, then throw an UnknownNameErr.