Methods

setΒΆ

set(obj:Any, attr:Str, val:Any)

Sets the given attribute to the given value
Source: stdlib.ngs:147

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
}