Re: [ANN] clojure.java.jdbc 0.7.0 Beta 2

2017-07-23 Thread Phillip Lord

Yep, appears that you are right. I ended with this:

(doseq
  [[k v] (ns-map ns)
   :when (= (find-ns 'clojure.core) (:ns (meta v)))]
(ns-unmap ns k))

which is pretty ugly.

Justin Smith  writes:

> refer-clojure doesn't ever remove mappings, it only adds them
>
> The reason a refer-clojure clause in your ns form can prevent bindings is
> because your refer-clojure clause (which is likely more qualified than the
> default) overrides the args that ns would otherwise provide to
> refer-clojure.

-- 
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: Reducing Jar file size for AWS Lambda

2017-07-23 Thread Kimmo Koskinen
Hi!

Although still at early stages, check out portkey 
https://github.com/cgrand/portkey. 

Portkey does tree-shaking by starting from a closure to minimize resulting jar 
size. Uses kryo and implementation of var tracing started in powderkeg project 
(https://github.com/HCADatalab/powderkeg)
. 

pk/deploy can lift (an anonymous) function with [in out ctx] args as a Lambda 
function. pk/mount can expose a defn through API gateway with query params 
mapped to function arguments. 

Christophe Grand and I have been working on portkey for now, but we'd welcome 
additional help on making it more awesome :) 

- Kimmo

-- 
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: Reducing Jar file size for AWS Lambda

2017-07-23 Thread Colin Fleming
portkey looks great, I wasn't aware of that - thanks!

On 23 July 2017 at 20:35, Kimmo Koskinen  wrote:

> Hi!
>
> Although still at early stages, check out portkey
> https://github.com/cgrand/portkey.
>
> Portkey does tree-shaking by starting from a closure to minimize resulting
> jar size. Uses kryo and implementation of var tracing started in powderkeg
> project (https://github.com/HCADatalab/powderkeg)
> .
>
> pk/deploy can lift (an anonymous) function with [in out ctx] args as a
> Lambda function. pk/mount can expose a defn through API gateway with query
> params mapped to function arguments.
>
> Christophe Grand and I have been working on portkey for now, but we'd
> welcome additional help on making it more awesome :)
>
> - Kimmo
>
> --
> 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.


int arguments for Java annotations

2017-07-23 Thread Joe Littlejohn
Hi all,

I recently used Clojure to create a Java interface and class (via 
definterface/deftype) that both required Java annotations. I was within 
striking distance of my goal, but was finally caught out by the fact that 
although Clojure has a nice Java annotation syntax, one cannot currently 
supply an int argument to a Java annotation.

This same issue is described here:

https://stackoverflow.com/questions/18280626/clojure-annotations-and-integers

It seems a shame that the Java annotations support in Clojure is very 
useful and capable yet has an Achilles' heel.

Does anyone have any thoughts about how this could be solved in Clojure?

-- 
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 is this code to create a stateful lazy sequence?

2017-07-23 Thread Rob Nikander
Yes, I find that much clearer too. Thanks!

On Saturday, July 22, 2017 at 4:50:23 PM UTC-4, tbc++ wrote:
>
> If we think about what we're doing here is a stateful filter, then maybe 
> we could leverage a few more core Clojure functions:
>
>
> (defn distinct-by [f coll]
>   (let [seen (atom #{})]
> (filter (fn [itm]
>(let [m (f itm)]
>   (when-not (@seen m)
> (swap! seen conj m 
>  coll)))
>
>

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


printing self referential data?

2017-07-23 Thread Rob Nikander
I'm translating some code from an object oriented language to Clojure. I'm 
a little confused about a tree structure I had where tree nodes have parent 
and children properties, so the structure forms cycles. I used atoms for 
those properties, so I could wire it all up. The code is clean and simple 
and I'm happy with it, except ... the things don't print in the REPL. 
(stack overflow)

Are there any tricks to printing cyclical data structures in the REPL?  

Rob

-- 
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: printing self referential data?

2017-07-23 Thread Justin Smith
You can prevent the need for mutable nodes by using an adjacency list to
represent a graph structure. In clojure this works nicely as a hash-map
from a node id to a set of connected node ids (eg for your case, a set of
parent nodes and a set of child nodes), and traversal becomes a series of
lookups.

On Sun, Jul 23, 2017 at 5:45 PM Rob Nikander  wrote:

> I'm translating some code from an object oriented language to Clojure. I'm
> a little confused about a tree structure I had where tree nodes have parent
> and children properties, so the structure forms cycles. I used atoms for
> those properties, so I could wire it all up. The code is clean and simple
> and I'm happy with it, except ... the things don't print in the REPL.
> (stack overflow)
>
> Are there any tricks to printing cyclical data structures in the REPL?
>
> Rob
>
> --
> 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: printing self referential data?

2017-07-23 Thread Didier
I'm not sure I can fully help without you explaining more what you're 
doing. It sounds like you've got a collection or container type which has 
an implementation of print that loops over its elements, and calls print on 
them. So if you have a cycle, the print will go on forever until memory 
runs out.

If you're using a standard type, you might be able to limit *print-level* 
. Most Clojure 
collections will limit how deep they print based on the value of this 
global dynamic Var.

If you want a solution that prints the full graph starting from any node, 
you'll have to define a custom implementation of print-method 
 which does a traversal 
of the graph and stops at cycles. The traversal you'll need to implement 
yourself. Print-method is only there to allow you to override the function 
used to print, for a specific type.

You could also look into using an existing graph library, like Loom 
. I believe it will print itself properly 
already.


On Sunday, 23 July 2017 17:45:04 UTC-7, Rob Nikander wrote:
>
> I'm translating some code from an object oriented language to Clojure. I'm 
> a little confused about a tree structure I had where tree nodes have parent 
> and children properties, so the structure forms cycles. I used atoms for 
> those properties, so I could wire it all up. The code is clean and simple 
> and I'm happy with it, except ... the things don't print in the REPL. 
> (stack overflow)
>
> Are there any tricks to printing cyclical data structures in the REPL?  
>
> Rob
>

-- 
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: Reducing Jar file size for AWS Lambda

2017-07-23 Thread Jose Trigueros
This looks like a viable solution! Is Portkey on Clojars or will I have to 
build myself? Not a problem either way, just making sure I'm doing it 
right. Thanks Kimmo.

On Sunday, July 23, 2017 at 2:35:37 AM UTC-6, Kimmo Koskinen wrote:
>
> Hi!
>
> Although still at early stages, check out portkey 
> https://github.com/cgrand/portkey. 
>
> Portkey does tree-shaking by starting from a closure to minimize resulting 
> jar size. Uses kryo and implementation of var tracing started in powderkeg 
> project (https://github.com/HCADatalab/powderkeg)
> . 
>
> pk/deploy can lift (an anonymous) function with [in out ctx] args as a 
> Lambda function. pk/mount can expose a defn through API gateway with query 
> params mapped to function arguments. 
>
> Christophe Grand and I have been working on portkey for now, but we'd 
> welcome additional help on making it more awesome :) 
>
> - Kimmo
>
>

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