Skip to content

add pairs_keys/2 and pairs_values/2 #212

Closed
@s-webber

Description

  1. Add pairs_keys/2 built-in predicate. Unifies its second argument with a list of keys obtained from the list of Key-Value pairs provided as its first argument. e.g.:
?- pairs_keys([a-y, c-x, b-z], L)
L = [a,c,b]

?- pairs_keys([a-y, a-x, a-z], L)
L = [a,a,a]
  1. Add pairs_values/2 built-in predicate. Unifies its second argument with a list of values obtained from the list of Key-Value pairs provided as its first argument. e.g.:
?- pairs_values([a-y, c-x, b-z], L)
L = [y,x,z]

?- pairs_values([a-y, c-y, b-y], L)
L = [y,y,y]

Metadata

Assignees

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions