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

2014-12-08 Thread Ganesh Krishnamoorthy
That helped, Thanks! The Clojure CLR seems to be working a bit different. It insists on a ns, creates an exe by ns and its readily run-able. I gave Lein a shot too, but apparently its looking for some dependencies to be downloaded, I am behind a proxy so that dint work too... Is there a dependenc

Re: test.check generating hierarchy with relations

2014-12-08 Thread cliff
Hi Gary I have tried your suggestion but I fear there is a deeper problem. Thanks Cliff On Monday, 8 December 2014 12:03:47 UTC+2, Gary Verhaegen wrote: > > I haven't touched test.check yet, si this might be completely off the > mark, but based on my limited understanding, here's what I think h

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

2014-12-08 Thread Dylan Butman
+10 for bringing this thread around. On Monday, December 8, 2014 9:42:33 PM UTC-5, Luc wrote: > > Dunno the answer but I know how many buddhist monks are needed, exactly > three: > > a) the first one readies itself for the bulb swap! by repeating a mantra > b) the second meditates to make the fi

Re: what do you think about this code?

2014-12-08 Thread Leif
Hi, Philip. I had the same urge as David--I tried it out, glossing over any formal rules. Here's what I came up with: https://gist.github.com/leifp/ae37c3b6f1b497f13f1e In truth, I think David's solution is more readable and maintainable. But I think "maintainability" is a pretty tricky conce

Re: ANN: Prone - better exception reporting middleware for Ring

2014-12-08 Thread Baishampayan Ghose
This is brilliant! Thanks Magnar :-) ~BG On Mon, Dec 8, 2014 at 1:15 PM, Magnar Sveen wrote: > Better exception reporting middleware for Ring. Heavily inspired by > better_errors > for Rails . > > See it to believe it: a quick video demoing Prone >

Re: 1.6.X latest branch

2014-12-08 Thread Andy Fingerhut
Is there something missing, at least for your purposes, with the JARs released via Maven for Clojure? http://search.maven.org/#search%7Cgav%7C1%7Cg%3A%22org.clojure%22%20AND%20a%3A%22clojure%22 I suspect you may want to make your script easy to modify for whatever is the branch that contains the

Re: 1.6.X latest branch

2014-12-08 Thread Andy Fingerhut
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 after the 1.2.0 and 1.5.0 releases. There were never any 1.4.x or 1.6.x releases for

1.6.X latest branch

2014-12-08 Thread GlassGhost
I see there is latest branches for versions: - https://github.com/clojure/clojure/tree/1.5.x - https://github.com/clojure/clojure/tree/1.3.x - https://github.com/clojure/clojure/tree/1.2.x - https://github.com/clojure/clojure/tree/1.1.x Where/Why is there no branches for 1.6 and 1.

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

2014-12-08 Thread Luc Préfontaine
Dunno the answer but I know how many buddhist monks are needed, exactly three: a) the first one readies itself for the bulb swap! by repeating a mantra b) the second meditates to make the first monk levitate toward the fixture c) the third one immolates itself to provide light for the entire dura

Re: Clojure on iOS devices - Swift as a host?

2014-12-08 Thread Sven Pedersen
Also, LLVM does support Swift seems to support Tail Call Optimization, according to this thread: http://stackoverflow.com/questions/24023580/does-swift-implement-tail-call-optimization-and-in-mutual-recursion-case I'm not familiar with the term fixnum, but if you mean the Ruby term for machine wo

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

2014-12-08 Thread Matching Socks
How many programmers does it take to change a light bulb?! http://dev.clojure.org/jira/browse/CLJ-1611 -- 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

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

2014-12-08 Thread Fluid Dynamics
On Monday, December 8, 2014 7:32:29 PM UTC-5, Stuart Sierra wrote: > > As the original author of the function that eventually became > clojure.java.io/reader, it was one of those unfortunate decisions that > seemed like a good idea at the time and cannot be changed without breaking > backwards c

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

2014-12-08 Thread Stuart Sierra
As the original author of the function that eventually became clojure.java.io/reader, it was one of those unfortunate decisions that seemed like a good idea at the time and cannot be changed without breaking backwards compatibility. Long before EDN existed, I wrote clojure.contrib.io https://g

Re: what do you think about this code?

2014-12-08 Thread Philip Schwarz
btw, my first impression when first looking at your solution is positive - the feeling I get is that I probably won't have problems understanding how it works Philip On Saturday, 6 December 2014 13:36:47 UTC, David Della Costa wrote: > > Hi Philip, > > I read your message and immediately wante

Re: what do you think about this code?

2014-12-08 Thread Philip Schwarz
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 are mirror images (2) The top half and bottom half of the diamond are also mirror images >I'm assuming you used a TDD process to write this (correct m

