weak-pointer: return two values: value and whenever it is present

We do that to avoid confusion (like with hashtables).
This commit is contained in:
Daniel Kochmański 2019-05-23 15:11:18 +02:00
parent 5bcfb122f4
commit 3e0a8c63eb

View file

@ -1478,7 +1478,11 @@ si_weak_pointer_value(cl_object o)
FEwrong_type_only_arg(@[ext::weak-pointer-value], o,
@[ext::weak-pointer]);
value = (cl_object)GC_call_with_alloc_lock((GC_fn_type)ecl_weak_pointer_value, o);
@(return (value? value : ECL_NIL));
if (value) {
@(return value ECL_T);
} else {
@(return ECL_NIL ECL_NIL);
}
}
#endif /* GBC_BOEHM */