Re: map output to string

2014-07-08 Thread Daniel Compton
To force realisation of a sequence, use one of the do* forms. https://clojure.github.io/clojure/clojure.core-api.html#clojure.core/do If you post a gist of your code then someone may be able to give more specific guidance. Daniel. On 8/07/2014, at 2:15 pm, Glen Rubin rubing...@gmail.com

Re: System/getenv can't read env vars?

2014-07-08 Thread James Reeves
You could try running: export MY_VAR=foo bash -c 'echo $MY_VAR' And see if that comes with the same result. You might also want to make sure you're not using a pre-loader like Drip. You can use Java system properties to do per environment/machine config as well. I wrote a library a

Re: is their a Clojure framework for handling form validation?

2014-07-08 Thread Mimmo Cosenza
Sorry for the delay, I just saw this thread now. I used https://github.com/cemerick/valip A version of https://github.com/weavejester/valip by Chas Emerick which can be used for both client and server side validation. You could eventually take a look at the way I used from here on:

IllegalArgumentException when running core.async example

2014-07-08 Thread endbegin
Hi I was trying to teach myself core.async and tried the rock, paper, scissors example found here: http://tech.puredanger.com/2013/07/10/rps-core-async/ See a gist here: https://gist.github.com/endbegin/b10be6d7a3ba5f6c29db Really, the main difference is in the :require statement at the top,

Re: map output to string

