pkg_.update(P1;P2)
When applied to a package, returns a new package that is the union of
P1 and P2, with the values of P2
taking precedence.
Description
pkg_.update is a user-defined function (defined with
<def_ufun/>). If you are not running your query in GUI2,
pkg_.update will only work if you import the
pkg_ library: <import
path="default.library.types.pkg_"/>.
Syntax
pkg_.update(P1;P2)
Input
| Argument | Type | Description |
|---|---|---|
P1 |
any | The name of a package variable |
P2 |
any | The name of a second package variable |
Return Value
pkg_.update
returns a package that is the union of P1 and
P2.Example
<set p1="{pkg('key1' 'key2';'val1' 'val2')}" p2="{pkg('key3' 'key4';'val3' 'val4')}"/> <signal msg="{lst_to_str(pkg_names(pkg_.update(@p1;@p2));',')}"/>
In the example above, the package p1 contains
'key1' and 'key2', and the package
p2 contains 'key3' and
'key4'. pkg_.update returns a new package,
containing 'key1', 'key2',
'key3', and 'key4'.
