Re: IllegalArgumentException when running core.async example

2014-07-09 Thread Tobias Kortkamp
In judge try changing (let [out async/chan] ...) to (let [out (async/chan)] ...) On Wednesday, July 9, 2014 5:57:53 AM UTC+2, endbegin wrote: 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.

Re: Land of lisp to Clojure

2014-07-09 Thread Cecil Westerhof
2014-07-09 2:24 GMT+02:00 Bruce Wang br...@brucewang.net: You might want to check out this https://github.com/quux00/land-of-lisp-in-clojure ​I will look into it. But I learn most if I do it myself. ;-)​ -- Cecil Westerhof -- You received this message because you are subscribed to the

Re: Land of lisp to Clojure

2014-07-09 Thread Cecil Westerhof
2014-07-09 5:11 GMT+02:00 Timothy Baldridge tbaldri...@gmail.com: 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 ​That is what

Re: Land of lisp to Clojure

2014-07-09 Thread Cecil Westerhof
2014-07-09 5:30 GMT+02:00 John Mastro john.b.mas...@gmail.com: 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

Re: Local variable

2014-07-09 Thread Cecil Westerhof
2014-07-09 4:19 GMT+02:00 Bob Hutchison hutch-li...@recursive.ca: 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

Re: Land of lisp to Clojure

