Does Common Lisp have a something like java's

2020-03-12 05:37发布

I need something like this, a collection of elements which contains no duplicates of any element. Does Common Lisp, specifically SBCL, have any thing like this?

标签: java lisp set sbcl
8条回答
来,给爷笑一个
2楼-- · 2020-03-12 06:16

Yes, it has sets. See this section on "Sets" from Practical Common Lisp.

Basically, you can create a set with pushnew and adjoin, query it with member, member-if and member-if-not, and combine it with other sets with functions like intersection, union, set-difference, set-exclusive-or and subsetp.

查看更多
淡お忘
3楼-- · 2020-03-12 06:17

Not that I'm aware of, but you can use hash tables for something quite similar.

查看更多
登录 后发表回答