[ANN] May London Clojure Dojo at Forward

2013-05-09 Thread Bruce Durling
Roll up! Roll up! The Next London Clojure Dojo is at Forward in beautiful and conveniently located Camden Town: Sign up here: http://ldnclj-may-fwd.eventbrite.com/ Time and Dates: May 2013 London Clojure Dojo at Forward London Clojurians Monday, 13 May 2013 at 18:30 (BST) Location: Forward In

Two new Clojure projects

2013-05-09 Thread Kelker Ryan
I just wanted to share two new Clojure projects. Porta is a Clojure utility that generates a Clojure abstraction for an existing Java Class.https://github.com/runexec/porta CHP (ClojureHomePage) is a project that aims at making Clojure web development as easy as PHP.https://github.com/runexec/chp  

why clojure.lang.Compiler.LOADER is null in clojure 1.5.1

2013-05-09 Thread stream
Hi all i wanna change the classloader of Clojure RT. in 1.5.1 so , i try to clojure.lang.Var.pushThreadBindings(clojure.lang.RT.map( clojure.lang.Compiler.LOADER, cl) ); but throws exception that cojure.lang.Compiler.LOADER is null Caused by: java.lang.NullPointerException at c

Lisp In Summer Projects

2013-05-09 Thread Tim Daly
If you have a Clojure project you could earn money and fame. Check out "Lisp In Summer Projects" http://lispinsummerprojects.org/?2013 Heow-Eide Goodman, the man behind LispNYC, is getting a group of experts together to judge the projects. You'll get your name in front of some well-connected peopl

Re: why clojure.lang.Compiler.LOADER is null in clojure 1.5.1

2013-05-09 Thread semperos
Is there a reason you don't use one of the methods exposed in clojure.lang.RT, e.g., makeClassLoader() or baseLoader() ? On Thursday, May 9, 2013 2:00:54 AM UTC-4, Stream wrote: > > Hi all > > i wanna change the classloader of Clojure RT. in 1.5.1 > so , i try to > clojure.lang.Var.pus

Re: Lisp In Summer Projects

2013-05-09 Thread Nico Balestra
Contest is also not open to residents of Brazil, Italy, Quebec, and Saudi Arabia I'm UK resident but born Italian and I find the above a bit distressing. *"It is better to have 100 functions operate on one data structure than to have 10 functions operate on 10 data structures" - A.J. Perlis* O

Re: Lisp In Summer Projects

2013-05-09 Thread Plínio Balduino
'(sad) On Thu, May 9, 2013 at 11:58 AM, Nico Balestra wrote: > Contest is also not open to residents of Brazil, Italy, Quebec, and Saudi > Arabia > > I'm UK resident but born Italian and I find the above a bit distressing. > > > "It is better to have 100 functions operate on one data structure th

Re: why clojure.lang.Compiler.LOADER is null in clojure 1.5.1

2013-05-09 Thread AtKaaZ
Caused by: java.lang.NullPointerException at clojure.lang.RT.*baseLoader*(RT.java:2043) hmm, it's almost as if: static final public Var LOADER = Var.create().setDynamic(); had no effect as in: LOADER=null; On Thu, May 9, 2013 at 4:51 PM, semperos wrote: > Is there a reason you don't us

Struggling with encapsulation

2013-05-09 Thread Colin Yates
(newbie, but trying hard!) I am designing a Woobly. A Woobly is non-trivial and has a number of internal data structures (queues, worker threads etc.). You can 'add' and 'remove' jobs from a Woobly. In OO land I might have a Woobly interface with the various methods which provides a public A

Re: why clojure.lang.Compiler.LOADER is null in clojure 1.5.1

