integer限定でよければこういう方法も

Max_integer(params*) {
o := object()
Loop % params.MaxIndex() {
o[params[a_index]] := true
}
Return, o.MaxIndex()
}