9.1
2 Threading Macros
| (require ebb/threading) | package: ebb-lib |
This module provides all the threading macro compatibility layers from ebb/threading/base, ebb/threading/cond and ebb/threading/extra.
2.1 Threading Base
| (require ebb/threading/base) | package: ebb-lib |
This module provides the basic threading macros for left and right threading with and without short-circuiting. It also provides all the lambda forms provided by threading library.
Uses ebb to provide compatibility with the original threading
macro.
Uses ebb/and to provide compatibility with the original
short-circuiting threading macro.
Uses ebb> to provide compatibility with the original, now
deprecated, right-threading macro.
Uses ebb>/and to provide compatibility with the original,
now deprecated, short-circuiting, right-threading macro.
Combines lambda and ~> to provide similar
functionality as the original threading macro. It is equivalent to:
(lambda (v) (~> v expr ...))
Combines lambda and ~>> to provide similar
functionality as the original threading macro. It is equivalent to:
(lambda (v) (~>> v expr ...))
Combines lambda and and~> to provide similar
functionality as the original threading macro. It is equivalent to:
(lambda (v) (and~> v expr ...))
Combines lambda and and~>> to provide similar
functionality as the original threading macro. It is equivalent to:
(lambda (v) (and~>> v expr ...))
Combines lambda and ~> to provide similar
functionality as the original threading macro. It is equivalent to:
(lambda vs (~> vs expr ...))
Combines lambda and ~>> to provide similar
functionality as the original threading macro. It is equivalent to:
(lambda vs (~>> vs expr ...))
Combines lambda and and~> to provide similar
functionality as the original threading macro. It is equivalent to:
(lambda vs (and~> vs expr ...))
Combines lambda and and~>> to provide similar
functionality as the original threading macro. It is equivalent to:
(lambda vs (~>> vs expr ...))
2.2 Threading Condition
| (require ebb/threading/cond) | package: ebb-lib |
This module provides the conditional forms like the original threading library does.
If given condition evaluates to #f then the value
val is returned. Otherwise the result is threading the value
through the expressions expr .... This is the same
functionality as the original threading library provides.
Inverted version of when~>.
Threads value val through expressions of matching
expressions or else expressions if no condition matches. If no
condition matches and there is no else branch, the value is returned
as-is. This is the same behaviour as the original threading library
provides.
2.3 Threading Extra
| (require ebb/threading/extra) | package: ebb-lib |
This module provides the extra forms like the original threading library does.
Evaluates to the result of expr0 while all the following
expressions expr ... are evaluated only for their side
effects like the original threading macro does.