user1215117
user1215117

Reputation: 93

Trouble defining new operator

I'm trying to define an infix operator but I keep getting errors. I'm using GNU Prolog 1.4.

I tried this: [user]. op(35, xfx, =>). ctrl-D

But got the error "native code procedure op/3 cannot be redefined (ignored)"

I also tried op(35, xfx, '=>'). and got the same error, and tried doing it without typing in [user]. first, but when I tried to actually use the operator I got an existence_error.

Upvotes: 3

Views: 1361

Answers (1)

m09
m09

Reputation: 7493

yup you need to run the predicate instead of defining it. To do that just insert :- before your op/3 call.

Upvotes: 5

Related Questions