Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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 join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant