Re: Any way to replace function body?

2019-01-19 Thread Janko Muzykant
Awsome! This is exactly what I was looking for :) Thanks James and thanks everyone for other suggestions. On Saturday, January 19, 2019 at 5:20:06 PM UTC+1, James Reeves wrote: > > Yes, the alter-var-root function allows you to change a var's definition: > > (alter-var-root >#'fetch-data >

Re: How should I debug a poorly performing small web app, using Jetty?

2019-01-19 Thread James Reeves
I'd first try increasing the connection pool size and see if that affects things. That should tell you if the issue is an issue with blocked connections. On Sat, 19 Jan 2019 at 21:25, wrote: > I'm looking for advice about how to debug this. > > I wrote a small web app. It has about 1,200 lines o

How should I debug a poorly performing small web app, using Jetty?

2019-01-19 Thread lawrence . krubner
I'm looking for advice about how to debug this. I wrote a small web app. It has about 1,200 lines of code. It is fairly standard for a Clojure app, it uses Jetty, and Compojure. It uses MongoDB. I'm just working on my MacBook Pro right now, so there is no issue such as using Nginx or load bala

Re: Learn Clojure - Syntax Test your knowledge No4. question.

2019-01-19 Thread Andy Fingerhut
If in a Clojure REPL session you type `(doc find-doc)`, you should see this (I'm using Clojure 1.10 here, in case the doc string has changed in a recent Clojure version): ser=> (doc find-doc) - clojure.repl/find-doc ([re-string-or-pattern]) Prints documentation for any va

Re: Any way to replace function body?

2019-01-19 Thread John Newman
dispacio has a shadow-extend-like capability: (defp assoc string? [s i c] (str (subs s 0 i) c (subs s (inc i And then (assoc "abc" 2 'x);#_=> "abx" Using alter-var-root in dispacio correctly would prevent var replacement warnings I

Re: using durable-queue, works locally, get :time-out when moving to an EC2

2019-01-19 Thread lawrence . krubner
> Is the problem possibly a difference between your > compilation environment and your deploy env? This seems to be proven by the fact that upgrading Java on the EC2 instance fixed the problem. On Wednesday, January 16, 2019 at 3:49:41 PM UTC-5, Chris Nuernberger wrote: > > Are you using aot

Re: Any way to replace function body?

2019-01-19 Thread James Reeves
Yes, the alter-var-root function allows you to change a var's definition: (alter-var-root #'fetch-data (fn [original-fetch-data] (fn [& args] (let [result (apply original-fetch-data args)] (transform-result result)) On Sat, 19 Jan 2019 at 14:58, Janko Muzykant wr

Re: Any way to replace function body?

2019-01-19 Thread Chris Nuernberger
There has to be. Trace, profile, and debugging libraries for clojure do it all the time. I might check the source for some of those. On Sat, Jan 19, 2019 at 9:06 AM jason poage wrote: > Why would you want to overwrite a function if you need reference to the > original function? Why not just re

Re: Any way to replace function body?

2019-01-19 Thread jason poage
Why would you want to overwrite a function if you need reference to the original function? Why not just rename the wrapper function to something else? Or you could use (source function-name) to get the function body and essentially rename the function. Sent from my iPhone > On Jan 19, 2019, at

Re: Any way to replace function body?

2019-01-19 Thread Pankaj Doharey
Checkout multi-arity functions in clojure. On Sat, 19 Jan 2019 at 8:28 PM, Janko Muzykant wrote: > Hi, > > Is there an way to replace body of existing (interned) function with own > code still being able to call original fn? > Suppose, I have a function: > > (defn fetch-data [arg1 arg2] >

Any way to replace function body?

2019-01-19 Thread Janko Muzykant
Hi, Is there an way to replace body of existing (interned) function with own code still being able to call original fn? Suppose, I have a function: (defn fetch-data [arg1 arg2] (db/fetch-data ...)) I would like to intern a slightly modified version of this fn. Something like this:

Learn Clojure - Syntax Test your knowledge No4. question.

2019-01-19 Thread Dervish
1. Using find-doc, find the function that prints the stack trace of the most recent REPL exception. what does this mean? -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@googlegroups.

Re: Online meeting: clojure data science

2019-01-19 Thread Daniel Slutsky
Further discussing the format of the meeting under another topic: https:// clojureverse.org/t/online-meeti ng-clojure-data-science-discussing-the-format/3643 … On Thursday, 17 January 2019 00:19:09 UTC+2, Daniel Slutsky wrote: > > Hi! > > We are discussing the possibili