Skip to content

2.20.0

Latest
Compare
Choose a tag to compare
@basil-conto basil-conto released this 12 Mar 13:23
· 1 commit to master since this release
2.20.0
fcb5d83

Deprecations

  • Calling -zip with two arguments now emits a warning. This long-discouraged calling convention remains supported, but the caller is now referred to the equivalent -zip-pair instead (Stefan Monnier, #400).
  • Calling -zip-pair with less than or more than two arguments is now deprecated, and can be replaced with the equivalent call to -zip-lists instead.

Fixes

  • Fixed a regression from 2.18 in -take that caused it to prematurely signal an error on improper lists (#393).

  • The function -pad can now be called with zero lists as arguments.

  • The functions -union, -intersection, and -difference now return proper sets, without duplicate elements (#397).

  • The functions -same-items? and -permutations now work on multisets (lists with duplicate elements) (#390, #397, #399).

    For example:

    (-same-items? '(1 1 2 3) '(3 1 2)) ; => t
    (-permutations '(1 1 2)) ; => '((1 1 2) (1 2 1) (2 1 1))
  • Several functions which are documented as returning a fresh, mutable object (such as a copy of one of their arguments) are no longer marked as pure. Pure functions called with constant arguments are evaluated during byte-compilation; the resulting value is an immutable constant, and thus unsafe to modify destructively. The functions in question are: -clone, -cons*, -drop-last, -interleave, -interpose, -iota, -non-nil, -repeat, -slice, -snoc, -split-at, -take, -take-last.

New features

  • The function -contains? now returns the matching tail of the list instead of just t, similarly to member (#397).
  • New function -frequencies that takes a list and counts how many times each distinct element occurs in it (suggested by @ebpa, #209, #214, #399).
  • New functions -zip-lists-fill and -unzip-lists which are better-behaved versions of -zip-fill and -unzip, respectively (#400).