An aspect-oriented library for Clojure

Most aspect-oriented patterns I have seen in Clojure work one of two ways: 
first, via rebinding var roots dynamically; or second, via functional 
composition. While both of these patterns are perfectly adequate for many 
use cases, they are not (IMO) perfect solutions for all. If I wish to avoid 
dynamic rebinding or if I do not wish to eschew built-in language/tooling 
features (fn arglist metadata, docstrings, etc.), then typical patterns 
won't work. 

The following library provides an extension to Clojure's built-in `defn` 
form that allows you to tag your function definitions with compile-time 
macro transformations. It also provides very simple macro constructors for 
the most common use cases. It's not intended to replace dynamic decorations 
<https://github.com/technomancy/robert-hooke> or functional composition 
<https://stackoverflow.com/a/5574392/2472391>, but to provide another 
useful tool in the box. The library's motivation is explained with a simple 
example here 
<https://github.com/galdre/morphe/blob/master/docs/rationale.md>, and a 
more detailed comparison with other Clojure idioms is found here 
<https://github.com/galdre/morphe/blob/master/docs/clojure-idioms.md>.

https://github.com/galdre/morphe

I've quite enjoyed building and using this library over the last few years, 
and I hope others can find it useful as well! I recently updated it to work 
with Clojurescript (but not self-hosted Clojurescript). This was an 
adventure, and it's quite possible there are some issues with the CLJS 
implementation that I have not yet discovered.

~Timothy Dean

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/clojure/74bda940-4f12-4bcb-b1d7-d21380a62b14%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to