Re: test.check generating hierarchy with relations

2014-12-09 Thread cliff
Nico, what is the correct way to turn my function which generates the graph (using core.logic) into a generator? On Monday, 8 December 2014 09:04:14 UTC+2, cliff wrote: > > Hi > > I would like to test a function which recursively traverses the nodes in a > graph and collects them. For example,

Re: debugging "MyClass cannot be cast to MyClass" exceptions

2014-12-09 Thread Laurent PETIT
Hello, I think it does for deciding whether to use the class file found on disk, or to recompile the namespace in memory from the .clj file. Does the above make sense ? Laurent Le mercredi 10 décembre 2014, Brian Craft a écrit : > This exception is related to the pack200 -m option, which alter

Re: clojure.edn won't accept clojure.java.io/reader? How to work around this and why isn't this documented anywhere?

2014-12-09 Thread Fluid Dynamics
On Tuesday, December 9, 2014 11:42:40 PM UTC-5, Ryan Schmitt wrote: > > It turns out there are some subtle issues which can cause incorrect >>> behavior were clojure.core/read to blindly wrap a PushbackReader around its >>> argument: >>> https://groups.google.com/d/msg/clojure/_tuypjr2M_A/W1EcE

Re: test.check generating hierarchy with relations

2014-12-09 Thread cliff
Hi Nico Thanks for your advice. * The `size` param in `gen-hierarchy` is being passed as the first param to > `run`, which limits the count of results returned by core.logic. What's the > intention there? I think it's most common to grab one result from run, or > all of them (to check if it al

Re: what do you think about this code?

2014-12-09 Thread Dave Della Costa
Hi Philip, I think Colin gave a good response further down the thread, in particular I think his statement "I at least have found Clojure has a much higher signal to noise ratio..and can provide a significant reduction in incidental complexity, thus reducing the problem that some of these appr

Re: debugging "MyClass cannot be cast to MyClass" exceptions

2014-12-09 Thread Brian Craft
This exception is related to the pack200 -m option, which alters class file timestamps. Do clojure class loaders depend on class file timestamps? On Monday, December 8, 2014 9:15:57 AM UTC-8, Brian Craft wrote: > > Assuming this is something to do with class loaders going wrong, how would > I a

Re: clojure.edn won't accept clojure.java.io/reader? How to work around this and why isn't this documented anywhere?

2014-12-09 Thread Ryan Schmitt
Can anyone come up with an example of a case where the call to clojure.edn/read leaves an unread character in the PushbackReader? Looking briefly at the EdnReader source, I only see cases where the pushback buffer is used internally, in order to save a character that is later consumed during th

Re: Memoize in the real world

2014-12-09 Thread Steven Yi
No reason really, just ended up writing it that way for the example. (Maybe subconsciously I didn't want to think about pointer pointers and wanted to break up the notation. :P) On Tue, Dec 9, 2014 at 11:18 PM, Fluid Dynamics wrote: > > > On Tuesday, December 9, 2014 7:19:27 PM UTC-5, Steven Yi w

Re: clojure.edn won't accept clojure.java.io/reader? How to work around this and why isn't this documented anywhere?

2014-12-09 Thread Ryan Schmitt
> > It turns out there are some subtle issues which can cause incorrect >> behavior were clojure.core/read to blindly wrap a PushbackReader around its >> argument: >> https://groups.google.com/d/msg/clojure/_tuypjr2M_A/W1EcEbMUg_cJ >> > > That sounds like magic. The user wrapping a PushbackReade

Re: Memoize in the real world

2014-12-09 Thread Fluid Dynamics
On Tuesday, December 9, 2014 7:19:27 PM UTC-5, Steven Yi wrote: > > Hi Andy, > > Just my two cents here, but I don't think memoize makes sense here myself > due to this not being referentially transparent, and I think Andrey's > comment on delays makes more sense to me. You could do something

Re: test.check generating hierarchy with relations

2014-12-09 Thread Nicolás Berger
Hey Cliff, A couple comments: * The `size` param in `gen-hierarchy` is being passed as the first param to `run`, which limits the count of results returned by core.logic. What's the intention there? I think it's most common to grab one result from run, or all of them (to check if it always genera

Re: Status of lean runtime?

2014-12-09 Thread Alex Miller
We are still very interested in improving both Clojure load times and pursuing multiple build profiles. That work will not be part of 1.7. Alex -- 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: what do you think about this code?

2014-12-09 Thread Colin Yates
Nice presentation (although I didn't see anything about comments. ?.). As I mentioned before, there seem to be significantly less examples of capturing semantic knowledge in names. I think a significant reason is the higher level abstractions you get to play with in FP and Clojure. This leads to

Re: Memoize in the real world

2014-12-09 Thread Steven Yi
Hi Andy, Just my two cents here, but I don't think memoize makes sense here myself due to this not being referentially transparent, and I think Andrey's comment on delays makes more sense to me. You could do something like this: (def conf (atom (delay (read-and-expensively-parse "somefile.xml"

Re: what do you think about this code?

2014-12-09 Thread Fluid Dynamics
That sounds interesting, but ... either disable all the security in my browser or download a 50 megabyte pdf? Ouch. :( -- 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

Re: what do you think about this code?

2014-12-09 Thread Philip Schwarz
picking up from my e-mail below... In Smalltalk Best Practice Patterns (STBPP) Kent Beck describes a 'good programming' style guide, a system or language of 92 patterns. Five of them stand out as being: - Fundame

Re: [ANN] ring-access-rules library

2014-12-09 Thread Dmitri
It really looks fantastic, I'll do the integration in Luminus this weekend and let you know how that goes. :) On Tuesday, December 9, 2014 4:50:51 PM UTC-5, Andrey Antukh wrote: > > > > 2014-12-09 22:35 GMT+01:00 Dmitri >: > >> I'm definitely up for that, if I knew about buddy I wouldn't have sta

Re: [ANN] ring-access-rules library

2014-12-09 Thread Andrey Antukh
2014-12-09 22:35 GMT+01:00 Dmitri : > I'm definitely up for that, if I knew about buddy I wouldn't have started > the lib in the first place. :) I found friend to be a bit too complex for > what I needed in the apps I was writing as well. I originally added the > access restriction logic to lib-no

Re: 1.6.X latest branch

2014-12-09 Thread Alex Miller
On Monday, December 8, 2014 9:01:06 PM UTC-6, Andy Fingerhut wrote: > > I can't state authoritatively why, but here is some evidence: > > 1.1.x and 1.3.x are identical to 1.1.0 and 1.3.0. > > 1.2.x and 1.5.x are equivalent to 1.2.1 and 1.5.1, respectively, which do > have a few bug fixes made af

Re: [ANN] ring-access-rules library

2014-12-09 Thread Dmitri
I'm definitely up for that, if I knew about buddy I wouldn't have started the lib in the first place. :) I found friend to be a bit too complex for what I needed in the apps I was writing as well. I originally added the access restriction logic to lib-noir, but recently I started considering de

Re: [ANN] ring-access-rules library

2014-12-09 Thread Andrey Antukh
Would be awesome join forces, and If you miss something that you library is already support, let me know, and we can integrate it in buddy. I have made buddy because I'm little frustrate with friend approach (is good but not convinced me). Regards. Andrey 2014-12-09 21:30 GMT+01:00 Dmitri : > T

Re: clojure.edn won't accept clojure.java.io/reader? How to work around this and why isn't this documented anywhere?

2014-12-09 Thread dmiller
> > > Also, how does this work on ClojureCLR or ClojureScript? Neither of those > platforms has a java.io.PushbackReader, and I'm not even sure what the > equivalent of the clojure.java.io namespace is for them, unless the > "java" in that name is misleading. > > ClojureCLR implements Pushback

Re: [ANN] ring-access-rules library

2014-12-09 Thread Dmitri
That does look rather similar actually, and it looks like buddy does a lot more as well. I guess that validates the approach, I'll have to see if it fits all my use cases. :) On Tuesday, December 9, 2014 2:43:42 PM UTC-5, Andrey Antukh wrote: > > Hi Dmitri! > > If I understand it well, is a very

Re: [ANN] ring-access-rules library

2014-12-09 Thread Andrey Antukh
Hi Dmitri! If I understand it well, is a very similar system already implemented in buddy: http://niwibe.github.io/buddy/#_access_rules_system Regards. Andrey. 2014-12-09 19:11 GMT+01:00 Dmitri : > https://github.com/yogthos/ring-access-rules > > Friend is a great library, but it's definitely n

[ANN] ring-access-rules library

2014-12-09 Thread Dmitri
https://github.com/yogthos/ring-access-rules Friend is a great library, but it's definitely not easy to get into and I found it can actually make the workflow logic difficult to follow in some cases. My experience has been that for apps I work on all I want is to apply a decision function to a

Re: Memoize in the real world

2014-12-09 Thread David Powell
If you want to use memoize, then the clojure.core.memoize provides a more tunable version, which supports clearing the cache if required. https://github.com/clojure/core.memoize/blob/master/docs/Using.md -- You received this message because you are subscribed to the Google Groups "Clojure" group.

Re: Memoize in the real world

2014-12-09 Thread Andrey Antukh
Hi! 2014-12-09 18:08 GMT+01:00 Andy Dwelly : > Looking through my recent work I see that a number of atoms, swap! and > reset! calls have snuck into my work, usually when there's an expensive > operation like reading and parsing a large file or connecting to a > database. I find I'm doing things

Memoize in the real world

2014-12-09 Thread Andy Dwelly
Looking through my recent work I see that a number of atoms, swap! and reset! calls have snuck into my work, usually when there's an expensive operation like reading and parsing a large file or connecting to a database. I find I'm doing things like (def conf (atom nil)) (defn config [] (if (

Re: Ring and Compojure with Node.js via Clojurescript

2014-12-09 Thread James Reeves
On 9 December 2014 at 11:07, Thomas Heller wrote: > Due to significant platform differences from the JVM to Node.js (no real > threads, everything needs callbacks) you'd probably be better off writing > something more javascript-y. Porting Ring is probably not likely since > everything is async a

Re: Ring and Compojure with Node.js via Clojurescript

2014-12-09 Thread Angel Java Lopez
Another path: write ClojureScript that consumes directly Nodejs and some popular web framework (like Express). Then, you can write the controllers/actions/logic in ClojureScript. I'm not sure about the feasibility of this idea from clojurescript. Angel "Java" Lopez @ajlopez On Tue, Dec 9, 2014 at

Re: Ring and Compojure with Node.js via Clojurescript

2014-12-09 Thread Angel Java Lopez
Maybe when you reach the async nature of node.js, you could use node fibers https://github.com/laverdet/node-fibers to wrap up async calls as sync ones, as a "baby step" to implement your ideas. Meteor https://www.meteor.com/ use a lot of fibers internally. Angel "Java" Lopez @ajlopez On Tue,

Re: Ring and Compojure with Node.js via Clojurescript

2014-12-09 Thread Thomas Heller
Due to significant platform differences from the JVM to Node.js (no real threads, everything needs callbacks) you'd probably be better off writing something more javascript-y. Porting Ring is probably not likely since everything is async and Ring is not. Same goes for Compojure but that is most

Re: clojure.main on a clj file does not show up any println

2014-12-09 Thread Gary Verhaegen
You need to set the http_proxy variable for lein to work behind a peoxy. Maybe the https_proxy too. If your proxy does man-in-the-middle style https interception, you might also need to downgrade leiningen to 2.3.x, depending on how badly the proxy server is configured. The syntax of http_proxy i

Re: what do you think about this code?

2014-12-09 Thread Colin Yates
Identifying the requirements for "maintainable" is the key and as far as I know we as a software industry aren't close to solving it. Whilst programs are written by those bags opinionated, subjective and finicky bags of water known as people it will also be elusive as maintenance has to be at least

Re: what do you think about this code?

2014-12-09 Thread Colin Yates
I forgot to mention but https://github.com/bbatsov/clojure-style-guide is a pretty good resource. On 9 Dec 2014 00:24, "Philip Schwarz" wrote: > Hello David, > > I had set myself the constraint that I wanted the solution to exploit two > symmetries: > (1) The top left and top right of the diamond