Skip to content

Latest commit

 

History

History
7 lines (4 loc) · 661 Bytes

20.md

File metadata and controls

7 lines (4 loc) · 661 Bytes

Day 23

Today's post is short: I briefly read about sets in CL. Sets and lists in Lisp are made the exact same way. For sets in Lisp, you can use the adjoin function to add to the set. However, adjoin doesn't actually update the original list/set you pass into it. Instead, you'll have to do a setf on the original list with the adjoin form as the new value. However, this is overly laborious so if you want to update the original list with less effort, you can just use the pushnew macro.

There are also operations for doing set-theoretic activities like intersections, unions, and set-difference.

There's also a subset function called subsetp.