is there a way I can learn clojure with a lot of exercises

2014-04-15 Thread Roelof Wobben
Hello, I like to try clojure. I have little or none programming background but I know I learn the best by reading a piece of text and then do exercises about it so I can check if I really understand it. What is then the best way to proceed ? Roelof -- You received this message because you ar

Re: Potential Intro clojure projects - libraries and ideas with wow factor

2014-04-15 Thread utel
Thanks Mikera and Andrew for the ideas. Some interesting suggestions there. I'll discuss these with my fellow devs. Much appreciated. On Tuesday, April 15, 2014 1:14:11 AM UTC+1, Andrew Chambers wrote: > > Clojure logic programming with core.logic (something akin to a sudoku > solver https://gi

Re: [ANN] Gorilla REPL 0.2.0 - all new extensible renderer

2014-04-15 Thread Andrew Chambers
Is there a way to rerun the whole notebook top to bottom with a hotkey? On Wed, Apr 16, 2014 at 3:59 PM, SteveSuehs wrote: > I'm running Leiningen 2.1.2 on Java 1.7.0_45 Java HotSpot(TM) 64-Bit > Server VM > > Upgrading now...version 2.3.4 > Removed tools.nrepl from project.clj > $ lein gorilla

Re: [ANN] Gorilla REPL 0.2.0 - all new extensible renderer

2014-04-15 Thread SteveSuehs
I'm running Leiningen 2.1.2 on Java 1.7.0_45 Java HotSpot(TM) 64-Bit Server VM Upgrading now...version 2.3.4 Removed tools.nrepl from project.clj $ lein gorilla Gorilla-REPL. Started nREPL server on port 50235 Running at http://localhost:8990/worksheet.html . Ctrl+C to exit. Looking good! On Tu

multiple browsers, live.js -> repl

2014-04-15 Thread t x
Hi, Okay. I think I have finally reached the limits of live.js, and now want an interactive browser repl + being able to push portions of code (rather than reloading the entire page). I have a simple question though: * I'm developing a _distribued_ app * So I can't test it unless I have

Re: Helping newcomers get involved in Clojure projects

2014-04-15 Thread Colin Fleming
That's interesting. I think such a database of common errors would be an extremely useful resource, not only for learning but also for development of linting tools (I think this is more or less what Dynalint does right now) and other tools. For example, I'd love to be able to flag these types of er

Re: Clojure Office Hours

2014-04-15 Thread Marcus Blankenship
Leif, thanks for the great session today. Not only did I get a jump start on my next 4Clojure problems, but I learned some emacs as well! Very enjoyable, and I look forward to next week's session. THANK YOU! All, if you're trying to get a jumpstart on Clojure, I highly recommend Leif's offic

Re: Clojure Office Hours

2014-04-15 Thread Leif
@Jakub: Thanks for your kind words. I'm definitely no "industry hero," but I hope Clojure devs of all levels start having more pair programming fun. @Tim: Clojurescript UI programming being *way* out of my comfort zone, I learned quite a lot from you yesterday. So thank *you*. @Everyone: To

Re: Helping newcomers get involved in Clojure projects

2014-04-15 Thread Leif
Re: tagging issues, we should probably just ask clojure library authors to add their projects to OpenHatch's issue indexers. They have them for Github issues and JIRA, which covers clojure/core (JIRA) and *most* current open source libs (Github). That way, each individual project maintainer c

Re: [Video] Game development in Clojure (with play-clj)

2014-04-15 Thread Kris Calabio
Thanks, Colin! I wasn't aware of mapv. On Tue, Apr 15, 2014 at 6:08 PM, Colin Fleming wrote: > Note that you could use mapv, to perform the map but return a vector > (filterv was also added at the same time). > > > On 16 April 2014 11:46, Kris Calabio wrote: > >> I'm not exactly sure, but I thi

Re: [Video] Game development in Clojure (with play-clj)

2014-04-15 Thread Colin Fleming
Note that you could use mapv, to perform the map but return a vector (filterv was also added at the same time). On 16 April 2014 11:46, Kris Calabio wrote: > I'm not exactly sure, but I think it's the use of 'conj'. My entities get > out of order if they are not vectors. > > All this might not

Re: Annotations on gen-class :state

2014-04-15 Thread Colin Fleming
That was what I figured. However Clojure currently makes certain kinds of interop extremely painful, which makes it hard to integrate into existing frameworks. I'm not proposing anything that would encourage concrete derivation in pure Clojure programs, but I think that facilitating that interop is

Re: Unexpected core.async timeout behaviour

2014-04-15 Thread Ghadi Shayban
Dredging this back up, you've read the scenario properly. Timers are coalesced a particular resolution. Use cases needing more than 1024 active handles on a channel can use a mult. For example, if you had to timeout every request at a same time exactly 5 minutes in the future, (mult (timeout

Re: [Video] Game development in Clojure (with play-clj)