2014-07-08 Thread Lee Spector
Sometimes you have to manually stamp out laziness, for this among other reasons. In some cases I apply the list function to do this: = (str (map inc (range 10))) clojure.lang.LazySeq@c5d38b66 = (str (apply list (map inc (range 10 (1 2 3 4 5 6 7 8 9 10) -Lee On 8 July 2014 09:49, Glen

Re: map output to string

2014-07-08 Thread Diego Basch
That's not your problem. From (doc str): With more than one arg, returns the concatenation of the str values of the args. The str value of a lazy sequence is something like: clojure.lang.LazySeq@386e0460 which is the result of (.toString your-seq) What you probably want is something like

Re: [ANN] Grimoire: up to date Clojure web docs

2014-07-08 Thread Andy Fingerhut
Mark, creating separate versions of the Clojure cheat sheet that link to Grimoire instead of ClojureDocs.org should be fairly straightforward, but due to other work I won't get to it for at least a few days. If someone else is interested, and not put off by my code, they are welcome to go for it

Re: [ANN] Grimoire: up to date Clojure web docs

2014-07-08 Thread Colin Fleming
If we think that Grimoire should be the official ClojureDocs replacement, why don't we do that? Could we just host Grimoire under the clojuredocs.org domain, perhaps structuring the URLs to match? One thing that I couldn't see - does Grimoire offer an API to get access to the examples? On 8

Re: [ANN] Grimoire: up to date Clojure web docs

2014-07-08 Thread Andy Fingerhut
On Tue, Jul 8, 2014 at 3:28 AM, Colin Fleming colin.mailingl...@gmail.com wrote: If we think that Grimoire should be the official ClojureDocs replacement, why don't we do that? Could we just host Grimoire under the clojuredocs.org domain, perhaps structuring the URLs to match? Depends upon

lein install

2014-07-08 Thread zhenxuanpan
when i run lein install lein install Compiling zilch.mq Exception in thread main java.io.FileNotFoundException: Could not locate zilch/mq__init.class or zilch/mq.clj on classpath: at clojure.lang.RT.load(RT.java:432) at clojure.lang.RT.load(RT.java:400) at

Re: lein install

2014-07-08 Thread Tim Visher
On Tue, Jul 8, 2014 at 7:39 AM, zhenxuanpan zhenxuan...@gmail.com wrote: when i run lein install lein install Compiling zilch.mq Exception in thread main java.io.FileNotFoundException: Could not locate zilch/mq__init.class or zilch/mq.clj on classpath: at clojure.lang.RT.load(RT.java:432)

Re: lein install

2014-07-08 Thread Plínio Balduino
I could guess that the problem is in the dot in the project name. Could you try to change it to zilch-mq or zilchmq and test? Plínio On Tue, Jul 8, 2014 at 8:39 AM, zhenxuanpan zhenxuan...@gmail.com wrote: when i run lein install lein install Compiling zilch.mq Exception in thread main

Re: lein install

2014-07-08 Thread zhenxuanpan
apache/storm, I compile at A,B machine, A machine success,B machine report this error 在 2014年7月8日星期二UTC+8下午8时12分48秒,Tim Visher写道: On Tue, Jul 8, 2014 at 7:39 AM, zhenxuanpan zhenx...@gmail.com javascript: wrote: when i run lein install lein install Compiling zilch.mq Exception

Re: lein install

2014-07-08 Thread zhenxuanpan
在 2014年7月8日星期二UTC+8下午7时39分51秒,zhenxuanpan写道: when i run lein install lein install Compiling zilch.mq Exception in thread main java.io.FileNotFoundException: Could not locate zilch/mq__init.class or zilch/mq.clj on classpath: at clojure.lang.RT.load(RT.java:432) at

Why clojure does not have pure lazy-evaluation like Haskell ?

2014-07-08 Thread Ashish Negi
I am new to clojure and finding it great.. :) I came across a paper - Why functional programming matters ? at www.cs.kent.ac.uk/people/staff/dat/miranda/whyfp90.pdf to quote it : This paper is also relevant to the present controversy over lazy evaluation. Some believe that functional

Fibonacci Heaps and Dijkstra's algorithm

2014-07-08 Thread Ashish Negi
I came across this article : http://maryrosecook.com/blog/post/the-fibonacci-heap-ruins-my-life The user says that he can not use fibonacci heaps efficiently in clojure because since the memory location of nodes changes, it is not possible to have a pointer to the nodes to get faster access to

Local variable

2014-07-08 Thread Cecil Westerhof
In Clojure you can define a local constant with let, but I need a variable (I think). I want to do the following. I have a function that checks several things. Every time an error is found I want to set the variable errors to: (concat errors new-error) Is this possible? Or is there a better

Re: Local variable

2014-07-08 Thread Michael Klishin
 On 8 July 2014 at 17:40:49, Cecil Westerhof (cldwester...@gmail.com) wrote: In Clojure you can define a local constant with let, but I need a variable (I think). They are not constants. Locals can be overwritten but their data structures are immutable (by default). I want to do the

Re: Local variable

2014-07-08 Thread Ashish Negi
you can make that variable error as an Agent and change it asynchronously or as a Ref if you want the change synchronously. other part of the code remains same. On Tuesday, 8 July 2014 19:10:54 UTC+5:30, Cecil Westerhof wrote: In Clojure you can define a local constant with let, but I need a

Re: Why clojure does not have pure lazy-evaluation like Haskell ?

2014-07-08 Thread Zach Oakes
Abstract topics like this are interesting, but you may be better off starting a discussion at a more generic venue like /r/programming, because it isn't really specific to Clojure. I would assume that pervasive laziness would greatly complicate interop with hosts like the JVM. On Tuesday, July

Re: Local variable

2014-07-08 Thread John Gabriele
On Tuesday, July 8, 2014 9:40:54 AM UTC-4, Cecil Westerhof wrote: In Clojure you can define a local constant with let, but I need a variable (I think). I want to do the following. I have a function that checks several things. Every time an error is found I want to set the variable errors

Re: System/getenv can't read env vars?

2014-07-08 Thread Jarrod Swart
James, It appears Sean and yourself have identified the issue. The tmux scripts that launch my dev environment don't pull in the necessary environment. I have seen your environ library and I was to thank you for all your contributions. Sean too! While I have you James do you have a good

Re: Why clojure does not have pure lazy-evaluation like Haskell ?

2014-07-08 Thread James Reeves
Laziness is a useful property, but it is not without its disadvantages, particularly in terms of predictable performance. For example, code involving lazy seqs is more prone to memory leaks than iterators are. Eager evaluation is a simpler approach, in terms of both code and predictability. Eager

Re: System/getenv can't read env vars?

2014-07-08 Thread James Reeves
I use an upstart script like: description Some description author Your name start on startup stop on shutdown setuid deploy chdir /deploy console log env PORT=4000 exec java -jar uberjar-name.jar In the above case, I deploy to the /deploy directory, and execute the jar using a non-privileged

Re: Local variable

2014-07-08 Thread Cecil Westerhof
2014-07-08 16:55 GMT+02:00 John Gabriele jmg3...@gmail.com: On Tuesday, July 8, 2014 9:40:54 AM UTC-4, Cecil Westerhof wrote: In Clojure you can define a local constant with let, but I need a variable (I think). I want to do the following. I have a function that checks several things.

Re: System/getenv can't read env vars?

2014-07-08 Thread Jarrod Swart
Awesome thank you! -- 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,

[ANN] Nightcode 0.3.8 and Nightmod 0.1.4

2014-07-08 Thread Zach Oakes
I recently released updates for Nightcode (a Clojure IDE) and Nightmod (a Clojure game tool). Nightcode https://nightcode.info/ has mostly received maintenance updates, because the main priority is being beginner-friendly rather than featureful. I finally added support for evaling a selected

Re: Local variable

2014-07-08 Thread Lars Nilsson
On Tue, Jul 8, 2014 at 11:38 AM, Cecil Westerhof cldwester...@gmail.com wrote: I al-ready tried something along those lines: (defn error-in-datastruct-p [] (let [errors (atom ())] (if (= (count objects) (count *object-locations*)) (map (fn [x] (println

Re: Local variable

2014-07-08 Thread John Gabriele
On Tuesday, July 8, 2014 11:38:42 AM UTC-4, Cecil Westerhof wrote: 2014-07-08 16:55 GMT+02:00 John Gabriele jmg...@gmail.com javascript:: On Tuesday, July 8, 2014 9:40:54 AM UTC-4, Cecil Westerhof wrote: In Clojure you can define a local constant with let, but I need a variable (I

Re: [ANN] Grimoire: up to date Clojure web docs

2014-07-08 Thread Colin Fleming
That was sort of a royal we, the community. I think everyone probably agrees that it's not in anyone's interest to have two separate clojure doc sites serving essentially exactly the same purpose (docs + examples). It looks like Zachary is working fairly actively on his new ClojureDocs version, is

Re: Why clojure does not have pure lazy-evaluation like Haskell ?

2014-07-08 Thread Marko Kocić
Clojure doesn't have lazy evaluation because it is a few years younger and didn't want to repeat Haskell's mistake. Even Simon Payton Jones, the creator of Haskel, confessed that, if he would make Haskel again, he would make it strict, and not lazy, but that it's too late to change it. -- You

Re: Why clojure does not have pure lazy-evaluation like Haskell ?

2014-07-08 Thread Andrey Antukh
2014-07-08 18:20 GMT+02:00 Marko Kocić ma...@euptera.com: Clojure doesn't have lazy evaluation because it is a few years younger and didn't want to repeat Haskell's mistake. Even Simon Payton Jones, the creator of Haskel, confessed that, if he would make Haskel again, he would make it strict,

Re: Local variable

2014-07-08 Thread Cecil Westerhof
2014-07-08 18:14 GMT+02:00 John Gabriele jmg3...@gmail.com: On Tuesday, July 8, 2014 11:38:42 AM UTC-4, Cecil Westerhof wrote: 2014-07-08 16:55 GMT+02:00 John Gabriele jmg...@gmail.com: On Tuesday, July 8, 2014 9:40:54 AM UTC-4, Cecil Westerhof wrote: In Clojure you can define a local

Re: Local variable

2014-07-08 Thread blake
Also, just a matter of style, but it's customary to leave closing parens at the end of a line, rather than by themselves on their own line. ​I do that also, but when I am editing I put them on there own line, because in this way changes are faster. When I am satisfied, I merge them. ;-)

Re: Why clojure does not have pure lazy-evaluation like Haskell ?

2014-07-08 Thread Colin Fleming
I searched for this as well, and found this: http://www.cs.nott.ac.uk/~gmh/appsem-slides/peytonjones.ppt Purity is more important than, and quite independent of, laziness and The next ML will be pure, with effects only via monads. The next Haskell will be strict, but still pure. On 8 July

Re: [ANN] Grimoire: up to date Clojure web docs

2014-07-08 Thread Reid McKenzie
1) doesn't make a whole lot of sense. I'm an adherent to the simplest thing that could possibly work philosophy, and as a result Grimoire is entirely static HTML. Search and symbol quick access could be implemented by adding some javascript, but that's a low priority item at the moment as there

Re: [ANN] Grimoire: up to date Clojure web docs

2014-07-08 Thread Reid McKenzie
Not as such. Strictly speaking one can navigate to say https://github.com/arrdem/grimoire/edit/master/_includes/1.4.0/clojure.core/DASH/examples.md and find all the examples for what is in this case clojure.core/-. However there is no examples API at present and due to the flat file nature of

[nginx-clojure] Getting started question

2014-07-08 Thread Boris Kourtoukov
I am working on a small personal project and want to use/learn nginx and clojure as the web backend. Unfortunately I am bogged down my the installation instructions. I have Nginx running and serving html on a Linode instance, I just don't know enough about it's plugins to do step 1.1

[question] Multimethods vs case

2014-07-08 Thread Elric Erkose
Is there any documentation or do you have thoughts on choosing between using multimethods vs case? I assume they both do constant time dispatch. -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email to

Re: Client side tools for Clojure web app (back end questions as well, especially Pedestal)

2014-07-08 Thread Ahmad Hammad
Brendan, could you please elaborate on how you handled client/server communication with a project using Reagent/Om? -- 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

Re: Local variable

2014-07-08 Thread Bob Hutchison
On Jul 8, 2014, at 9:40 AM, Cecil Westerhof cldwester...@gmail.com wrote: In Clojure you can define a local constant with let, but I need a variable (I think). I want to do the following. I have a function that checks several things. Every time an error is found I want to set the

Re: [question] Multimethods vs case

2014-07-08 Thread Sam Ritchie
Use multimethods if you want to open the system up for later extension (by a library user, for example). Elric Erkose mailto:elric.erk...@gmail.com July 8, 2014 at 2:02 PM Is there any documentation or do you have thoughts on choosing between using multimethods vs case? I assume they both do

Re: lein install

2014-07-08 Thread Sam Ritchie
No, that's the name of a namespace - zilch is the library, and it has an mq namespace, I believe. My guess is that it's a multi-module project and you're running lein install from the root, instead of the appropriate submodule. Plínio Balduino mailto:pbaldu...@gmail.com July 8, 2014 at 6:39

Re: Local variable

2014-07-08 Thread Cecil Westerhof
2014-07-08 23:11 GMT+02:00 Bob Hutchison hutch-li...@recursive.ca: On Jul 8, 2014, at 9:40 AM, Cecil Westerhof cldwester...@gmail.com wrote: In Clojure you can define a local constant with let, but I need a variable (I think). I want to do the following. I have a function that checks

Land of lisp to Clojure

2014-07-08 Thread Cecil Westerhof
I received the book land of lisp as a gift. I am trying to translate it to Clojure. In chapter 5 there is a text game engine. In the attachment my translation. What do you think of it? There are a few problems. - The book displays all the lines of a look on separate lines. In my case it is just

Re: Land of lisp to Clojure

2014-07-08 Thread Bruce Wang
Hi Cecil, You might want to check out this https://github.com/quux00/land-of-lisp-in-clojure Cheers, Bruce On Wed, Jul 9, 2014 at 9:49 AM, Cecil Westerhof cldwester...@gmail.com wrote: I received the book land of lisp as a gift. I am trying to translate it to Clojure. In chapter 5 there is

Re: Local variable

2014-07-08 Thread Bob Hutchison
On Jul 8, 2014, at 7:08 PM, Cecil Westerhof cldwester...@gmail.com wrote: 2014-07-08 23:11 GMT+02:00 Bob Hutchison hutch-li...@recursive.ca: On Jul 8, 2014, at 9:40 AM, Cecil Westerhof cldwester...@gmail.com wrote: In Clojure you can define a local constant with let, but I need a

Re: map output to string

2014-07-08 Thread Glen Rubin
I am still having difficulties with this, so let me clarify by showing some sample code. My fn looks like this: (defn report [text] (str string1 string2 (apply str (map-indexed (fn [idx itm] (time-text idx itm)) (filtered-list text)) When I invoke spit in order to output a text

Re: Land of lisp to Clojure

2014-07-08 Thread Timothy Baldridge
A few notes: Prefer vectors over quoted lists '(1 2) vs [1 2]. There's rarely a case (outside of macros) that you want the former. Instead of quoted lists of symbols: '(You cannot get that.) try strings You cannot get that Don't use defs inside defs. Instead move the defs to a global position

Re: map output to string

2014-07-08 Thread Lee Spector
Hi Glen, You haven't really provided what we would need to replicate your problem. Specifically: - You call but don't provide definitions for address or is-blank? - You refer to unbound symbols some-string and another-string. - You don't provide an input for report, or the top-level call you

Re: Land of lisp to Clojure

2014-07-08 Thread John Mastro
Hi Cecil, Cecil Westerhof cldwester...@gmail.com wrote: - The book displays all the lines of a look on separate lines. In my case it is just one long line. Am I doing something wrong? No, you're not doing anything wrong. There's nothing in that data structure which would inherently cause it to

Re: IllegalArgumentException when running core.async example

2014-07-08 Thread endbegin
Just tried it with Clojure 1.6.0. Still no luck! -- 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.

Re: map output to string

2014-07-08 Thread Glen Rubin
Thanks Lee. You are correct there is something wrong with my input to this function that is causing the problem, not the function. Sorry for the error. On Tuesday, July 8, 2014 8:13:36 PM UTC-7, Lee wrote: Hi Glen, You haven't really provided what we would need to replicate your

Re: Why clojure does not have pure lazy-evaluation like Haskell ?

2014-07-08 Thread Magnus Therning
On Tue, Jul 08, 2014 at 08:39:30PM +0200, Colin Fleming wrote: I searched for this as well, and found this: http://www.cs.nott.ac.uk/~gmh/appsem-slides/peytonjones.ppt Purity is more important than, and quite independent of, laziness and The next ML will be pure, with effects only via