Skip to content
This repository was archived by the owner on Aug 15, 2018. It is now read-only.

rename the/2 #10

Open
mndrix opened this issue Dec 20, 2013 · 0 comments
Open

rename the/2 #10

mndrix opened this issue Dec 20, 2013 · 0 comments

Comments

@mndrix
Copy link
Owner

mndrix commented Dec 20, 2013

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.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant