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
>(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  > 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]
>>   (db/fetch-data ...))
>>
>> I would like to intern a slightly modified version of this fn. Something 
>> like this:
>>
>> (defn fetch-data [& args]
>>   (let [result (apply original-fetch-data args)]
>> (transform-result result)))
>>
>> The problem I see is how to keep the reference to original fetch-data fn 
>> (here denoted by original-fetch-data),
>> so it could be still called in a altered version of fetch-data function.
>>
>> Best,
>> JM.
>>
>>
>>
>> -- 
>> You received this message because you are subscribed to the Google
>> Groups "Clojure" group.
>> To post to this group, send email to clo...@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+u...@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+u...@googlegroups.com .
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>
> -- 
> James Reeves
> booleanknot.com
>

-- 
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.


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 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 balancers.
>
> I can start the app up, and reach it on port 8082, and see all of the
> pages.
>
> However, this app does have a scheduled task that runs every 15 minutes
> and which is fairly demanding. It imports a large number of JSON files from
> an S3 bucket and stores them in MongoDB.
>
> This all works fine, but during the import, the app is no longer
> responsive on port 8082. The browser gets nothing back.
>
> My first thought was "I'm stupid because I've blocked the main thread,
> I've got too much going on." But then I thought "Wait, Jetty does not run
> on the main thread, so it shouldn't be effected by whatever I'm doing on
> the main thread."
>
> So now I'm thinking, I'm doing some database work on the main thread, and
> this keeps the Ring handlers from looking up information from the database,
> so there is perhaps some kind of timeout issue? Like, the handler tries to
> reach MongoDB, finds it unresponsive, and gives up after a certain amount
> of time? Or too many functions are sharing a single connection to MongoDB,
> so that is the problem.
>
> I'm testing, in part, by moving all of the database calls to background
> threads, and giving each separate connections to MongoDB, but I'm also
> looking for advice about other problems I should look for.
>
>
>
> --
> 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.
>


-- 
James Reeves
booleanknot.com

-- 
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.


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 balancers. 

I can start the app up, and reach it on port 8082, and see all of the pages.

However, this app does have a scheduled task that runs every 15 minutes and 
which is fairly demanding. It imports a large number of JSON files from an 
S3 bucket and stores them in MongoDB. 

This all works fine, but during the import, the app is no longer responsive 
on port 8082. The browser gets nothing back. 

My first thought was "I'm stupid because I've blocked the main thread, I've 
got too much going on." But then I thought "Wait, Jetty does not run on the 
main thread, so it shouldn't be effected by whatever I'm doing on the main 
thread." 

So now I'm thinking, I'm doing some database work on the main thread, and 
this keeps the Ring handlers from looking up information from the database, 
so there is perhaps some kind of timeout issue? Like, the handler tries to 
reach MongoDB, finds it unresponsive, and gives up after a certain amount 
of time? Or too many functions are sharing a single connection to MongoDB, 
so that is the problem.

I'm testing, in part, by moving all of the database calls to background 
threads, and giving each separate connections to MongoDB, but I'm also 
looking for advice about other problems I should look for. 



-- 
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.


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 var whose documentation or name
 contains a match for re-string-or-pattern
nil

That says that if I do `(find-doc "some-string")` or `(find-doc
#"some-regular-expression")`, it will scan through the names and
documentation of all vars looking for something that matches, and print it.

For example, if I am looking for something relevant to "stack", try
`(find-doc "stack")` and see what comes out.

Andy

On Sat, Jan 19, 2019 at 6:10 AM Dervish  wrote:

>
>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.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.
>

-- 
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.


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 believe, similar to s/instrument, but I haven't figured out how 
to do it yet in a cross-platform way. PRs welcome. 

V/r

John
On Saturday, January 19, 2019 at 9:58:29 AM UTC-5, 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]
>   (db/fetch-data ...))
>
> I would like to intern a slightly modified version of this fn. Something 
> like this:
>
> (defn fetch-data [& args]
>   (let [result (apply original-fetch-data args)]
> (transform-result result)))
>
> The problem I see is how to keep the reference to original fetch-data fn 
> (here denoted by original-fetch-data),
> so it could be still called in a altered version of fetch-data function.
>
> Best,
> JM.
>
>
>
>