Re: Clojure on iOS devices - Swift as a host?

2014-12-08 Thread Colin Fleming
Also worth mentioning is Gal Dolber's project https://github.com/galdolber/clojure-objc. It's a modified version of the Clojure compiler which outputs Java source instead of bytecode, and then uses Google's J2Objc project. It's pretty neat - he has two iOS apps live which were totally written in Cl

Re: what do you think about this code?

2014-12-08 Thread Philip Schwarz
TIL: butlast Nice. Philip On Saturday, 6 December 2014 13:36:47 UTC, David Della Costa wrote: > > Hi Philip, > > I read your message and immediately wanted to try it myself--I intended to > leave it at that but I realized I would be remiss if I did not give you a > little bit of feedback based

Re: Ring and Compojure with Node.js via Clojurescript

2014-12-08 Thread Henrik Eneroth
Awesome! I look forward to seeing the results. On Monday, December 8, 2014 3:50:48 PM UTC+1, Matthew Molloy wrote: > > Dear Community, > > I love making Clojure web apps, however their startup time is a serious > drawback when used with a transient hosting service such as Heroku. My > thought i

Re: Clojure on iOS devices - Swift as a host?

2014-12-08 Thread Sven Pedersen
All the options I mentioned -- swift-lambdatron, Goby, and RoboVM can be used to make apps to submit to the app store. None require jail breaking. Goby and RoboVM have been used for apps that were accepted. The compiled form of each app is a bonified Objective-C style LLVM binary. The ClojureSwift

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

2014-12-08 Thread Andy Fingerhut
To Fluid Dynamics: I attempted to send this privately to the email address a2093...@trbvm.com, but got a permanent failure to deliver. Hence the open letter. I understand that some things do not work as you wish them to, and I understand that one can be frustrated or shocked by the state of libr

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

2014-12-08 Thread Fluid Dynamics
On Monday, December 8, 2014 4:01:28 PM UTC-5, Michał Marczyk wrote: > > On 8 December 2014 at 21:17, Fluid Dynamics > wrote: > > On Monday, December 8, 2014 9:32:28 AM UTC-5, Las wrote: > >> […] > >> io/reader is not meant to be used solely as an input to edn/read. > > > > > > AFAICT, Pushba

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

2014-12-08 Thread Stephen Gilardi
> On Dec 8, 2014, at 9:02 AM, Ganesh Krishnamoorthy > wrote: > > I have been trying all my bit on to get my hello world working; Any help is > much appreciated... > > am trying to run it by > java -cp clojure-1.6.0.jar clojure.main hey.clj > I just get an empty line. > Below is my file: > >

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

2014-12-08 Thread Michał Marczyk
On 8 December 2014 at 21:17, Fluid Dynamics wrote: > On Monday, December 8, 2014 9:32:28 AM UTC-5, Las wrote: >> […] >> io/reader is not meant to be used solely as an input to edn/read. > > > AFAICT, PushbackReader is substitutable anywhere a reader is expected, but > apparently a plain unwrapped

Re: atoms, memoize, future-s and CAS

2014-12-08 Thread Michał Marczyk
On 8 December 2014 at 21:46, Fluid Dynamics wrote: > [...] > Which means it's locking or bust. You just get to either do the locking > yourself or delegate :) Sure, but isn't it nice when somebody else does your locking for you? :-) Incidentally, there is a trade-off here between lockless reads

Re: atoms, memoize, future-s and CAS

2014-12-08 Thread Michał Marczyk
Oh, and as for how to use it here, you could for example say (.putIfAbsent concurrent-hash-map :foo (delay (foo))) Then the first thread to @(get concurrent-hash-map :foo (delay :not-found)) (or similar) would actually compute the value. With a map in an atom, you could swap! using a function

Re: atoms, memoize, future-s and CAS

2014-12-08 Thread Fluid Dynamics
On Monday, December 8, 2014 3:34:05 PM UTC-5, Michał Marczyk wrote: > > On 8 December 2014 at 17:54, Andy L > > wrote: > >> But I'd personally just use a delay rather than "locking" for this > >> purpose. > > > > > > It is not that I like locking at all. However I still fail to see, how > in

Re: Clojure on iOS devices - Swift as a host?

2014-12-08 Thread Fluid Dynamics
On Monday, December 8, 2014 1:45:43 PM UTC-5, Sven Pedersen wrote: > > Austin Zheng has some code here > https://github.com/austinzheng/swift-lambdatron > that implements the basic syntax of Clojure with a REPL but does not > compile to LLVM bitcode yet. He's working on some cool ideas. I really

Re: Open html file in Clojure

