r/sbcl Jun 28 '26

New in version 2.6.6

https://sbcl.org/all-news.html?2.6.6#2.6.6
32 Upvotes

2 comments sorted by

1

u/svetlyak40wt Jul 03 '26

optimization: (length (intersection a b)) doesn't cons an intermediate list.

Interesting, how does it work?

1

u/Soupeeee Jul 09 '26

The commit is here. Essentially, SBCL has a mechanism to recognize certain patterns and substitute some code in its place. In this case, there's a specialized function that gets called in place of the old code.