rename the/2
Opened this issue · 0 comments
mndrix commented
I've come to dislike how I named the/2
. For one, it makes it sound like a variable has only one value. That's confusing in code like
the(integer, X),
member(X, [1,2,3,4]),
I wonder if var(X, Type)
would be better. That looks a lot like a variable declaration. It also puts the type name after the variable, which matches the PlDoc format: X:type
.
var(X, integer),
member(X, [1,2,3,4]),
There's still a little bit of confusion because var(X)
fails if X
is not a variable. However, var(X,Type)
succeeds as long as X
has the proper type.