seeking retrieve the value of an argument irrespective of functor
Posted: 19 Apr 2018 20:08
Hello
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:
every attribute has a functor (last, first.....hundredslater) , and a single arity argument that is always a string.
I could retrieve that string value by:
but this requires one for each funtor....
OR
I am seeking magic predicate/function that behaves like this:
where Value is the string that is containing in the argument irrespective of functor.
Is there such a technique?
thanks in advance
dave
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