2014-04-15 Thread Kris Calabio
I'm not exactly sure, but I think it's the use of 'conj'. My entities get out of order if they are not vectors. All this might not matter though, because I've started rewriting my game from scratch since I'm using way too many mutable atoms than is necessary. James' screencast cleared a lot of thi

Re: [Video] Game development in Clojure (with play-clj)

2014-04-15 Thread Zach Oakes
I see. If your code requires a vector, I think you will have to coerce the list each time as you are doing. Out of curiosity, what are you doing that makes this necessary? Are you using something like get-in? On Tuesday, April 15, 2014 7:11:56 PM UTC-4, Kris Calabio wrote: > > In one of the call

Re: [Video] Game development in Clojure (with play-clj)

2014-04-15 Thread Kris Calabio
In one of the callback functions in the defscreen I have a pipeline of functions that do something to the entities vector and return the resulting entities. I do something like this: (->> entities (process-entities01) (process-entities02) (map (fn [entity] (->> entity

Re: [Video] Game development in Clojure (with play-clj)

2014-04-15 Thread Zach Oakes
Kris, the entities are automatically converted back into a vector by play-clj after being returned by a given function. Can you elaborate on what problem you believe is occurring when you don't change it back to a vector? On Tuesday, April 15, 2014 5:26:07 PM UTC-4, Kris Calabio wrote: > > Jame

Re: [Video] Game development in Clojure (with play-clj)

2014-04-15 Thread Kris Calabio
James, I have a question. I see this pattern a lot in the sample code and in your code as well, for example: (defn- move-player [entities] (->> entities (map (fn [entity] (->> entity (update-player-position) (update-hit-box (r

Re: [ANN] Sente - Clojure(Script) + core.async + WebSockets/Ajax

2014-04-15 Thread Sam Ritchie
I think the two granularities I'd be interested in are channels and individual users. If we exposed a global list of uids, and a list of UIDs per channel, I think we'd have enough to build up a nice set of broadcast operations. For example: - Broadcast to this channel for users that pass thi

One app, multiple mains \ processes -- heroku style architecture

2014-04-15 Thread Jarrod Swart
I've been reading about Heroku's process model and their approach to web app architecture. I'm curious how you could recreate something like this: https://devcenter.heroku.com/articles/getting-started-with-clojure#one-off-scripts Using an uberjar in environments other than heroku. Would it mak

Re: [ANN] Sente - Clojure(Script) + core.async + WebSockets/Ajax

2014-04-15 Thread Peter Taoussanis
Hey Sam! it doesn't look like the list of all connected users is available in the > API. > Yeah, that's right. Have been punting on this... For the moment have left it up to applications to decide who they're interested in broadcasting to. This might be everyone that's connected, everyone that's

Re: Puppet Labs and Trapperkeeper

2014-04-15 Thread Chris Price
Yep, you've pretty much nailed it... the design was heavily inspired by the OSGi service registry, but we didn't really have a need for most of the other functionality that OSGi offers. So we basically just came up with a way to describe services via Clojure protocols, and then we wire them togeth

Re: Helping newcomers get involved in Clojure projects

2014-04-15 Thread Gary Trakhman
Is there a generalized framework we can use for such 'codeacademy' sites? The closest thing that already exists I think is 4clojure, perhaps adding a tracks-navigation sort of thing would address that specific need? Though, I think my criticism with these things, is the best way to learn really de

Re: [ANN] Sente - Clojure(Script) + core.async + WebSockets/Ajax

2014-04-15 Thread Sam Ritchie
Hey Peter, I like the UUID feature, but it doesn't look like the list of all connected users is available in the API. How would you do a global broadcast to all connected clients using Sente? I'm having trouble figuring out how to write a chat demo using Sente. Thanks for your work! On Wednes

Re: [ANN] Gorilla REPL 0.2.0 - all new extensible renderer

2014-04-15 Thread Jony Hudson
Thanks for the kind words chaps - glad you like it! @Steve Are you sure your Leiningen is up to date? I've only seen this problem when accidentally trying to run Gorilla with Lein 1.7 (as Debian seems to have that version as its default install). @Andrew Probably not what you're looking for, bu

Re: How to work with variables that need to change

2014-04-15 Thread Gary Trakhman
One nitpick I noticed, reduce is eager, not lazy. On Tue, Apr 15, 2014 at 9:25 AM, Alex Vzorov wrote: > Hi, Cecil. > > The difference is that doseq is used to produce side-effects, which is > idiomatic, which is exactly what you did. When using doseq you can be > sure that it's body will evalua

Re: How to work with variables that need to change

2014-04-15 Thread Alex Vzorov
Hi, Cecil. The difference is that doseq is used to produce side-effects, which is idiomatic, which is exactly what you did. When using doseq you can be sure that it's body will evaluate, whereas with map, for, reduce you can't - they expect pure functions, and produce lazy sequences, and there

Re: Annotations on gen-class :state

2014-04-15 Thread Alex Miller
I think not too favorably. :) See http://clojure.org/datatypes where Rich says "concrete derivation is bad." I do not think he would be interested in adding anything to Clojure that included concrete derivation. -- You received this message because you are subscribed to the Google Groups "Clo

Re: Linked Hash Map/Set

2014-04-15 Thread Frankie Sardo
Thanks for the pointers Andy. I had a look at the ordered-map and indeed is a smart and fast implementation. However it relies on continuously growing a backing array, filling dissoc-iated values with nil and hoping that at one point the user will call (compact map) to free all the unused positi

Re: Clojure compiletime vs runtime

2014-04-15 Thread Luc Prefontaine
Compilation is mandatory before executing anything. By default when code is loaded it's executed. That's how a Lisp behaves. If you want to isolate compilation, from execution, you can use AOT (ahead of time compilation). You would use this to deliver compiled code w/o source code, make sure th

Re: "true" lightweight threads on clojurescript?

2014-04-15 Thread Andrew Chambers
You need to write either an interpreter of some sort of bytecode in javascript/clojurescript and and have the interpreter implement the threading, or use a webworker for each process then something like core.async for sending ui events to the main browser loop. Clojurescript doesnt attempt to e

Re: Clojure Office Hours

2014-04-15 Thread Timothy Washington
I just came from an office hours session, yesterday with Leif. This is good stuff guys, and a great way to learn and meet with other developers. Highly recommended. Thanks Leif Tim Washington Interruptsoftware.com On Tue, Apr 15, 2014 at 5:12 AM, Jakub Holy wro

Re: [ANN] Gorilla REPL 0.2.0 - all new extensible renderer

2014-04-15 Thread Andrew Chambers
This is awesome (reminds me of ipython notebooks). I hope to use this to custom render some data structures internal to my compiler project. I'll have to read up on how to render directed graphs. On Thursday, March 20, 2014 9:22:57 AM UTC+13, Jony Hudson wrote: > > Hi all, > > I'm happy to ann

Re: Clojure compiletime vs runtime

2014-04-15 Thread Andrew Chambers
I only noticed it because I was trying to write a macro which expands to multiple def calls. This requires the def's to be inside a do block, which made me question a whole lot about how the AOT compiler works. On Tue, Apr 15, 2014 at 11:05 PM, Phillip Lord wrote: > > You need to distinguish be

Re: Clojure compiletime vs runtime

2014-04-15 Thread Phillip Lord
You need to distinguish between "compiled" and "aot compiled to byte code". As far as I know, all forms are compiled before they are executed. So, if you type: (+ 1 1) it is first compiled to bytecode, and then run. It's not executed at compile time at all; rather when it is evaluated, it is co

Re: Clojure compiletime vs runtime

2014-04-15 Thread Andrew Chambers
Why are the toplevel forms which arent macros executed at compile time? For example Lua can be compiled to bytecode without executing its top level calls. On Tue, Apr 15, 2014 at 9:04 PM, Softaddicts wrote: > Ahem :) > > a) The fn x does not exist in the universe until you call foo, hence you >

Re: Clojure Office Hours

2014-04-15 Thread Jakub Holy
Hi Leif, This is a great activity, thank you for contributing to the community this way! Do not be surprise and discouraged by the fact that the interest seems low. I have a similar experience - in my company we can consult with an "industry hero" yet people use the opportunity seldom, presuma

Re: Clojure compiletime vs runtime

2014-04-15 Thread Softaddicts
Ahem :) a) The fn x does not exist in the universe until you call foo, hence you cannot expect the compiler to known anything about it if it's not called before making any reference to x. b) If you refer to x at the top level (the "universe" above :) before defining it, obviously it

Re: Extending a data model

2014-04-15 Thread Colin Yates
Multimethods are fantastic and do indeed work across namespaces if by "across namespaces" you mean you can defmethod in ns2 a defmulti in ns1. On Tuesday, April 15, 2014 2:56:30 AM UTC+1, Andrew Chambers wrote: > > An update, I read about protocols and multimethods. I think multimethods > are a

Re: Helping newcomers get involved in Clojure projects

2014-04-15 Thread kurofune
For what it's worth, I would like to see a codecademy.com type site but for Clojure that can take you from 0 to hero, in one place, with interactive tracks depending on subject (i.e. Web-Dev, core functions, key libraries, idioms, regex, encryption, etc.). Something like an interactive SICP to t

Re: Helping newcomers get involved in Clojure projects

2014-04-15 Thread kurofune
For what it's worth, I would like to see a codecademy.com type site but for Clojure that can take you from 0 to hero, in one place, with interactive tracks depending on subject (i.e. Web-Dev, core functions, key libraries, idioms, regex, encryption, etc.). Something like an interactive SICP to t