mixin

Dict

@Js
const mixin Dict

Dict is an immutable map of name/value pairs.

methods toStr

Return string for debugging only

get

Get the value for the given name or null if name not mapped

isEmpty

Return if the there are no name/value pairs

missing

Return true if this dictionary does not contain given name

has

Return true if this dictionary contains given name

id

Get the id tag as a Ref or raise CastErr/UnknownNameErr

trap

Get the value mapped by the given name

eachWhile

Iterate through the name/value pairs until the given function returns non-null, then break the iteration and return resulting object

each

Iterate through the name/value pairs

dis

Get display string for the dict

dis virtual Str dis()

Get display string for the dict. The default routes to Etc.dictToDis or fallback on toStr.

each abstract Void each(|Obj,Str| f)

Iterate through the name/value pairs

eachWhile 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.

get @Operator
abstract Obj? get(Str name)

Get the value for the given name or null if name not mapped

has abstract Bool has(Str name)

Return true if this dictionary contains given name

id virtual Ref id()

Get the id tag as a Ref or raise CastErr/UnknownNameErr

isEmpty abstract Bool isEmpty()

Return if the there are no name/value pairs

missing abstract Bool missing(Str name)

Return true if this dictionary does not contain given name

toStr virtual Str toStr()

Return string for debugging only

trap 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.

Haxall 4.0.5 ∙ 24-Feb-2026 14:33 EST