#clojure log - Oct 29 2012

The Joy of Clojure
Main Clojure site
Google Group
List of all logged dates

0:00 zackzackzack: I don't know, is it possible to keep a repl sandboxed with full access to the process while preventing it from crashing the app?

0:00 amalloy: i don't think so. the jvm security measures aren't strong enough if you're running code in-process

0:01 flying_rhino: it doesn't have to have full acess to everything

0:01 it is just for scripting, like JS

0:03 zackzackzack: flying_rhino: Can you provide a concrete use case? JS is, for better or worse, getting full access to many things nowadays in various environments and so I am not entirely sure what you are looking for.

0:05 flying_rhino: concrete use case would be console for RPG I am conteplating (still haven't started to actualy write code, because I am looking for right lang). I need things like AI scripts and quests. It doens't have to have acess to game engine (networking, filesystem) itself.

0:05 *doesn't

0:06 I would like to give gamers option to change how game world behaves (to an extent), but I would not like people to accidentaly crash JVM

0:07 zackzackzack: Hmm

0:07 AtKaaZ: any reason why clojure.java.io/delete-file doesn't return true/false to indicate why file is deleted? since I notice (.delete fFile) always fails for some reason

0:07 why=that

0:08 flying_rhino: one opetion is to develop my own scripting language

0:08 *option

0:08 zackzackzack: flying_rhino, it should be a fine language for what you've outlined

0:08 callen: flying_rhino: you're making a game in Clojure?

0:08 flying_rhino: callen: possiby

0:08 callen: flying_rhino: what kind of game?

0:09 flying_rhino: callen: type of rpg but with full world simulation. World simulation meaning that critters should hunt eachother even when player isn't around

0:09 callen: ambitious as hell

0:10 callen: flying_rhino: you're getting into the same territory as Dwarf Fortress in terms of simulation.

0:10 flying_rhino: do you have a lot of experience making games?

0:10 flying_rhino: you should expect to spend at least a decade on that sort of thing before it's even playable.

0:11 flying_rhino: callen: some. I have one half finished RTS, and one fully finished 2d shotter in actionscript (with decent visual effects). I am fully aware that this is going to be several year long project

0:12 callen: flying_rhino: anything simulation-centric along those lines is not only going to be performance intensive in ways you cannot begin to fathom, but it's very labor intensive.

0:13 flying_rhino: it might be better, if your goal is to "just" make a game is to focus on a small, concentrated idea that you want to test.

0:14 flying_rhino: callen: hence clojure, mulithreading. Yes I do plan to start smal. Just a scriptable world with a few critters, that you can manipulate real time. But utlimate goal is as outlined

0:14 callen: basically I am exploring if what I want to do is doable at all in JVM. Then I can start small, but with massive goal in mind.

0:15 callen: flying_rhino: uhm, doable yes, playable/fast is up for debate.

0:15 flying_rhino: you're just being too ambitious. You need to back it off and find something small/simple to validate an idea.

0:16 flying_rhino: callen: I have to get at least some sort of scriptable world up and running. Then I can explore playability, and speed.

0:16 callen: right now all I want is 2d world + scriptable at runtime.

0:17 callen: then I look at scalability and playability

0:17 callen: flying_rhino: if all you want is to make a game quickly, then you should be looking at toolkits like Unity.

0:17 games aren't scalable by definition, they're generally real-time constrained.

0:19 flying_rhino: callen: I don't need premade thing like unity, Besides I want to use Entity Systems ( http://t-machine.org/ ) and unity uses different system.

0:20 callen: flying_rhino: then go do your thing, but my advice is to constrain the scope and use something made to make what you want.

0:20 dnolen: so getting a Mozart/Oz like distribute step into core.logic was pretty easy :)

0:21 callen: dnolen: did you do any lisp before Clojure?

0:23 dnolen: callen: not that much, I went through the first 3 chapters + exercises of SICP around 2003, then I played around w/ CL for 3 months or so in 2008.

0:26 flying_rhino: callen: thanks for the warning. I am planning to develop the thing in similar way as Age of Empires. Meaning that it is actually turn-based, but turn expires every 0.25 seconds so it appears real time. I think that modern processors probably can pull off small sized world simulation.

0:28 callen: I agree that first person real time would have been a tall order

0:29 callen: I don't think I am getting int Dwarf Fortress theritory. DF, if I am not mistaken mostly simulates terrain and dwarf cities. I am almost entirely focused on critters you can hunt.

0:37 callen: do you have experience making games, by the way?

1:09 generally speaking I like of idea of Lisp-like language on JVM, but I frankly see Clojure as a bit too dogmatic for my tastes

1:25 luxbock: this might be a silly question, but what exactly is the difference between a collection, and a sequence?

1:26 all collections are sequences I take, but not all sequences are collections?

1:30 amalloy: other way round

1:31 all sequences are collections, and all collections can be made into a sequence, but many (eg maps) are not one

1:32 luxbock: ah ok, thanks

