Skip to content
This repository has been archived by the owner on Oct 7, 2024. It is now read-only.

Big refactoring to formalize internals #1

Draft
wants to merge 15 commits into
base: master
Choose a base branch
from
Draft

Conversation

DeLaGuardo
Copy link
Contributor

No description provided.

(lif cond-pattern then-pattern else-pattern)

else-pattern is optional

"IF data matches with cond-pattern (result of match is not empty) THEN use
result as a preconditions for match then-pattern against the same data ELSE
match the data against else-pattern if present."
takes a function of one argument and pattern. Before match agains some
data will apply this tr-fn function to the data before applying pattern.

```
(matches (reshape-by (juxt ex-message ex-data) ['?msg {:type :input-error}])
         (ex-info "Message" {:type :input-error}))
;; => '({?msg "Message})
```
Same as clojure.core/destructure

```
[?x ?y & [?x ?y ?z]]
[1 2 1 2 3]
;; => {?x 1 ?y 2 ?z 3}
```
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant