SasseMan 49 Junior Poster

Hi, Im kind of new to prolog and would like som help.

I want to write a rule that only takes integers as input like the following example.

rule( X, [] ).
rule( X "is integer", [Heat|Tail] ) :- rule(X, Tail).
rule( X "is anything else", [Heat|Tail] ) :- rule(X, Tail)

Is this functionality avaliable? I want the rule only to be called if X is and Integer and the other rule otherwise. I don't not want to test if X is an integer like this...

rule(X, [Head|Tail]) :- integer(X), rule(X,Tail).

Anyone who can help?