Programmatic reification

2015-04-24 Thread Brian Guthrie
Hi all, Is there a good way to reify protocols programmatically, i.e., by passing data structures rather than dropping down into a macro? reify bottoms out in reify*, which doesn't help much. Thanks, Brian -- You received this message because you are subscribed to the Google Groups Clojure

Re: Programmatic reification

2015-04-24 Thread Steven Deobald
Okay, Brian. I'll bite. :) I don't have the answer for you, but I'm definitely curious what your use case is. Whatcha upto? Steven Deobald -- ⌀ -- nilenso.com On Fri, Apr 24, 2015 at 7:18 PM, Brian Guthrie btguth...@gmail.com wrote: Hi all, Is there a good way to reify protocols

Re: Meaning of part of the doc string for `ns-resolve`

2015-04-24 Thread Brian Marick
Nicola Mometto wrote: It's talking about fully qualified symbols that map to an actual var. E.g user= (ns-resolve *ns* 'clojure.string/join) #'clojure.string/join Ah. Thank you. Ambrose Bonnaire-Sergeant wrote: Could you clarify why you expect that? Thanks, Ambrose Because the

[ANN] Clojure 1.7.0-beta2

2015-04-24 Thread Alex Miller
Clojure 1.7.0-beta2 is now available. Try it via - Download: https://repo1.maven.org/maven2/org/clojure/clojure/1.7.0-beta2/ - Leiningen: [org.clojure/clojure 1.7.0-beta2] Regression fixes since 1.7.0-beta1: 1) CLJ-1711 - structmap iterator broken 2) CLJ-1709 - range wrong for step != 1 3)

Re: Strange behaviour of a callable record

2015-04-24 Thread Alex Miller
It would be great if the ticket has more of the original use case as motivation. On Thursday, April 23, 2015 at 7:00:51 AM UTC-5, Nicola Mometto wrote: I've opened an enhancement ticket with a patch that changes this behaviour btw: http://dev.clojure.org/jira/browse/CLJ-1715

Re: What are favored Redis-backed queues?

2015-04-24 Thread Christopher Small
Also, I should mention that Ruby doesn't have very good built in parallelism support (no true threads when I was using, though this might have changed). As such, I've seen a fair bit of usage of Resque running on a single machine. This would be an insane overcomplication in Clojure given all

Re: [ClojureScript] Re: [ANN] Silk, an isomorphic routing library for Clojure and ClojureScript

2015-04-24 Thread Joel Holdbrooks
On Saturday, April 11, 2015 at 8:40:07 AM UTC-7, kovas boguta wrote: On Sat, Apr 11, 2015 at 10:46 AM, Malcolm Sparks mal...@juxt.pro  So, in summary, I think it would be useful to have a single 'default' routing library in Clojure that supported isomorphism and was built on protocols, as

Re: What are favored Redis-backed queues?

2015-04-24 Thread Christopher Small
I think you mean to be asking specifically about *job* queuing using Redis. You don't need anything other than Redis + Carmine to create queues. But obviously, the value of Resque (note spelling) is that it *uses* Redis in a number of non-trivial ways, such that all of the features above are

Re: Programmatic reification

2015-04-24 Thread Timothy Baldridge
This is a situation where I reach for eval. Construct your reify call as if you were inside a macro, but instead of returning data from the macro, call (eval form). The call to reify will be slow (and could cause permgen problems), but if you wrap the form in a function you can cache the function

Re: Meaning of part of the doc string for `ns-resolve`

2015-04-24 Thread Mike Rodriguez
I agree about wanting to use the explicit argument name surrounded by markdown quotes in docs. I've definitely started adopting this practice and wish there were conventions around this sort of thing. Without it, doc strings can easily get ambiguous and confusing in how they relate the the

Could type function (type X) print nothing?

