Skip to content

Shouldn't these two examples hold true? #2774

Answered by triska
jgarte asked this question in Q&A
Discussion options

You must be logged in to vote

One small note on terminology: "return" is terminology from functional programming; a predicate is true or holds.

list_to_set(Xs, Ys) relates the list Xs to a list Ys where each element of Xs occurs exactly once, and the first occurrences of each element are in the same order in both lists.

Therefore, we indeed expect the predicate to hold in the first example, but not in the second one.

Replies: 2 comments 4 replies

Comment options

You must be logged in to vote
3 replies
@jgarte
Comment options

@jgarte
Comment options

@jgarte
Comment options

Answer selected by jgarte
Comment options

You must be logged in to vote
1 reply
@jgarte
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants