Re: fold over a sequence

2013-03-10 Thread Alan Busby
On Mon, Mar 11, 2013 at 9:40 AM, Paul Butcher wrote: > I'm currently working on code that processes XML generated by > clojure.data.xml/parse, and would love to do so in parallel. I can't > immediately see any reason why it wouldn't be possible to create a version > of CollFold that takes a seque

Re: ANN: Iota 1.0.2 release (Reducers for text files)

2013-03-10 Thread Alan Busby
Hi Bernard, I'm going to see if I can add some performance metrics in the test code to try and determine where various bottlenecks may exist. If that goes well I'll see if I can add a branch that returns Byte[] instead of String for iota/vec. I suspect this will just require modifying iota.FileVe

Querying hierarchies in core.logic

2013-03-10 Thread JvJ
I understand that it is possible, and I have found a code example here : https://github.com/frenchy64/Logic-Starter/blob/master/src/logic_introduction/extend.clj#L76 However, the code presented is rather terse, and some functions, such as lvar-in? aren't documented. Does anyone know of somethi

Re: Clojure 1.5.1

2013-03-10 Thread ke . mar . 92
I think there's a typo in the download link on http://clojure.org/downloads: It says http://repo1.maven.org/maven2/org/clojure/clojure/1.5.*0* /clojure-1.5.1.zip whereas it should be http://repo1.maven.org/maven2/org/clojur

Re: fold over a sequence

2013-03-10 Thread Rich Morin
On Mar 10, 2013, at 17:40, Paul Butcher wrote: > As things currently stand, fold can be used on a sequence- > based reducible collection, but won't be parallel. > > I'm currently working on code that processes XML generated by > clojure.data.xml/parse, and would love to do so in parallel. > I can

Re: Newbie requesting review

2013-03-10 Thread Craig Ching
Alright, thanks Gary and Marko, I really appreciate the advice! On Sunday, March 10, 2013 8:26:47 AM UTC-5, Marko Topolnik wrote: > > Several comments: > > 1. camelCase is not idiomatic for Clojure. Prefer lowercase-dashed-style. > > 2. use :keywords for map keys and, more generally, for any > e

fold over a sequence

2013-03-10 Thread Paul Butcher
As things currently stand, fold can be used on a sequence-based reducible collection, but won't be parallel. I'm currently working on code that processes XML generated by clojure.data.xml/parse, and would love to do so in parallel. I can't immediately see any reason why it wouldn't be possible

Re: type inference in core.logic

2013-03-10 Thread JvJ
Thank you! That's exactly what I was looking for. On Sunday, 10 March 2013 18:11:56 UTC-4, Ambrose Bonnaire-Sergeant wrote: > > Did you find the accompanying wiki? > https://github.com/frenchy64/Logic-Starter/wiki > > Ambrose > > On Mon, Mar 11, 2013 at 4:37 AM, JvJ >wrote: > >> >> I feel as tho

Re: Problem with Code Dispatch for Anonymous Functions?

2013-03-10 Thread Devin Walters
After discussing with a couple of folks in IRC (big thank you to hyPiRion for his help), I opened a ticket to address this bug here: http://dev.clojure.org/jira/browse/CLJ-1181 Long story short, ((formatter-out "~<#(~;~@{~w~^ ~_~}~;)~:>") nlis) expects nlis to be a sequence, but in the case of

Re: Windows Installation

2013-03-10 Thread Martin Jul
An alternative to GNU tools is to use the things that ship with Windows PowerShell and are on most developer's machines already, e.g. using the Invoke-RestMethod commandlet as an alternative to wget and curl. I have used PowerShell to simplify ClojureScript setup on Windows without too much tro

Re: Clojure 1.5.1

2013-03-10 Thread Ghadi Shayban
fyi - Rich's .idea/ crept in on the bug fix commit. On Sunday, March 10, 2013 8:35:34 PM UTC+2, Stuart Halloway wrote: > > Clojure 1.5.1 fixes a memory leak in Clojure 1.5, discussed here: > > https://groups.google.com/d/msg/clojure-dev/uAFM0Ti4AcQ/GmnKmphF1BgJ > > Getting Clojure: > > Web:

Re: :use an entire namespace full of protocols or stick with :require?

2013-03-10 Thread Devin Walters
I switched to just using (:require) with :as and :refer unless there's a really good reason to use :use. It stops me from accidentally making the mistake of dropping [my.ns.core :as foo] into a growing (ns (:use …)) form. -- '(Devin Walters) On Sunday, March 10, 2013 at 3:03 PM, Jonathan F

