Hello Everyone,
I have a question about how I can represent one or more variables in a query.
It is best to ask the question with an example:
If I were to write a function that checks whether all the numbers in a list are even and I enter:
checkeven([2,4,6,X]).
I would expect X=8.
Or if I enter:
checkeven([2,4,6,X,Y]).
I would expect X=8, Y=10
How would I write a function in which X can represent one or more variables.
For instance, if I added a constraint in checkeven limiting a list to a particular size:
checkeven([2,4,6,[X]]).
Returning:
X=[8]
X=[8,10]
X=[8,10,12]
X=[8,10,12,14]
and so forth.... up to the maximum size I defined.
Thank you very much for your help
best wishes
James