set multimethod

Methods

set(obj:Any, field:Str, val:Any) Source: stdlib.ngs:228
Sets the given field to the given value

Returns

The modified obj

Example

s.len() != 1 throws InvalidArgument("ord() argument must be of length 1 exactly").set('given', s)
# Would else be written as
if s.len() != 1 {
	e = InvalidArgument("ord() argument must be of length 1 exactly")
	e.given = s
	throw e
}
set(obj:Any, **kwargs:Hash) Source: stdlib.ngs:236
Sets the given fields to the given values

Returns

The modified obj

Example

my_cond throws InvalidArgument("Out of range").set(min=0, max=10, given=12)