← Back to team overview

opencog-dev team mailing list archive

overloaded getHandleSet

 

Hi all,

There are an awful lot of overloaded getHandleSet methods in AtomTable
that return HandleEntry pointers and in AtomSpace that return
OutputIterators.

Is there a reason for making them overloaded instead of making them
explicit in describing what type of Handle set they return?

i.e. getHandleSetByImportance(AttentionValue::sti_t,
AttentionValue::sti_t upperBound = 32767)
instead of
getHandleSet(AttentionValue::sti_t, AttentionValue::sti_t upperBound = 32767)

getHandleSetByTargets(Type*, bool*, Arity, Type type = ATOM, bool
subclass = true)
instead of
getHandleSet(Type*, bool*, Arity, Type type = ATOM, bool subclass = true)

For the latter example, there are several overloaded methods that get
a handle set by what atoms have certain targets, and it'd make sense
to leave these overloaded. Unfortunately, this change would take a
while to differentiate which of the overloaded method each call refers
to, but I think it'd be worth it to make the interface friendlier to
developers.

I guess whether to do this depends on more for_each iterators like
Linas created should be made for each equivalent getHandleSet...

Any thoughts?

J



Follow ups