diff --git a/prolog/metta_lang/metta_types.pl b/prolog/metta_lang/metta_types.pl index 60cc59dd6e..fab1a5f9ed 100755 --- a/prolog/metta_lang/metta_types.pl +++ b/prolog/metta_lang/metta_types.pl @@ -441,7 +441,8 @@ % Ensure no repeated types using no_repeats_var/1. no_repeats_var(NoRepeatType), % Retrieve the type of the value. - get_type_each(Depth, Self, Val, Type), Type\=='', + call_nth(get_type_each(Depth, Self, Val, Type),Nth), Type\=='', + (Nth >1 -> Type\== 'Atom' ; true), % Ensure the type matches the expected no-repeat type. NoRepeatType = Type, Type = TypeO, @@ -618,6 +619,7 @@ trace_get_type(How, Type, gt(Val))), (trace_get_type('FAILED', '', gt(Val)), fail)). + %! get_type_cmpd_2nd_non_nil(+Depth, +Self, +Val, -Type, -How) is nondet. % % Determines the type of a compound value, ensuring that if multiple types