Skip to content

elarkin/fw.matching

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

fw.matching

I've always found the way clojure.core/let does map destructuring to be a little confusing.

I'm still learning Clojure, so I understand that there may be some hidden reason for it working the way it does.

When I first heard that Clojure had map destructuring, I expected it to work by putting a map literal on the left hand side. Instead, you have to reverse the key and value positions.

This library provides a naive implementation of what I originally thought map destructuring meant.

A Clojure library with an alternate destructuring ideology to the one in clojure.core/let

matching destructures maps as if they are literals:

(matching [some-map-value {:x 1}
           {:x x} some-map-value]
  x) ;; evaluates to 1 and is equivilent to the below let:
(let [some-map-value {:x 1}
      {x :x} some-map-value]
  x)

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published