I am seeking a way to retrieve the value of an argument irrespective of it's functor.
I have a domain for attributes of a person:
Code: Select all
personAtr =
last(string);
first(string);
.....
hundredslater(string).
I could retrieve that string value by:
Code: Select all
class predicates
get_memberValue : (personAtr) -> string.
clauses
get_memberValue(last(Value)) = Value :-
!.
get_memberValue(first(Value)) = Value :-
!.
....
get_memberValue(hundredslater(Value)) = Value :-
!.
OR
I am seeking magic predicate/function that behaves like this:
Code: Select all
get_value_with_magic_arg_extractor(Arg)=Value:-
Is there such a technique?
thanks in advance
dave