-- 
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.


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?
>
> We have used that durable queue with 1.8.  In fact, we have a 
> compatibility later that allows you to move from the durable queue to an 
> Aws queue:
> (mostly undocumented)
>
> https://github.com/techascent/tech.queue
>
> Is the problem possibly a difference between your compilation environment 
> and your deploy env?
>
>
>
> On Wed, Jan 16, 2019, 1:29 PM  wrote:
>
>> So, I upgraded to Java 11, and now everything works. So I guess this was 
>> a version conflict. 
>>
>> Just curious, but is there a way for Factual to make durable-queue to 
>> tell Leiningen that Java 11 is necessary? 
>>
>>
>>
>> On Wednesday, January 16, 2019 at 3:17:49 PM UTC-5, lawrence...@gmail.com 
>> wrote:
>>>
>>> On the new EC2 instance, running Ubuntu:
>>>
>>> java -version
>>> openjdk version "1.8.0_191"
>>> OpenJDK Runtime Environment (build 
>>> 1.8.0_191-8u191-b12-0ubuntu0.18.04.1-b12)
>>> OpenJDK 64-Bit Server VM (build 25.191-b12, mixed mode)
>>>
>>> Is it possible this version does not have the checksum signature that 
>>> durable-queue is looking for? 
>>>
>>> I'm thinking this is some kind of version problem. 
>>>
>>>
>>>
>>>
>>>
>>>
>>> On Wednesday, January 16, 2019 at 2:50:14 PM UTC-5, 
>>> lawrence...@gmail.com wrote:

 Sorry, I'm an idiot. The real error was when I called put!

 I don't understand this error:

 INFO: java.lang.NoSuchMethodError: java.util.zip.Checksum.update([B)V 
   java.lang.NoSuchMethodError: java.util.zip.Checksum.update([B)V
  at durable_queue$checksum.invokeStatic (durable_queue.clj:64)
 durable_queue$checksum.invokePrim (durable_queue.clj:-1)
 durable_queue.TaskSlab.append_to_slab_BANG_ (durable_queue.clj:314)
 durable_queue$queues$reify__6549$slab_BANG___6570.invoke 
 (durable_queue.clj:702)
 durable_queue$queues$reify__6549$fn__6575.invoke 
 (durable_queue.clj:719)
 durable_queue$queues$reify__6549.put_BANG_ (durable_queue.clj:717)
 durable_queue$queues$reify__6549.put_BANG_ (durable_queue.clj:732)
 humongorous_nlp.core$cycle_to_database$fn__13673$fn__13693.invoke 
 (core.clj:665)
 humongorous_nlp.core$cycle_to_database$fn__13673.invoke 
 (core.clj:663)
 clojure.lang.AFn.run (AFn.java:22)
 java.util.concurrent.Executors$RunnableAdapter.call 
 (Executors.java:511)
 java.util.concurrent.FutureTask.runAndReset (FutureTask.java:308)
 
 java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301
  
 (ScheduledThreadPoolExecutor.java:180)
 
 java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run 
 (ScheduledThreadPoolExecutor.java:294)
 java.util.concurrent.ThreadPoolExecutor.runWorker 
 (ThreadPoolExecutor.java:1149)
 java.util.concurrent.ThreadPoolExecutor$Worker.run 
 (ThreadPoolExecutor.java:624)
 java.lang.Thread.run (Thread.java:748)




 On Wednesday, January 16, 2019 at 1:47:21 PM UTC-5, 
 lawrence...@gmail.com wrote:
>
> I was away from Clojure for a year and I missed it. I am pleased to be 
> back. But I've forgotten certain common errors. I feel like this is 
> something I used to know but now I've lost the knowledge. 
>
> I'm using Factual's durable-queue to put a step inbetween the import 
> of large JSON files, and their writes to the database. This works fine on 
> my local MacBook Pro, but when I move to an EC2 instance, I'm instead 
> getting time-outs when durable-queue tries to read from the queue. 
>
> At start up the app creates a few of these workers, which run for as 
> long as the app is running:
>
> (defn worker
>   [from-topics-to-persistence-queue current-database-connection]
>   (slingshot/try+
>(loop [message (durable/take! from-topics-to-persistence-queue 
> :message 6 :timed-out!)]
>  (slingshot/try+
>   (log-seq " the message in the work function " message)
>   (when (= (type message) durable_queue.Task)
> (advance message current-database-connection))
>   (catch Object o
> (log-seq "error in worker function")
> (durable/retry! message)
> (log-seq o)))
>  (recur (durable/take! from-topics-to-persistence-queue :message 
> 6 :timed-out!)))   
>(catch Object o
>  (error o)
>  (slingshot/throw+ {
> :type worker
> :error o
> :from-topics-to-persistence-queue 
> from-topics-to-persistence-queue
>   

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  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]
>   (db/fetch-data ...))
>
> I would like to intern a slightly modified version of this fn. Something
> like this:
>
> (defn fetch-data [& args]
>   (let [result (apply original-fetch-data args)]
> (transform-result result)))
>
> The problem I see is how to keep the reference to original fetch-data fn
> (here denoted by original-fetch-data),
> so it could be still called in a altered version of fetch-data function.
>
> Best,
> JM.
>
>
>
> --
> 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.
>


-- 
James Reeves
booleanknot.com

-- 
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.


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 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 07:50, 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]
>   (db/fetch-data ...))
>
> I would like to intern a slightly modified version of this fn. Something
> like this:
>
> (defn fetch-data [& args]
>   (let [result (apply original-fetch-data args)]
> (transform-result result)))
>
> The problem I see is how to keep the reference to original fetch-data fn
> (here denoted by original-fetch-data),
> so it could be still called in a altered version of fetch-data function.
>
> Best,
> JM.
>
>
>
> --
> 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.
>
> --
> 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.
>

-- 
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.


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 07:50, 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]
>   (db/fetch-data ...))
> 
> I would like to intern a slightly modified version of this fn. Something like 
> this:
> 
> (defn fetch-data [& args]
>   (let [result (apply original-fetch-data args)]
> (transform-result result)))
> 
> The problem I see is how to keep the reference to original fetch-data fn 
> (here denoted by original-fetch-data),
> so it could be still called in a altered version of fetch-data function.
> 
> Best,
> JM.
> 
> 
> 
> -- 
> 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.

-- 
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.


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]
>   (db/fetch-data ...))
>
> I would like to intern a slightly modified version of this fn. Something
> like this:
>
> (defn fetch-data [& args]
>   (let [result (apply original-fetch-data args)]
> (transform-result result)))
>
> The problem I see is how to keep the reference to original fetch-data fn
> (here denoted by original-fetch-data),
> so it could be still called in a altered version of fetch-data function.
>
> Best,
> JM.
>
>
>
> --
> 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.
>

-- 
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.


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:

(defn fetch-data [& args]
  (let [result (apply original-fetch-data args)]
(transform-result result)))

The problem I see is how to keep the reference to original fetch-data fn 
(here denoted by original-fetch-data),
so it could be still called in a altered version of fetch-data function.

Best,
JM.



-- 
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.


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.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.


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 possibility of an online meeting around data science 
> in clojure:
> https://clojureverse.org/t/online-meeting-clojure-data-science/3503 
> - would love to hear your comments.
>

-- 
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.