2014-07-09 Thread Cecil Westerhof
2014-07-09 9:39 GMT+02:00 Cecil Westerhof cldwester...@gmail.com: Or you could use a definition of look more like this, which uses println to print each item on its own line (not sure if you wanted to retain the parens or not, but both are easily doable). (defn look [] (doseq [d

Re: [ANN] clojure-scheme - Compiling Clojure to Scheme to C

2014-07-09 Thread Dry Jin
By the way, how does Clojure-Scheme hand the Clojures's libraries over to Gambit-C? 2012년 3월 15일 목요일 오전 6시 8분 2초 UTC+9, Nathan Sorenson 님의 말: I've modified the output of the ClojureScript compiler to emit Scheme code. At this point the core library is successfully compiled by Gambit

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

2014-07-09 Thread Colin Fleming
True, but I think that's why he argues for a strict language which controls side effects via monads, as Haskell does. On 9 July 2014 07:18, Magnus Therning mag...@therning.org wrote: On Tue, Jul 08, 2014 at 08:39:30PM +0200, Colin Fleming wrote: I searched for this as well, and found this:

How to use functions from clojure.contrib?

2014-07-09 Thread Pierre Masci
Hi, I am new to Clojure (about a week) so I might be missing something. I want to use the (positions) http://clojuredocs.org/clojure_contrib/clojure.contrib.seq/positions function from clojure.contrib.seq. I could simply copy its source, but I would prefer a more generic way of using functions

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

2014-07-09 Thread Jonathon McKitrick
My new project is coming along nicely already. I'm currently using XHR calls to populate atoms on the client side, which are then automatically rendered into the DOM via Reagent components. It's wonderful, so far. -- Jonathon McKitrick On Tue, Jul 8, 2014 at 3:37 PM, Ahmad Hammad

Re: How to use functions from clojure.contrib?

2014-07-09 Thread Andy Fingerhut
Pierre: The link to the page Where did Clojure.Contrib Go on the page where you noted that clojure.contrib is deprecated gives the names of current modular contrib libraries that contain most or all of what *some* older clojure.contrib libraries contained. Unfortunately clojure.contrib.seq has

Re: Land of lisp to Clojure

2014-07-09 Thread Cecil Westerhof
2014-07-09 10:38 GMT+02:00 Cecil Westerhof cldwester...@gmail.com: 2014-07-09 9:39 GMT+02:00 Cecil Westerhof cldwester...@gmail.com: Or you could use a definition of look more like this, which uses println to print each item on its own line (not sure if you wanted to retain the parens or

Re: How to use functions from clojure.contrib?

2014-07-09 Thread Pierre Masci
Thank you Andy, that's exactly the answer I needed. I thought I might be missing the right place where to look, because I'm new to the ecosystem. http://crossclj.info http://www.google.com/url?q=http%3A%2F%2Fcrossclj.infosa=Dsntz=1usg=AFQjCNG-DyQUTVfpaTQKl0M8glmTtO-tMQ is a very good resource

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

2014-07-09 Thread Alex P
There's also a version of what you wrote (at least something very similar), where one can specify libraries he wants docs for and have it all running either locally or on some webserver: https://github.com/ifesdjeen/gizmo-cloc Adds code snippets with highlights and lucene-backed search. On

[ANN] Cats: category theory abstractions library for clojure(script).

2014-07-09 Thread Andrey Antukh
Hello everyone! I just wanted to announce cats: category theory abstractions library for clojure(script). Why another library? You can see a list of differences with existing libraries here: http://niwibe.github.io/cats/#_why_another_library Github: https://github.com/niwibe/cats Documentation:

Re: IllegalArgumentException when running core.async example

2014-07-09 Thread endbegin
Thanks!! That did it. -- 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

How to access record in a hashmap

2014-07-09 Thread Cecil Westerhof
When you have: (def object-locations { 'whiskey 'living-room 'bucket'living-room 'chain 'garden 'frog 'garden 'dummy 'nowhere 'test 'nowhere }) You can retrieve the location of the bucket with: (object-locations 'bucket) and with:

Re: Proposing a new Clojure documentation system (in Clojure)

2014-07-09 Thread Edwin Watkeys
On Tuesday, May 6, 2014 10:39:47 AM UTC-4, Gregg Reynolds wrote: On Tue, May 6, 2014 at 4:53 AM, Phillip Lord philli...@newcastle.ac.uk javascript: wrote: Trivial things that I would like to be able to do that I cannot do (in a way which will be reliably interpreted). - Add hyperlinks

Re: How to access record in a hashmap

2014-07-09 Thread Thomas Heller
Short and simple answer: NullPointerException (def object-locations nil) (object-locations 'bucket) will throw ('bucket object-locations) = nil HTH, /thomas On Wednesday, July 9, 2014 3:48:53 PM UTC+2, Cecil Westerhof wrote: When you have: (def object-locations { 'whiskey

Re: How to access record in a hashmap

2014-07-09 Thread Thomas Heller
Oh and its rare (outside of macros) to use symbols like that. Usually you'd use keywords. (def object-locations {:whiskey :living-room}) On Wed, Jul 9, 2014 at 5:03 PM, Thomas Heller th.hel...@gmail.com wrote: Short and simple answer: NullPointerException (def object-locations nil)

Re: How to access record in a hashmap

2014-07-09 Thread Cecil Westerhof
2014-07-09 17:03 GMT+02:00 Thomas Heller th.hel...@gmail.com: Short and simple answer: NullPointerException (def object-locations nil) (object-locations 'bucket) will throw ('bucket object-locations) = nil ​That is interesting.​ ​Not a problem, because it will never be ​nil, but always a

Re: How to access record in a hashmap

2014-07-09 Thread Cecil Westerhof
2014-07-09 17:18 GMT+02:00 Thomas Heller th.hel...@gmail.com: Oh and its rare (outside of macros) to use symbols like that. Usually you'd use keywords. (def object-locations {:whiskey :living-room}) ​It is from 'Land of Lisp'. The symbols are printed. Or is it possible to print the

Re: How to access record in a hashmap

2014-07-09 Thread Timothy Baldridge
(name :foo) will return the name as a string (symbol (name :foo)) Converts the name of the keyword to a symbol On Wed, Jul 9, 2014 at 9:28 AM, Cecil Westerhof cldwester...@gmail.com wrote: 2014-07-09 17:18 GMT+02:00 Thomas Heller th.hel...@gmail.com: Oh and its rare (outside of macros) to

Re: How to access record in a hashmap

2014-07-09 Thread Thomas Heller
Don't know Land of Lisp, but if you print it you can use (name :whiskey) to get whiskey (as a String), also works on (name 'whiskey). On Wed, Jul 9, 2014 at 5:28 PM, Cecil Westerhof cldwester...@gmail.com wrote: 2014-07-09 17:18 GMT+02:00 Thomas Heller th.hel...@gmail.com: Oh and its rare

Re: How to access record in a hashmap

2014-07-09 Thread Cecil Westerhof
2014-07-09 17:32 GMT+02:00 Timothy Baldridge tbaldri...@gmail.com: (name :foo) will return the name as a string (symbol (name :foo)) Converts the name of the keyword to a symbol ​It is not even necessary. I changed to keywords. The code uses: `(You see a ~obj on the floor.) And it

Re: How to access record in a hashmap

2014-07-09 Thread Cecil Westerhof
2014-07-09 17:50 GMT+02:00 Cecil Westerhof cldwester...@gmail.com: 2014-07-09 17:32 GMT+02:00 Timothy Baldridge tbaldri...@gmail.com: (name :foo) will return the name as a string (symbol (name :foo)) Converts the name of the keyword to a symbol ​It is not even necessary. I changed to

Re: Land of lisp to Clojure

2014-07-09 Thread John Mastro
Cecil Westerhof cldwester...@gmail.com wrote: I read a little about it. And no, I do not use dynamic binding. So I probably should use atoms. Is there a convention how to name atoms? Nope, none that I've come across anyway. Dynamic variables can have very surprising effects if you're not aware

An Averaging function

2014-07-09 Thread Stephen Feyrer
Hi, I tried to create the function below in a Lighttable instarepl. In lieu of any better idea for formatting, thestatements below indicate instarepl output. (defn avged ([x] ((def sumed (reduce + x)) 10 (def counted (count x)) 4 (def result (/ sumed counted)) 5/2 result ))) (avged

Re: An Averaging function

2014-07-09 Thread Sam Ritchie
About code style, don't do defs inside of a function - this binds them inside the entire namespace, so your values are escaping and persisting when you just want locals. Use let: (defn averaged [x] (let [summed (reduce + x) counted (count x)] (/ summed counted))) That function

Re: An Averaging function

2014-07-09 Thread Lee Spector
On Jul 9, 2014, at 8:48 PM, Stephen Feyrer stephen.fey...@gmail.com wrote: Hi, I tried to create the function below in a Lighttable instarepl. In lieu of any better idea for formatting, thestatements below indicate instarepl output. (defn avged ([x] ((def sumed (reduce + x)) 10

Re: An Averaging function

2014-07-09 Thread Lee Spector
On Jul 9, 2014, at 9:31 PM, Lee Spector lspec...@hampshire.edu wrote: You could patch (not recommended!) this by adding do to the beginning of that list: Or -- I now see, instead of adding the do you could just remove the outermost parentheses after the parameter list. But as Sam and I said