Buoy v5.0.0 released!

Photo by Girma Nigusse on Unsplash

Buoy, the project aiming to complement Pharo adding useful extensions reached it’s 5.0.0 version.

The supported Pharo versions are 6.1 — 32 bits and 7.0 — 32 & 64 bits. The breaking changes are just in the package organization, so you may have to adapt your baseline dependencies but the rest of the code is backwards compatible with version 4.

New features in this version

Some useful extensions were added to the collections hierarchy:

  • maxUsing: , minUsing: , maxUsing:ifEmpty: and minUsing:ifEmpty: were added to Collection, allowing the user to provide a closure used to get the objects to compare.
  • copyFirst: copyLast: copyNoMoreThanFirst: and copyNoMoreThanLast: were added to SequenceableCollection. Check the documentation to notice the differences with first: and last:

There were other extensions added to base Pharo classes:

  • BlockClosure>>#on:except:do was added. Pharo gained support to exclude some exceptions in a handler on the previous release by using the - message to create an exclusion set, but we feel this extension provides clearer semantics.
  • Behavior>>#allLeafSubcasses allows to get the subclasses of a class that don’t have subclasses.

Two algorithms working on collections were added in this release:

  • BalancedDistributionInBucketsAlgorithm implements an algorithm that given a starting collection and a maximum bucket size will return a list of buckets (respecting the max bucket size) including all the collection elements distributed in the buckets in a balanced fashion (so no bucket will look almost empty).
  • BinarySearchAlgorithm implements a binary search operating on a collection previously sorted. Given a search key it will return the insertion index for it. It's useful as a building block for slicing collections with the provided properties in a given range, or inserting new elements in the proper place.

Other improvements

  • RegexCondition performance was improved, previously the regular expression was created every time the condition was evaluated, now it’s cached on the initialization.
  • Being close to the Pharo 7 release, the related build jobs aren’t marked anymore as allowed to fail.
  • The documentation has improved covering almost all the provided features.
  • The project structure was adapted to match the upcoming guidelines for the ecosystem.

Join us at at ba-st and check out the new community guidelines project.