type inference in core.logic

2013-03-10 Thread JvJ
I feel as though I've seen a comprehensive tutorial involving type inference in core.logic. I've recently been looking through the links referred to in this post, how

Problem with Code Dispatch for Anonymous Functions?

2013-03-10 Thread Devin Walters
Could anyone help me understand why the following code is breaking? (require '[clojure.pprint :refer [with-pprint-dispatch code-dispatch pprint]]) (with-pprint-dispatch code-dispatch (pprint (read-string "(^:once fn* [x] x)"))) IllegalArgumentException Don't know how to create ISeq from: clojur

Re: Windows Installation

2013-03-10 Thread Sean Corfield
On Sat, Mar 9, 2013 at 12:37 PM, BJG145 wrote: > (...I have to say that, from reading the above, Cygwin sounds like a > nighmare and I certainly won't be troubling it...! If you want Linux on a > Windows machine, Virtualbox sounds like a safer bet...) Installing GOW Gnu on Windows seems to be a m

Re: :use an entire namespace full of protocols or stick with :require?

2013-03-10 Thread Jonathan Fischer Friberg
I would say using :require :as is in almost all cases better. However, I think :use is preferred if almost everything done in the current namespace depends on the used namespace. Though, no more than one namespace should ever be imported with :use in the same namespace. In your case I think it's a

Clojure 1.5.1

2013-03-10 Thread Stuart Halloway
Clojure 1.5.1 fixes a memory leak in Clojure 1.5, discussed here: https://groups.google.com/d/msg/clojure-dev/uAFM0Ti4AcQ/GmnKmphF1BgJ Getting Clojure: Web: http://clojure.org/downloads Lein/Maven: :dependencies [[org.clojure/clojure "1.5.1"]] Note that it will take a few hou

Re: Model-View-Controller in Clojure?

2013-03-10 Thread edward
Thanks very much Jim, that's really useful stuff. On Saturday, March 9, 2013 2:30:59 PM UTC, Jim foo.bar wrote: > > also see this for a discussion about why the need for design patterns > almost disappears in Clojure: > > http://stackoverflow.com/questions/8902113/clojure-model-view-controller-m

Re: Namespaced symbols, and errors

2013-03-10 Thread Marko Topolnik
On Friday, March 8, 2013 4:56:03 PM UTC+1, nick rothwell wrote: > > Typing the following at a REPL: > > (str ::junk/junk) > > (where there's no alias for junk) gives me: > > RuntimeException Invalid token: ::junk/junk > clojure.lang.Util.runtimeException (Util.java:219) > RuntimeException Unmat

[ANN] clj-configurator – A powerful yet simple Clojure configuration library.

2013-03-10 Thread Greg V
Hello everyone! I made a little configuration library: https://github.com/myfreeweb/clj-configurator Supports any configuration format (TOML, YAML, JSON, EDN, whatever) -- you just parse it yourself. Supports environment variables and Java system properties. Automatically figures out types base

Re: Newbie requesting review

2013-03-10 Thread Marko Topolnik
Several comments: 1. camelCase is not idiomatic for Clojure. Prefer lowercase-dashed-style. 2. use :keywords for map keys and, more generally, for any enumeration-type values (coming from a closed set of options). If you want JSON output, transform these into camelCased strings only at the "ch

Re: Model-View-Controller in Clojure?

2013-03-10 Thread Marko Topolnik
My approach to this was to build a GUI framework which facilitates the use of closures to capture all the state atoms. This avoids the global map. The downside of global maps is also the limitation to singletons: if the same GUI element were created twice, name clashes in the global map would be

Re: Newbie requesting review

2013-03-10 Thread Gary Verhaegen
Your code looks fine to me. One alternative for make-students would have been (defn make-students [teacherName n] (map #(make-student teacherName (make-student-name %) 0) (range n))) In case you're not familiar with it, the #() notation creates an anonymous function in the same way as (fn [_]

Re: Namespaced symbols, and errors

2013-03-10 Thread Gary Verhaegen
Here's another mental model that you can use. (Not sure it is 100% accurate with the actual implementation, but it has served me well so far.) Keywords are not bound, in the same sense that numbers are not bound. 1 is 1, just as 2 is 2, whatever the namespace you are into. 1 from the user namespac

Re: Model-View-Controller in Clojure?

2013-03-10 Thread Jim - FooBar();
On 10/03/13 12:32, Gary Verhaegen wrote: Not all of your application can be purely functional, because it inevitably needs to interact with the outside world at some point. yes that is true...however, I often find that my first impression of what the functional boundaries are, is not necessarily

Re: :use an entire namespace full of protocols or stick with :require?

2013-03-10 Thread Alex Baranosky
>From experience in your case (300+) I'd use require/as with a small prefer like p/ . On Sun, Mar 10, 2013 at 5:10 AM, Jim - FooBar(); wrote: > On 10/03/13 12:03, Marko Topolnik wrote: > >> I came to prefer one-letter prefix for a common ns over no prefix at all. >> Once you get accustomed to it,

Re: Model-View-Controller in Clojure?

2013-03-10 Thread Gary Verhaegen
Not all of your application can be purely functional, because it inevitably needs to interact with the outside world at some point. Purely functional code is easier to reason about, so the pragmatic approach of Clojure is to encourage you to have most of your application be purely functional, whil

Re: :use an entire namespace full of protocols or stick with :require?

2013-03-10 Thread Jim - FooBar();
On 10/03/13 12:03, Marko Topolnik wrote: I came to prefer one-letter prefix for a common ns over no prefix at all. Once you get accustomed to it, prefixless fns start looking "wrong", and the overhead of two chars is something we can live with. yes I agree with you 100%...this is my approach as

Re: :use an entire namespace full of protocols or stick with :require?

2013-03-10 Thread Marko Topolnik
I came to prefer one-letter prefix for a common ns over no prefix at all. Once you get accustomed to it, prefixless fns start looking "wrong", and the overhead of two chars is something we can live with. On Sunday, March 10, 2013 12:50:57 PM UTC+1, Alex Baranosky wrote: > > Stick with require/as

Re: :use an entire namespace full of protocols or stick with :require?

2013-03-10 Thread Jim - FooBar();
On 09/03/13 23:09, Travis Vachon wrote: Speaking strictly for myself, but as someone who spends about half his professional day writing Clojure: :use is dead, long live :require. I've found using ":require [foo :refer :all]" rather than ":use foo" has lead to cleaner, more consistent ns statemen

Re: :use an entire namespace full of protocols or stick with :require?

2013-03-10 Thread Jim - FooBar();
On 09/03/13 23:00, Korny Sietsma wrote: Note that as of clojure 1.4 you can also do: (:require foo.bar :refer :all) in fact from comments I've seen elsewhere there is a general intention to remove :use entirely? a bare :use is essentially the same thing as :require :refer :all...none gives

Re: :use an entire namespace full of protocols or stick with :require?

2013-03-10 Thread Jim - FooBar();
no I don't have to :import them...I need the namespace loaded and then I need access to all the protocol vars (both can be achieved with :require)...The concrete records need importing by the consumer, if that's what you mean... Jim On 10/03/13 11:18, Marko Topolnik wrote: Isn't it true that

Re: :use an entire namespace full of protocols or stick with :require?

2013-03-10 Thread Marko Topolnik
Isn't it true that you must *import* those protocols, and not :use them? In that case your dilemma would be moot. On Thursday, February 14, 2013 2:26:50 PM UTC+1, Jim foo.bar wrote: > > I know that using a bare :use in the ns macro is generally frowned upon > as it provides no hints about what

Re: Composable mutual recursive function composition

2013-03-10 Thread Catonano
I see now the blog post. Thanks anyway 2013/3/10 Catonano > What´s Prismatic for ? > > Why do you build graphs of computation ? > > Thanks > > > 2013/3/10 Brent Millare > >> I recently asked about mutual referenced support in the prismatic library >> plumbing >> >> https://github.com/Prismatic

Re: Composable mutual recursive function composition

2013-03-10 Thread Catonano
What´s Prismatic for ? Why do you build graphs of computation ? Thanks 2013/3/10 Brent Millare > I recently asked about mutual referenced support in the prismatic library > plumbing > > https://github.com/Prismatic/plumbing > > and currently its an open question about how to implement that. >

Re: Windows Installation

2013-03-10 Thread David Powell
I've made installers for clojure-based programs using InnoSetup before, and wouldn't mind doing it if people think it is a good idea. There would be a few choices around Java... a) Assume that a JDK is installed b) Check for java and direct the user to Oracle's site to download JDK 7 if it is mis

Re: Windows Installation

2013-03-10 Thread Korny Sietsma
As Jonathan Friberg says - "lein.bat" works fine. As Windows seems to often go hand-in-hand with intrusive proxies, you might also want to make sure you have environment variables "HTTP_PROXY" and "HTTPS_PROXY" pointing to a working proxy, if necessary you can run your own proxy using cntlm : http: