How can I use ellipsis (...) ?
Posted: 5 Jul 2014 9:27
I have met with the same problem as Dmitry Ermolaev http://discuss.visual-prolog.com/viewto ... t=ellipsis.
I defined a predicate x:(...) to avoid flow variants x:(string), x:(string,integer), x:(string,integer, my_own_domain), so on.
When I tried to call x(S,I) the compiler reported error.
How can use ellipsis?
This way using conversion to any* list?
Please write me an example.
I defined a predicate x:(...) to avoid flow variants x:(string), x:(string,integer), x:(string,integer, my_own_domain), so on.
When I tried to call x(S,I) the compiler reported error.
How can use ellipsis?
This way using conversion to any* list?
Code: Select all
domains
my_own_domain : long; short; fuzzy. /*hair*/
predicates
x:(...) determ.
a:(any*) determ.
clauses
x(...) :-
fromEllipsis(...) = AnyList,
a(AnyList).
a(["cat"] /*animal only*/).
a(["dog",4] /*animal & legs*/).
a(["pony",4, fuzzy] /*animal & legs and hair*/).