I would also recommend reconsidering  the premise that this is a feature
that is needed. Go back to what your design goals and think about
implementing them in a slightly different way. Function composition, for
example, can do all sorts of wonderful things.

At the risk of sounding rude, I've been programming Clojure for about 5-6
years and have never needed a feature like this. So I'm wondering what it
is you are building that makes your experience differ from mine.

Timothy

On Wed, Aug 5, 2015 at 9:58 AM, Russell Mull <russell.m...@gmail.com> wrote:

> On Wednesday, August 5, 2015 at 4:58:42 AM UTC-7, Georgi Danov wrote:
>>
>> I wish I could do that in Clojure:
>>
>> (defn ^:transactional someFunction [...] ...)
>>
>
>
> How about
> https://clojure.github.io/java.jdbc/#clojure.java.jdbc/with-db-transaction?
> These kinds of scope macros are pretty common and have the benefit of being
> very explicit.
>
> Perhaps, though, it's the ability to late-bind such decorators that you're
> looking for. alter-var-root! is certainly a way to get in to that world.
> lein test does this kind of thing:
> https://github.com/technomancy/leiningen/blob/master/src/leiningen/test.clj#L13.
> I'd be hard-pressed to recommend it though, as I only know about this
> behavior because it bit me recently.
>
> I would encourage you to consider your specific needs and think about a
> way to address them in a more direct way. Requiring a higher-level
> construct to set up a function before it works, using alter-var-root! or
> robert-hooke, is well into "spooky action at a distance" territory and
> should be avoided if possible.
>
> - Russell
>
> --
> 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.
> For more options, visit https://groups.google.com/d/optout.
>



-- 
“One of the main causes of the fall of the Roman Empire was that–lacking
zero–they had no way to indicate successful termination of their C
programs.”
(Robert Firth)

-- 
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.
For more options, visit https://groups.google.com/d/optout.

Reply via email to