2014-12-08 Thread Fluid Dynamics
On Monday, December 8, 2014 11:44:10 AM UTC-5, daveray wrote: > > Nope. It barely renders HTML3. JavaFX, I think, has a real embedded > browser component. > That's what I meant. And, of course, it's always easy to just launch a browser: > http://docs.oracle.com/javase/6/docs/api/java/awt/Deskto

Re: atoms, memoize, future-s and CAS

2014-12-08 Thread Michał Marczyk
On 8 December 2014 at 17:54, Andy L wrote: >> But I'd personally just use a delay rather than "locking" for this >> purpose. > > > It is not that I like locking at all. However I still fail to see, how in a > multithreaded context memoize/cache prevents executing a given function more > than once

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

2014-12-08 Thread Fluid Dynamics
On Monday, December 8, 2014 9:32:28 AM UTC-5, Las wrote: > Still, this is awkward, verbose, and prevents the (nontrivial) use of edn >> in a platform-neutral way by referring only to Clojure functions without >> direct interop. Well, except for the even more awkward workaround of slurp >> and r

Re: Clojure on iOS devices - Swift as a host?

2014-12-08 Thread Sven Pedersen
Austin Zheng has some code here https://github.com/austinzheng/swift-lambdatron that implements the basic syntax of Clojure with a REPL but does not compile to LLVM bitcode yet. He's working on some cool ideas. I really like Mike Fikes work on Goby and the example app Shrimp, and I've been expe

Re: Clojure on iOS devices - Swift as a host?

2014-12-08 Thread Sven Pedersen
Here is a project by Austin Zheng to implement Clojure in Swift (swift-lambdatron). He has some basics implemented with a REPL, but it does not compile to LLVM bitcode yet. He's talking about moving to Rust somehow… I'm still pretty new to Cloju

ANN Monger 2.0.1 is released

2014-12-08 Thread Michael Klishin
Monger [1] is a Clojure MongoDB driver for a more civilized age. Release notes: http://blog.clojurewerkz.org/blog/2014/12/08/monger-2-dot-0-1-is-released/ 1. http://clojuremongodb.info -- @michaelklishin, github.com/michaelklishin -- You received this message because you are subscribed to the

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

2014-12-08 Thread Brian Craft
Assuming this is something to do with class loaders going wrong, how would I approach finding the code paths involved? Could I identify where the class is being loaded; set breakpoints at those places to get the stack traces? Something else? In my case it seems to be triggered by a type hint on

Re: Open html file in Clojure

2014-12-08 Thread Niels van Klaveren
Perhaps it could be as simple as browse-url .. On Monday, December 8, 2014 5:44:10 PM UTC+1, daveray wrote: > > Nope. It barely renders HTML3. JavaFX, I think, has a real embedded > browser component. And, of course, it's always easy to jus

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

2014-12-08 Thread Ganesh Krishnamoorthy
I have been trying all my bit on to get my hello world working; Any help is much appreciated... am trying to run it by java -cp clojure-1.6.0.jar clojure.main hey.clj I just get an empty line. Below is my file: (defn -main [] (println "Hello World!") (println (- 1 1))) -- You received t

New Functional Programming Job Opportunities

2014-12-08 Thread Functional Jobs
Here are some functional programming job opportunities that were posted recently: Senior Software Engineer at McGraw-Hill Education http://functionaljobs.com/jobs/8771-senior-software-engineer-at-mcgraw-hill-education Software Engineer at UC Santa Cruz http://functionaljobs.com/jobs/8770-s

Re: atoms, memoize, future-s and CAS

2014-12-08 Thread Andy L
> > > Most of the cache implementations in core.cache have no side-effects. They > simply return a new cache rather than overwriting the old one. The memoize > library places the cache in an atom, so it's guaranteed to change > atomically. > I tried to read the cache code (btw an excellent exerci

Re: Open html file in Clojure

2014-12-08 Thread Dave Ray
Nope. It barely renders HTML3. JavaFX, I think, has a real embedded browser component. And, of course, it's always easy to just launch a browser: http://docs.oracle.com/javase/6/docs/api/java/awt/Desktop.html#browse%28java.net.URI%29 Dave On Mon, Dec 8, 2014 at 4:23 AM, Gary Verhaegen wrote: >

Re: [ClojureScript] Re: ANN: ClojureScript 0.0-2411

2014-12-08 Thread David Nolen
Thanks, fixed! David On Sun, Dec 7, 2014 at 7:01 PM, Shaun LeBron wrote: > might need to update the readme with this latest version > > On Friday, December 5, 2014 2:03:25 PM UTC-6, David Nolen wrote: >> ClojureScript, the Clojure compiler that emits JavaScript source code. >> >> README and sour

Re: For review: Clojure Namespace Isolation

