What does the Prolog crowd operator mean?

I found another post discussing the colon, but the expression doesn't look quite like that. I see that this variable X can be passed as an argument, curious what it does?

X = x: 2

+4
source share
1 answer

Without modules, it is a symbol of the infix function. You can try this by doing

?- x:2 =.. X. X = [:, x, 2]. 

at the swi invitation.

Some explanation of the operator = ..: this is a relation, where the left side is the arbitrary term "symbol (argument1, argument2, ...)", and the right side is the list "[symbol, argument1, argument2, ...]".

hope this helps!

+6
source

All Articles