2013-05-09 Thread AtKaaZ
is there any chance that we can see the full code (maybe's on github already?) On Thu, May 9, 2013 at 9:00 AM, stream wrote: > Hi all > > i wanna change the classloader of Clojure RT. in 1.5.1 > so , i try to > clojure.lang.Var.pushThreadBindings(clojure.lang.RT.map( > clojure.lang.Comp

Re: Lisp In Summer Projects

2013-05-09 Thread Nico Balestra
..after reading the FAQ I know have the answer why Italians are not eligible: *Q: Why do you hate Italians?* A: We're not sure why Italy is ineligible, contact us if you're an Italian lawyer willing to help us out. It might be because Italians have too man

Re: Lisp In Summer Projects

2013-05-09 Thread Nico Balestra
(replace "I know have" "I now have") *"It is better to have 100 functions operate on one data structure than to have 10 functions operate on 10 data structures" - A.J. Perlis* On 9 May 2013 17:13, Nico Balestra wrote: > ..after reading the FAQ I know have the answer why Italians are not > elig

Re: Struggling with encapsulation

2013-05-09 Thread Gary Trakhman
If the interface provides everything that's needed, then there will be no need to dive in? I find attempts to hide that stuff frustrating when I'm a consumer of the code, if I need it, and I acknowledge that implementation details are subject-to-change when I take that risk, so only having somethi

Re: why clojure.lang.Compiler.LOADER is null in clojure 1.5.1

2013-05-09 Thread AtKaaZ
is not this one is it ? https://github.com/CmdrDats/clj-minecraft/blob/master/javasrc/cljminecraft/BasePlugin.java#L82 On Thu, May 9, 2013 at 7:12 PM, AtKaaZ wrote: > is there any chance that we can see the full code (maybe's on github > already?) > > > On Thu, May 9, 2013 at 9:00 AM, stream w

Re: Struggling with encapsulation

2013-05-09 Thread Jonathan Fischer Friberg
I agree with Gary, there's normally not really any need to obfuscate the implementation, and using the underlying structure can sometimes be useful. That said, if you really want to, you can create a "woobly" protocol and implement it using reify, this will make the underlying implementation compl

Re: Struggling with encapsulation

2013-05-09 Thread Dave Ray
I agree that you probably don't need to go overboard with hiding stuff. For option 2 though there's no need for deftype. Just implement the protocol with reifiy within the create function and use the closure for state. (defn create-woobly [...] (let [... put your queues and stuff here ...]

Re: Struggling with encapsulation

2013-05-09 Thread James Reeves
On 9 May 2013 17:07, Colin Yates wrote: > The part I am struggling with is how to create a Woobly without exposing > its internals. > To what end? What's the benefit? If you take a look at some internal data structures Clojure uses, like zippers or protocols, you'll notice that they're just map

Re: why clojure.lang.Compiler.LOADER is null in clojure 1.5.1

2013-05-09 Thread Sean Corfield
Daniel hinted at it in his response and it's been discussed several times in the past but most of clojure.lang.RT and pretty much all of clojure.lang.{anything-else} is considered a private implementation detail and subject to change, so relying on it in code is very brittle. I think Rich has indic

Re: Struggling with encapsulation

2013-05-09 Thread Colin Yates
Thanks for all the helpful responses. One reason I want to hide the internals is that I don't want people to add jobs directly to the queue. (add-job) will put a map containing the provided function onto the queue. Not really relevant, but this is so that I can track queue timings that I can lat

Eatomic: a Datomic-themed dinner and chat (tonight; SF Bay Area, CA, USA)

2013-05-09 Thread Rich Morin
[ Eatomic is tonight; drop by if you can... -r ] The 2nd Thursday of the odd-numbered months seems to be free, so let's get together anyway. Eatomic is a Datomic-themed dinner and chat. Be prepared to spend about $20 on interesting food (and conversation). Thursday, May 9, 2013 6:00 PM to

Re: Lisp In Summer Projects

2013-05-09 Thread Konrad Scorciapino
Disappointing, isn't it? They've explained to me further: Basicly our small project is similar to Google's Code-In, which is where > the requirement originated. We don't have Google's cadre of lawyers and > cannot risk inviting trouble to our friends and colleagues at the ALU. They > coordinate th

Quick question on protocols

2013-05-09 Thread Dave Kincaid
I've not worked with protocols much, but saw a good fit recently. However, I'm a little bit unsure about this situation. I have some Thrift objects that I'd like to be able to easily unpack into maps, so I created a protocol (defprotocol Unpackable (unpack [x])) Thrift has two main data types

Re: Quick question on protocols

2013-05-09 Thread Jeroen van Dijk
Hi David, I've used protocols for the exact same purpose (Thrift unpacking, and like you (?), for convenience in Cascalog). I think it works very well and is speedier than other methods. It is also convenient when you have nested data structures and you don't want to care how to go through this ne

Re: Lisp In Summer Projects

2013-05-09 Thread u1204
I believe that cash payments are forbidden by law in the listed countries. The contest will make cash payments. I know that Lisp In Summer Projects has no problem with people from Italy, Brazil, or other listed countries. Tim Daly -- -- You received this message because you are subscribed to th

Re: Struggling with encapsulation

2013-05-09 Thread James Reeves
On 9 May 2013 18:03, Colin Yates wrote: > I am nervous as well about "expose internals but trust people to do the > right thing" because in this case, if I was a consumer and saw that queue, > particularly given the emphasis about data being the contract etc. then why > would I think *not* to use

Re: Clojure/Script pr-str/read-string roundtrip differences

2013-05-09 Thread Brian Jenkins
Hi, Thomas. I also found this frustrating. Here's a work-around I came up with: ;; assuming (defrecord Design [id name]) in namespace tektite.model.design (cljs.reader/register-tag-parser! "tektite.model.design.Design" tektite.model.design/map->Design) (extend-protocol IPrintWithWriter t

Re: Accessing JSON Array data in Clojure

2013-05-09 Thread Hawkeye02
Thanks Greg for the suggestion. I have added the book to my Safari account. Michael, I tried your suggestion with 'get-in' and it came back with [object Object] from JSON. I switched the clojure.contrib stuff with data.json. Below is the updated code and a screenshot of the result. Thanks in

Re: Accessing JSON Array data in Clojure

2013-05-09 Thread Hawkeye02
Forgot to put the JSON data: "radarStation":"lot","dayPrecipitation":[{"time":1368129600,"probability":0.23,"type":"rain","temp":74,"cloudCover":1,"relHumidity":0.45},.. On Thursday, May 9, 2013 4:10:44 PM UTC-5, Hawkeye02 wrote: > > Thanks Greg for the suggestion. I have added the book to

ANN: kits 1.5.1 - some of Runa's core utilities

2013-05-09 Thread Alex Baranosky
Runa has decided to open source a project of our utility namespaces that we call Runa Kits . At this point in time this includes: - benchmark.clj ;; simple timing functions - csv.clj ;; wrapper around clojure-csv library that turn csv in to column-name, c

defmethod/require race condition

2013-05-09 Thread Steven Degutis
In my app, sometimes a file containing a defmethod hasn't been required yet by the time some other function calls the multi-method. So naturally it throws an exception. But later, as the app continues to run, the file containing the proper defmethod eventually gets required by another file. Then e

Re: ANN: kits 1.5.1 - some of Runa's core utilities

2013-05-09 Thread Timothy Gardner
That's awesome! Thanks! On Thu, May 9, 2013 at 5:57 PM, Alex Baranosky < alexander.barano...@gmail.com> wrote: > Runa has decided to open source a project of our utility namespaces that > we call Runa Kits . At this point in > time this includes: > >- benchm

Re: Lisp In Summer Projects

2013-05-09 Thread Softaddicts
Quebec is a province within Canada and has little jurisdiction outside of its geographic borders. It's not a country... A good example are internet poker game sites and similar activities on the net. The Quebec agency which regulates all lotteries and similar activities cannot do anything about

Re: defmethod/require race condition

2013-05-09 Thread Gary Trakhman
Do you have dynamic 'require' statements? Why? Should prefer (ns (:require [])) in non-scripts. As an alternative, if you want to ensure a sane state, I would suggest starting your app from an initialization namespace that requires all the namespaces you might want. On Thu, May 9, 2013 at 5:19 P

Re: LambdaNext Clojure Workshop - London May 20-22 2013

2013-05-09 Thread Sam Aaron
Hey there, just a quick reminder of the upcoming LambdaNext Clojure training workshop in London in a couple of weeks. There are only a few spots left, so if you were thinking about joining, act quick to grab your place! The LambdaNext Team - http://lambdanext.eu/ On 15 Apr 2013, at 11:24, Sam

Re: ANN: kits 1.5.1 - some of Runa's core utilities

2013-05-09 Thread Michael Klishin
2013/5/10 Alex Baranosky > These are tools we use everyday, and have not been spiffed up with many > doc strings. In general these kits are offered up for use by the community > as-is, and we hope you find something of use in there. Alex, I can't find what license Kits uses. Would it be possi

Re: Accessing JSON Array data in Clojure

2013-05-09 Thread Michael Klishin
2013/5/10 Hawkeye02 > :hour-summary (core/get-in :dayPrecipitation [:temp] forecast) I don't think you use get-in the way it is demonstrated in the examples. It takes a map as the first argument and a collection of keys to traverse. http://clojuredocs.org/clojure_core/clojure.core/get-in Also

Re: defmethod/require race condition

2013-05-09 Thread sdegutis
They're all in the (ns (:require [...])), so that's fine. The problem is, a file which requires the concrete implementation won't get required by another file for a while. On Thursday, May 9, 2013 6:00:39 PM UTC-5, Gary Trakhman wrote: > > Do you have dynamic 'require' statements? Why? Should pr

Re: Clojure/Script pr-str/read-string roundtrip differences

2013-05-09 Thread David Nolen
Patch welcome for 1. As far as 2 I myself see no way to make that work without considering a numerics overhaul. On Sun, Jan 6, 2013 at 7:13 PM, Thomas Heller wrote: > Hey, > > I'm writing a Clojure Webapp with a CLJS Frontend and expected to be able > to cljs.reader/read-string everything I pr

Re: ANN: kits 1.5.1 - some of Runa's core utilities

2013-05-09 Thread Dave Sann
A question for the community. There are several "projects" that provide a bunch of base level/common functions and extensions (similar to those here) beyond core Clojure. And I am sure that many people have their own collection of useful utilities like this. I know that I do. clojure/core.incu

Re: Clojure/Script pr-str/read-string roundtrip differences

2013-05-09 Thread Thomas Heller
Hey Brian, been a while since that Post, Issue #1 has been resolved for a while (see http://dev.clojure.org/jira/browse/CLJS-466) but I actually switched to using proper EDN tags via IPrintWithWriter, clj/print-method and clojure.edn/read-string like you suggested. #2 I solved indirectly via #1,

Re: Clojure/Script pr-str/read-string roundtrip differences

2013-05-09 Thread David Nolen
Heh didn't notice the date on the first post :) On Thu, May 9, 2013 at 8:29 PM, Thomas Heller wrote: > Hey Brian, > > been a while since that Post, Issue #1 has been resolved for a while (see > http://dev.clojure.org/jira/browse/CLJS-466) but I actually switched to > using proper EDN tags via I

Re: defmethod/require race condition

2013-05-09 Thread Brandon Bloom
This is an unfortunate ugly side effect of def and def-like forms being, um, side effectual. In the particular case of defmethod, I think that the general recommendation would be to structure your namespaces such that methods are defined along side the code that could produce dispatch values wh

Re: Two new Clojure projects

2013-05-09 Thread Kelker Ryan
There's now a tutorial for CHP https://github.com/runexec/chp/tree/master/tutorial/01  09.05.2013, 20:03, "Kelker Ryan" :I just wanted to share two new Clojure projects. Porta is a Clojure utility that generates a Clojure abstraction for an existing Java Class.https://github.com/runexec/porta CHP (

Re: Accessing JSON Array data in Clojure

2013-05-09 Thread Bryan Henderson
What map would be defined for the first argument with the given code? It seems like how it is set up, it is grabbing information straight from the JSON data without a map defined. The 'format-forecast' definition takes forecast as an arg so I tried it like this with no luck: *:hour-summary (core

Re: Lisp In Summer Projects

2013-05-09 Thread Terje Norderhaug
I suggest allowing participants from the listed countries, but give an eventual prize to a charity of choice to avoid a cash payment. On Thu, May 9, 2013 at 12:59 PM, u1204 wrote: > I believe that cash payments are forbidden by law in the listed > countries. The contest will make cash payments.