You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Support Protocols and Volatiles fully.
Protocols can be created via `(defprotocol Proto)` and are stored as regular maps in the Var designated by `Proto`. All type-making forms should support Protocols directly.
Protocol support is buoyed by a few small compiler level changes. First, the compiler now statically computes the set of arities for a function (integers and the keyword `:rest` for the variadic method) and attaches them to the function via the `.arities` attribute. Secondly, the compiler attempts to statically check Protocol interface definitions by accessing the interface located at `(:interface proto)` (though can always fall back to the runtime check if required).
All of the builtin collection types have had their MROs switched to place their corresponding collection interface highest in the method resolution order. This is critical for allowing the interface-matching capabilities of [`functools.singledispatch`](https://docs.python.org/3/library/functools.html#functools.singledispatch) to work in the most natural way for users in the event that a collection type matches multiple interfaces in the MRO.
`basilisp.walk` was updated to use a protocol `IWalkable` both the validate that Protocols work and in the hopes that Protocol dispatch would be faster than the existing type which ran through a linear list of type checks to dispatch each nested invocation.
Copy file name to clipboardExpand all lines: CHANGELOG.md
+2Lines changed: 2 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -13,6 +13,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
13
13
* Added metadata about the function or method context of a Lisp AST node in the `NodeEnv` (#548)
14
14
* Added `reify*` special form (#425)
15
15
* Added support for multi-arity methods on `definterface` (#538)
16
+
* Added support for Protocols (#460)
17
+
* Added support for Volatiles (#460)
16
18
17
19
### Fixed
18
20
* Fixed a bug where the Basilisp AST nodes for return values of `deftype` members could be marked as _statements_ rather than _expressions_, resulting in an incorrect `nil` return (#523)
0 commit comments