2014-12-08 Thread Gary Verhaegen
Thanks for these clarifications! On Monday, 8 December 2014, Ralph Ritoch wrote: > One important piece of information about this feature is that it doesn't > manipulate classloaders. This feature was designed to be used with OSGi or > applications that handle their own classloading issues. In

Ring and Compojure with Node.js via Clojurescript

2014-12-08 Thread Matthew Molloy
Dear Community, I love making Clojure web apps, however their startup time is a serious drawback when used with a transient hosting service such as Heroku. My thought is to port Ring and Compojure over to Clojurescript so that can get their nice abstractions hosted on the Node.js runtime. Any

Ring and Compojure in Clojurescript

2014-12-08 Thread Matthew Molloy
Hi guys, I love making Clojure web apps, however their startup time is a serious drawback when used with a transient hosting service such as Heroku. My thought is to port Ring and Compojure over to Clojurescript and create a Node.js ring adapter. Has anybody tried something like this? Any s

Re: For review: Clojure Namespace Isolation

2014-12-08 Thread Ralph Ritoch
One important piece of information about this feature is that it doesn't manipulate classloaders. This feature was designed to be used with OSGi or applications that handle their own classloading issues. In a typical application when entering a namespace isolation you may also need to bind 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-08 Thread László Török
2014-12-08 8:12 GMT+00:00 Fluid Dynamics : > On Monday, December 8, 2014 2:26:42 AM UTC-5, Andy Fingerhut wrote: >> >> In regards to your question "Why isn't this documented anywhere?", it is >> documented somewhere -- in the documentation string for clojure.edn/read, >> the very function you were

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

2014-12-08 Thread Ashton Kemerling
Nothing in the Java.io namespace was made by the clojure team, so it's not their fault that reader and pushbackreader aren't cross compatible. I'm assuming that they need something from pushbackreader for performance reasons, but that's just a guess. Clojurescript and ClojureCLR must have diff

Re: For review: Clojure Namespace Isolation

2014-12-08 Thread Ralph Ritoch
Gary, One additional note. When your about to use a dependency you will still need to enter into the isolation of that dependency for any feature that accesses namespaces not in your current environment (such as any call to the dependency which uses conflicting namespaces). Not every feature

Re: For review: Clojure Namespace Isolation

2014-12-08 Thread Ralph Ritoch
Gary, What your stating is possible with this, but it wouldn't be automatic. You could load the one dependency in one isolation, and load the second dependency in a second isolation. This is where a bit of "hard work" would be needed to keep the pointers returned when you create the two en

Re: For review: Clojure Namespace Isolation

2014-12-08 Thread Gary Verhaegen
Naive question: does that solve the dependency problem where two explicit dependencies depend on different versions of a transitive one and something breaks because of it? On Monday, 8 December 2014, Ralph Ritoch wrote: > Thank you. I have signed the contributor agreement and applied to join > c

Re: For review: Clojure Namespace Isolation

2014-12-08 Thread Ralph Ritoch
Thank you. I have signed the contributor agreement and applied to join clojure-dev (request pending). On Monday, December 8, 2014 3:38:15 AM UTC+8, Alan Forrester wrote: > > On 7 December 2014 at 19:27, Fluid Dynamics > wrote: > > On Sunday, December 7, 2014 11:12:37 AM UTC-5, Bozhidar Batsov w

Re: Open html file in Clojure

2014-12-08 Thread Gary Verhaegen
This seems to be what Fluid is talking about: https://docs.oracle.com/javase/tutorial/uiswing/components/html.html I wiuld be a bit wary, however: I doubt this is a complete implementation of an HTML5-compatible browser with state of the art JavaScript interpreter. It's worth trying, but I would

Re: [ANN] stateful-check 0.1.0 - test stateful systems with test.check

2014-12-08 Thread Jan Stępień
W dniu piątek, 28 listopada 2014 15:50:41 UTC+1 użytkownik Carlo napisał: > > > I think we've started working on our libraries nearly the same day :) > > > > https://github.com/jstepien/states > > I've actually seen your library since writing stateful-check. When I > experimented with it, thoug

Re: test.check generating hierarchy with relations

2014-12-08 Thread Gary Verhaegen
I haven't touched test.check yet, si this might be completely off the mark, but based on my limited understanding, here's what I think happens. for-all probably removes one level of nesting from your generator, which means that bindings is bound to a seq with one element, which is a map. Then, key

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

2014-12-08 Thread Fluid Dynamics
On Monday, December 8, 2014 2:26:42 AM UTC-5, Andy Fingerhut wrote: > > In regards to your question "Why isn't this documented anywhere?", it is > documented somewhere -- in the documentation string for clojure.edn/read, > the very function you were attempting to use: > > user=> (doc clojure.edn/