1:36 flying_rhino: does clojure have something like triple quotes """ in scala and python for explicit quoting?

1:37 Sgeo: The regular double-quotes can be multi-line

1:37 flying_rhino: (I know that syntax isn't lispy thing to do, but I think that one would be immensely usefull)

1:38 Sgeo: that's good, too.

2:08 ambrosebs: New version of Typed Clojure dissertation, with some corrections and rewrites. Further corrections welcome. https://github.com/downloads/frenchy64/papers/paper.pdf

2:49 brainproxy: simple/recommended way to have clojure.test based tests to re-run on source / test-source change?

3:47 Jal_Flanders: brainproxy, I.. am optimus prime

4:22 arrdem: is there a way to define an "init method" in deftype?

4:23 luxbock: is there a variable for the result of the last valid evaluation in REPL?

4:24 francis-: @luxbock *1

4:24 luxbock: thanks

6:53 ro_st: Raynes: ping

7:00 Cheiron_: Hi, why gen-class is generating a main method (according to javap) ? I didn't specify it

7:28 AtKaaZ: hi, I need some suggestions about what can I do if I have a reader and I'm using with-open but I want to assign some let variables that remain after with-open is done

7:35 borkdude: AtKaaZ then use with-open inside a let and not vice versa?

7:36 AtKaaZ: but can I let within the with-open ?

7:36 why do I have the feeling I'd have to use vars?

7:36 something like define the var in the outside let and inside the with-open assign/change it or something

7:37 or something like this: http://clojuredocs.org/clojure_core/clojure.core/with-local-vars

7:37 but I don't want it to be imperative:/

7:38 _ulises: AtKaaZ: what's the specific thing you're trying to do?

7:39 AtKaaZ: take simple example: count number of lines from the reader within a with-open and after with-open is done, still remember the number (but of course I'm doing more than just count)... ok I just realized it should be a function returning that?

7:40 so instead of using let, I should use a function return the stuff? in this case if I have to return 3 things what's the idiomatic way to do so ? a map ?

7:41 _ulises: AtKaaZ: it depends, a map would let you name the 3 things, you could use a vector and use positions, etc.

7:41 AtKaaZ: as for counting the number of lines, then that's just a function that'd operate on a reader opened with with-open

7:41 AtKaaZ: _ulises: what would you use?

7:41 _ulises: AtKaaZ: I'd say

7:42 AtKaaZ: _ulises: I think you're right, that does seem more idiomatic than with vars or I can't imagine anything else

7:42 _ulises: AtKaaZ: I normally use maps as they also provide better documentation than a vector and having to remember the positions inside a vector, etc.

7:42 AtKaaZ: yeah I was wondering about that, cool then

7:44 that's definitely the way I'd want to go, function and return a map, just in case I'll change order of returned things or add more inbetween, thank you for this

7:45 _ulises: AtKaaZ: sure, no worries, another thing to keep in mind is that with maps now you can do (:returned-value the-map)

7:45 AtKaaZ: which is a great improvement over (get the-vector 1) or something

7:45 AtKaaZ: yep for sure!

7:45 ,(:c {:a 1 :b 2} :not-found)

7:45 clojurebot: :not-found

7:46 _ulises: AtKaaZ: however, I'd encourage you to have wrapper functions like (returned-value-1 the-map) even if initially they are simply (defn returned-value-1 [the-map] (:returned-value-1 the-map))

7:46 AtKaaZ: excellent sugestion!

7:46 _ulises: AtKaaZ: and the reason is that sooner rather than later you'll want to add checks, maybe ACLs, etc.

7:46 AtKaaZ: my thoughts exactly

7:46 _ulises: AtKaaZ: and it'll be far easier to change that function instead of *all* your code ;)

7:47 AtKaaZ: just awesome:)

7:47 (inc _ulises)

7:47 lazybot: ⇒ 1

7:47 _ulises: AtKaaZ: not just that, if you find that eventually maps are too slow for you, you can then rewrite returned-value-1 fn to take a vector and hide the positional extracting there

7:47 AtKaaZ: basically, indirection saves the day again

7:47 AtKaaZ: I'm just trying to save you some pain from the beginning :)

7:47 * _ulises has been burnt by this too many times

7:47 AtKaaZ: much appreciated

7:48 _ulises: np

7:54 deg: Hi... I'm a newbie to this IRC and, pretty much, to Clojure. Is it appropriate to ask a question here looking for basic help?

7:55 _ulises: deg: don't ask if you can ask :)

7:56 shachaf: Be bold, deg. Ask your question.

7:56 In the worst case, you'll be referred elsewhere.

7:56 ("referred" may be a euphemism, in the very worst case.)

7:56 deg: :-) Yup, I was afraid that would be a reaction... Anyway, then, I'm having trouble figuring out how to debug effectively (I'm working in an Eclipse/CCW env). In particular, I have a local that I think is always a vector... my code only inits it to [] or conj's on to it, but... at one point it prints out as #<core$conj clojure.core$conj@e86a5f>

7:57 And, when my code tries to take first of it, I get the error "IllegalArgumentException Don't know how to create ISeq from: clojure.core$conj clojure.lang.RT.seqFrom (RT.java:494

7:57 AtKaaZ: _ulises: could I maybe enforce the use of wrapper functions on the returned map ? maybe make the returned object be something else which wraps the map?

7:58 _ulises: AtKaaZ: perhaps, but I personally wouldn't do that

7:58 AtKaaZ: _ulises, why not?

7:58 _ulises: deg: maybe paste the code?

7:58 AtKaaZ: well, it's sort of a philosophical position

7:59 AtKaaZ: I mean, I would rather keep the data open and provide utility functions to the users of my lib/myself

7:59 AtKaaZ: than to police it

7:59 deg: Ok. give me a minute to extract the relevant pieces....

7:59 _ulises: AtKaaZ: because police-ing the data takes times and effort

7:59 AtKaaZ: and it doesn't make that much sense anyway in most scenarios

7:59 AtKaaZ: I'm lazy you see :)

8:00 AtKaaZ: _ulises: but if I wanted to do it what should I look into? something to build a new class and have that map as a field with possibly replacing toString to show the map contents

8:01 _ulises: AtKaaZ: then the world is your oyster my son, you can do whatever you want and not necessarily wrap a map

8:02 deg: (defmacro dbg[x] `(let [x# ~x] (println "dbg:" '~x "=" x#) x#)) ... {:chromatin chromatin :rules rules :rule-path []} ; passed into a function ... (defn f [input] (let [chromatin (:chromatin input) rules (:rules input) rule-path (:rule-path input)] (dev/dbg rule-path) (dev/dbg (first rule-path))

8:02 (oops, lost the newlines... let me try that again)

8:02 (defmacro dbg[x] `(let [x# ~x] (println "dbg:" '~x "=" x#) x#))

8:03 ...

8:03 _ulises: deg: use friendpaste/refheap/etc.

8:03 AtKaaZ: you can use refheap.com

8:03 for pastes

8:03 deg: https://www.refheap.com/paste/6232

8:04 Obviously, not all the code is there, and the error is somewhere else. But (I claim) the only thing I'm doing is conj'ing on to the vector.

8:05 _ulises: deg: well, the error is probably in that claim; I mean, something's going wrong while you conj because you're ending up with an fn instead of a vector and then (first...) complains

8:05 deg: I will probably be able to find my error, if I can udnerstand what it is. But, I don't understand what the "#<core$conj clojure.core$conj@e86a5f>" is.

8:05 _ulises: deg: so without seeing that code (or a simpler version of) there's not uch I can do

8:05 deg: Oh, it is a function?

8:06 _ulises: deg: yes, that message is a function

8:06 ,(str identity)

8:06 clojurebot: "clojure.core$identity@35d3694a"

8:06 deg: k... one minute... let me stare at my code and see if it becomes glaringly obvious now.

8:06 _ulises: ,(str #(+ 1 %))

8:06 clojurebot: "sandbox$eval54$fn__55@5a9875d1"

8:06 _ulises: deg: cool

8:07 deg: Ikes... yeah, glaringly obvious typo.

8:07 Sorry, all!

8:09 So, I guess my next question becomes: what doc describes the printed rep of different objects? Does "#<...>" always represent a function?

8:09 borkdude: AtKaaZ sorry, was away for a minute

8:09 AtKaaZ: borkdude, np

8:09 borkdude: AtKaaZ maybe you should take a look at this article: http://blog.malcolmsparks.com/?p=17

8:10 deg: And, broader question, where can I find a good description of debugging tools for Clojure in Eclipse? (Or am I better off just moving to Emacs, if it has a richer debug env)

8:11 AtKaaZ: can emacs refactor? i can see ccw doesn't

8:12 like rename functions for example

8:12 deg: Ideally, I'd like a debugging environment where (1) stack traces show my functions only, not the java support structure; (2) an exception leaves me in a REPL in the lexical environment of my erring function; and (3) the debugger REPL lets me navigate into the lexical envs of calling stack frames.

8:13 Do such tools exist yet for Clojure?

8:14 clgv: deg: in eclipse you can use breakpoints.

8:15 deg: just make sure that the repl is started in debug mode

8:15 deg: I tried using breakpoints yesterday. As far as I could tell, my breakpoint was never reached, and execution kept stopping at an unmarked breakpoint deep in the runtime support code.

8:16 Did I make a mistake by first starting the REPL and then (hours later) doing F11 (Eclipse's Run|Debug)? Or should that automatically start a debugging REPL?

8:17 Or, I guess I should ask, is there a doc that describes how to start a Clojure debugging session in Eclipse?

8:28 Ok, so trying again to use breakpoints in Eclipse... Restarted Eclipse, set a few breakpoints, and then did Run|Debug from the Eclipse menu. It started a REPL, and broke in Clojure's core.clj, seemingly at line 101, in the def of ffirst.

8:29 Eclipse does not show a breakpoint on that line. Continuing just breaks at another line in the runtime support.

8:30 Hmm, my file is also called core.clj, and I have a breakpoint at line 101. Is it possible that Eclipse is setting the breakpoint in the wrong file, despite them being in different namespaces?

8:40 babilen: Hi all -- Is it intentional that reduce and reduce-kv or map/mapv and reducers/map show different behaviour when called on nil? (cf. https://www.refheap.com/paste/6233)

8:40 clgv: deg: you have to start the repl in debug mode

8:41 babilen: I find myself in the unfortunate position that I have to litter my code with "(nil? coll) (new-coll-of-expected-type)" which is IMHO quite ugly. Is this inconsistency intentional?

8:52 deg: (back) clgv: how do I start the repl in debug mode? It looks to me like Eclipse is starting the repl itself, when I do a Run|Debug. What other step(s) do I have to do?

8:52 clgv: use debug ^^

8:53 deg: close the open REPL and Run -> Debug As -> Clojure Application

8:54 deg: thx. One minute while I restart and try that.

8:56 clgv: I restarted Eclipse, did Run|Debug As|Clojure Application, and then did Clojure

8:56 .. Clojure|Load File In Repl. Now, all breakpoints are showing with a slash through them

8:57 and toggling breakpoint goes between no icon or breakpoint with a slash.

8:57 clgv: well, I did nothing more than that and could use breakpoints

8:58 deg: Ok, thanks. I'll paly around. Surely just something in my env. Once I do get it to work, how powerful are the breakpoints? Do they leave me in the lexical env of each of my functions?

8:58 "paly" -- "play"

9:06 clgv: deg: yeah, you get local variables with values as in java. but afair there might be problems with "locals clearing"

9:11 deg: clgv: thanks. I'm now playing with Eclipse and should have this figured out soon. (Turns out that the slashes were caused by a "skip all breakpoints" setting in Eclipse, but now I'm back to the original problem. But, I'm sure it's just something environmental.

9:12 clgv: deg: I dont use breakpoints often though. It pays off more to test functions in the repl as you develop them

9:13 deg: clgv: Agreed, but debugging is still an unavoidable evil sometimes.

9:14 clgv: deg: I ve written some debug tools but they currently have a hard time with tail-recursion

9:14 deg: And, even after years of suffering through C++ and Java, I'm still spoiled by early exposure to the Lisp dev env on Symbolics machines. Clojure has such potential, I hope it will soon reach and surpass those glory days.

9:20 _ulises: deg, clgv: surely you also write unit/integ tests too ;)

9:21 clgv: _ulises: definitely.

9:46 ro_st: dnolen: in cljs, how do protect a set! property from advanced mode munging?

9:46 in vanilla gclosure i'd just goog.export the name or use a string eg foo["bar"] = "baz"

9:47 i'm busy wiring in exception reporting with goog.debug.ErrorReporter/install

9:47 and i need to write some additional stuff into the context so that the reports are useful

9:47 ohpauleez: ro_st: You can use the ^:export metadata

9:47 ro_st: i know i can do that on def and defns

9:48 but what about ".-my-version" in (set! (.-my-version context) version/version) ?

9:48 ohpauleez: If that

9:48 ro_st: "my-version" is being munged, which i don't want

9:49 kudos on ttt, btw :-) i'm looking forward to spelunking in there

9:50 ohpauleez: Thanks! Is that property specified outside of CLJS, in some other JS code?

9:50 ro_st: nope

9:50 in cljs

9:50 refheap inboud

9:51 ohpauleez: and it still munges even though context is ^:export 'd? That seems odd to me

9:51 cool

9:52 ro_st: https://www.refheap.com/paste/6235

9:53 see the issue? i have to mutate an obj that gclosure passes to my fn

9:54 i guess i could cheat and export empty defs

9:54 ohpauleez: ro_st: What happens if you you ^:export error-context

9:55 that's also another work around

9:55 ro_st: neither of those seems to work

9:55 ohpauleez: or if you wanted to be dangerous, you can use the js* form

9:56 ro_st: how would that look?

9:56 ohpauleez: and if you attach meta ^:export at the call location, does that result in a compilation error?

9:56 (js* "raw JS syntax here to set the property you're talking about")

9:57 ro_st: like this? (goog.debug.ErrorReporter/install "/client-error" ^:export error-context)

9:57 ohpauleez: you're going to have to use, with-meta

9:57 but you'll need to extend the IWithMeta protocol to the context (if it doesn't already exist)

9:58 ro_st: (js* (str "context.c2-version = " version/version))

9:58 compiler laughed at me in multicolor stacktrace prose

9:58 ohpauleez: :(

9:58 ro_st: is there a way to do this?

9:58 obj["foo"] = bar

9:59 ohpauleez: Hmm, open up an enhancement ticket on the tracker - I'll see if I can come up with anything today/this week

9:59 ro_st: the tracker that needs a CA?

9:59 i'm all out of spare blood -grin-

10:00 ohpauleez: beyond (set! (.-foo obj) bar), not that I know of

10:00 haha, there should be a digital CA soon - I'll open up the issue

10:01 so where is the .-c2-version coming from?

10:01 ro_st: ok cool. our jenkins writes git-describe into a cljs prior to cljs-build

10:01 into app.version/version

10:02 so that the app knows which git tree it's built on. i want to write that into the outgoing errors so that we can precisely reproduce error conditions

10:02 ohpauleez: do you have an externs file for the app.version?

10:03 ro_st: don't need one:

10:03 (ns app.version)

10:03 (def version "#VERSION#")

10:03 we just sed #VERSION# with the actual version number

10:03 ohpauleez: ahh, it's CLJS

10:03 ro_st: yes

10:04 ohpauleez: then were is the error happening? Name munging shouldn't matter if it's all internal

10:04 Ohhhhhh

10:04 ro_st: well, the error reporter target is a server-side script

10:04 i'm writing app version into the data going to the server

10:05 so i do need ^:export, but on that particular js property name rather than a fn or namespaced declaration

10:05 ohpauleez: and you get passed a context, which a flat JS object, but generated after the fact, but the .-c2-version is munged and you get an error?

10:06 so the .-c2...*

10:06 ro_st: yes. gclosure passes me an anon js obj with stuff in it - stack trace, line number, etc - and i then add context.c2-version = app.version/version

10:06 hence the need for set!

10:06 i have to mutate an object passed to me

10:07 dnolen: ro_st: use aset not set!

10:07 ro_st: dnolen to the rescue :-)

10:07 where do i find docs for that? -curious-

10:07 nothing on himera abouut it

10:08 dnolen: there are no docs for that really. related - figuring how to expose GClosure support for this kind of thing. @expose seems to fit the bill.

10:09 ro_st: (aset context "c2-version" version/version) ?

10:09 dnolen: ro_st: yes

10:09 ohpauleez: this is a good little nugget - I've never run up against this before

10:10 ro_st: thanks dnolen. high five

10:10 yeah. a great thing to know.

10:11 works!

10:11 ohpauleez: do you log js exceptions in your cljs apps?

10:11 if so, how?

10:11 (f not, why not, you madman?)

10:12 dnolen: how are things going with sourcemaps?

10:12 dnolen: ro_st: not currently working on them. busy w/ core.logic stuff.

10:13 ro_st: thinking about it, i'm actually 100% happy with :advanced -> :simple sourcemap support, which i believe you said is already working

10:13 ohpauleez: ro_st: In one internal app we just log to console, in another app we use Shoreleave's remotes

10:13 and expose a server-side logger

10:14 ro_st: and how do you capture the exceptions?

10:14 ohpauleez: and in two others, no logging, but they are small

10:14 we just squash them and hit the logger

10:14 dnolen: ro_st: hmm that's true I could probably cherry-pick that bit out.

10:15 ohpauleez: most of the serious exceptions we hit in development (missing protocols, etc)

10:15 ro_st: dnolen: i would be most grateful if you could. it'd be great to be able to build 'normal' sourcemaps along side our :advanced js

10:16 ohpauleez: ro_st: I'm sure dnolen would accept patches from you, passed through my CA :)

10:16 ro_st: i'm afraid it's a little beyond my ken at the moment

10:17 CTO for a startup, and we're just about to tip. father of a toddler. spare time sliiiiightly on the non-existent side -grin-

10:18 i'm really glad i decided on clojure 7 months ago. we'd be nowhere near where we are now.

10:21 ohpauleez: we've tested pretty thoroughly. i'm just putting something in to help us catch the stuff that didn't occur to us

10:22 ohpauleez: ahhh cool!

10:30 ro_st: was so happy to not have to support IE8. man that thing is a dog

10:44 jonasen: dnolen: will there be a :column key in the cljs ast tree now when we have reader support for it?

10:54 casperc: hi, anyone familiar with datomic in here?

10:55 ro_st: yup

10:56 casperc: awesome, so I have a connection url for datomic which looks like this: datomic:ddb://datomic/<name>?aws_access_key_id=yyyy&aws_secret_key=xxxx

10:56 thing is I am behind a corporate firewall, and it doesn't work

10:57 ro_st: ah, apologies. only been using free on single-machine setups

10:57 best place is the google group

10:58 casperc: yeah figured as much, was just hoping i might find someone here :)

10:58 thanks anyways

11:02 dnolen: ro_st: ohpauleez: I added basic GClosure source map support to CLJS

11:02 you just need to add :source-map "name.json" to your build options

11:02 ro_st: ah

11:03 i've had :sourcemap true in for a while

11:03 what does "name.json" describe?

11:03 dnolen: ro_st: the name/path of the source map file.

11:03 ro_st: rooted where? the project?

11:03 dnolen: ro_st: :sourcemap true doesn't do anything.

11:04 ro_st: relative to where you run the compiler. improvements welcome

11:04 ro_st: let me try that out

11:06 which version did that land in, dnolen?

11:06 i currently have 0.0-1450

11:06 dnolen: ro_st: it's not in a released version - fixed in master.

11:08 ro_st: ah. i can chuck it into checkouts to test it, right?

11:09 ohpauleez: dnolen: Awesome, I'll check it out today

11:09 ro_st: sorry, i've not had to work with a jar dep as a git checkout before

11:13 hmm. looks like it's not that simple

11:13 dnolen: ro_st: hopefully another release soon, I'd like to see the let issue CLJS-411 to get resolved first.

11:13 ro_st: i'm using cljsbuild in my project. is it a big mission to get it using a checkout of clojurescript instead of some jar? sorry, this is stuff i've never had to deal with before :-)

11:14 dnolen: ro_st: it's pretty simple - make a directory called checkouts in your project. git clone clojurescript into it. use leins :extra-class-paths

11:14 ro_st: the master version of CLJS will be used by lein-cljsbuild

11:15 ro_st: i'm using these deps https://www.refheap.com/paste/6240 due to needing a modern enough version of gclosure to support shoreleave and enfocus/domina at the same time

11:15 i'm guessing doing so complicates this somewhat?

11:16 i'm guessing "clojurescript/src" is sufficient for :source-paths?

11:17 yeah, i'm getting this error "WARN ignoring checkouts directory clojurescript as it does not contain a project.clj file."

11:17 dnolen: ro_st: lein 1 / 2 ?

11:17 ro_st: 2

11:18 dnolen: ro_st: no you need full paths

11:18 ro_st: yeah i don't use 2 so I don't know about that warning.

11:18 ro_st: ok cool

11:18 i'll pester ohpauleez once he's given it a go :-)

11:18 or wait until the next release

11:18 dnolen: ro_st: http://gist.github.com/3974095 is an example of how I do it.

11:19 ro_st: ah you include both clj and cljs directly

11:19 ohpauleez: ro_st: If you see that warning, just make your own branch of CLJS, and add a standup project.clj

11:20 or, follow dnolen's suggestion (which is also what I do with other contrib libs)

11:20 dnolen: ro_st: yes

11:21 joro: I'm using aleph.http http-server with ring middleware, and compojure static route. With 2GHz i7 I'm getting 30 req/s. Any ideas how to improve that?

11:21 ro_st: it fetched org/clojure/clojurescript/0.0-1513/clojurescript-0.0-1513.jar, and i'm getting new deprecation warnings for shoreleave

11:21 so i'm guessing it's using 1513 and not my checkout

11:22 ohpauleez: you've probably fixed already? Protocol IPrintable is deprecated at line 27 .lein-cljsbuild-compiler-1/shoreleave/browser/cookies.cljs

11:22 ohpauleez: gist or refheap me the deprecation warnings

11:22 ahh no, I haven't fixed that one

11:22 ro_st: it's just that one

11:22 ohpauleez: ahhh that's an easy update

11:23 ro_st: that's in 0.2.3-snapshot (which i'm still using)

11:24 ok. i'm going to hold out for the next version of cljs, dnolen. thanks for your time. do you tweet when cljs is released? where should i watch for news?

11:24 dnolen: ro_st: stuart sierra usually makes an announcement on the list.

11:24 ro_st: on the clojure ggroup, right?

11:25 dnolen: ro_st: yep

11:25 ro_st: cool

11:25 is there a way to set up an alert on ggroups?

11:26 i'll google :-)

11:26 dnolen: you seem to be having lots of fun with logic!

11:27 getting a small taste of it with datalog in datomic now. starting to appreciate its power. queries that would have been walls of sql are so simple and straightforward in datalog

11:28 btw, someone with high scale experience needs to represent clojure at http://scaleconf.org/

11:28 i'm printing an Ask me about clojure tshirt to wear when i attend

11:30 quadrocube: Hi all! Is there anyone who may explain how to use (no-loop) in clj-processing? I have been running my head into it for quite a while, but still am unable to find out why this (quite prosaic) example fails http://pastebin.com/LYR86vVq Thank you in advance!

11:30 dnolen: ro_st: it is fun - but it's also annoying :)

11:30 quadrocube: *quil, which was earlier a clj-processing

11:31 clgv: quadrocube: it's a property setter on the sketch

11:32 dnolen: samaaron: look forward to hanging at TechMesh!

11:32 samaaron: dnolen: haha, me too!

11:35 quadrocube: clgv: not sure I caught corretly what you meen.. Can you, please, elaborate a little bit. (Kinda newbie into quil all in all)

11:35 clgv: quadrocube: i think that (no-loop) says "dont call the draw method and only execute the setup method"

11:37 quadrocube: the docstring of "no-loop" is quite instructive

11:38 quadrocube: yeah, that's what the prototype method noLoop in processing is meant to be. But as the majour purpouse of it, it provides you wtih the possibility to call (redraw) to manually redraw the sketch as you need. Nevertheless, i'm failing to force the redraw by calling (redraw) func outside the setup - e.g. mouse handlers do not trigger at all

11:39 And, e.g., here: http://processing.org/learning/basics/noloop.html there is an example, which shows that a (redraw) inside mouse-handler is possiblke

11:41 so, mainly, the question is: why no-loop behaves in the similiar way as sketch-stop in terms of ignoring all the possible outside-world events?

11:43 docs say that it's not the correct behaviour and most probably it's me who is doing smth wrong

11:49 Cubic: Damn, paredit mode hates my curly braces

11:49 clgv: quadrocube: since this is all running in a different thread wrap some try-catch blocks around your code and output the stacktraces if any

11:49 samaaron: quadrocube: please file any quil issues on Github :-)

11:51 quadrocube: thank you all =) Yeah, perhaps it's not the best place..)

11:53 Cubic: Has anyone here managed to get paredit-mode to properly work with curly braces? If so, how?

11:57 samaaron: Cubic: what do you mean by "properly work"

11:57 i.e. what doesn't it do that you would expect it to do?

11:58 Cubic: It doesn't close {'s when I write them, although it does recognize {} as a SEXP when I close it myself (and I can't delete a single { without closing it first). It's all very weird

11:59 samaaron: Cubic: check out how Emacs Live does it

12:00 it works perfectly there

12:00 ro_st: cubic: i suggest swapping out your own .emacs.d for emacs live and trying it out

12:00 i use an emacs live based config and paredit is awesomesauce

12:01 Cubic: Does it actually glow weird like in the screenshots?

12:01 ro_st: no that's a filter on the video :-)

12:02 samaaron: Cubic: sadly not :-)

12:02 ro_st: although i must admit i did think it would when i first saw the vid

12:08 mikerose357: hey there is supposed to be a branch of vimclojure that can connect to nrepl anyone use this/

12:10 ohpauleez: mikerose357: The latest version of vimclojure connects via nrepl I believe

12:14 technomancy: mikerose357: I think that's still in development

12:17 Cubic: Wow, the emacs live package is pretty cool. Only downside is, now I gotta find my old theme again. The preconfigured one has too much contrast

12:31 mpan: Anyone know what's happening lately with Light Table?

12:36 jrajav: mpan: http://www.chris-granger.com/ https://twitter.com/ibdknox

12:36 mpan: thanks!

12:43 francis-: I need a fn that does devision but discards the remainder. The name of it is escaping me at the moment.

12:43 EG:

12:44 (some-fn 7 3)

12:44 ;=>2

12:45 Wild_Cat: francis-: (int (/ 7 3))

12:45 francis-: thanks

12:45 Wild_Cat: francis-: meaning the function you want is in fact (comp int /)

12:50 metellus: $findfn 7 2 3

12:50 lazybot: [clojure.core/bit-flip clojure.core/bit-clear clojure.core/quot clojure.core/unchecked-divide-int]

12:51 metellus: $findfn 7 2 3

12:51 $findfn 7 3 2

12:51 lazybot: [clojure.core/bit-flip clojure.core/bit-clear clojure.core/quot clojure.core/unchecked-divide-int]

12:51 [clojure.core/quot clojure.core/unchecked-divide-int]

12:51 metellus: ,(quot 7 2)

12:51 clojurebot: 3

12:52 mpan: does findfn do something special? or just brute force?

12:52 technomancy: brute force is special in its own way

12:52 mpan: I never claimed to be good with natural language, I suppose

12:53 technomancy: just messing with you

12:54 mpan: I seem to have lost my train of thought of what I wanted to ask

12:54 technomancy: pretty sure it's doing brute force; type inference in Clojure is still in its infancy

12:54 mpan: due to looking into findfn

12:55 ToBeReplaced: technomancy: is there a way to get the release branch of clojure-test-mode with package.el or do I need to clone the repos? i hit this: https://github.com/technomancy/clojure-mode/issues/98

12:56 gfredericks: I wonder if adding typed-clojure to lazybot could make find-fn a lot more smarterer?

12:56 technomancy: ToBeReplaced: I don't understand

12:57 ToBeReplaced: only the releases are on marmalade

12:57 gfredericks: only if someone went to the trouble of annotating everything in core first

12:58 hiredman: technomancy: seems likely

12:58 mpan: technomancy: is everything annotatable?

12:59 ToBeReplaced: technomancy: understood... so i guess i'm hitting an issue with the release then dated 09/14, which is the same one as proofit404; should i just add an issue?

12:59 technomancy: ToBeReplaced: there's no release with that date

13:00 ToBeReplaced: maybe you're using melpa? they generate their own releases from git master automatically.

13:00 which obviously leads to all kinds of breakages in the normal course of usage

13:00 ToBeReplaced: yes you're correct; it's from melpa... i'll switch to marmalade

13:03 dnolen: technomancy: hiredman: typed clojure already annotates a good chunk of core http://github.com/frenchy64/typed-clojure/blob/master/src/typed/core.clj#L6229

13:04 technomancy: oh, gotcha

13:04 so the other problem with using an explicit ann function for annotations (as opposed to just metadata) is that it creates a runtime dependency on typed clojure, which is unfortunate for a dev-time tool

13:05 I guess I should mention that when ambrose is online

13:05 dnolen: technomancy: actually perhaps not as much as I had thought - but seems like a good starting point

13:06 technomancy: well doubtless it will happen with time

13:07 dnolen: bbloom: ping

13:08 lynaghk: dnolen: stay dry, David

13:08 dnolen: lynaghk: will do, thanks

13:12 ToBeReplaced: technomancy: thanks; issue resolved

13:14 technomancy: yeah melpa is an interesting idea, but until they offer a repo that only includes explicitly tagged releases I think it's just more trouble than it's worth

13:18 ToBeReplaced: i'm using emacs for the first time, so after you brought it up i went to go learn about them. i think i'm inclined to agree with you, but i haven't felt its power yet so hard to know

13:21 technomancy: oh, did I tell you to use it? my bad =\

13:22 uvtc: Only catching the tail end of this conversation, but I tell folks to use melpa in http://www.unexpected-vortices.com/clojure/10-minute-emacs-for-clojure.html . technomancy, not good advice?

13:23 technomancy: uvtc: I don't think so. newbies shouldn't be following git master; that's just asking for breakage.

13:23 as evidenced above

13:24 uvtc: Ah. In that doc, I'm using it to install only clojure-mode.

13:24 technomancy: yeah, but people will go on to install other things

13:24 and clojure-mode breaks on master sometimes too

13:24 uvtc: right.

13:25 So, it's better to use marmalade. Ok.

13:25 pyr: I suppose warnings like this one: Warning: protocol foo is overriding method bar of protocol baz are unavoidable ?

13:25 and to be clear, the only risk that protocol overriding presents is a single record/type/class implementing both protocols

13:26 Baldanders`: Speaking of newbies and breakage... technomancy, you are the author of Leiningen, right?

13:26 technomancy: depends, what's the question? =)

13:26 Baldanders`: heh

13:26 Well I posted something to thegoogle group about this right before you moved the list.

13:27 But I had a lot of problems with Leiningen under my Win 7 machine at work. It's possible that I did something stupid, but I don't think so.

13:27 Because I followed the same steps on both my Win 7 laptop and on a Linux VM and things worked...

13:28 So I think Lein 2may have some problems gettingpackages with certain setups under Win 7.

13:28 technomancy: hm; yeah I think I remember that email

13:28 unfortunately I don't know where to look to debug that kind of problem on Windows

13:29 Baldanders`: I've been able togetaround it for nowby using Linux in a VM at work, but I thought I I'd give you a heads-up about it.

13:29 Yeah- I am not sure what to do to try to diagnose what is happening.

13:30 Otherwise I would dig into it and try to figure it out. But it has been quite a while since I did anything with the JVM, and I am just starting to use Clojure seriously.

13:35 I do have one question about working around it though- since I can get packages OK on my Win 7 laptop, would it work to set up a project with the dependencies I want on that machine, and then move the downloaded files to my desktop at work? I'm not quite clear on where Leiningen puts stuff, but I imagine I could figure it out.

13:36 And by the way, other than this little problem, Leiningen is very cool.

13:38 technomancy: Baldanders`: sure; copying ~/.m2/ over should get you what you need

13:40 Baldanders`: Cool, thanks.

13:43 ToBeReplaced: sorry; one more :) how do you connect clojure-test-mode to nrepl? if i do C-u M-x nrepl-jack-in, then C-c C-t to a test file, then C-c C-,, it says Not connected.

14:00 ;; figured out that clojure-test-mode doesn't support nrepl... works with swank

14:01 or maybe i have bad blobs from previous release :)

14:03 yes, 1.6.0 runs with slime, 1.7, when it is released, will work with nrepl, but it doesn't quite get there yet

14:36 nbeloglazov: Hi. I have a problem with proxies. Base class has empty public method mouseClicked. Proxy based on this class is created where mouseClicked overridden. This mouseClicked method called by base class in 2 different places from 2 different threads. In one thread overridden version is called, in other - empty. How it is possible?

14:37 Proxy is created here: https://github.com/quil/quil/blob/master/src/quil/applet.clj on line 275

14:40 Cheiron: hi, when using gen-class , should i pass 'this' to every function ?

14:41 nbeloglazov: I tried to log all invocations of mouseClicked and here what I have: https://www.refheap.com/paste/6242

14:42 Cheiron: what happened if we didn't pass this to functions for gen-class?

15:02 jweiss_: am i the only one would would find this useful? (binding [*print-lazy* true] (iterate inc 0)) => () (where *print-lazy* would only print the already realized portion of a lazy sequence?) i know it's not that hard to do for lazy seq's, not sure about Cons's.

15:04 sorry (binding [*print-lazy* true] (prn (iterate inc 0))) => ()


15:06 ro_st: Raynes: ping

15:06 anyone using ring and have a solution for logging exceptions?

15:06 i'm wondering if there's any more to consider beyond the solution here: http://stackoverflow.com/questions/12627410/idiomatic-way-to-catch-exceptions-in-ring-apps

15:10 ibdknox: ping

15:14 yay. found it

15:25 rbxbx: If anyone is having difficultly with getting vimclojure-nailgun-client working and you're on OSX, I wrote a little homebrew recipe that should take away the pain – http://regretful.ly/clojure/2012/10/28/up-and-running-with-vimclojure/

15:27 tgoossens: I'm really getting frustrated at university

15:28 hyPiRion: tgoossens: oh?

15:28 tgoossens: We are obligated to do our assignment OO

15:28 And clojure is so cool :P

15:28 ro_st: yuck

15:28 solussd: how do I remove a protocol implementation from a record? I moved the protocol implementation from one namespace to another, but now I get "blah blah blah already directly implements interface blahblah for protocol blah"

15:28 tgoossens: Even though i've only been working with clojure for 1 month

15:28 I love it

15:29 I forget to study though :S

15:30 ro_st: tgoossens: you can do FP in an OO language

15:30 rbxbx: ro_st tgoossens and vice versa ;)

15:30 tgoossens: I know.

15:30 I like multiparadigm

15:30 But it is a course on OOP :p

15:31 ro_st: can you unsubscribe?

15:31 switch to, say, scheme?

15:31 tomoj: solussd: I don't understand https://gist.github.com/c06b191ee5657ce8a668

15:31 tgoossens: Its a course in java

15:31 ro_st: this is why i dislike uni. pay lots of money to fill your precious braincells with crap.

15:32 tomoj: if the protocols are in separate namespaces, they're separate protocols, and there should be no problem

15:32 oh, the implementation. hmm

15:32 ro_st: trusty way to test exception handlers: (/ 1 0)

15:32 much more fun than (throw "up")

15:32 solussd: tomoj: actually, I'm implementing the protocol inline with the defrecord declaration (defrecord Blah [key key2] Proto (func [_] "hi"))

15:33 then I moved it elsewhere and recompiling (without restarting my repl) complains

15:33 tomoj: that seems like it should also work..

15:33 since it will be a completely new record type in a new namespace

15:34 hyPiRion: ro_st: I wouldn't say uni is crap, but it's teaching you the current industry standard and gives you a proof that you know it

15:34 ro_st: but is it the current industry standard?

15:34 hyPiRion: Java is, at least over here

15:34 ro_st: and is it proof?

15:34 and is that the best way to turn that money into that result?

15:34 solussd: tomoj: I'm replacing the protocol implementation using (extend-type Blah Proto (func [_] "hi again)) after removing it from the defrecord declaration and recompiling it first, of course

15:35 tgoossens: The nice thing is if you are obligated to make a program in java

15:35 hyPiRion: But, important aspect I should tell - I'm not paying for my education, so maybe I'm biased

15:35 tgoossens: You can do it in clojure :)

15:35 ro_st: i'm self taught. 33 yrs old, 15 years work experience. got paid for all my learning

15:36 tomoj: solussd: I don't think you can do what you want

15:36 solussd: :/ REPL, i'm sorry, I'm going to have to disconnect you.

15:36 tomoj: you could remove an extended-on impl by altering the protocol

15:36 well, just undef the record

15:36 solussd: oh, ok

15:36 ill do that. :)

15:36 tomoj: er, hmm

15:36 Cubic: ro_st: Well, I pay roughly $300 per year (and earn roughly $250 per month) at university, so money wise it's not a problem. Also, I don't mind Java being taught here because we're really not doing very much programming either way

15:37 tomoj: yeah, (ns-unmap *ns* 'TheRecord) seems to work

15:37 Cubic: tgoossens: Unfortunately we can't, at least at our uni they're checking source codes.

15:37 ro_st: $300/year is for nothing!

15:37 tgoossens: Same here

15:37 Unfortunately

15:37 tomoj: heck even (defrecord TheRecord [])

15:37 solussd: tomoj: thank you

15:38 ro_st: tgoossens: how big is the project?

15:38 solussd: ha

15:38 tgoossens: But what i meant is : in a working environment

15:38 ro_st: oh yes. clojure, no question.

15:38 tgoossens: Short story : controlling nxt robots

15:38 ro_st: we're using clojure everywhere. cljs, clj, datomic, pallet. only html and css aren't strictly clojure, although half the html is, as hiccup

15:39 tgoossens: :D

15:39 What do you do for living

15:39 tomoj: hiring? :P

15:39 ro_st: and clojure as the wire format. so refreshing.

15:39 tomoj next year :-)

15:39 i'm a chief technical chicken for a startup

15:40 3 devs, including myself, so far

15:40 solussd: tomoj: we're hiring, and we use clojure…….. but we're only hiring for a asp.net position. :D

15:40 tgoossens: Nice

15:40 tomoj: hah

15:40 tgoossens: I still have 2.5 years to go at univ.

15:41 and i'm really annoyed on how

15:41 ro_st: tgoossens: i'd get the OO project done as quickly and as simply as possible. get it behind you. then you can have fun with clojure afterward

15:41 tgoossens: OOP is teached to us as the best way

15:41 Problem with that:

15:42 It is a year project

15:42 In group

15:42 ro_st: then write clojure that generates the code you'll need to provide

15:42 tgoossens: And at regular moments we need to report

15:42 ro_st: "what would you like, java? javascript? lua, perhaps?"

15:43 tgoossens: Other members won't agree

15:43 ro_st: can you unsubscribe?

15:43 tgoossens: No obligated

15:44 ro_st: if not, do your best. you've already committed your money.

15:44 tgoossens: Sure

15:44 I mean

15:44 I have a lot of fun

15:44 But i want the time to do othet stuff than Oop

15:44 ro_st: i personally wouldn't waste precious time and brains on it, but then i'm in a different place to you

15:45 i've done my decade of OOP already. you're lucky, you only have to do 2.5 yrs :-)

15:45 you can still learn something. make that your mission: see what you can learn

15:46 and have fun with clojure in your endless spare time ;-)

15:47 emezeske: tgoossens: It's good to have a wide breadth of programming knowledge -- knowing OOP inside-out will help your FP, and vice-versa

15:47 tgoossens: Yes :)

15:47 ro_st: emezeske: thanks for your help with *assert*. it's proving super handy

15:48 emezeske: what do you do for cljs exception logging, if anything?

15:48 emezeske: ro_st: np!

15:48 tgoossens: I'll minimize the work

15:48 Got2go

15:48 Bye

15:48 ro_st: enjoy

15:48 emezeske: ro_st: Heh, that's super high up on my priority list, but I do basically nothing right now O_o

15:48 ro_st: Which is horrible.

15:49 tgoossens: We speak again

15:49 emezeske: ro_st: I was planning to just make an AJAX call and have the server log it

15:51 tomoj: need a longbottom for cljs

15:52 but getting stacktraces past async boundaries requires cooperation. hmm

15:54 ro_st: emezeske: all done. https://www.refheap.com/paste/6243

15:55 emezeske: ro_st: Oh, nice, I didn't know about ErrorReporter, that was the part I was least looking forward to writing! Thanks!

15:55 ro_st: google closure is full of goodies

15:55 * emezeske should probably know more about google closure.

15:56 ro_st: i find it's better to dig when you need something. there is a LOT of stuff in there

15:56 Cubic: Are any of the people that recommended emacs live earlier still here? I'm trying to get the nrepl buffer to do syntax highlighting, but it somehow doesn't work

15:56 callen: so a few things

15:57 samaaron: Cubic: howdy

15:57 callen: 1. Don't use Emacs Live, or any other pre-baked Emacs environ.

15:57 2. Don't expect something to work that you don't understand well enough to fix

15:57 3. Just learn Emacs

15:57 muhoo: ro_st: what's the "?" in that paste do?

15:57 callen: Cubic: https://github.com/bitemyapp/dotfiles/ *learn* from but do not *copy* my dotfiles repo.

15:57 muhoo: on line 10

15:57 callen: Cubic: you can see how my .emacs.d is laid out and how the clojure directory is setup.

15:58 Cubic: callen: Thanks for the _advice_ but I personally am more interested in writing code rather than writing the tools I need to write my code.

15:58 callen: Cubic: it takes like 2 minutes for me to setup Emacs + nrepl.

15:58 if that.

15:58 samaaron: callen: sometimes learning by example is beneficial

15:58 callen: Cubic: it's better to start from a minimal base, take the 5-15 minutes it takes to add the bare minimum you need, and then go back to coding.

15:58 ro_st: collorary to 1: unless, of course, you want to. to 2: except stuff like cars, or routers, or cpus, or refridgerators, or fish knives. 3: once you've made enough money doing real work and have time to spelunk down a black hole

15:58 callen: Cubic: that minimal base is easier to understand, and since you only added the minimum you wanted, you understand those bits.

15:59 ro_st: we're programmers, not consumers of manufactured products.

15:59 ro_st: muhoo: whatever you like :-)

15:59 samaaron: callen: I have spent many, many man-months on Emacs Live - it's going to be more useful for some people than 2 minutes of setting up nrepl

15:59 ro_st: callen: wrote your own OS, did you?

15:59 callen: ro_st: a decade ago, yes. Why?

15:59 ro_st: still using it?

15:59 muhoo: ro_st: metasyntax?

15:59 callen: ro_st: I'm still using the knowledge from the experience. Don't be an idiot.

16:00 ro_st: hardware drivers? hardware? make your own furniture?

16:00 callen: he tried to use something he didn't understand

16:00 it bit him.

16:00 I'm providing an alternative.

16:00 Stop wasting my time and screen space.

16:00 samaaron: oh, and 2 for Emacs Live: I'll fix things if they're an issue on vanilla Emacs Live.

16:00 llasram`: *plonk*

16:00 emezeske: llasram: Who did you plonk?

16:00 ro_st: no, you're suggesting that there are no alternatives to your own suggestion. there's a difference. he (like i and many other users) don't have the luxury of time that you do

16:01 tomoj: `(read-string (str "#inst \"" s "\""))` bothers me

16:01 callen: you don't have the luxury of 15 minutes?

16:01 Cubic: I installed Emacs Live because it did a few things that my minimal setup didn't do, e.g. the Paredit mode I downloaded from Marmalade was broken, and I'm not about to either fiddle around in paredit.el nor start installing packages by hand. I know configuring every little thing yourself is more of the emacs spirit, but I really just want emacs the editor that works, not emacs the religion.

16:01 ro_st: also, i'm an idiot, and have far too much flu medication in my bloodstream.

16:01 tomoj: but I think the relevant helpers are private?

16:01 ro_st: callen: no, because i'm too busy arguing with you.

16:01 -grin-

16:01 llasram: emezeske: The hopefully-obvious

16:01 callen: only being incredibly callow and lazy could lead you to believe you don't have 15 minutes to learn how your tools work.

16:01 Apage43: tomoj: yeah. I actually copy-pasted the helpers out

16:01 muhoo: omg emacs flamewar

16:01 callen: sorta not really.

16:01 emezeske: llasram: Oh, now that I read up, I think maybe it is obvious

16:01 samaaron: Cubic: I do recommend tinkering with Emacs now and then - it pays off to know how to hack it.

16:01 ro_st: callen: i dropped a week on emacs. i barely made it out alive

16:02 callen: ro_st: I'm sorry learning is that painful for you.

16:02 ro_st: muhoo: no, just a placeholder for whatever you want to record

16:02 samaaron: ro_st: only a week? ;-)

16:02 Apage43: tomoj: the important bit is https://github.com/clojure/clojure/blob/master/src/clj/clojure/instant.clj#L165

16:02 ro_st: callen: thank you :-)

16:02 tomoj: then in reader.cljs read-date is private

16:02 samaaron: callen: there's really no need to be so pretentious

16:02 ro_st: samaaron: only a week. once i could clode and git, i stopped fussing

16:03 tomoj: oh but there is a public parse-timestame

16:03 ro_st: i'm going to have to go back in though because i want nrepl.el goodness

16:03 Apage43: Oh yeah, forgot that one

16:03 tomoj: which is just what #inst uses

16:03 Apage43: I actually needed to print one sans the #inst ""

16:03 emezeske: callen: Only being incredibly arrogant could lead you to believe that you should tell other people how to work. :) :)

16:03 ro_st: tomoj: i use #inst because rich hickey told me to

16:03 and i've got the datomic group post to prove it

16:04 tomoj: would like to read that

16:04 samaaron: Cubic: so what's your issue?

16:04 muhoo: it's funny, the discussion turns to emacs, and the tone turns to rms/esr/jwz style discourse :-)

16:04 soemthing about emacs that makes people cranky?

16:04 samaaron: muhoo: yeah, it's crazy

16:05 ro_st: tomoj: second rhickey one on https://groups.google.com/forum/#!searchin/datomic/date$20parse/datomic/M6zmtbfw9-w/ez2XK7n2DyAJ

16:05 tomoj: yeah saw that

16:05 samaaron: people should be allowed to use the tools they want without other people going nuts

16:05 tomoj: in cljs cljs.reader/parse-timestamp seems to make more sense

16:05 hiredman: as long as the tools they want are emacs

16:05 tomoj: and actually clojure.instant has that public too

16:05 samaaron: hiredman: what about xemacs?

16:06 Cubic: samaaron: No problem, turns out the repl buffer just didn't have clojure-mode active for some reason

16:06 ro_st: samaaron: i'm curious why you didn't include magit?

16:06 samaaron: ro_st: I did, I perhaps haven't plugged it in properly yet

16:06 ro_st: ok, it wasn't in the build i grabbed, which was probably 4-5 months ago now

16:07 samaaron: unless you're just looking at the README - which is woefully outdated

16:07 ro_st: oh man, *much* has changed since then

16:07 ro_st: poor thing needs help. tried installing helm from melpa and it just crashes

16:07 i so badly miss Textmate's Cmd-T fuzzy find

16:07 i have ido with fuzzy on but it's just not the same

16:08 samaaron: ro_st: does that do a fuzzy find on open buffers or somethign else?

16:08 ro_st: i am ashamed to say that i use SublimeText2 for search/replace and browsing and emacs for everything else

16:08 tomoj: ro_st: do you have *read-eval* false? :)

16:08 ro_st: for finding files in the project (git root)

16:09 pandeiro: just wrapped most of phonegap in cljs and it works! yay

16:09 samaaron: ro_st: no need to be ashamed - do what works best for you

16:09 ro_st: tomoj: you mean for the #inst thing?

16:09 tomoj: yeah

16:09 ro_st: my colleague got helm installed and it looks fab. incremental search.

16:09 dnolen: ro_st: anything.el is pretty good if you take a little time to configure it. haven't tried helm myself yet.

16:09 ro_st: thank you tomoj

16:09 samaaron: helm looks pretty cool

16:10 it's like a better, more modular Emacs Live

16:10 except, Emacs Live has the benefit of being curated as a whole

16:11 llasram: ro_st: http://marmalade-repo.org/packages/find-file-in-project ?

16:11 tomoj: I think you might be safe even with *read-eval*

16:12 ro_st: llasram: i am using that. but i can't find out how to tell it about .cljs and .dtm files

16:12 and how to tell it to stop with the .js files

16:12 haven't looked very hard, to be perfectly honest

16:12 tomoj: since read-string will only read the first form, so passing "2012-10-29\" #=(println \"foo\") \"" doesn't work

16:12 technomancy: ro_st: just set ffip-patterns

16:13 ro_st: oh. i didn't realise that was one of yours, technomancy

16:13 (defvar ffip-patterns '("*.whatever" "*.i" "*.want")) ?

16:14 technomancy: ro_st: defvar won't work; it has defonce semantics

16:14 you can use setq or .dir-locals.el

16:14 ro_st: 15 minutes indeed -grin-

16:15 technomancy: I learned my lesson from the starter kit v1: lots of little libraries focused on one thing is definitely the way to go.

16:15 ro_st: (set 'ffip-patterns '("*.whatever" "*.i" "*.want"))

16:15 like so?

16:15 technomancy: sure

16:15 frawr: Hi, how can i change a agent's state to the empy vector?

16:16 ro_st: it is, once you're comfortable composing them. but what emacs live brings is a running start. the fact that it was all nicely structured into folders and lib vs config helped me to get a sense of what sort of thing belongs where

16:16 technomancy: dir-locals are better long-term but that'll do for now anyway

16:16 ro_st: how do i see what it's currently set to?

16:16 clojurebot: excusez-moi

16:16 technomancy: hm; similar situation to noir vs compojure I suppose

16:16 ro_st: C-h v

16:17 ro_st: this is awesome. Cmd-T just became infinitely more useful.

16:18 thank you, callen. without you, i'd still be using C-x C-f

16:18 may i assume that less patterns means faster execution?

16:19 technomancy: ro_st: fewer matches means faster, but under the hood it's just using find(1)

16:19 you'd have to be in a pretty ridiculous project to notice a difference I think

16:19 makes me lol every time: http://www.smbc-comics.com/index.php?db=comics&id=2491

16:19 ro_st: ok. i notice it's seeking inside jars

16:19 can i stop that?

16:20 technomancy: reeeeeeally

16:20 ro_st: oh man

16:20 technomancy: I don't know how that's possible

16:20 ro_st: i don't want to see all the jar src files :-) just my own

16:20 llasram: What distribution of `find` do you have installed???

16:20 lazybot: llasram: How could that be wrong?

16:21 ro_st: oh haha

16:21 it's cljsbuild's temp files -phew-

16:21 ok. how do i get it to ignore some folders?

16:22 .folders, basically

16:22 technomancy: ro_st: ffip-find-options; not sure of the syntax to add

16:24 tomoj: seems problematic

16:24 ro_st: thanks technomancy

16:24 tomoj: find . -not -path ./.lein-clsbuild-compiler\*

16:24 but the ./ is required

16:25 I guess \*.lein-cljbuild-compiler\* would work

16:25 technomancy: find is crazytown

16:25 ro_st: tomoj: this looks promosing: https://github.com/ahobson/dot-emacs/blob/master/ahobson/my-dir-local.el#L10

16:26 i need to exclude .crossover-cljs too

16:26 amalloy: tomoj: whaaaat. $ find -name .lein* -prune -or ...

16:27 tomoj: nice

16:27 ro_st: so what would i set? -utter newbie-

16:28 tomoj: but how do you do it twice?

16:29 amalloy: find -name .lein* -or -name .crossover* -prune -or ... ## i think so, anyway

16:29 might need parens

16:29 samaaron: technomancy: does ffip work with ido?

16:30 technomancy: samaaron: yeah, looks like it

16:30 samaaron: technomancy: awesome

16:30 technomancy: (I wrote most of this in 2008)

16:31 tomoj: thank you, ro_st. without you, i'd still be using C-x C-f

16:31 technomancy: man... it really sucks that emacs's uniquify functionality isn't well-factored-out

16:31 ro_st: (set 'ffip-find-options "-name .lein* -or -name .crossover* -prune -or") ?

16:32 tomoj: those don't seem to work for me

16:32 technomancy: ro_st: setq is more idiomatic than set+' though they're functionally equivalent

16:32 ro_st: might need to be a list of strings

16:33 ro_st: wrong type argument

16:34 nm

16:34 zsh: no matches found: .lein*

16:35 ah, .lein* needs to be quoted

16:36 tomoj: seems ffip can't C-x 4 yet?

16:36 ro_st: gah this is arcane

16:37 tomoj: I don't think those args will work even if you get it right for emacs

16:37 try with just find

16:37 ro_st: yeah. i'm seeing this.

16:37 technomancy: find is nuts, but it's fast

16:37 ro_st: amalloy: when you say might need parens, what do you mean?

16:38 amalloy: $ find \( -name foo -or -name bar \) -prune -or ...

16:38 mklappstuhl: I want to analyze a fictional stock portfolio but I don't know which data structures/clojure tools to use to "build" the portfolio...

16:38 I have a rough idea here: https://github.com/mklappstuhl/computational-investing.clj/blob/master/src/mklappstuhl/stock_utils/simulate.clj

16:39 I'd love to learn about other ways to approach this kind of problem

16:39 dnolen: mklappstuhl: what kind data structure seems appropriate to you? and why?

16:39 ro_st: nawp. sod it. i'll live with ST2 and wait till i get a fresh set up with helm and nrepl going

16:40 thanks all for your help

16:40 mpenet: ro_st: This might help you get started https://github.com/mpenet/emax/blob/master/config/modes.el#L183

16:40 ro_st: I allow everything then blacklist some unwanted files/dirs (everything starting with ., jars etc)

16:41 ro_st: that makes sense

16:41 mklappstuhl: dnolen, I think hash-maps because it allows me to structure the data in a way that is easily accessible later on.

16:42 dnolen, I also don't see a real problem with my current implementation but I'm curious about other possible ways

16:42 dnolen: mklappstuhl: then you're probably on the right track ;)

16:43 ro_st: ^5 mpenet. working. thank you!

16:43 mklappstuhl: dnolen, does that mean you would probably do something similar?

16:43 #

16:43 ro_st: mklappstuhl: the beauty of clojure is that you can change your mind whenever you realise you need to

16:44 that's been my experience, so far, anyway

16:44 dnolen: mklappstuhl: I note that trades in your code is a seq - not sure if random access matters here, if it does you might want to use something else.

16:46 mklappstuhl: dnolen, I think it does not really matter but yeah, could be easily changed if needed, thanks

16:46 tomoj: well, C-x 4 C-x f for now..: https://www.refheap.com/paste/6245

16:53 wingy: multimethods are so powerful

16:55 jcromartie: wingy yes they are :)

16:55 ro_st: a whole area of clojure i've yet to even touch are protocols, records, and multimethods

16:55 jcromartie: this is my attempt at a multimethod-based state machine for simple text games https://gist.github.com/4ba56804cee48fc0e709

16:55 want to use it for platformers etc

16:56 wingy: and extensible .. no need to worry about me implementing everything .. i just do some of the methods and users can extend with their

16:56 jcromartie: nice

16:57 mklappstuhl: dnolen, I'd also like to get feedback on the whole structure of the "project" ... most functions take the symbol of a stock as argument... I'm still exploring the possibilites of clojure so there might be other ways to chain stuff together

16:58 wingy: ro_st: you were new to clj as well?

16:59 i need to use macros .. haven't yet had a good reason to use them

16:59 give me a reason!

16:59 ro_st: yeah. been using it about 7 months. but basic stuff. lots of fns and HO fns. one macro. atoms. that's it

16:59 haven't needed anything else, yet!

16:59 wingy: i remember now you were like 2 months ahead of me

17:00 that must be a good sign

17:00 ro_st: i think so, too.

17:00 technomancy: ro_st: that's pretty typical I think

17:00 ro_st: oh, and one agent.

17:00 to watch a filesystem for changes

17:00 technomancy: genuine need for polymorphism just isn't very common

17:01 ro_st: yeah. my approach is to use the most idiomatic stuff (maps lists seqs vectors) and then profile performance. we've yet to profile. but i know for sure what we'll need to to do improve performance; lots of low hanging fruit

17:01 brehaut: clojurebot: polymorphism |reply| genuine need for polymorphism just isn't very common

17:01 clojurebot: Ik begrijp

17:02 brehaut: ~polymorphism

17:02 clojurebot: polymorphism reply genuine need for polymorphism just isn't very common

17:02 brehaut: sonova

17:02 how do i make him forget that?

17:02 (and do it right)

17:02 technomancy: clojurebot: forget polymorphism |reply| genuine need for polymorphism just isn't very common

17:02 clojurebot: I forgot that polymorphism reply genuine need for polymorphism just isn't very common

17:03 ro_st: the whole backend is stateless (if you exclude ring session state, which'll be in memcached), so we haven't needed to do anything fancy

17:03 dnolen: mklappstuhl: at a glance seems reasonable but you don't have a lot of code to look at :)

17:03 ro_st: i use a whole bunch of atoms in cljs, but they're all in a single namespace

17:03 brehaut: technomancy: thanks

17:03 technomancy: clojurebot: polymorphism is <reply>genuine need for polymorphism just isn't very common

17:03 clojurebot: Ok.

17:03 technomancy: brehaut: I think that's the syntax?

17:03 mklappstuhl: dnolen, okay, cool

17:03 brehaut: ~polymorphism

17:03 clojurebot: genuine need for polymorphism just isn't very common

17:03 brehaut: technomancy: i'm makling that a note for my wall

17:04 technomancy: why not teach it to clojurebot?

17:04 brehaut: haha

17:06 clojurebot: reply is<reply>key is<reply>witty phrase

17:06 clojurebot: whose job is<reply>that is rlbs job

17:06 brehaut: ~reply

17:06 clojurebot: reply is the new high-powered repl that powers lein2's repl task https://github.com/trptcolin/reply

17:06 brehaut: ha

17:06 wingy: who owns the clojurebot?

17:07 brehaut: hiredman

17:07 wingy: everyone can create his own clojurebot? how do you know all commands

17:07 hiredman: yes?

17:07 clojurebot: yes isn't is

17:07 Raynes: It's probably easier to get lazybot running.

17:08 brehaut: hiredman: sorry, i was replying to wingy

17:08 ro_st: Raynes: is it possible to add metadata to defpage declarations?

17:09 Raynes: No clue.

17:09 I imagine in theory you could.

17:09 ro_st: i want to decorate a whole bunch of urls and process them in a middleware

17:09 Raynes: You would probably have to mutate the atom holding all the routes.

17:10 But defpage might support metadata. Not sure.

17:10 brehaut: hiredman: incidentally i had a little laugh at @(promise) in the clojuerbot source. nice trick

17:10 Raynes: brehaut: I think I did something similar in Irclj.

17:13 wingy: help : https://www.refheap.com/paste/6246

17:13 i wanna use the rest params in my multimethod

17:16 brehaut: wingy: try your code in a fresh repl

17:16 wingy: i think you have been bitten by the pseudo-defonce nature of defmulti

17:16 wingy: brehaut: that was it :)

17:16 ro_st: that's right, you can't redef the defmulti

17:17 brehaut: (doc ns-unmap)

17:17 clojurebot: "([ns sym]); Removes the mappings for the symbol from the namespace."

17:17 technomancy: or (def mymulti nil)

17:17 brehaut: oh. thats much simpler. thanks technomancy

17:18 technomancy: every time I write a defmulti I always precede it with that

17:18 which granted is only like once or twice a year but whatever

17:18 because it's basically guaranteed you're going to want to change the dispatch function at least once or twice

17:20 wingy: you cannot add a docstring to defmethod?

17:21 not according to the doc

17:21 brehaut: a defmethod doesnt really exist as its own thing; its part of the multi

17:23 gfredericks: yeah; hard to imagine how you would even obtain a reference to a defmethod if you wanted one

17:24 wingy: if i make a library for validation and add a few validators (as defmethods) and let anyone extend it with their own validator .. if they do (doc validate) they can only read my docstring where i list my core validators. i guess it makes sense in a way

17:27 tomoj: seems like it would be nice if (= :clojure.string/foo (do (require '[clojure.string :as str]) ::str/foo))

17:28 gfredericks: ,::str/foo

17:28 clojurebot: #<ExecutionException java.util.concurrent.ExecutionException: java.lang.RuntimeException: Invalid token: ::str/foo>

17:28 gfredericks: ,(keyword ":str/foo")

17:28 clojurebot: ::str/foo

17:30 ro_st: do wildcard ssl certificates nested subdomains?

17:30 eg, www.staging.domain.com

17:30 nDuff: ro_st: No.

17:30 tomoj: oh wait

17:30 wingy: what is the idiomatic way to destruct rest arguments: [x y user password] or [x y & [user password]]

17:31 ro_st: thanks nDuff

17:31 tomoj: &(= :clojure.string/foo (do (require '[clojure.string :as str]) ::str/foo))

17:31 lazybot: java.lang.RuntimeException: Invalid token: ::str/foo

17:32 emezeske: wingy: Your first example doesn't use rest arguments, e.g. it will fail if called with less than 4 arguments

17:32 tomoj: well, it works here. except you obviously have to require beforehand

17:32 emezeske: wingy: Your second example is correct.

17:32 wingy: emezeske: right

17:43 Bronsa: bunga bunga?

17:48 callen: is there an equivalent to ipdb for Clojure? I'm used to being able to inject a first-class REPL into arbitrary code.

17:48 being able to do that for Clojure would be ideal, particularly since it's...a lisp.

17:48 technomancy: callen: https://github.com/technomancy/limit-break

17:49 callen: technomancy: you're on the ball like a golden retriever. Thank you.

17:49 technomancy: callen: caveat being I've hardly used it and haven't gotten around to getting it working smoothly with nrepl yet

17:50 callen: technomancy: I'll take what I can get.

17:50 technomancy: also I didn't write it; I just cleaned up and repackaged an older lib designed for clojure 1.2

17:51 also it has a single-segment namespace; heh. but it's optional.

17:53 callen: technomancy: what do you use for debugging if not this, though?

17:54 technomancy: I can't seriously be the only lisper that is obsessed with interactive/REPL/debugger based programming.

17:54 technomancy: I write smaller functions =)

17:54 brehaut: lol

17:54 callen: technomancy: do ho ho. but seriously, sometimes I have to call outside services, etc etc. Being able to examine intermediate data and test hypotheses makes me work a lot quicker.

17:54 it has a *lot* to do with how productive I am in Python and was in Common Lisp

17:56 technomancy: you don't need a repl inside another function unless you're working against a bunch of state that has been painstakenly constructed

17:56 if you can avoid that, you don't need any fancy tooling

17:56 of course you can't always avoid that, but I've been fortunate recently =)

17:56 I think I'm pretty repl-obsessed though

17:57 callen: yeah, definitely. literally all the clojure code I've been writing in the past couple months has been Leiningen, so that hasn't been the case for me.

17:57 I used swank.core/break a lot before this, which is based on the same original project.

17:59 though anyway, with outside services what I typically do is (def response (call-outside-service)) (my-fn response) ; rinse, repeat, etc

18:00 just use vars

18:00 vars are the best thing ever

18:05 gfredericks: ~vars

18:05 clojurebot: vars are a linking construct

18:12 lynaghk: technomancy: I'm putting up a demo server on heroku for my grammar of graphics compiler, but for security reasons I'd prefer to keep the actual compiler source off of webserver machines. Do you foresee any issues with just AOT compiling a JAR and manually including that somehow on the Heroku deploy?

18:13 technomancy: lynaghk: you can use :omit-source true

18:13 lynaghk: technomancy: The demo server is in a separate git repo than the actual compiler source

18:13 technomancy: technically you could also check a jar into git but that's a bit gross

18:13 shurizzle: Bronsa: http://bit.ly/S8nVqU

18:14 technomancy: lynaghk: I guess for a demo putting a jar in git might be the lesser of N evils

18:14 lynaghk: technomancy: yeah, I was thinking about that. Other options are to set up a private mvn repo somewhere or put it on password-protected S3?

18:14 callen: how do you AOT compile a jar?

18:15 technomancy: lynaghk: right-o. and getting proper creds exposed to the build process is slightly annoying.

18:15 worth doing if you've got a Real Project, but possibly overkill for a demo

18:15 callen: :aot :all in project.clj, possibly in a profile if you don't want it to mess with your regular development

18:15 lynaghk: technomancy: eventually it will be Real Project = )

18:17 technomancy: s3-wagon-private would be the thing to use, if I want to go down that route?

18:17 technomancy: lynaghk: yeah, if you don't already have a server set up that you can use for static files

18:18 lynaghk: technomancy: yeah, I've never done mvn stuff. S3 looks easiest, unless there is some way to give the Heroku app a pubkey it can use to get deps via SSH

18:18 technomancy: SCP is supposedly possible, but it's basically undocumented

18:18 http basic auth is easy though

18:19 lynaghk: technomancy: okay. Thanks for the pointers

18:25 tolsen_: has anyone ever seen an error like this when type-hinting? java.lang.ClassCastException: jux.layout.quark_preview_context.GalleryInfo cannot be cast to jux.layout.quark_preview_context.GalleryInfo

18:26 (note the types are the same)

18:26 Apage43: hm

18:26 possible you created an object of that type and reloaded the library?

18:27 tolsen_: the clojure namespace where the defrecord is actually jux.layout.quark-preview-context . I wonder if the hyphen to underscore conversion for java packagespaces is confusing things

18:27 @Apage43. I'll try restarting nrepl again

18:27 Apage43: oh!

18:27 if that type is a Record and you reload the file its in

18:27 it's a new class with same name

18:27 and you'll get that

18:27 if you use an object that was around from before the reload

18:29 tolsen_: still getting the error even after restarting nrepl :-(

18:29 hiredman: tolsen_: restarting nrepl or restarting the jvm?

18:30 tolsen_: I kill the *nrepl-server* buffer. Does that kill the jam?

18:30 *jvm

18:30 hiredman: no

18:30 tolsen_: ahh… how do I kill the jam?

18:30 lol. why do i keep typing jam

18:31 hmm.. I get the error even if I run it outside of nrepl

18:31 hiredman: tolsen_: have you cleaned out classes/ ?

18:32 tolsen_: no. I'll try that

18:32 technomancy: killing *nrepl-server* should kill the jvm

18:33 hiredman: https://groups.google.com/d/msg/clojure/FgE4MHAbMRo/SNDcLUWlpMwJ

18:33 tolsen_: interesting. the problem started happening right after I started using instance?

18:36 cleaning out classes worked. thanks!

18:36 should I add :gen-class to the ns where I declare the record?

18:39 tgoossens: Do any of you know some good practices on good use of maps in java (instead of classes?)

18:39 nDuff: tgoossens: Could you make that question a bit more specific?

18:40 tgoossens: Sure.

18:41 I like using maps in clojure. And I would love to use more of the map idiom in java. But because it is statically typed, it makes it hard. Question:"How do you make you life easier with maps in java?"

18:44 emezeske: tgoossens: I think the big problem you're going to run into is that maps of heterogeneous objects will always be ugly, due to typecasts, etc

18:45 technomancy: yeah, probably a lost cause

18:52 tgoossens: mmyes

18:53 You are right

18:53 over the past few weeks

18:53 i've been trying things out with maps

18:53 just to get some similar experience (because i'm obligated to program in java for university)

18:54 but :(

18:54 hiredman: you

18:54 you can use type specifc static get methods

18:55 tgoossens: can you clear this a bit up,

18:55 ?

18:55 technomancy: any university program that sticks with java exclusively is probably not going to teach you as much as you could learn on your own on IRC

18:55 tgoossens: probably

18:55 that's why I started opening my eyes about a month ago

18:55 at univ. always java, always OO is the best way and blablabla

18:56 so I started with something radically different

18:56 hiredman: int Ootisl.getInt(Map m)

18:56 tgoossens: clojure :)

18:56 hiredman: User Ootisl.getUser(Map m)

18:56 tgoossens: Mm

18:56 hiredman: pardon me

18:56 Ootils

18:56 I am really lagged

18:56 tgoossens: no prob

18:57 mmm

18:57 and the map is then

18:57 Map<KeyType,Object>

18:57 emezeske: hiredman: May as well just use member variables at that point :)

18:57 tgoossens: that might work yes

18:58 but I'm never going to be able to convince my teammates of that

18:58 emezeske: hiredman: I guess if you have a bunch of dynamic int fields, though, that could be concise

18:58 tgoossens: also I need to think about whether it is even a better solution than using classes

18:58 (in java)

18:58 hiredman: emezeske: yeah, the point is, that would work any map from any where

18:58 not jsut a specific data holding type

18:59 emezeske: hiredman: Right. Unchecked, that Ootils class might get a bit ridiculous after a while, though, as the grand list of getters for all types

18:59 I guess you could use generics, like a .<Whatever>get() method

19:00 That's essentially just as bad as casts everywhere, though

19:00 tgoossens: yes

19:00 hiredman: emezeske: write some clojure code to generate Ootils

19:00 emezeske: hiredman: now you're talking!

19:00 tgoossens: hiredman: cool! :p

19:00 hiredman: it combines the cast and the method call in to a single thing

19:01 tgoossens: not entirely seeing how that is going to work

19:01 hiredman: you would have a types.clj with just a set of type names, and as part of the build it would generate a some/package/Ootils.java

19:02 lynaghk: technomancy: I'm getting a no matching ctor error for class org.sonatype.aether.repository.Authentication when trying to push to heroku

19:02 tgoossens: the question is . In java. What do we win by using maps like that

19:02 lynaghk: technomancy: uploading the jar worked fine. Does Heroku not take a project.clj's :plugins key into account?

19:02 hiredman: also you need some kind of thing where a a weight drops, which causes an arm to rotate, which strikes a match, which lights a candal, which sets off the smoke alarms, which turns on the spinklers which fill the cup on top of the easy button to fill with water, which actives the easy button

19:02 which causes a deploy

19:02 tgoossens: :D

19:02 emezeske: tgoossens: You win the ability to have type errors at runtime instead of at compile time

19:03 hiredman: you get generic Data you can manipulate as data

19:03 tgoossens: emezeske: interesting

19:03 and for the map

19:03 emezeske: tgoossens: Sorry, I was kind of being sarcastic (not very obviously)

19:03 hiredman: instead of every project having different data carrying objects that you have to treat differently

19:03 tgoossens: would you use the PersistentMap or the (guava) ImmutableMap

19:04 yes

19:04 lynaghk: technomancy: here's my project.clj https://gist.github.com/be4fa039fc3f79e77775

19:06 tgoossens: When I find the time (that goddamn java project at unif .... bah!). I'll experiment with using maps like that in java

19:08 But I will never -ever be able to convince my teammates (yes its teamwork with other people who are still in the java domain and OO is the best, "if it is not 'nice' OO" it is not a good program

19:11 emezeske: My unimportant opinion is that if you have to use Java, you should probably do things the Java Way™

19:11 tgoossens: yeah probably thats the best =D

19:11 but that doesn't stop me from experimenting :D

19:12 emezeske: Oh, by all means, I agree.

19:12 tgoossens: and comparing the (dis)advantages of both ways in java

19:12 which would probably learn me much more

19:12 SegFaultAX: But what if the Java Way is really terrible? :(

19:12 tgoossens: that just being the faithfull OO programmer

19:12 haha

19:12 emezeske: SegFaultAX: Then don't use Java :)

19:13 tgoossens: emezeske: I have to :(

19:13 however

19:13 to be honest

19:13 SegFaultAX: tgoossens: Is it impossible for you to use some other JVM language and interoperate with the stuff you already have?

19:13 emezeske: I say, do Java the Java Way™, and Clojure the Clojure Way™. Doing Clojure in Java or Java in Clojure seems like a suboptimal choice.

19:14 tgoossens: SegFaultAX: the problem is. i have teammates who only know java. and the tutors expect us to program "nice OO" and "design by contract"

19:14 SegFaultAX: emezeske: I guess it depends on which bits of the Clojure way you're talking about. Creating idiomatic Java implementations for Clojures persistent data structures seems very appealing to me.

19:15 tgoossens: I don't know what "nice OO" means. But Clojure natively supports pre- and post-conditions.

19:15 tgoossens: well i don't know either what "nice OO" means (hence the brackets)

19:15 SegFaultAX: tgoossens: And the only choices are not Java or Clojure. There are lots of JVM languages these days.

19:15 tgoossens: (i mean quotes)

19:16 emezeske: SegFaultAX: The second that you start using maps in place of statically-typed classes, you're not really writing "idiomatic" java anymore

19:16 tgoossens: SeqFaultAX: of course. But again. My teammates only know java. So its a no-go for my assignment

19:16 emezeske: SegFaultAX: (Not that I think immutability is bad in Java -- it's great)

19:17 SegFaultAX: emezeske: No, you're right. But it's just so damn useful... :(

19:17 tgoossens: Do you know any other JVM languages?

19:18 Or languages that have JVM implementations? (eg JRuby)

19:18 tgoossens: heard of them. never tried them. Clojure is the first non-OO language I began with

19:18 Scala right?

19:18 SegFaultAX: tgoossens: Scala is a thing, yes.

19:18 tgoossens: Not sure what your opinion is on this: but OO seems quite natural for me when controlling gui's (but I don't know other ways yet so maybe it is that)

19:19 SegFaultAX: tgoossens: OO is generally very useful.

19:19 tgoossens: also for the project i'm doing

19:19 it is actually quite useful

19:19 SegFaultAX: tgoossens: It's the artifacts of certain implementations that made it hard to deal with. Eg the conflation of state and identity.

19:20 tgoossens: yes

19:20 long story short: control NXT (lego) robots from the computer. There is is quite useful to have a "Motor" "Robot" "Sensor" etc

19:20 I love the idea of identity

19:20 don't get me wrong

19:21 jonasac: (javadoc) is a function in clojure right, not leininingen?

19:21 tgoossens: This month has been my first experience with a non-OO language

19:21 its has been quite exciting

19:21 watched a LOT of talks about it :p

19:21 (clojure)

19:22 SegFaultAX: tgoossens: Awesome! Welcome!

19:22 thorbjornDX: tgoossens: read "Clojure Programming" and "Joy of Clojure" :)

19:22 SegFaultAX: (inc thorbjornDX)

19:22 lazybot: ⇒ 1

19:24 emezeske: tgoossens: A probably-unrealistic-but-fun-idea: while you and your teammates build out your project in Java, quietly build the same project in Clojure by yourself, and at the end of the year when you present it, casually mention that you also have a Clojure implementation that is written in 1/N the number of lines of the Java one. :)

19:25 frio: tgoossens: that was the original intent behind OO though, IIRC

19:25 modelling physical objects, like the mouse/keyboard/etc., that didn't have easy interfaces

19:25 SegFaultAX: Does Scala have the same level of support for persistent data structures as Clojure?

19:26 frio: so having objects for motor/robot/sensor closely matches the original intent

19:26 SegFaultAX: frio: I thought the original intent of OO was message passing between subprograms?

19:27 jonasac: tgoossens: im new to clojure to and labrepl is something worth checking out, accompanied by books

19:27 frio: that was absolutely part of it iirc SegFaultAX. it's all sadly loose in my mind right now, but i do recall reading about modelling physical objects with it

19:27 tgoossens: sorry was gone for a sec

19:27 I read "Programming Clojure" of stuart

19:29 emezeske: "emezeske: A probably-unrealistic-but-fun-idea:" Yeah kinda. I'm now already sometimes forget I still have stuff to study

19:29 frio: IIRC?

19:29 thorbjornDX: tgoossens: I read "Clojure Programming" (Emerick)

19:30 tgoossens: Aaargh so much to read.. so much to learn and so little time (i really have no time. I hate it !)

19:30 I'm 100% sure that if I had no courses at all (or just less) I would still be able to use 100% of my time in a useful way :p

19:31 thorbjornDX: tgoossens: don't go to class then :)

19:31 emezeske: tgoossens: If I Recall Correctly

19:31 thorbjornDX: tgoossens: I learned a lot more at school not "studying" or in class

19:31 just make up a project and do it, if you can tie it in with schoolwork then it's two birds with one stone

19:32 tgoossens: I have maybe an interesting opportunity of writing a web project for use in schools in the Province i live (Antwerp)

19:32 Would it be a good idea to make it in clojure perhaps =D

19:33 using noir or something

19:33 emezeske: tgoossens: I can attest that web development in Clojure is fun.

19:33 tgoossens: Plus, you could maybe try out ClojureScript too :)

19:33 tgoossens: Heard a lot about that too

19:34 jonasac: anyone on osx experiencing the repl completely crashing whenever (javadoc) is called ? considering reporting it somewhere

19:35 tgoossens: thorbjornDX: about not going to class. I've always been the "dutiful" student. Always passing my exams. This year (because i'm so amazingly fascinated by clojure) i've been putting already a lot of time into clojure. But i'm afraid that i'll neglect my studies too much. I still want my 3 months of vacation (I always learn a lot during that period)

19:37 thorbjornDX: tgoossens: going to class is fine, just know that you won't learn best practices (or good ways of thinking) through the lecture material alone.

19:37 tgoossens: I've experienced that during my student job last month

19:38 there was a guy

19:38 thorbjornDX: tgoossens: depends on the professor, class, and students too

19:38 tgoossens: that introduced me to clojure :)

19:38 opened my eyes a lot. Because I was a bit monosighted on how to program

19:39 i've been really shocked by that fact how outdated the material is I learn at university

19:39 and how in practice it differs A LOT

19:40 nevertheless

19:40 thanks for all the info

19:40 but i really need to go. Class tomorrow morning ;)

19:41 thorbjornDX: have fun, keep learning!

19:41 tgoossens: we speak again!

20:00 gnarmis: hey, trying to install VimClojure on debian. Can't seem to get http://kotka.de/projects/vimclojure/vimclojure-nailgun-client-0.7.1.zip to not 404

20:00 the nailgun client I mean

20:02 ohpauleez: gnarmis: I think in the latest version, VimClojure uses nrepl and not nailgun

20:02 gnarmis: oh wow nice

20:02 ohpauleez: nrepl+lein

20:02 gnarmis: I guess I should try it out

20:03 ohpauleez: I might be wrong, but I believe that's what the most recent release was about

20:03 Also, take a look at lein-tarsier

20:03 technomancy: oh did they finally release the nrepl-backed vimclojure?

20:04 * emezeske 's ears perk up.

20:05 rbxbx: ohpauleez gnarmis I don't believe that's an offical branch yet

20:05 gnarmis: Just read about it, yeah

20:06 rbxbx: gnarmis you should try this url http://kotka.de/projects/vimclojure/vimclojure-nailgun-client-2.3.4.zip

20:06 ohpauleez: oh, total bummer

20:06 gnarmis: ah sweet

20:06 well, i'll try the nrepl branch

20:07 rbxbx: I believe the nrepl branch is even more "here there be dragons" than master, which is fairly dragon-full

20:07 but feel free to try ;)

20:07 gnarmis: haha, should be interesting...

20:07 rbxbx: report back, I'd love to get off nailgun

20:08 gnarmis: for sure

20:21 hmm…I'll need to do a gradle build

20:22 I'll mess with this later

20:22 rbxbx: gnarmis try out that url I gave you earlier... imagine you'll sink a lot less time than trying to get up and running with nrepl

20:22 gnarmis: haha yes

20:22 rbxbx: unless your goal is to sink time/improve the state of things. Then by all means ;)

20:23 gnarmis: I'll def be looking into it. nrepl is the way forward

20:23 rbxbx: It is, it still seems a bit young to me to deprecate the other solutions though

20:23 the edge, it bleeds.

20:24 technomancy: everything bleeds

20:25 rbxbx: truth. It simply depends which mode you're operating in.

20:26 Pierre____: hello

20:26 Newby here. I am having troubles getting started with Quil. I am trying to build a vector containing mouse coordinates.

20:27 rbxbx: technomancy however as demonstrated by http://www.cs.virginia.edu/~robins/YouAndYourResearch.html, ideally I'd love to arrive at the _general_ solution. It just depends on the day

20:27 Pierre____: IE, when the mouse button is pressed down, until it is released, I'd like to collect the successive mouse coordinates.

20:27 what is the best way to do that?

20:27 (sorry to be interrupting on-going conversations btw)

20:28 rbxbx: no worries Pierre____.

20:30 seems like you could listen for the mouse-button event?

20:31 lynaghk: Is it possible to set reader literals dynamically in a Clojure app? I'm calling a fn which calls set! on *reader-readers* but read-string is still throwing exceptions about tags. Of course, running the exact same code in a REPL works fine.

20:31 so my

20:31 question should be: is there any reason why I can't do that in an AOT compiled fn?

20:32 hiredman: *data-readers* is bound at the repl, but not otherwise

20:32 Pierre____: rbxbx: ok, but once I access the coordinates, how can I append them to the list of past coordinates?

20:32 hiredman: lynaghk: your function set! *data-readers* should be throwing an exception

20:32 rbxbx: Pierre____ store past coordinates as an atom and append them, perhaps?

20:32 lynaghk: hiredman: you're the best. So I need to write a handler fn and reference it in data_readers.clj?

20:33 hiredman: you can still do it dynamically, either by binding *data-readers* yourself, or using alter-var-root

20:33 lynaghk: hiredman: it doesn't throw; this is on clojure 1.4.

20:33 rbxbx: Pierre____ via swap!

20:34 hiredman: lynaghk: are you calling the fn that does the set! from a repl?

20:34 Pierre____: rbxbx: ok, great. I had a mental block about that, thought it was a smell.

20:34 rbxbx: thank you!

20:34 lynaghk: hiredman: yeah. Calling it toplevel on the code though, and it runs when I do "lein run"

20:35 hiredman: ah, using a binding form works great. thanks!

20:35 rbxbx: Pierre____ to be fair, just because I suggested it doesn't mean it's _not_ a smell. Hopefully it'll work out for you though :D

20:36 hiredman: *data-readers* may be bound while the code compiles (so the top level doesn't fail) but not when the code runs or something

20:37 Pierre____: rbxbx: I guess smell is relative then

20:37 emezeske: Pierre____: If you're using a callback-based GUI library, you might not have much choice other than using an atom (or equivalent) for state

20:37 Pierre____: At least using an atom, the state is managed in a very sane way

20:37 Pierre____: *can be managed

20:38 rbxbx: concessions made in clojure are often less harmful than concessions made in other languages (relativly speaking ;) )

20:38 hiredman: data_readers.clj is a nice declarative way to avoid all the mucky muck with binding and set!

20:39 Pierre____: emezeske rbxbx :ok, good to know there was no obvious answer hidden in plain sight. TY both

20:39 lynaghk: hiredman: yeah. My issue with that is that all of the readers have to be vars---I'm building up a ton of reader fns based on registered methods of a multimethod

20:40 hiredman: ah

20:41 rbxbx: Pierre____ np, glad to help!

20:43 Pierre____: rbxbx: to make you regret to be so helpful :) : would you know why I am not able to print debug statements to the REPL using (print "...") from inside the (quil/setup ..) or (quil/draw ..) fns? It's prob a quil-specific question tho...

20:44 rbxbx: Pierre____ is it throwing an error or simply not printing?

20:44 Pierre____: rbxbx: not printing

20:45 emezeske: Pierre____: Possibly because your terminal is line-buffered and you're not printing a newline?

20:47 Pierre____: emezeske: actual code is (println "hello\n"). It's in draw, which is called once per frame, so many times in a row..

20:47 emezeske: Pierre____: Ah, nevermind then

20:49 gnarmis: rbxbx: lein-tarsier just worked

20:49 pretty nifty

20:49 rbxbx: gnarmis lein-tarsier is nice :)

20:49 gnarmis did it work for nrepl or nailgun?

20:49 gnarmis: nailgun

20:49 I

20:49 I'll try the other one later

20:54 rbxbx: gnarmis I should probably add lein-tarsier to my blawgpost

20:54 gnarmis: good idea

20:55 super simple for linux users in particular

20:57 rbxbx: gnarmis good to know :)

21:06 ghachey: Hi any clojure user. I have recently starting learning clojure and am now trying out IRC fo the first time, so not too sure how this all works.

21:08 nDuff: ghachey: Howdy. Just as a note -- while sometimes there's a lot of social chatter, at times when the channel is quieter (now being onesuch), you'll get more response from a direct technical question (if you have something we can help with) than a general introduction.

21:09 ghachey: ...also, being willing to wait for a bit for a response tends to be appreciated during slow hours; folks may only check their IRC client very occasionally if in the middle of getting code written. Anyhow, all that said -- welcome!

21:16 ghachey: Thanks nDuff. I do in fact have a technical question. I am trying to read a JSON serialized file from another program and some of the values contains MAC addresses (e.g. "ethAddressString": "00:26:37:64:96:95"). This seems to cause problems when I try to read with clojure.data.json 0.2.1. I get this error: "Exception JSON error (non-string key in object) clojure.data.json/read-object (json.clj:93)"

21:21 bbloom: ghachey: can you provide a minimal json file (via a paste bin) that causes the issue?

21:22 nDuff: ghachey: this works fine: (clojure.data.json/read-str "{\"00:26:37:64:96:95\": 123}")

21:23 ghachey: ...so, yes, if you could provide a reproducer, that'd be useful.

21:23 (if you can get that reproducer down to a one-liner, that'd be even better).

21:27 ghachey: I copied this from within the file {"host_key": "", "index": 0, "ethAddressString": "00:26:37:64:96:95"}.

21:29 This works. (json/read-str "{\"host_key\": \"\", \"index\": 0, \"ethAddressString\": \"00:26:37:64:96:95\"}")

21:29 rbxbx: ghachey you could also try using https://github.com/dakrone/cheshire, data.json is somewhat out of favor.

21:30 ghachey: But if I try to read it from the file directly with (json/read (FileReader. "my-file.json")) it fails.

21:31 Thanks rbxbx, I will have a look. I was under the impression that data.json was sort of the canonical JSON lib for clojure.

21:33 rbxbx: ghachey it sort of was... isn't necessarily so at the moment. Which is not to say that it's parsing capabilities are lagging... I imagine for your purposes either library would server you well... but it's worth checking out. Plus, you'll save yourself a (somewhat inevitable) later move to cheshire ;D

21:38 jonasac: im trying to get this example to work from a book, im running lein repl and i have a file that im trying to get loaded into the repl, completely new clojurian btw :p

21:39 nDuff: jonasac: You'll need to provide more information (what you're entering, what you expect, what you get instead) before we can be very helpful.

21:40 jonasac: nDuff: i have a file one directory below the one im currently at, im trying to evaluate this at the repl, i get a classpath error

21:41 nDuff: "this"?

21:41 jonasac: You'll need to provide enough information for us to reproduce your problem -- ie. *exactly* what you typed, *exactly* what happened in response.

21:44 jonasac: im have a directory called test containing a file called date_operations_spec.clj test/date_operations_spec.clj so in the repl i tried (use 'test/date_operations_spec.clj) and i get a classpath error saying test/date_operations_spec.clj could not be located at the classpath

21:45 nDuff: ...so, first, use takes namespaces, not filenames

21:46 second, the location your source is relative to has to actually be in your classpath.

21:46 Are you using leiningen?

21:46 jonasac: yes

21:47 nDuff: Do you actually use underscores, as opposed to dashes, in your namespace declaration? (It's more typical to use dashes in the ns declaration, even if you're using underscores in the filename)

21:47 jonasac: dashes in namespace, underscore in filename

21:47 nDuff: Okay. Then you'll want the dashes in the use declaration too.

21:47 ie. make the argument to use match the ns name

21:48 jonasac: ok did that now, (use 'test/date-operations-spec), but still same error

21:49 nDuff: "test/"?

21:49 jonasac: meant test.

21:49 nDuff: and does the ns declaration start with "test."?

21:49 jonasac: yep (ns test.date-operations-spec)

21:50 nDuff: ...well, first note is that test is usually in the classpath directly

21:51 so, for instance, if you look at the example template, it includes a file test/yourproj/core_test.clj with ns yourproj.core-test

21:51 notably, "test." isn't at the front of it there

21:52 jonasac: right, i didnt use lein new because im trying to follow this book

21:52 i just did lein repl

21:52 so i guess i need to modify the classpath then?

21:52 nDuff: Why modify the classpath?

21:53 Modify the namespace to stick with convention.

21:53 ...or make it src/test/...

21:53 where you put the "test.*" files

21:54 (the "test/" directory is reserved for unit tests; if that's not what you're doing here, it doesn't make so much sense)

21:54 * nDuff heads home from the office; it's darned late here.

22:04 jonasac: nDuff: thanks for the help, your advice combined with some googling got me there :)

22:12 ghachey: I tried reading JSON using cheshire this time. A paste bin of the JSON dump from an external program is available at http://pastebin.com/rajRLgGf and the repl code I tried at http://pastebin.com/aJMzr59m. I do not have control over the incoming JSON.

22:22 bbloom: ghachey: that json is invalid. try it at http://jsonlint.com/

22:24 ghachey: search for "ipsecRcvd", the line after that is clearly invalid

22:24 ghachey: no json parser will accept that. I don't think it's valid javascript either

22:25 ghachey: you'll need to report a bug to whoever produces that JSON, or you'll need to figure out how to work around their invalid document

22:27 ghachey: Thanks bbloom, it makes sense now. Thanks for the http://jsonlint.com/ pointer too.

22:35 amalloy: ghachey: that looks like one valid json document pasted at random into the middle of another valid json document, by the way

22:45 ghachey: amalloy: true, but this is directly from the application. It consistently returns this. I'll check with latest version to make sure, otherwise I will report a bug with that project.

23:09 tomoj: huh, did we lose some logs at n01se?

23:10 I swear dakrone showed me how cheshire allows you to choose whether to use core or custom, but I can find no trace of it, neither in the logs nor in cheshire

23:11 Apage43: tomoj: you just use the encode/decode functions from cheshire.custom instead of cheshire.core

23:12 well, encode anyway

23:12 there's not any sort of custom decoding

23:12 but the cheshire.custom namespace has aliases for it anyway

23:12 tomoj: sure, but what if my library uses cheshire and I want to let the user pick?

23:13 of course you could just let them pass the decode function

23:13 but I thought there was some dynamic var somewhere..

23:13 s/decode/encode/

23:14 Apage43: unno, dakrone's own clj-http just has it as a var that the user can rebind how they wish: https://github.com/dakrone/clj-http/blob/master/src/clj_http/client.clj#L41

23:14 defaulting to cheshire.core/encode if it's available: https://github.com/dakrone/clj-http/blob/master/src/clj_http/client.clj#L20

23:15 tomoj: oh right

23:15 that makes more sense

23:15 thanks

Logging service provided by n01se.net