2015-04-24 Thread 임정택
Hello, Clojure users. I'm a beginner of Clojure, so it could be a dumb question. I'm playing with Apache Storm, and I leave below line to see tuple value when something is wrong. (log-warn Can't transfer tuple - task value is null. tuple type: (type tuple) and information: tuple)

Re: Could type function (type X) print nothing?

2015-04-24 Thread James Reeves
(str nil) = (type nil) = nil (str (type nil)) = Rather than use `str`, try using `pr-str` to get a more accurate representation of the data: (pr-str nil) = nil - James On 25 April 2015 at 03:23, 임정택 kabh...@gmail.com wrote: Hello, Clojure users. I'm a

Re: [ANN] Clojure 1.7.0-beta2

2015-04-24 Thread Matt Mitchell
Awesome. Just tested it on our API and working well. Looking forward to a more in depth testing session! - Matt On Friday, April 24, 2015 at 2:27:40 PM UTC-4, Alex Miller wrote: Clojure 1.7.0-beta2 is now available. Try it via - Download:

Re: [ANN] Clojure 1.7.0-beta2

2015-04-24 Thread Alex Miller
Thanks David! Instaparse was using some internals of the reader, which changed for reader conditionals, but has subsequently been patched. On Friday, April 24, 2015 at 2:06:01 PM UTC-5, David McNeil wrote: I did a real quick test on one of our projects. I had to upgrade to the latest

Re: [ANN] Clojure 1.7.0-beta2

2015-04-24 Thread David McNeil
I did a real quick test on one of our projects. I had to upgrade to the latest compojure (seems the old version used a version of instaparse that wouldn't compile) but after that it seemed to work and was noticably faster. -David -- You received this message because you are subscribed to the

Re: Programmatic reification

2015-04-24 Thread Brian Guthrie
On Fri, Apr 24, 2015 at 10:14 AM, Steven Deobald ste...@nilenso.com wrote: I don't have the answer for you, but I'm definitely curious what your use case is. Whatcha upto? I've become a firm believer in using protocols to encapsulate operations with side effects, but I don't know of any good

What are favored Redis-backed queues?

2015-04-24 Thread larry google groups
I'm looking at this old post from Github, that lists the features they were looking for in a message queue: - Persistence - See what's pending - Modify pending jobs in-place - Tags - Priorities - Fast pushing and popping - See what workers are doing - See what workers

[ANN] closp 0.1.11 and closp-crud 0.1.0

2015-04-24 Thread Sven Richter
Yesterday I release a new version of closp which includes closp-crud. You can find the change list of closp at the bottom of the readme: https://github.com/sveri/closp I also released closp-crud, which is a leiningen CRUD plugin generating SQL files, HTML templates and clojure database and

Re: Programmatic reification

2015-04-24 Thread Timothy Baldridge
This is why I like component (https://github.com/stuartsierra/component). The nice thing about using this library is that it encourages you to break your application into self-contained components. Those components must then communicate via protocols, and the result is a modular system that's much

Re: Programmatic reification

2015-04-24 Thread Timothy Baldridge
Correction on my original response: The call to eval will be slow... Reify doesn't take up permgen space with each invocation, but eval will (at least on JVM 8). Timothy On Fri, Apr 24, 2015 at 2:14 PM, Brian Guthrie btguth...@gmail.com wrote: Thanks for the advice, Timothy. I think this is

Re: Programmatic reification

2015-04-24 Thread Brian Guthrie
On Fri, Apr 24, 2015 at 3:51 PM, Timothy Baldridge tbaldri...@gmail.com wrote: This is why I like component (https://github.com/stuartsierra/component). The nice thing about using this library is that it encourages you to break your application into self-contained components. Those components

Re: Programmatic reification

2015-04-24 Thread Brian Guthrie
Thanks for the advice, Timothy. I think this is probably much cleaner than where I ended up, and good advice. I'll let you know how it goes. On Fri, Apr 24, 2015 at 10:45 AM, Timothy Baldridge tbaldri...@gmail.com wrote: This is a situation where I reach for eval. Construct your reify call as

Re: Strange behaviour of a callable record

2015-04-24 Thread Alexey Cherkaev
Thanks, Nicola! It solved it. When I looked at docs, I couldn't figure out the role of `applyTo`. Well, now I know. On Thursday, April 23, 2015 at 1:47:11 PM UTC+2, Nicola Mometto wrote: You're not implementing IFn.applyTo, you should. Why applyTo is used in the second example while invoke