scryer-prolog
scryer-prolog copied to clipboard
Add Example for element/3
https://www.scryer.pl/clpz.html#element/3
We should add a REPL example for element/3.
I can do this.
:- use_module(clpz).
?- element(1, [0, 1, 2], 0).
%@ true.
?- element(1, [0, 1, 2], X).
%@ X = 0.
?- element(X, [0, 1, 2], 0).
%@ X = 1.
?- help(element/1).
%@ false.
Please think about what a potential example should illustrate. Is there something in the documentation that can best be explained or illustrated by an example? Are there any remaining questions unless an example is added?
Analogous to nth1/3.
I feel that this statement can be disambiguated. For example, How is element/3 comparable to nth1/3 exactly?
A code comparison example might be able to answer this question elegantly.
What do you think?