I saw a question asking what does [a,b,c]=..L.
return.
When testing this I saw that it returns: L = ['.', a, [b, c]]
.
I can't understand why this happens, I was unable to understand the nature of Univ from the documentation. Understanding this will help me understand Univ.
One way to learn more about terms is to use write_canonical/1
in a conforming Prolog system.
For example, with GNU Prolog, we obtain:
| ?- write_canonical([x,y]). '.'(x,'.'(y,[]))
This shows:
'.'
, with arity 2x
'.'(y, [])
, which is the list [y]
This explains why (=..)/2
yields:
| ?- [x,y] =.. Ls. Ls = ['.',x,[y]]
and also your other example.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With