Prolog: declaring an operator

Posted by B K on Stack Overflow See other posts from Stack Overflow or by B K
Published on 2012-03-23T17:27:16Z Indexed on 2012/03/23 17:29 UTC
Read the original article Hit count: 182

I have defined ! (factorial) function and registered it as arithmetic function and an operator, so that I can execute: A is 6!.

Now I'd like to define !! (factorial of odd numbers), but the same way - writing clauses, registering arithmetic_function and operator, calling A is 7!! - results in SyntaxError: Operator expected

How should I, if possible, register !! operator ?

Yes, I realize, ! is normally the cut.

© Stack Overflow or respective owner

Related posts about prolog

Related posts about operator-overloading