You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Aug 15, 2018. It is now read-only.
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.
The text was updated successfully, but these errors were encountered:
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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 likeI 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
.There's still a little bit of confusion because
var(X)
fails ifX
is not a variable. However,var(X,Type)
succeeds as long asX
has the proper type.The text was updated successfully, but these errors were encountered: