Age | Commit message (Collapse) | Author |
|
`$` takes a list of forms and makes a unary function which applies
them via `->>`. Previous definition reversed the forms supplied
s.t. `$` was closer to the applicative operator in Haskell i.e. the
function (<$> f g) is f(g(x)). But this version fits closer with the
lower operator (->>) being used AND allows easier lifting from
`->>` (which produces a value) to `$` (which produces a function).
|
|
Instead of exporting cantedraw.lib.macro._ and making anyone who wants
to use the --> macro _require_ importing that specific symbol, let's
just make it so the user has to supply a placeholder name before they
do anything. This means each package provides its own placeholder
symbol which lowers coupling.
|
|
This is mostly a sanity check in-case anyone else decides to load this
system for use in their own package - don't want to conflict with
their names.
|
|
|
|
f $ g $ h -> f(g(h)) whereas previous implementation ($ f g h) was
h(g(f)).
|
|
|
|
The `$` operator takes a sequence of FORMS and returns a unary
function which applies the input through that sequence via the `->>`
operator.
For example, consider the predicate "not null". `null` is built into
Common Lisp but "not null" requires writing a
function (lambda (x) (not (null x))). Now, using this operator, you
can write ($ not null) which returns the same lambda as above while
being more concise.
|
|
|
|
`fn' is a convenience macro for defining functions with a type
specifier. Only really matters for `sbcl` and other hard-optimising
Lisp interpreters which actually take these seriously.
|
|
|
|
|