On Mon, Aug 29, 2022 at 4:34 AM Marcin Błażejowski <marcin(a)wrzosy.nsb.pl> wrote:
Hi,
current git, the code below. In general: we look if given argument
exists in a bundle and if so we check its typeof().
The first end the second examples work fine, but at the third evaluation
of 'model_prior' looks like ommited we get error: "internal genr error:
aux node mismatch".
Marcin
<hansl>
set verbose off
function void FOO (bundle UserOpts)
bundle Overloadable
string arg_name, type_of
strings OverloadableKeys
Overloadable["bic_type"] = _(bic=1, hbic=2, ibic=3)
Overloadable["model_prior"] = _(binomial=1, betabinomial=2)
Overloadable["with_const"] = _(never=0, always=1, canbedropped=2)
OverloadableKeys = getkeys(Overloadable)
eval OverloadableKeys
loop i=1..nelem(OverloadableKeys) --quiet
arg_name = OverloadableKeys[i]
if inbundle(UserOpts, arg_name)
if typeof(UserOpts[arg_name]) == 4
type_of = "string"
else
type_of = "non-string"
endif
printf "Typeof %s is %s\n", arg_name, type_of
endif
endloop
end function
printf "The first examle:\n"
FOO(_(bic_type="bic", with_const=0))
printf "\nThe second examle:\n"
FOO(_(bic_type="bic", model_prior="binomial",
with_const="always"))
printf "\nThe third examle:\n"
FOO(_(bic_type="bic", model_prior="binomial", with_const=0))
</hansl>
That's now fixed in master. (It was already OK in the
"more_compilation" branch, but that's not yet ready for merging into
master.)
Allin