#clojure log - Oct 18 2012

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

0:04 ForSpareParts: Have any of you guys done real-timey stuff using Clojure? I'm trying to hack something together, and I'm a little hung up on creating behaviors that regularly act on a state.

0:04 Thought about attaching "update behaviors" to elements of the state, also considering an event queue-like...thing.

0:14 doomlord: you mean realtimey like games or something else

0:43 ForSpareParts: doomlord, Sorry I missed your message before, but yeah.

0:44 I'm interested in games specifically, but I'm guessing the problems I'm working on here have broader applications.

0:46 doomlord: i've only dabled with FP a bit. i've setup a gameloop in haskell.. my useage of haskell is very noob-ish but i managed it

0:47 i had a record per entity, a list of entities, and each just had a function for re-generating itself "next frame" ... more like a C method (callback function) of doing polymorphic entities than a C++ method (classes etc)

0:47 when I say "my haskell code is noobish" - i dont fully get monads yet, instead of the "state monad" i've just been manually piping a state around;

0:48 (i made some helper function that made it easier)

0:49 ForSpareParts: Yeah, I wasn't really thinking in monads, myself.

0:49 Had a notion that I'd build a data structure for my state and map transforming functions over it, somehow.

0:49 I've found a few methods for doing this, but they seem... inelegant.

0:50 doomlord: my 'stone age' monad state replacement is a helper function like this:- pipeState3 f0 f1 f2 s .. this did the result0, s'= f1 s..result1 s''= s''' chaining :) but i need versions for N arguments pipeState2 pipeState4 etc

0:51 duck1123: does a send-off inside a dosync still only fire when the transaction completes?

0:51 doomlord: i was happy with the haskel representation , but haskel records suck - i find that a barrier

0:51 ForSpareParts: doomlord, Haskell's a neat language, but I'm not fond of its syntax -- personal preference.

0:51 Feels too math-y to me.

0:51 doomlord: i was happy with the core concept of data entity{ update::UpdateFunc, ....}

0:52 duck1123: also, what about logging inside a dosync? My send-off, nor my log statement seem to be firing

0:52 tomoj: sends are held until the transaction ends

0:52 IO is not

0:53 doomlord: i like the type inference in haskell; but the record system puts me off.. also as you say, some of its syntax choices are also offputting;

0:54 duck1123: I wasn't expecting the io to be safe, it was only there because I can't figure out why the send isn't running

0:54 doomlord: its got infix.. but not . for element acess; that sucks. and i prefer F# |> to haskell's $ ... its a bit like the threading macros in clojure i think

0:56 is there a clojure interpreter that can be embedded in a c++ program :) if not perhaps it wouldn't be too hard to adapt one of the existing embeddable lisps to behave more like clojure

0:59 sort of related to the gameloop discussion - are there any GUI frameworks that work in a functional way ..does that even make sense. will gui always be very impure by its nature. or do any of clojures features lend themselves to events etc

1:02 ForSpareParts: doomlord, I've seen some stuff about using functional-reactive programming for that -- somthing else I've been thinking about in relation to games.

1:02 Google "yampa" -- it's a Haskell library that implements it, though I can't say I exactly grok it yet.

1:03 duck1123: okay, I just took the agent out of the equation. It's working now.

1:05 doomlord: trying to find java opengl bindings.. they're not in the javasdk's by default are they? is it 'jogl' that i'm after

1:06 ForSpareParts: doomlord, LWJGL, perhaps?

1:18 abp: Hell-o

1:18 technomancy: salut

1:18 doomlord: has anyone here installed jogl?

1:19 where is the best place to get it, how do you install it

1:22 abp: doomlord: google said that for example: http://stackoverflow.com/questions/1962718/maven-and-the-jogl-library

1:23 doomlord: searching jogl maven, because you probably meant a dependency in leinigen when saying "how to install it".

1:26 aperiodic: doomlord: have you looked at penumbra? https://github.com/ztellman/penumbra

1:26 doomlord: i am a complete noob with java environment

1:28 interesting so it turns begin/end , push/pop into single forms

1:29 i think i'll probably stick with the interface as close to C as possible

1:30 brainproxy: hmm, I need to include the html entity ™ (and things like that) in my defelem, but it's getting espaced or something when hiccup generates the html from the template

2:45 doomlord: eek, where is sqrt

2:52 fredyr: (Math/sqrt 2)

2:52 ?

2:52 antares_: ,(Math/sqrt 2)

2:53 clojurebot: 1.4142135623730951

2:53 doomlord: ah. i was trying (use 'clojure.contrib.math) ... and gettnig errors

2:53 yes that works here

2:53 fredyr: oh gotta try the bot

2:53 antares_: doomlord: clojure.contrib.* is obsolete, see http://dev.clojure.org/display/design/Where+Did+Clojure.Contrib+Go

2:54 doomlord: ok. the perils of distributed info

2:55 is it possible to pull that into the main namespace.. i'm trying (use Math) & various combinations with clojure\; ' etc

2:55 fredyr: ,(/ (+ 1 (Math/sqrt 5)) 2)

2:55 clojurebot: 1.618033988749895

2:55 antares_: doomlord: Math is a java class (java.lang.Math)

2:56 you cannot refer to Java methods

2:56 doomlord: yikes,ok.

2:56 ChongLi: you can use import-static to turn them into macros

2:56 goracio: hello can anyone help with this https://gist.github.com/3910191 mongo query ...

2:56 doomlord: i was about to say, should i just make my own wrappers, but "import-static" will do that for me?

2:57 ChongLi: that's what it does

2:57 though it's not ideal

2:57 macros are not first class functions

2:57 clj_newb_234: mvn install:install-file ... <-- this installs *.jar fles. How do I instlal jnilibs ? So I can use them via lein.

2:58 doomlord: would it not do the same job as #defines in C :)

2:58 oh.. you can't pass to map :(

2:58 ChongLi: yeah

2:58 doomlord: i think i'll be ok with that- it would have thrown me if i didn't know, but i'm much more likely to map with a lambda or something else i've written

2:59 ChongLi: to use something like sqrt with map

2:59 you need to wrap with a lambda

3:00 ,(map #(Math/sqrt %) [4 9 16 25])

3:00 clojurebot: (2.0 3.0 4.0 5.0)

3:01 doomlord: ,(map Math/sqrt [1 2 3 4 5])

3:01 clojurebot: #<CompilerException java.lang.RuntimeException: Unable to find static field: sqrt in class java.lang.Math, compiling:(NO_SOURCE_PATH:0)>

3:01 doomlord: ,(map (fn[x](Math/sqrt x)) [1 2 3 4 5])

3:01 clojurebot: (1.0 1.4142135623730951 1.7320508075688772 2.0 2.23606797749979)

3:01 arrdem: Clojure doesn't have an "import *" now does it.

3:01 aperiodic: clj_newb_234: you just need to have some jars with the native extensions in the proper arrangement; lein will extract the native deps and put them on the classpath to be picked up by the loadLibrary statements

3:02 clj_newb_234: what is the "proper arrangement" ?

3:03 doomlord: clojure in ubuntu: i just discovered you can apt-get install clojure1.3 (up till now i just had 1.1 without installing something else manually).. is 1.3 still trash?

3:03 ChongLi: it's not trash, it's just old

3:04 doomlord: i was trying to get clojure working with emacs aswell... is there more to it than just (set-inferior-lisp "clojure")

3:04 ChongLi: yeah

3:04 nrepl

3:04 doomlord: slime sorry not emacs

3:04 aperiodic: clj_newb_234: this is the best documentation about it i've been able to find: https://github.com/swannodette/native-deps

3:05 ChongLi: you can use slime or nrepl

3:05 doomlord: having second thoughts about exposing myself to the JVM and letting it occupy any neurons in my skull , but clojure itself appears very interesting

3:06 ChongLi: what's wrong with the JVM?

3:06 clj_newb_234: aperiodic: nice thanks

3:07 doomlord: i've used c++ mostly. lisps weren't so shocking or 'far away' because they can be embeded

3:08 i'd never touch java.

3:08 ChongLi: well if you do you're missing out

3:09 there are a lot of great java libraries you can use with clojure

3:09 doomlord: clojure is interesting, as is scala. java itself... its the combination of a certain style of OO and non-native that has a very negative reaction in my head

3:09 ChongLi: there are so many nice "small" languages out there that languish due to lack of library support

3:09 the fact that clojure can leverage java libraries is a huge advantage

3:10 doomlord: ok fair enough.

3:10 ChongLi: and clojure really takes the pain out of writing java anyway

3:11 aperiodic: also, there's a huge difference between "Java" and "the JVM"

3:11 ChongLi: thanks to macros and the lack of checked exceptions

3:12 doomlord: yeah, but they come up in word association. Like i say.. i've started with an interest in FP which made me look into this (i also want to try scala). i like lisp macros. i suspect scala will be easier for my c++ head geerally

3:13 ChongLi: I haven't looked at scala very much

3:13 it seems like a really weird language

3:13 due to being multi-paradigm

3:14 doomlord: heh. on the contrary i would say "it looks interesting due to being multi-paradigm" :) mult-paradigm seems the most useful to me

3:14 shift style to whatever suits

3:14 ChongLi: I wouldn't be so sure

3:15 doomlord: haskell being very pure FP makes some basic tasks hard

3:15 ChongLi: there's always a price to be paid in terms of cognitive load

3:15 yeah, haskell can have a very high price

3:16 some of the type signatures get way out of hand

3:16 doomlord: scala compared to C++ , i think it will be a lightened load.

3:17 ChongLi: I don't know; scala's got quite a complex type system itself

3:17 doomlord: many things which require hacking with #defines should be easier when built-in

3:17 ChongLi: also I find that nothing beats S-exps for reducing cognitive load

3:18 having a lot of special syntax and weird operators can make you go cross-eyed after a while

3:18 doomlord: one of the main things i'm after in my 'other language quest' is reflection for serialization (is it reflection or introspection) .. the abliity to walk structure members.. in C++ its a mess

3:18 haskell is really bad for special operators .

3:18 <$> .. wtf

3:18 ChongLi: or it's really good

3:18 depending on your perspective

3:19 guys who like to play perl golf will feel right at home

3:19 doomlord: in lisp i can handle prefix maths just fine, its reminiscent of low level code plus doing vectormath in C.. i'm used to prefix notation helpers. What i find myself missing though is dot notation for component access.

3:20 ChongLi: what's wrong with using keywords?

3:20 doomlord: but clojure seems to help quite a bit with destructuring and callable objects, i like that

3:20 ChongLi: destructuring is really nice

3:20 doomlord: (object :component) is still not as good as object.component

3:20 ChongLi: especially the :keys form

3:21 doomlord: what i really like away from c++ is tuples, not having to declare or wrap multiple values.

3:21 i like opportunities to avoid naming things

3:22 in c++ you're having to make or refer to temporary classes alot

3:23 ChongLi: also did you know you can use sets as predicates for filtering?

3:24 ,(filter #{:a :b :c :d} [1 9 :a 19 :c 'x \u])

3:24 clojurebot: (:a :c)

3:24 doomlord: i didn't realise that no

3:24 ChongLi: stuff like that is so cool and useful

3:24 doomlord: yes it definitely is

3:25 the ability to make literal maps (like anon structs i guess) seems really good.

3:25 scottj: doomlord: it's actually easy to do object.component in your own clojure build, though you can't use "." http://youtu.be/OiaYxaONChg?t=2m

3:26 ChongLi: I love how clojure's data structures lead to a different style of working

3:26 doomlord: interesting

3:26 ChongLi: since you can make most things using only the built-in data structures

3:26 no need to declare new ones the way you do in most languages

3:26 doomlord: yeah the combination of maps and vectors is really powerful

3:26 ChongLi: and the sequences library

3:27 lets you leverage them all in a very clean way

3:27 doomlord: object:value , interseting

3:28 i'll persevere with the parens. there's enough else to like

3:28 scottj: I think I also did #.object.value once

3:29 at that point though (:value object) is better :)

3:29 doomlord: its (slot-value object value) that is too much :) (object :value) is tolerable

3:31 just tried writing vector maths routines, these are very pleasing with destructuring

3:31 ChongLi: yeah

3:31 have you looked into multimethods?

3:32 they're an extremely powerful feature of clojure that aren't talked about that much

3:32 a la carte polymorphism with ad-hoc hierarchies is really nice

3:32 doomlord: i'm aware of how CLOS does it, i much prefer this sort of thing to the traditional OO style of defining methods inside classes

3:32 multiple dispatch is rather interesting too

3:33 i really despise class heirachies. i like the way Go does things.

3:33 ChongLi: ad-hoc hierarchies are just really nice and clean

3:33 you use derives to build them

3:34 (derive ::rect ::shape)

3:34 for example

3:34 the other really cool thing about multimethods is they can dispatch on any arbitrary function

3:35 doomlord: what do you mean by that

3:35 ChongLi: (defmulti cool even?)

3:35 doomlord: someone said clojure gives more control over the dispatch compared to CLOS

3:36 ChongLi: in this case, even? is the dispatch function

3:36 with this multimethod you dispatch on whether something is even or odd

3:37 doomlord: a bit like pattern matching on steroids perhaps

3:37 ChongLi: so you don't even need to care about types, you dispatch on values

3:37 ,(defmulti cool even?)

3:37 clojurebot: #<Exception java.lang.Exception: SANBOX DENIED>

3:37 ChongLi: oh

3:37 doomlord: can that emulate c++ style overloading , eg make 'add' work on values or vectors

3:38 ,(vector? [1 2 3])

3:38 clojurebot: true

3:38 ChongLi: well for that you usually use protocols or java interfaces

3:39 doomlord: i really wish there was a fixed version of c++. so many irritations in it seperate to the reason for using it, i.e. manual memory management with no complex runtime

3:40 ChongLi: I think many people find manual memory management a big irritation

3:40 noidi: doomlord, isn't D pretty much a fixed C++?

3:41 doomlord: must be reasons its not so popular . its still got a garbage collector in there so its more overlapping with other languages than c++ perhaps

3:41 ChongLi: D's GC is optional

3:43 noidi: doomlord, didn't you just mention manual memory management as one of the irritations that should be fixed? :)

3:43 ah, sorry, I misread

3:43 ChongLi: I think it could be read either way

3:43 doomlord: because its a core-feature rather than an irritation. My perception is: you use C++ where you *need* manual memory management. its still got enough improvements over C to be worth using

3:44 ChongLi: and yet linus hates it

3:44 noidi: I prefer C+Lua over C++

3:44 ChongLi: http://article.gmane.org/gmane.comp.version-control.git/57918

3:44 this always cracks me up

3:44 doomlord: yeah that seems a good combination

3:44 clojurebot: cemerick: Yeah, MacKay's book is great too.

3:45 doomlord: i find C++ templates are useful for expressing solutions to low level problems like making offset pointers. but the high level parts suck

3:47 noidi: https://twitter.com/AlecMuffett/statuses/252512427567108097

3:47 "We can't teach C++ anymore. It's like trying to explain "Lost" now - you had to be there. No one's going to watch all 6 seasons"

3:47 doomlord: heh.

3:52 arrdem: hey. I managed to teach myself the C parts of C++ in one summer...

3:52 gave up when I hit the actual C++

3:53 so can't be that hard right? XP

4:08 doomlord: is there a function to modify an element of a vector (??? [10 20 30] 1 5) -> [10 5 30]

4:09 (nondestructive)

4:09 probably want to do that as a batch... indices to replace and new values

4:12 Chousuke: doomlord: replace

4:15 hoeck: doomlord: vectors are associative

4:15 ivan: ,(assoc [10 20 30] 1 5) ; or the thing that isn't replace

4:15 clojurebot: [10 5 30]

4:15 hoeck: ,(assoc [1 2 3] 0 0 2 0)

4:15 clojurebot: [0 2 0]

4:15 doomlord: interesting

4:17 ejackson: lpetit: bonjour

4:18 lpetit: ejackson: hello dear

4:18 ejackson: lpetit: happy hacking-day :)

4:18 lpetit: thank you :)

4:19 currently fighting my limitations in writing macro-defining macros :)

4:20 ejackson: how are you?

4:26 ejackson: macro-defining macros !

4:26 that turtles all the way down dude... you can't win !

4:26 i'm fine, myself.

4:29 lpetit: ejackson: currently wrapping Eclipse' tracing API. Classical wrapping of (when (trace-option-enabled? ..) …) with a macro. Then there are 4-5 flavors of tracing calls => removing duplication between the macros code. And then, I'd like to have a macro creating the relevant macros for a specific eclipse plugin :)

4:30 I believe I can fly ! :)

4:30 ejackson: it might be easier...

4:30 :)

4:31 you are a brave, brave man

4:36 lpetit: ejackson: I am a fool, you mean :)

4:36 ejackson: hahaha - not at all.

4:37 but you'd better put some wine in the fridge for this evening :)

4:37 lpetit: :-D

4:38 ejackson: failing to do *that* would be foolish

4:39 clgv: "macros generating macros - thats perverse!" (structural quote... ;) )

4:40 lpetit: clgv: and it's for you

4:41 I want to be able to leave traces in ccw, while not polluting everybody … so configurable traces … so Eclipse Trace API :)

4:41 clgv: lpetit: not for us all - the tools for a better future in debugging CCW? ;)

4:41 lpetit: … or how spending 5 hours what could have been hacked in 5 seconds :)

4:42 clgv: yes

4:42 but you meant "no", not "not", right?

4:42 clgv: I meant "not for us all?" ... badly puncutated...

4:47 lpetit: clgv: ok :). You're right, that's because I intend it to be generally useful that I didn't, yet again, throw a quick println until I remember to remove it … 5 months later, say ? :)

4:49 clgv: lpetit: I've been pretty busy last weekend and will be next weekend. so my changes wont be made until the end of next week...

4:49 lpetit: clgv: noted, thx for the status update

5:03 clgv, ejackson : so far, I think I've been falling into every imaginable trap of macro writing. Let's start level 2 by externalizing macro-defining macro into its proper namespace :)

5:04 clgv: lpetit: oh I gather some experience with that. are you struggeling with somethin particular right now?

5:04 *gathered

5:04 ejackson: lpetit: aah, yeah I did that (if I understand you !)

5:04 clgv: I have written a Meta-DSL to generate a DSL which is used for concrete documents then

5:05 ejackson: otfrom: mornin' Mr Wayne

5:05 lpetit: clgv: no, not started yet, still finishing debugging current situation. But I guess I'll have to look closely at each auto-namespaced symbol because it will not have to be expanded into the macro-defining macro's own namespace, but rather within the defined macro's namespace

5:07 arch, reflection code added by clojure adding noise to my stack and preventing eclipse to properly report calling function name :)

5:07 s/arch/argh

5:10 otfrom: morning ejackson

5:23 Kototama: hi, any ideas why I get compilation warning with the jaqy library even if compiling without optimization? https://gist.github.com/3910617

5:24 I mean jayq

5:31 mpenet: Kototama: this disapears with alpha4

5:44 Kototama: ah! okay

7:16 abp: Hm, how do I set up a Clojurescript REPL attached to the code running in my browser?

7:18 I already start an nrepl server for my server-side code and connect to that using ccw repl, and i could use the cljs middleware of piggieback with that server too, but where/how is the connection to the browser made?

7:47 goracio: anyone use monger ?

7:48 antares_: goracio: I am the author of monger

7:49 goracio: antares: great have couple questions :)

7:49 antares_: great have couple questions :)

7:51 antares_: suppose we have this (mg/find-maps "messages" {:nik a }) and a is a vector, so how to choose all messages with :nik that is in vector

7:51 antares_: a for example ["dave" "martin"]

7:51 antares_: goracio: using MongoDB query operators

7:52 $in, $all, etc

7:52 goracio: antares_: and :nik field is a string like :nik "dave"

7:52 antares_: goracio: see http://clojuremongodb.info/articles/querying.html#using_mongodb_query_operators and MongoDB query docs

7:53 goracio: antares_: suppose we have this (mg/find-maps "messages" {:nik {$in : a} }) something like this ?

7:56 nonrecursive: Hi all - I'm trying to run my leiningen project and get two errors which alternate each time I try. The errors are "Too many arguments to def" and "java.lang.NoSuchMethodError: clojure.lang.RT.keyword"

7:56 would anyone know how to debug this?

7:56 antares_: goracio: yes. It's the same as in mongo shell. See the docs.

7:56 nonrecursive: are you sure you are not using Clojure 1.2-only code?

7:57 nonrecursive: antares_: yeah, i'm using clojure 1.4 for a web app

7:58 antares_: nonrecursive: yes but are you sure you are not using old contrib libraries or any other 1.2-only code?

7:58 that exception is from the 1.2-to-1.3 migration age as far as I remember

7:58 goracio: antares_: seems works :) thanks

7:58 antares_: although "too many arguments to def" is probably an issue in your own code

7:58 nonrecursive: antares_: ah ok - I'm not sure about that

7:59 antares_: it's bizarre because the error changes every time, even when I don't make changes in code

8:01 antares_: nonrecursive: files that do not require each other can be compiled in different order

8:01 clgv: nonrecursive:yeah your code has probably some wrongly place parantheses

8:01 nonrecursive: antares_: ok it looks like requiring clojure 1.3 instead of 1.4 fixed the issue

8:02 clgv: nonrecursive: thats no good sign

8:02 antares_: nonrecursive: 1.4 is a drop in replacement for 1.3, has been the case for me in almost 30 codebases

8:02 nonrecursive: clgv: I think the "too many arguments to def" must have come about through something funky with a macro in one of the libraries I'm using

8:04 clgv: nonrecursive: if I were you I'd switch back to 1.4 and hunt down the error in the code.

8:04 nonrecursive: ok now this is weird - i've switched the clojure version back to 1.4 and now it's working again

8:04 i mean, still working

8:04 antares_: nonrecursive: run lein clean and try again

8:04 you possibly have some AOT-compiled code around

8:04 clgv: nonrecursive: well, then a "lein clean" would have solved it as well, I guess ;)

8:05 nonrecursive: oh shoot, the error is back

8:05 after doing lein clean

8:06 ok I'm going to dig into this more to see if I can resolve that "too many arguments" error - thanks for the help

8:07 clgv: lpetit: still around?

8:08 lpetit: still, and having greatly improved my macro-foo so far

8:08 john2x: hi.

8:08 lpetit: nested syntax quotes have no secret for me anymore :)

8:08 abp: lpetit: How is CCW Clojurescript integration going? ;)

8:08 clgv: lpetit: I was wondering whether maybe the history search should be displayed similar to the autocompletion in an additional widget.

8:08 john2x: is there a way to reload all the files currently loaded in the repl?

8:09 clgv: lpetit: ok insider comment ~'~'my-symbol ;)

8:09 abp: lpetit: About to start piggieback browser-connected ccw repl battle..

8:09 lpetit: clgv: and sometimes ~'~(symbol (name (ns-name *ns*)) "foo") :)

8:10 abp: ?

8:10 clgv: lpetit: been there ;)

8:10 lpetit: your first reaction to the above suggestion?

8:11 abp: lpetit: I want to connect the repl of counterclockwise to a clojurescript-app running in the browser. Seems like it's not very straight forward from what I've read so far?

8:12 lpetit: clgv: so that before "accepting" (hitting enter?) the input area stays the same, and the filtered history appears in a list ?

8:12 nonrecursive: antares_: clvv: it looks like I get the error whenever I put (:use korma.core) in a namespace declaration

8:12 lpetit: abp: what's not straightforward is to launch this browser connected repl from ccw

8:12 clgv: lpetit: yeah that was the rough idea - but I dont know yet how to incorporate different search modes there.

8:13 lpetit: what I wanted to know is whether that would be rejected by you at once for some reasons ;)

8:13 lpetit: abp: but if you launch it straight from lein2 on the command line, you just need to get the port number, and it's straightforward from ccw to connect to this port: Window > Connect to REPL

8:13 clgv: seems interesting idea

8:14 clgv: no great idea out of the box right now

8:14 (out of my head, I mean)

8:14 clgv: lpetit: and a lot of work compared with the current state of it

8:15 lpetit: clgv: indeed, which will probably be the compelling reason for you to postpone this enhancement :)

8:15 clgv: lpetit: very likely ^^

8:15 Tichodroma: (source my-stuff.core/foo

8:15 lpetit: abp: will be around for the next couple hours, so if you're having problem, feel free to ping me

8:15 Tichodroma: woops, wrong buffer

8:15 abp: lpetit: Ah ok, then I should try that first. I'm a little confused about the port I pass to start a Clojurescript repl.. Can I have a ring webapp and the repl run on the same port?

8:16 antares_: nonrecursive: I am not familiar with korma but they keep 1.2 compatibility and korma.core is 500+ lines long. Naked use may or may not be a good idea.

8:17 lpetit: abp: there can be so many ways to start a nrepl server from within your test environment. I must know a little bit more about how you do (or intend to do) start it.

8:18 abp: if you want the ring web app and the repl on the same port, then you'll need your nrepl server to be served through http, right ? That means you'll have to use a library provided by cemerick which allows this. tl;dr: yes

8:18 abp: https://github.com/cemerick/drawbridge

8:20 abp: I use lein-ring to start up my Ring webapp on port 3000. lein-ring supports an :init function specified in project.cls, which I then use to start an nREPL-server. I window/connect to repl in ccw onto the nREPL-server to eval Clojure. Now I want something similiar so I can have an clj and cljs repl side by side ;)

8:20 *project.clj

8:21 lpetit: abp: so currently you're having ring started serving http on port 3000, and an nrepl server inside the same JVM started on another port

8:21 abp: lpetit: yep, nrepl on 7888

8:22 lpetit: abp: you could have started a :repl on port 7888, and used the :injections (or whatever) from it to start your ring handler LOL too :)

8:23 abp: with the last version of CCW, it's easy: in the View for your "Clojure" REPL, there's a button to quickly open a second View connected to the same port.

8:24 abp: in this second view, you can just issue the usual cljs incantations to transform it into a cljs repl, thanks to the magic of nrepl middle wares.

8:25 abp: so the "hard" part will be in correctly configuring the piggyback middle ware for nrepl. At this point, this is purely a lein2/nrepl configuration thing, not really related to ccw (piggyback will make the thing transparent to ccw, afaik)

8:26 abp: really, it'll be a piggyback / lein2 configuration battle :)

8:26 (and I cannot help here, I have no experience)

8:28 abp: lpetit: Ok, then I will get my hands at it. Since diving into the whole cljs-thing I lost a lot of time by reading up things and got it working pretty quickly.. So more a problem of hesitation than anything else.. Thanks so far :)

8:31 nonrecursive: OK I think I've fixed the problem. Where I had (defdb db …) I now have (if (not (resolve 'db)) (defdb db …)

8:31 lpetit: abp: a comprehensive tutorial on setting up a whole ring+cljs with lein2 and piggyback is still missing in the clojure ecosystem, AFAIK. As well as its complement for (pre)prod situations with drawbridge to server the repl through HTTP/BASIC protection :)

8:34 abp: lpetit: Yes, theres a whole lot missing in terms of content on cljs atm, but nothing is really hard. Things like using a js-library under advanced compiliation seem quite hard but are eventually dead easy.

8:36 lpetit: abp: I don't doubt it's not hard in the end, and once you know it. Getting to it right now, though, seems scary. I miss some easy to grasp big picture drawings

8:36 abp: lpetit: That's it.

8:39 djanatyn: I started playing around with threads in sbcl and it's defeinitely not as fun as it is in clojure

8:39 clojure was my first experience with multiple threads. now I appreciate clojure's concurrency model even more

8:44 lpetit: clgv: yeepee ! macro-defingin-macro working !

8:44 do you want to see the mess i created ? :)

8:44 clgv: lpetit: :) sure, lets see

8:46 lpetit: clgv: not final state, but a working state ! : https://gist.github.com/3911545

8:48 clgv: lpetit: not too messy. but I can only guess how to use it ;)

8:48 lpetit: I'll show you in a dozen minutes, there are still simplifications to be made

8:48 clgv: lpetit: dont hurry. I might be leaving early today since I caught a cold...

8:48 nonrecursive: clgv: antares_: ok I found the actual culprit, it was a bug in Korma - https://github.com/korma/Korma/issues/51

8:49 lpetit: clgv: ok

9:01 alex_baranosky: hey guys, what are some common solutions for handling composure routes that can optionally end in a trailing slash?

9:01 it looks like Compojure used to accept regexes as routes, but doesn't any longer

9:03 has anyone extended the Route protocol to regexes for their projects? https://github.com/weavejester/clout/blob/master/src/clout/core.clj#L71

9:08 LordPinky: alex_baranosky, ZvZ is such a beautiful matchup

9:13 xeqi: alex_baranosky: I've seen middleware that rewrites the :uri

9:13 another option is to redirect instead of serve the page on both uris

9:13 alex_baranosky: xeqi: yeah seen that too… Seems silly to have to work around the framework

9:13 LordPinky: I don't understand

9:14 LordPinky: alex_baranosky, ah, you don't play StarCraft?

9:14 alex_baranosky: xeqi: what do you think of the Compojure protocol extending approach?

9:14 LordPinky: You should, everyone here does.

9:14 If you don't, you're not part of it.

9:14 Can't sit at the cool table if you don't bro, those are the rules and we do enforce them.

9:14 alex_baranosky: LordPinky: correction: everyone here does CLojure

9:15 AdmiralBumbleBee: not everyone here does clojure

9:15 LordPinky: just a ruise honestly, this channel is where all the people who play StarCraft on freenode come together under the praemise of discussing a programming language while they actually brag about their blink stalker micro.

9:15 AdmiralBumbleBee: pretty sure sgeo only does haskell with lots of parens ;)

9:16 alex_baranosky: xeqi: looks like it might be complicated (bad) to extend that protocol, because the String implementation is doing a ton of parsing etc

9:18 xeqi: alex_baranosky: yeah, I can't follow it on quick glance so it might be messy

9:30 lpetit: clgv: here's the way to install the code for ccw.core: https://gist.github.com/3911733

9:31 clgv: lpetit: pretty compact. after that statement it will trace every eclipse event?

9:31 lpetit: clgv: hell no :)

9:32 clgv: lpetit: what does it do? I see no config in that gist ;)

9:32 lpetit: clgv: after that statement, it will install in ccw.core.trace a handful of macros wrapping the eclipse tracing api

9:32 Sgeo: AdmiralBumbleBee, heh

9:34 lpetit: I'm now able to write (ccw.core.trace/trace :autocompletion "some log message") and it will check if the "ccw.core/autocompletion" Eclipse trace flag is set to true, and if so, it will add the appropriate call that will add a trace in the user's workspace/.metadata/trace.log file (with file/line number, thread, and the message)

9:34 AdmiralBumbleBee: Sgeo: I learn a lot from your musings, so no harm intended :)

9:35 antares_: Sgeo: do you mind a small haskell question? I am scared of hardcore academics in #haskell :)

9:35 lpetit: clgv: starting from Juno, Eclipse will let the user toggle the trace flags from the preferences > trace page.

9:35 clgv: prior to Juno, the user (you) has to start Eclipse with the -debug (don't ask me why it's not named -trace) flag and the path (url?) to the file defining which debug flags are on

9:38 Sgeo: antares_, in general I don't mind, but right now I'm running late for class

9:46 antares_: Sgeo: ok

10:25 abp: xeqi: Do you have a clue how to get piggieback with a browser-repl working when the page containing the cljs is served from a ring app?

10:25 dfd: Do you folks know if there's a way to run just one test in midje? While I'm at it, what is the appropriate way to stub out a function "globally" (for a whole set of tests hitting the same function), except, er, on the tests where you don't want to stub it out...?

10:39 cemerick: abp: you mean the cljs side of the browser repl, or the cljs for your app?

10:40 abp: cemerick: Hi there. I want to execute cljs in my browser from a ccw repl.

10:41 cemerick: abp: Sure; to do so, you'll just need to start your REPL from Leiningen (so the piggieback middleware can be rolled in to the stack), and connect to it from ccw.

10:42 You'll still need to set up your app to look for a browser-repl connection (e.g. on port 9000).

10:42 abp: cemerick: Currently I have that in lein-rings :init, starting an nrepl server with piggieback middleware

10:42 cemerick: Ah ok, so that port is separate from everything else?

10:42 cemerick: ah, ok, that'll work too

10:43 abp: cemerick: Then I think it's just about to work ;)

10:43 cemerick: Yes, the browser-repl controls its own set of resources.

10:43 abp: cemerick: Let me try.

10:43 cemerick: There was talk a bit ago about trying to make it possible to route them through an existing ring app, but that's apparently not in the cards.

10:45 abp: cemerick: Your clojurescript dependencies in piggieback conflict with the way cljsbuild works, so i need to exclude them :x Or probably cljsbuild conflicts with everything else..

10:46 cemerick: You certainly need to be using the same version of clojurescript in both places.

10:46 abp: cemerick: Sure, I think cljsbuild uses a newer version, but not via lein deps but bundled.

10:47 cemerick: abp: nothing is bundled; the cljsbuild jar is ~8kb

10:49 abp: cemerick: https://github.com/emezeske/lein-cljsbuild/issues/105

10:49 cemerick: Not bundled, but pulled, sorry.

10:54 cemerick: Ehm, so I still need to serve an index.html from port 9000 then, not integrating the repl into my ring-apps cljs?

10:55 cemerick: abp: No; at least, I don't

10:55 But, I don't grok that cljsbuild issue, either.

10:57 AFAICT, cljsbuild always uses whatever version of ClojureScript you have in your :deps vector

10:59 abp: cemerick: Ok, then this issue would be obsolete. I don't have a ClojureScript dep in my :deps and no .jar in the leiningen deps folder. So somehow it's got ClojureScript.

11:00 cemerick: abp: deps folder? What version of leiningen are you using?

11:00 casperc: hey

11:01 stupid question: Is there a function in core which returns true if it gets nil and nil otherwise?

11:01 abp: cemerick: lein2, I don't mean a physical folder, only the view in eclipse "Leiningen Dependencies"

11:01 cemerick: ah

11:01 andrewmcveigh|wo: casperc: nil?

11:02 casperc: that returns false if not nil unfortunately

11:02 andrewmcveigh|wo: casperc: ah, sorry. didn't read your question properly.

11:02 casperc: it should be like this (if val nil true)

11:02 cemerick: casperc: what are you trying to do?

11:02 casperc: np

11:03 bit hard to explain the whole thing, but i need a nil value when i get something which is not nil

11:03 i guess i can just do the if thing, but i just feel stupid for doing it :)

11:04 cemerick: sounds like a specious requirement :-)

11:05 abp: cemerick: So, I'm doing the things described in the Browser REPL section of piggiebacks readme. The only difference is, I've a ring app running on localhost:3000, delivering the page my cljs is included in. When I call (repl/connect "http://localhost:9000/repl") from there, should that work? Despite me having no index.html served from localhost:9000 etc.

11:07 cemerick: abp: You have no control over what's served from 9000 at all; that server comes up when you call (cemerick.piggieback/cljs-repl ………)

11:09 antares_: so, for every Raynes we send to the conj they release 3 new tickets? That sounds like a price increase some may just accept. Now, where can we get additional Rayneses…

11:09 abp: cemerick: Ok, but the cljs-repl does not work. I can't evaluate anything.

11:10 cemerick: abp: make sure you're loading your web page that connects to :9000 after starting the cljs REPL.

11:22 notsonerdysunny: Is it possible to import 2 classes of same name from two different packages into the same clojure namespace?

11:22 I seem to be running into name clash related compilation errors..

11:22 abp: cemerick: Doesn't work either. But I should be able to see the browser polling on localhost:9000 in chrome developer tools?

11:23 cemerick: Yes, though it only attempts to connect once; I don't think it polls.

11:23 abp: cemerick: Ok, but still a visible network connection. I've got none.

11:28 cemerick: It's getting better, sorted out one error of my own.

11:29 cemerick: Do you use lein-cljsbuild?

11:29 cemerick: yes

11:29 though I still don't see how that's related to browser-repl

11:30 chouser: 4clojure is down. Did I kill it?

11:30 abp: cemerick: Not at all. Having no issues with it? In terms of stability, reproducible errors.

11:30 cemerick: nope, it's been solid

11:30 chouser: hm, back up

11:31 abp: cemerick: Strange. I'm using shoreleave and jayq, but sometimes I get errors in the js-console that are gone after a clean and rebuild.

11:32 ohpauleez: abp: Shoreleave related errors or just general errors?

11:33 abp: cemerick: Done. browser-repl works, thanks for another great job on an astonishing tool. ;)

11:33 cemerick: abp: what was the issue?

11:35 abp: ohpauleez: General errors. I get a few warnings for Shoreleave while building, nothing severe, I'm still fiddling around how to structure my app reactive around pubsub and minimizing state. Having a blast. :)

11:35 xeqi: abp: glad to here you got it working

11:35 abp: cemerick: A bug in my code and not having repl/connect "http://localhost:9000/repl") eval'd.

11:35 cemerick: ah :-)

11:35 ohpauleez: abp: Good to hear. Feel free to ping me or email me (via the shoreleave ml) if you have any questions

11:36 abp: lpetit: Would it be hard to highlight (comment ...) blocks in ccw?

11:36 ohpauleez: there is one outstanding pubsub bug I need to patch up

11:36 abp: cemerick laughs hard. :D

11:36 ohpauleez: but I'm also sitting on a few other changes I need to polish up before releasing

11:36 lpetit: abp: you mean show them as ;#_ comments?

11:36 cemerick: abp: FWIW, I have this as a top-level in one of my app's cljs files:

11:36 (when (-> js/window .-location .-hostname (= "localhost"))

11:36 (connect "http://localhost:9000/repl"))

11:37 ohpauleez: cemerick: That deserves to be in Shoreleave haha

11:37 my trick is query args (so I can use it in production)

11:37 abp: ohpauleez: Didn't ran into that bug. ;) I have one function publish changes from a user typing in an input. Not much more.

11:37 cemerick: ohpauleez: nah, shouldn't be in libraries :-)

11:37 abp: lpetit: Yes, please.

11:38 xeqi: ohpauleez: where is the shoreleave ml?

11:38 cemerick: abp: once ccw uses leiningen to start its REPLs, then stuff around piggieback etc. will get a lot easier

11:38 lpetit: abp, cemerick : dunno. Highlighting (comment) as ; or #_ comments … what if the user uses something else than clojure.core/comment ?

11:39 abp: When get things in cljs files executed? Is there some auto-wrapping into a jquery-ready like handler?

11:39 lpetit: cemerick: how much easier? I mean, the hard stuff will then still be made in lein2 configuration,and only grabbing nrepl server's port and starting client repl automatically will be easier.

11:40 hldfr: Hmm why isn't some named as some? , just like the every? sequence predicate ?

11:40 S11001001: hldfr: because some isn't a predicate

11:41 ,(some seq '[() [] [1]])

11:41 clojurebot: (1)

11:41 hldfr: ,(some odd? [])

11:41 clojurebot: nil

11:41 hldfr: ah

11:41 cemerick: lpetit: The difference between setting up your own nREPL stack vs. using the easy lein2 configuration available for doing the same is significant.

11:42 Nevermind other plugins, middleware, hooks, etc.

11:42 S11001001: hldfr: it's worth comparing some to (comp first filter), and considering which is appropriate in each situation

11:42 gfredericks: abp: I believe it's all at the top level; you can check the compiled file though

11:42 lpetit: cemerick: you mean in case one does not want to start lein2 from the command line without waiting for better integration with ccw ?

11:43 S11001001: ,((comp first filter) seq '[() [] [1]])

11:43 clojurebot: [1]

11:43 cemerick: lpetit: Right; you lose code completion and such doing that.

11:44 lpetit: ooh, I wasn't aware of that

11:45 cemerick: lpetit: Reason #43 I've been harping on about completion as middleware, instead of using eval for it.

11:49 abp: cemerick: Seems like the next stop for me would be lerning to use lein2 properly. ;)

11:50 lpetit: You can't get at the ns of a symbol for highlighting currently?

11:51 wingy: what version of eclipse should i download for clojure?

11:52 abp: gfredericks: Sure

11:52 wingy: Eclipse IDE for Java Developers or Eclipse Classic

11:52 lpetit: wingy: both should do. Go for "for Java Developers", I guess

11:52 bbl

11:52 abp: gfredericks: Just wondering why everybody is happily hacking top-level code while that wasn't good in plain js

11:57 gfredericks: abp: everybody?

11:57 abp: cemerick: "GET http://localhost:3000/deps.js 404 (Not Found) main.js:165" shows up in the js-console. That happens randomly while using lein cljsbuild auto. That is a bug of an older ClojureScript version or not?

11:58 gfredericks: Ok, some folks in examples I've seen.

11:58 gfredericks: abp: when I need dom-related side-effects I always wrap the call to the side-effecting function

11:58 something like (js/jQuery init)

11:59 abp: if you see people doing otherwise you have my permission to frown

12:00 abp: gfredericks: Yes, that's what I'm doing too, until now in an anonymus function, because I'm only tampering.

12:03 doomlord: was just trying to compile/run a couple of modules, the tools are telling me errors about classpaths .... is it not possible to just combine a few sourcefiles from a single commandline like with ghc or gcc

12:04 gfredericks: doomlord: are you using lein?

12:04 doomlord: just started trying that aswell

12:05 is this extra complexity imposed by the jvm

12:06 (heh i guess i could try a script that concatenates source files :) )

12:06 gfredericks: doomlord: lein is pretty easy once you're familiar with it

12:07 doomlord: do i need a whole lein generated directory structure for a library

12:07 gfredericks: one big win over manually compiling source files is that with lein it is trivial to tap into the ecosystem of clojure/java libraries

12:07 yeah that's generally what you want; `lein new ...` will set one up for you

12:08 putting the source files in directories that match the namespace is standard java/clj procedure

12:08 doomlord: ok i guess i was expecting this 'middle ground' of one step up over a single sourcefile to be as easy as c ... i suppose at least if this chews up more neurons its knowledge applicable to a range of tools not just clojure

12:09 ok thats my first mistake

12:09 i just setup a lein project and stuck all my sources in there

12:09 (in the one directory it made)

12:10 gfredericks: I'm sure it's technically possible to compile a pile of files if you use things like clojure.core/load, but using require (which I believe assumes the aforementioned directory structure) is _much_ more idiomatic

12:10 doomlord: in this 'middle ground' my "library" is merely one file

12:11 noidi: creating a new project with lein only takes a couple of seconds, so there's not much need for a middle ground, imo

12:11 gfredericks: there's a lot of uniformity gain with a small amount of effort

12:11 noidi: lein new foo; cd foo; lein repl

12:11 doomlord: foo\src\foo .. :(

12:11 gfredericks: hundreds of libraries on github with standard directory structures

12:12 doomlord: ok i guess i can stil a bunch of my helpers together to avoid directory overhead

12:13 noidi: doomlord, there's also this https://github.com/mtyaka/lein-oneoff

12:13 oops, apparently that's for leiningen1

12:14 so disregard that :)

12:14 doomlord: if i've just got 4-5 sourcefiles ... but 4 i want to re-use - i'm going to need 2 lein projects then i guess

12:15 deeply nested directories (foo/src/foo) makes commandline use much more awkward :(

12:16 if you've got hundreds of sources then great

12:16 gfredericks: could make a symlink

12:17 doomlord: "if you use things like clojure.core/load"... how would that look

12:18 gfredericks: I think you just give it a filename and it evals the file

12:19 doomlord: 1st attempt: in the repl, in the directory where the source is - "(load "sourcrname.clj") ... errors about classpath :(

12:20 gfredericks: oh there's a load-file as well

12:20 that must be what I was thinking of

12:20 doomlord: so far i've used "$ clojure <singlesourcename.clj>" to run a single file project. (very tempted to make a script to concat sources and run that..)

12:21 gfredericks: you can go ahead building your own thing if that's what you enjoy doing, but anytime you ask for help about it people will ask you why you're not using lein

12:21 doomlord: ok load-file works - thanks :)

12:21 gfredericks: np

12:22 doomlord: ok i guess "lein" is worth getting into if i want to, say, dable with clojure + scala

12:22 or when i've written more than 5 sources

12:22 gfredericks: and it will ease your ability to do lots of other common build-related tasks

12:23 e.g., make executable jarfiles

12:23 doomlord: so by default java land has many .classes which can be loaded add-hoc? but jarfiles are a self-contained bundle?

12:24 konr_trab: Is there a way to deconstruct the keys and values of a hash in a defn? For example, {:foo {:bar "baz"}} would have :foo set to a, :bar set to b and "baz" to c?

12:24 doomlord: map gets them i think

12:25 i think mapping a hash gets[key value] 's passed in?

12:25 ,(map #(print %) { :a 1 :b 2 :c 3})

12:25 clojurebot: ([:a 1][:c 3]nil [:b 2]nil nil)

12:26 konr_trab: hmm, but can't I do something like (let [{a {b c}} {:foo {:bar "baz"}}] (list a b c))?

12:27 gfredericks: konr_trab: you can

12:27 well

12:27 doomlord: you could build a vector and destructure the vector perhaps? is there a better way

12:27 gfredericks: if you don't know the keys ahead of time then it's messier

12:27 that is a much less common thing to want to do

12:28 ,(let [[[a [[b c]]]] {:foo {:bar "baz"}}] (list a b c))

12:28 clojurebot: #<UnsupportedOperationException java.lang.UnsupportedOperationException: nth not supported on this type: PersistentArrayMap>

12:28 dnolen: konr_trab: that doesn't really make sense given there can be many more key value pairs - hash are unordered so you don't know what you would get.

12:28 gfredericks: hrm :(

12:28 AdmiralBumbleBee: I thought you couldn't destructure nested maps?

12:28 doomlord: ,(let [ [k0 v0][k1 v1] ] (map #([%1 %2]) { :foo 1 :bar 2} ) )

12:28 clojurebot: #<CompilerException java.lang.RuntimeException: Unable to resolve symbol: k1 in this context, compiling:(NO_SOURCE_PATH:0)>

12:29 dnolen: AdmiralBumbleBee: you can

12:29 AdmiralBumbleBee: has that always been the case?

12:29 doomlord: ,(let [[ [k0 v0][k1 v1] ] (map #([%1 %2]) { :foo 1 :bar 2} )] (print k0 v0 k1 v1) )

12:29 clojurebot: #<ArityException clojure.lang.ArityException: Wrong number of args (1) passed to: sandbox$eval127$fn>

12:29 dnolen: AdmiralBumbleBee: yes

12:30 gfredericks: doomlord: I think the classfiles in the jars are loaded in the same way; the jvm has a 'classpath' which can be a combination of raw directories and jarfiles containing classfiles

12:30 doomlord: ,( let [ [[k0 v0][k1 v1]] (map #([%1 %2]) { :foo 1 :bar 2}) ] (print k0 v0 k1 v1) )

12:30 clojurebot: #<ArityException clojure.lang.ArityException: Wrong number of args (1) passed to: sandbox$eval163$fn>

12:30 doomlord: ,( let [ [[k0 v0][k1 v1]] (map #(list %1 %2) { :foo 1 :bar 2}) ] (print k0 v0 k1 v1) )

12:30 clojurebot: #<ArityException clojure.lang.ArityException: Wrong number of args (1) passed to: sandbox$eval199$fn>

12:31 AdmiralBumbleBee: I even have code in the project I'm working on that destructures a nested map… and I wrote the code

12:31 * AdmiralBumbleBee facepalms

12:31 doomlord: ,( let [ [[k0 v0][k1 v1]] [[:a 1][:b 2]] ] (print k0 v0 k1 v1) )

12:31 clojurebot: :a 1 :b 2

12:31 doomlord: (map #(list %1 %2) {:a 1 :b 2})

12:31 ,(map #(list %1 %2) {:a 1 :b 2})

12:31 clojurebot: #<ExecutionException java.util.concurrent.ExecutionException: clojure.lang.ArityException: Wrong number of args (1) passed to: sandbox$eval261$fn>

12:32 AdmiralBumbleBee: doomlord: could you use a local repl?

12:32 doomlord: heh sorry

12:34 ,( let [ [[k0 v0][k1 v1]] (map (fn[x]x) { :foo 1 :bar 2}) ] (print k0 v0 k1 v1) )

12:34 clojurebot: :foo 1 :bar 2

12:39 doomlord: multi-files: ok i appear to be able to use "load-file" from a single source ... thats enough for the minute but i dont get to make my own namespaces without figuring out lein i guess

13:10 TimMc: &(-> "\ud834\udd1e" (.substring 0 1) (.codePointCount 0 1))

13:10 lazybot: ⇒ 1

13:10 muhoo_: doomlord: wat?

13:11 doomlord: i'oll figure out lein once i've written more code..

13:12 TimMc: doomlord: Don't use load-file.

13:13 muhoo: there's not much to figure out about using lein

13:13 TimMc: doomlord: https://github.com/baznex/crosscram/tree/master/src/crosscram -- just takea look at this project structure.

13:22 AtKaaZ: ,(quote 1 2 3)

13:22 clojurebot: 1

13:23 AtKaaZ: maybe it should err ? if the programmer expected something else other than ignoring 2 3

13:25 added to the list:) https://gist.github.com/3895312

13:29 quote is a special form ? ##(apply quote '(1 2 3))

13:29 lazybot: java.lang.RuntimeException: Unable to resolve symbol: quote in this context

13:30 antares_: AtKaaZ: yes

13:30 AtKaaZ: cool, thanks

13:32 this is cool: ##(. 1 toString)

13:32 lazybot: ⇒ "1"

13:32 AtKaaZ: ,(. 1/2 toString)

13:32 clojurebot: "1/2"

13:32 AtKaaZ: ,(str 1/2)

13:32 clojurebot: "1/2"

13:33 AtKaaZ: hmm I notice str uses this internally: ##(. 1 (toString))

13:33 lazybot: ⇒ "1"

13:33 S11001001: AtKaaZ: try on nil

13:33 AtKaaZ: ,(. nil toString)

13:33 clojurebot: #<NullPointerException java.lang.NullPointerException>

13:34 AtKaaZ: that's why I should use str, good point:)

13:34 but why is str using (. 1 (toString)) ?

13:34 instead of (. 1 toString)

13:34 ,(. 1 (str "toString"))

13:34 clojurebot: #<IllegalArgumentException java.lang.IllegalArgumentException: No matching method found: str for class java.lang.Long>

13:35 AtKaaZ: so I can't execute clojure code there

13:39 looks like the two forms are equivalent: http://clojure.org/java_interop#dot

13:39 (. Classname-symbol (method-symbol args*)) or (. Classname-symbol method-symbol args*)

13:41 except that the () is looking for method specifically, and without () is looking for field then method, as far as I can tell by the exceptions

13:41 ,(. 1 (bitCount))

13:41 clojurebot: #<IllegalArgumentException java.lang.IllegalArgumentException: No matching method found: bitCount for class java.lang.Long>

13:41 AtKaaZ: (. 1 bitCount)

13:41 ,(. 1 bitCount)

13:41 clojurebot: #<IllegalArgumentException java.lang.IllegalArgumentException: No matching field found: bitCount for class java.lang.Long>

13:43 AtKaaZ: that doc actually says so if I read :) i'll stfu now

14:11 dimovich: hello people...

14:12 how hard is finding some freelance Clojure projects?

14:12 does anyone have experience in this area?

14:15 dnolen: wow did know about :strs or :syms feature of map destructuring

14:15 dbushenko: never seen such projects

14:16 hiredman: dimovich: from what I have seen, clojure jobs tend to be around core infrastructure, not really around stuff you send out or contract

14:16 Frozenlo`: dnolen: learned it around 4 days ago. Blew my mind :P

14:16 dnolen: dimovich: I think it depends on what you do - data / analytics folks don't seem to have a hard time I think.

14:17 dimovich: thanks for the tips

14:18 pepijndevos: Is there am ebook of Lisp In Small Pieces?

14:18 hiredman: https://twitter.com/wunki/statuses/228408001655087104

14:19 nickmbailey: dnolen: woah, and now i know about :strs and :syms, thanks :)

14:22 dnolen: pepijndevos: not that I know of, though that seems like a book worth having in print.

14:22 pepijndevos: dnolen: yea, they seem rather expensive though.

14:25 dnolen: pepijndevos: in this case I think it's worth it - filled with goodies you can keep coming back to.

14:26 pepijndevos: dnolen: heh, once I have some money to spend, i'll consider it.

14:32 DaReaper5: Hi, what is the server address to this irc?

14:37 I have a noobie clojure issue/question: what is the best approach for generating a report (like Jasper Reports) using clojure as the web server

14:40 hiredman: DaReaper5: I would just use jaspher reports

14:40 DaReaper5: it's an existing java library, clojure interops very well with java, and your done

14:40 :/

14:40 DaReaper5: I am thinking about using DynamicJasper to simplifiy things.

14:40 hiredman: you're

14:40 whatever, I don't know anything about jasper, just that it is a java library

14:40 DaReaper5: as well*

14:50 TimMc: DaReaper5: That's not a question that can actually be answered meaningfully.

14:50 DaReaper5: Ok, to simplify my current issue: How do i enable a clojure web server to allow a client to download a file?

14:50 TimMc i agree

14:51 ... that may not be the best wording either

14:51 TimMc: A file that is statically sitting on the server, or one that is generated dynamically by the server?

14:53 DaReaper5: an example of both would be nice. However, I need the client to be able to download dynamically generated files more so.

14:56 amalloy: DaReaper5: look up what http headers/content you need to send, and then do that

14:57 pjstadig: jasper is a disaster

14:57 at least it was when i used it from java or rails or something

14:57 maybe clojure could make it nicer

15:00 gfredericks: pjstadig: I find your claim plausible because it rhymes

15:00 DaReaper5: pjstadig i am hoping to avoid uglyness and issues by using DynamicJasper

15:00 haha

15:01 TimMc: DaReaper5: It's really all about the Content-Disposition header or some such.

15:02 Everything else is glue.

15:03 DaReaper5: ok, just fishing for possibly a link that has an example. I think i will dig into the current clojure web service code and see what we do currntly...

15:12 lnostdal: perhaps a strange question, but the clojure printer sometimes outputs what i guess must be memory addresses for some objects it prints .. will this output change based on the GC doing its work?

15:12 hyPiRion: what do you mean?

15:12 lnostdal: i suppose the GC might move objects around in memory .. and the addresses printed for the objects will then change

15:13 (move things around to avoid fragmentation etc.)

15:13 amalloy: &(str (lazy-seq nil))

15:13 lazybot: ⇒ "clojure.lang.LazySeq@1"

15:13 hiredman: lnostdal: it is the object's hashcode

15:13 amalloy: hm. lazy-seqs don't print as their hashcode anymore?

15:13 lnostdal: hiredman: oh, ok

15:13 gfredericks: &(str (range))

15:13 hyPiRion: heh.

15:13 lazybot: Execution Timed Out!

15:13 hiredman: the default impl for Object is often the pointer, but it gets cached, since yes, the gc can move thrings around

15:13 raek: &(pr-str (lazy-seq nil))

15:13 lazybot: ⇒ "()"

15:14 lnostdal: hiredman: i see .. interesting .. thank you :)

15:14 hyPiRion: ,(pr (Object.))

15:14 clojurebot: #<Object java.lang.Object@427c6d2e>

15:14 lnostdal: hmm, this opens up another question; since it is cached .. is there a chance another object might end up with the same address then?

15:15 (since the real underlying address might be freed up while the GC moves things around)

15:15 amalloy: lnostdal: it wouldn't matter if that happened

15:15 hyPiRion: lnostdal: I'm quite sure that's a negative, the JVM would be strange if that would occur.

15:15 at least not visibly.

15:15 lnostdal: ok

15:16 gfredericks: hyPiRion: based on what hiredman said I would assume the opposite

15:16 hiredman: lnostdal: there is, but it doesn't matter

15:16 it's just a hash collision for Objects

15:17 gfredericks: I suppose it would be unreasonable to expect a runtime to assign all objects a permamently unique ID

15:19 hiredman: not a lot of utility there

15:19 gfredericks: and lots of wasted space

15:19 hiredman: that is basically what a pointer is, but the pointer can change

15:19 TimMc: Object.equals() must have some guarantee that objects can't be moved in memory in between address dereferences.

15:20 hiredman: and you don't want the hashcode changing

15:24 TimMc: I think are confusing Object.equals() with the object identity check it uses

15:24 you

15:24 amalloy: TimMc: i can't imagine why it would make that guarantee

15:24 TimMc: Mmm, right.

15:24 .equals would just use ==

15:25 gfredericks: but if you have a pair of object references, and the GC decides to move the object somewhere else, it will have to change those pointers, right?

15:25 TimMc: amalloy: I don't mean the contract of .equals() in general, just Object's impl.

15:25 hiredman: or use *shudder* handles

15:26 gfredericks: hiredman: are those pointer pointers?

15:26 hiredman: yes

15:26 amalloy: TimMc: right. i don't see why it would make that guarantee. there's no point

15:27 gfredericks: I must be missing a detail about this

15:27 oskarth: I have a function that is defined by a macro which returns "{:foo 0}" when evaluated. How do I test this using clojure.test? "(is (= {:foo 0} BAR-FN-CALL))" fails.

15:27 amalloy: when the gc moves an object around, it also necessarily must update all references to that object in active stack frames

15:28 TimMc: Oh, hmm... are you saying that when I have a reference to an object, I actually have a pointer to the real memory location?

15:28 gfredericks: amalloy: so what we're saying is that the jvm just won't let == be executed while it's in the middle of updating the stack frame?

15:28 amalloy: so even if (a == b) goes like push a, <gc....>, push b, compare, if a has been moved after pushing, the compare still sees the current value

15:28 hiredman: uh, what do you think the word reference implies?

15:28 TimMc: That does seem to ring more true.

15:28 hiredman: I was in fact thinking of pointers to pointers. :-/

15:29 gfredericks: amalloy: implicit in your statement is that <gc....> is atomic

15:29 hiredman: TimMc: that is sort of an unfortunate overload

15:29 TimMc: I haven't had to think about memory management details for a while.

15:29 amalloy: gfredericks: indeed, that is implied. and not necessarily true, but the jvm cooperates with your bytecode to make sure it appears atomic

15:30 hiredman: http://www.artima.com/insidejvm/ed2/jvmP.html might be a good reference (I have not read it)

15:30 gfredericks: amalloy: all of the things make sense now

15:30 hyPiRion: Huh

15:30 ,(vector)

15:30 clojurebot: #<ExecutionException java.util.concurrent.ExecutionException: java.lang.NoClassDefFoundError: Could not initialize class clojure.lang.RT>

15:31 Bronsa_: wtf

15:31 hiredman: sandbox is broken, it should right itself in 10 minutes

15:32 madsy: hiredman: It's your bot?

15:32 amalloy: &(vector) in the mean time

15:32 lazybot: ⇒ []

15:33 gfredericks: &((reduce comp (repeat 15 vector)))

15:33 lazybot: ⇒ [[[[[[[[[[[[[[[]]]]]]]]]]]]]]]

15:33 madsy: &(map {} [1 2 3] [:a :b :c])

15:33 lazybot: ⇒ (:a :b :c)

15:33 madsy: &(map into [1 2 3] [:a :b :c])

15:33 lazybot: java.lang.IllegalArgumentException: Don't know how to create ISeq from: clojure.lang.Keyword

15:33 madsy: Eh, I suck. Been a while since I wrote any clojure code

15:33 gfredericks: (def identity (partial {} :foo))

15:35 hyPiRion: (def identity #(do %))

15:36 gfredericks: now accepting submissions for most surprising implementation of identity

15:37 &((#'and 7 8) 19)

15:37 lazybot: java.lang.ClassCastException: java.lang.Boolean cannot be cast to clojure.lang.IFn

15:37 gfredericks: &((@#'and 7 8) 19)

15:37 lazybot: java.lang.ClassCastException: java.lang.Boolean cannot be cast to clojure.lang.IFn

15:38 * gfredericks gives up

15:38 Bronsa: &(#'and nil nil 23)

15:38 lazybot: ⇒ 23

15:39 gfredericks: oh I shoulda used partial

15:39 Bronsa: yeah

15:40 gfredericks: &(#'and nil nil 1 2 3)

15:40 lazybot: ⇒ (clojure.core/let [and__3822__auto__ 1] (if and__3822__auto__ (clojure.core/and 2 3) and__3822__auto__))

15:40 llasram: (def identity (partial 'identity nil))

15:42 mattmoss: ,(range 6 3 -1)

15:42 clojurebot: (6 5 4)

15:43 mattmoss: &(or 25 (range 6 3 -1))

15:43 lazybot: ⇒ 25

15:43 Bronsa: ,(or 1)

15:43 clojurebot: 1

15:44 mattmoss: &(range (or 25 6) 3 -1)

15:44 lazybot: ⇒ (25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4)

15:45 AdmiralBumbleBee: mattmoss: what are you trying to do?

15:45 mattmoss: Chicago song lyric: "Twenty-five or -six to four..."

15:45 aperiodic: gfredericks: (def id (fn [x] @(reify clojure.lang.IDeref (deref [_] x))))

15:46 mjg123: What is the current status of Source Maps in ClojureScript? Do they work? Can I use them?

15:46 aperiodic: gfredericks: more "convoluted" than "surprising", i guess

15:46 dnolen: mjg123: they do not work. I'm the only person that has worked on them. very half-finished.

15:46 hyPiRion: (def identity (comp (partial apply reduce nil) reverse (partial list nil)))

15:46 dnolen: mjg123: feel free to lend a helping hand tho ;)

15:46 mattmoss: &(range (+ 20 (or 5 6)) 3 -1)

15:46 lazybot: ⇒ (25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4)

15:47 mattmoss: There we go.

15:47 aperiodic: international obfuscated clojure identity contest?

15:48 gfredericks: yes.

15:48 mjg123: dnolen: not sure how much help I could be - but there must be a good ref. somewhere? What's browser support like?

15:48 gfredericks: ((apply comp (take 10000 (cycle [:foo (partial hash-map :foo)]))) 41)

15:48 &((apply comp (take 10000 (cycle [:foo (partial hash-map :foo)]))) 41)

15:48 lazybot: ⇒ 41

15:49 mattmoss: o_O

15:50 hyPiRion: I assume we're going to bring in the big guns now?

15:50 gfredericks: "Ah, that's what's slowing it down. That call to identity creates five thousand array maps"

15:51 dnolen: mjg123: already supported in Chrome

15:51 * mjg123 off to read about source maps.

15:51 dnolen: mjg123: http://www.html5rocks.com/en/tutorials/developertools/sourcemaps/

15:52 mjg123: is the primary resource, they link to the Google SourceMap v3 doc

15:52 mjg123: dnolen: thanks.

15:52 aperiodic: dnolen: what stage are they at, exactly? last i heard you could read and write the newest kind of source map, and the main work left to do was have the cljs compiler emit the necessary info

15:52 dnolen: mjg123: http://github.com/clojure/clojurescript/tree/source-map, is the branch

15:53 mjg123: https://github.com/clojure/clojurescript/tree/source-map/src/clj/cljs you can see source_map.clj and the source_map directory there.

15:53 aperiodic: yes we can pass a flag so that we generate the usual sourcemap - but this needs to read back in a merged with whatever information was produced during emission.

15:53 aperiodic: Clojure 1.5.0 now has column data, so now's a good time to wrap this up.

15:55 http://github.com/clojure/clojurescript/blob/source-map/src/clj/cljs/compiler.clj#L207 is some basic emission of source map info when we encounter a var/binding

15:58 so ClojureScript is pretty fast on Raspberry Pi via V8

15:58 muhoo: really? wow.

15:58 scriptor: nice

15:59 dnolen: http://twitter.com/swannodette/status/258994509755609088

15:59 muhoo: i was running jvm clj on a beagleboard for a while

15:59 Frozenlo`: dnolen: What have you done! Nooo! No I'll have to buy one!

15:59 dnolen: well according to Martin Trojer

15:59 Frozenlo`: *now

15:59 muhoo: jit compillation and repl was painful, but with the embedded-optimized jvm, an aot compiled clj project worked well

16:00 beagleboard ships with node.js

16:00 Frozenlo`: While on the subject, anyone tested jvm clj on the raspberry?

16:00 scriptor: is anyone still selling them, actually?

16:02 Mr_Bond: there is something called cubieboard as well which looks cool

16:02 prob not long they get gigE as well

16:02 muhoo: 1gb a8? nice

16:06 Mr_Bond: It's crazy how cheap small computers are getting these days

16:09 Frozenlo`: Eh. Code will eat the world :P

16:11 hyPiRion: hm

16:11 (def identity #(`[~@%&](+)))

16:11 gfredericks: you win

16:12 Bronsa: wtf

16:13 gfredericks: &(#(`[~@%&](+)) "swearing in clojure")

16:13 lazybot: ⇒ "swearing in clojure"

16:13 * aperiodic slow claps

16:13 Cheiron: Hi, what is the idiomatic way to perform an action on each item in a sequence but I don't care to collect the output . doseq is one option, any other ones?

16:13 Bronsa: is github down?

16:13 gfredericks: Cheiron: I like doseq; not sure why you need anything else

16:14 thorbjornDX: Bronsa: it is for me

16:14 gfredericks: you can do it with dorun and map

16:14 aperiodic: yup

16:14 Cheiron: just expanding my knowledge :)

16:15 mattmoss: Github was fine for me just a few minutes ago... now very very slow.

16:15 hyPiRion: Bronsa: Looks down from here.

16:15 Cheiron: about the new reducers. it is a built-in hadoop feature for Clojure?

16:15 scriptor: https://status.github.com/ minor interruption apparently

16:15 Bronsa: just as i was git pushing :(

16:19 * gfredericks imagines 'git pushing' to be a british variant on 'cow tipping'

16:20 thorbjornDX: gfredericks: awesome

16:20 Bronsa: gfredericks: lol

16:20 dnolen: Cheiron: nothing to do w/ Hadoop http://clojure.com/blog/2012/05/08/reducers-a-library-and-model-for-collection-processing.html

16:21 scriptor: git bash now means something very different

16:22 TimMc: hyPiRion: Now do factorial. :-P

16:23 * TimMc goes off to invent swEarlang, a language for distributed cussing.

16:23 hyPiRion: ~Factorial

16:23 clojurebot: factorial is not something you need alphanumeric characters for: https://gist.github.com/3036120

16:24 hyPiRion: Except it's down.

16:24 gfredericks: this is that scene where the local champion walks into the arcade with his groupies

16:24 hyPiRion: heh

16:24 Bronsa: youtube is down too.

16:25 gfredericks: well that's like the whole internet then

16:25 scriptor: cached: http://webcache.googleusercontent.com/search?q=cache:RmuaRRSWE90J:https://gist.github.com/3036120+&cd=1&hl=en&ct=clnk&gl=us

16:27 DaReaper5: wow that is rare

16:27 TimMc: hyPiRion: Seriously though, that's a pretty good identify fn.

16:27 gfredericks: "But watch out." he warns and leaves the arcade.

16:27 Frozenlo`: What is happening?! Is this the internet kill switch?

16:28 * Frozenlo` runs everywhere

16:28 * DaReaper5 derps

16:29 xeqi: how are we still talking?

16:29 TimMc: Your local IRC server is running simulations of the other participants.

16:29 beep boop

16:30 gfredericks: does not compute

16:30 emezeske: TimMc: For a second I thought you were the real TimMc. But you gave away your robotness with that beep boop.

16:30 DaReaper5: this explains everything

16:31 hyPiRion: TimMc: If you by good mean obscure, then thanks.

16:31 TimMc: xeqi: When the netsplit is over, your client will use eventual consistency protocols to correct your logs.

16:32 DaReaper5: ok serious question: i still cannot figure out how to return dynamically created files with a clojure web service

16:32 i can do static files

16:32 and do not want to create temp files

16:32 TimMc: It's just output streams and headers.

16:33 DaReaper5: ok ill look more into output streams in clojure

16:33 xeqi: DaReaper5: what do you have so far?

16:33 TimMc: Pick a web lib. Write a thing that does some things when a request comes in. Write the response to the provided output writer/stream.

16:34 Mr_Bond: muhoo: I came across this as well: http://lispm.dyndns.org/ccl

16:35 DaReaper5: xeqi: I have a clojure web service created by someone else that acts as an API to a database. I am giving myself a crash course on how to generate and return reports so i can add this

16:35 functionality to the web service

16:35 duck11231: DaReaper5: This is a pretty good getting started guide for compojure: http://www.booleanknot.com/blog/2012/09/18/routing-in-compojure.html

16:35 xeqi: (inc duck11231)

16:35 lazybot: ⇒ 1

16:36 DaReaper5: just fyi, i am still very new to clojure but am fine with everything else involved (java and client front end stuff)

16:37 thanks duck11231

16:39 TimMc: gfredericks: I can conj onto a list or vector in "swearjure", but I can't figure out how to destructure.

16:40 &(let [existing [1 2 3]] `(~(+) ~@existing))

16:40 lazybot: ⇒ (0 1 2 3)

16:40 gfredericks: TimMc: you don't have any general way to get locals do you?

16:40 just #() args?

16:41 TimMc: Right.

16:41 I can't bind.

16:41 gfredericks: is flat lambda calculus turing-complete?

16:41 TimMc: Flat?

16:41 gfredericks: #() can't be nested

16:41 TimMc: Oh, heh.

16:42 Bronsa: oh, github is being DDoSed

16:42 TimMc: I guess if I can write an interpreter in swearjure then it is.

16:42 AimHere: Who would DDoS github?

16:42 TimMc: Bitbucket? :-P

16:42 xeqi: ah, beat by TimMc

16:43 TimMc: An extortionist, perhaps.

16:43 gfredericks: leave $1000 in the whole in the south tree in the park and we will let your servers go

16:43 xeqi: A company trying to lower th price on an aquihire?

16:43 gfredericks: s/whole/hole/

16:45 xeqi: oooh, someone who really really wants to make sure their project is backed up by constantly creating and pushing to new repos

16:46 Mr_Bond: is that on beanstalk?

16:47 DaReaper5: TimMc thanks again for your help

16:47 hyPiRion: ,(#([`[~@(%(+))~@(%(*))]](+))(#([`[~@%&]](+)) [1 2 3] [4 5 6]))

16:47 clojurebot: [1 2 3 4 5 ...]

16:48 hyPiRion: Ahh, concatenation.

16:48 Bronsa: tfw

16:48 scriptor: ...

16:48 hyPiRion: You can destructure with that TimMc

16:48 thorbjornDX: hyPiRion: what have you done

16:48 TimMc: I'm so proud.

16:49 duck11231: I'm a little scared

16:49 technomancy: great time to remind folks how easy it is to mirror to gitorious

16:50 and use http://p.hagelb.org instead of gist =)

16:50 emezeske: Phagelborg

16:50 That's fun to say

16:50 gfredericks: I almost had to type that out myself

16:51 emezeske: it NEEDs to be a flavor of bagel

16:51 hyPiRion: "You will be assimilated" - hagelborg

16:51 xeqi: I'm not suppose to be using refheap.el for my pastes?

16:52 technomancy: oh I guess

16:52 just saying: fewer moving parts -> less downtime

16:52 though refheap is on heroku, which is awesome

16:52 TimMc: hyPiRion: I'm all ears.

16:54 Raynes: Conj flights are booked.

16:54 o/

16:54 emezeske: \o

16:54 gfredericks: \\\\\o

16:54 dnolen: o/

16:54 TimMc: \o/

16:54 xeqi: /o\

16:54 TimMc: \o/ /o\ \o/ /o\

16:55 ~\o/~ help I'm drowning

16:55 clojurebot: forget ~paste is gist.github.com

16:55 TimMc: clojurebot: Fickle, are you?

16:55 clojurebot: It's greek to me.

16:55 emezeske: \o/ /o/ /o\ \o\

16:55 gfredericks: clojurebot: I forgot that ~paste is gist.github.com

16:55 clojurebot: Ack. Ack.

16:55 technomancy: gfredericks: head asplode

16:56 hyPiRion: So if you want to produce e.g. (fn [[a b] c] (+ a b c)) you can just do ##(#(+(%(+))(%(*))(%(+(*)(*))))(#([`[~@(%(+))~(%(*))]](+))(#([`[~@%&]](+)) [4 7] 9)))

16:56 lazybot: ⇒ 20

16:56 gfredericks: technomancy: you gotta recognize when the bots want to play; to not do so is negligent

16:57 TimMc: hyPiRion: If I give you [0 1 2 3 4] can you give me [1 2 3 4]?

16:57 bhenry: is noir still the preferred way to do web with clojure?

16:58 TimMc: bhenry: It's never been the preferred way -- it's just one way.

16:58 emezeske: bhenry: My suggestion is to use compojure, FWIW. Opinions vary.

16:58 Frozenlock: bhenry: That's what I use, but I think most use compojure directly.

16:58 TimMc: I found it great for getting something simple running very quickly.

16:58 * gfredericks uses a magnetized ring and a steady hand

16:58 hyPiRion: TimMc: Yeah, probably. Let me massage it.

16:59 TimMc: hyPiRion: The best I can figure is a recusive procedure that takes element 1 and recurs to get element 2..n, then prepends.

17:00 How do you tell when it is done recurring?

17:00 ToBeReplaced: bhenry: I had never done web development before, and I found that Noir hid too many things from me and insulated me from decisions I would rather arrive at myself >> instead went with compojure/ring/enlive >> noir is compojure/ring/hiccup with higher-level functions

17:01 TimMc: hyPiRion: Vectors don't support the 2-arity get: ##([1 2] 5 :nope)

17:01 lazybot: clojure.lang.ArityException: Wrong number of args (2) passed to: PersistentVector

17:01 bhenry: maybe i'll just go back to mustache? did anyone find major problems with that library by cgrande?

17:02 ToBeReplaced: i thought it wasn't supported anymore

17:02 cemerick: bhenry: mustache isn't very widely used at all

17:02 bhenry: dag. i liked it better than compojure

17:02 TimMc: hyPiRion: Oh, but ##({[] :empty} [] :not-empty)

17:02 lazybot: ⇒ :empty

17:03 TimMc: Clearly the next step is to write a swearjure assembler.

17:03 ToBeReplaced: i think compojure/ring are pretty solidly established for at least a little while... whether you use noir on top of that is preference

17:03 hyPiRion: TimMc: Surely.

17:03 cemerick: bhenry: FWIW, if you've not looked at compojure in a while, you may find it more to your liking. I remember there was someone else in here that loved mustache, but only vs. ye old-time compojure.

17:03 TimMc: curje

17:04 hyPiRion: TimMc: As a vector or as varargs? ##(#({%`[~@%&]}%) 0 1 2 3 4)

17:04 lazybot: ⇒ [1 2 3 4]

17:04 bhenry: cemerick: that could be. i haven't started a new web project in clojure for some time. i'll look at it again.

17:06 hyPiRion: Hum, it shouldn't be that far for a vector version

17:14 TimMc: hyPiRion: Oh hey, that's right!

17:14 hyPiRion: For some reason I was thinking that %& was all-args, not rest-args. >_<

17:16 Now you just need apply. :-P

17:20 hyPiRion: yeah dangit

17:20 TimMc: which can't be had

17:30 OK, it can be done, but it would be longer than factorial.

17:30 It needs a helper fn and two if clauses.

17:31 And my code's done compiling, so I'll have to do it another time. :-P

17:31 hyPiRion: oh dog.

17:32 Alright, new identity function time

17:32 TimMc: hyPiRion: Basically, take the factorial code and add an initial fn that takes the input and concats [1 []] to the arg list, then passes that on to the real recursive fn.

17:32 hyPiRion: (def identity #(`%%%))

17:33 TimMc: wat

17:33 ToBeReplaced: it seems like there are some contradictions between the Library Coding Standards and the examples in The Joy Of Clojure. Generally, which should I assume is more up to date?

17:34 hyPiRion: TimMc: Bleh, I was kind of hoping one could use some tricks with backquoting.

17:34 TimMc: &('foo 5 5)

17:34 lazybot: ⇒ 5

17:34 TimMc: _nice_

17:34 hyPiRion: (#(identity `%) :foo)

17:34 ,(#(identity `%) :foo)

17:34 clojurebot: p1__27__28__auto__

17:35 ToBeReplaced: examples: TJoC uses (:key collection) to extract an element instead of (collection :key), and the very first example DSL in the book has (:use [clojure.string :as str :only []]) which I would have thought is now meant to be (:require [clojure.string :as str])

17:36 TimMc: ToBeReplaced: The issue of key vs coll as fn is mostly one of intended semantics.

17:37 E.g. if your associative coll could be nil, you'd use the key as the fn for sure.

17:37 gfredericks: ToBeReplaced: and the second point sounds correct

17:37 TimMc: &(:foo nil)

17:37 lazybot: ⇒ nil

17:37 TimMc: If the key is unknown, the associative coll would be used as the fn.

17:37 gfredericks: or if the key isn't a keyword

17:38 ToBeReplaced: i thought in that case you would use (get collection :key)

17:38 gfredericks: also that

17:38 at the very least maps as functions are useful instead of #(get collection %)

17:39 ToBeReplaced: ah, right

17:41 maybe i'll just write down all of the things that come up that are confusing idiomatically as a newcomer and forward it along to the authors

17:42 TimMc: hyPiRion: I know how to stop the recursion!

17:42 ToBeReplaced: or maybe i just gotta get used to people using :use anyway :)

17:43 TimMc: If your input is [0 1 2 3 4] and you have collected [1 2 3 4] as rest, then you can check if (= [0 1 2 3 4] `[0 ~@[1 2 3 4]]).

17:43 aperiodic: wait, symbols are functions?

17:43 this is news to me

17:43 gfredericks: aperiodic: just like keywords

17:44 technomancy: aperiodic: a feature never before invoked on purpose

17:44 TimMc: &(:key 5 6)

17:44 lazybot: ⇒ 6

17:44 hyPiRion: TimMc: Sweet

17:44 gfredericks: aperiodic: it's a secret of clojure which, once you know it, causes you to never again write bad code

17:44 aperiodic: oh sweet

17:45 when would you want to actually use that, if you're not trying to turn clojure into brainfuck?

17:45 technomancy: afaict it's only used for obfuscation purposes

17:45 gfredericks: symbols-as-keys might come up in macros

17:46 Due to a copyright claim by Microsoft this code sample has been obfuscated.

17:47 aperiodic: but you'd need to quote or unquote-quote the symbol in the macro either way

17:47 hyPiRion: It may be used to lookup stuff in a symbol table. (cue bad joke)

17:48 aperiodic: although i guess you might have fully qualified symbols in the collection

17:48 emezeske: ~badum

17:48 clojurebot: Huh?

17:48 gfredericks: hyPiRion: a symbol, a keyword, and a string walk into a bar

17:48 emezeske: ~rimshot

17:48 clojurebot: Badum, *tish*

17:49 gfredericks: I think it's totally conceivable for a complicated macro to have a map from plain symbols to some kind of values, and to want to look up symbols in that map

17:50 hyPiRion: gfredericks: The string isn't IFn though.

17:50 gfredericks: hyPiRion: that's the punchline!

17:50 now to figure out the middle of the joke...

17:51 hyPiRion: heh, well, the keyword is the only one to guaranteed have a colon.

17:51 gfredericks: ,(keyword ":://")

17:51 clojurebot: ::://

17:52 hyPiRion: or multiple.

17:53 gfredericks: Three stringoids walked into a bar. Two fell out. Who was left?

17:54 aperiodic: i don't know, gfredericks. who?

17:54 amalloy: gfredericks: even if a macro does have a map from symbols to something, it's likely to be more natural to use the map as a function than the symbol

17:55 eg, `(do ~@(map sym->value symbols))

17:55 gfredericks: aperiodic: one of them!

17:56 hiredman: I like to tell jokes that ask the question "..., what's left?" and then tell people "no, that way" and point left after they try and guess

17:57 * gfredericks notes that

17:57 aperiodic: gfredericks: you like telling shaggy dog stories, don't you?

17:57 * gfredericks googles that

17:59 gfredericks: aperiodic: I couldn't orally perform such a thing; my straight faces have a halflife of ~5sec

17:59 aperiodic: that's probably a good thing

18:00 i once very nearly got thrown off of a moving bus for telling a half-hour-long version of the "you're not a monk" joke

18:00 TimMc: heh

18:01 * mattmoss googles, "You're not a monk."

18:03 Pip: Is Clojure cool shit?

18:03 TimMc: Very cool shit.

18:03 But not the coolest.

18:04 I don't know, what are you trying to ask?

18:04 thmzlt: Pip: clojure is just legacy bullshit (https://twitter.com/ryah/status/258634435161899009)

18:05 TimMc: aperiodic: I once heard a 20-30 minute shaggy dog story (something to do with a monestary, so maybe the same one?) and the "performer" kept noting digressions that he *wouldn't* make.

18:05 It was pretty impressive.

18:05 gfredericks: (->> shit (sort-by coolness) (take 3))

18:05 Pip: lol

18:05 That's really impressive

18:05 aperiodic: TimMc: yeah, it sounds like the same one

18:05 technomancy: yeah you really need to get on a real non-legacy language like C++

18:06 everything else just keeps confusing everyone

18:06 emezeske: Is this ryah guy a troll?

18:07 hiredman: yes

18:07 technomancy: obvs

18:07 aperiodic: TimMc: i'm impressed; 30 minutes or so is the longest i've been able to stretch that

18:07 TimMc: It might have only been 15 minutes, for all I know -- it *felt* like 30. :-P

18:07 technomancy: emezeske: so much so that it's actually kind of impressive

18:08 emezeske: technomancy: :)

18:09 thmzlt: technomancy: touche

18:10 dnolen: emezeske: normally wouldn't get any attention but he's the creator of Node.js

18:10 technomancy: dnolen: https://mobile.twitter.com/robey/status/258676358086029312 =)

18:10 emezeske: dnolen: Ahhh, I thought that name sounded familiar

18:14 thmzlt: too bad I blocked HN here, would love to see what kind of discussion is going on there today

18:15 emezeske: thmzlt: None, AFAICT.

18:15 technomancy: you can catch up at http://shitryandahlsays.tumblr.com/

18:15 I think this is below even the standards of HN

18:16 emezeske: technomancy: Even below proggit's radar.

18:16 Impressive

18:16 scriptor: oh cool, clojure needs to be euthanized

18:16 at least that'll be quick and painless

18:18 * emezeske puts Clojure in a shoebox and points his 30 ought 6 at it.

18:18 amalloy: it's aught, isn't it?

18:19 emezeske: Can't say I've ever typed it out before :) aught looks better.

18:19 hiredman: ~google aught

18:19 ToBeReplaced: wow, that guy's awesome... great tumblr

18:19 clojurebot: First, out of 199000 results is:

18:19 Aught - Definition and More from the Free Merriam-Webster Dictionary

18:19 http://www.merriam-webster.com/dictionary/aught

18:20 hiredman: ~google ought

18:20 clojurebot: First, out of 8420000 results is:

18:20 Ought - Definition and More from the Free Merriam-Webster Dictionary

18:20 http://www.merriam-webster.com/dictionary/ought

18:21 hiredman: oh, I see, they are both words, that through be off for a second, I assumed aught being correct (in this case) would have more hits

18:21 emezeske: It sounds like "aught" is a bastardization of "naught"

18:21 Which makes sense, as "naught" means nothing (zero)

18:21 aperiodic: aught prounoun 1) anything 2) all, everything; noun 1) zero 2) nothing

18:21 i <3 english

18:21 emezeske: Although "nought" is apparently a valid variant of "naught"

18:21 hiredman: http://i.imgur.com/OfN6N.jpg

18:22 aperiodic: ^ truth

18:22 emezeske: hiredman: hahahaha

18:22 aperiodic: that's why it's so much fun

18:57 callen: a brief thought, was wondering how other people felt: the emphasis on functions like partition, particular in things like 4clj and clojure-koans feels a bit contrived and cutesy. What do you think?

19:00 dnolen: callen: perhaps, but partition is pretty useful when writing macros that involving the binding forms.

19:00 emezeske: callen: A bit contrived? Things like 4clj and clojure-koans are completely contrived, that's the point.

19:00 callen: If you want non-contrived, give yourself a project and build it.

19:01 technomancy: non-contrived exercises don't scale

19:01 actually "non-contrived exercise" is probably self-contradictory

19:01 emezeske: technomancy: Exactly

19:03 TimMc: callen: OK, we can write some nice little exercises involving JDBC or shelling out.

19:43 doomlord: the return value of a map is a lazy sequence? i'm trying to concatenate the results of maps on vectors. the return value prints as (a b)(c d)(e f) ... it doesn't seem to let me concat to get (a b c d e f) wheras concat does work on [a b][c d][e f]. Whats the solution?

19:43 do i need to turn the result of the map into an actual vector first or something

19:43 emezeske: doomlord: Maybe use mapcat?

19:44 ,(mapcat (fn [x] [x x]) [1 2 3 4])

19:44 clojurebot: (1 1 2 2 3 ...)

19:44 doomlord: didn't know that existed. looks like what i want. I'm surprised its a special case ; is there another way to do this from primatives

19:44 gfredericks: doomlord: almost certainly your issue is not about the difference between vectors and seqs

19:44 emezeske: ,(apply concat (map (fn [x] [x x]) [1 2 3 4]))

19:44 clojurebot: (1 1 2 2 3 ...)

19:45 doomlord: mapcat works ; but i'd like to know what went wrong before

19:45 emezeske: see above ^

19:45 mapcat is not really a special case, it's just a convenience function because that's so common

19:45 I'm guessing you left off the apply before?

19:46 doomlord: ok apply works too. yes i left of the apply. why is the apply needed

19:46 gfredericks: concat is variadic

19:47 doomlord: (i knew of "apply" from common-lisp being apply a function to an arg array)

19:47 gfredericks: same thing, it sounds like

19:47 doomlord: ok silly me i see it now.

19:47 emezeske: ,(concat [1 2] [3 4] [5 6])

19:47 clojurebot: (1 2 3 4 5 ...)

19:48 emezeske: ,(apply concat [[1 2] [3 4] [5 6]])

19:48 clojurebot: (1 2 3 4 5 ...)

19:48 doomlord: i was doing (concat [ other lists]). idiot.

19:48 gfredericks: a side effect is that concat with one arg does nothing, which is confusing

19:48 emezeske: doomlord: Not idiot! Just learning.

19:49 doomlord: the repl is an awesome tool for breaking down what the expressions do, i should have been able to figure that out :)

19:54 callen: TimMc: JDBC? Who do you think I am, Mark Pilgrim?

19:56 my deeper point is that using things like partition isn't the hard part, although knowing the idioms is useful.

20:01 amalloy: if 4clojure could effectively teach whatever you think is "the hard part" of programming, we'd have venture capital by now

20:03 emezeske: amalloy: Please make 4clojure download a decade of experience into my brain, matrix style.

20:03 "I know computer science."

20:04 * aperiodic wonders what follows "Show me."

20:04 doomlord: foreclosure ?!

20:04 TimMc: doomlord: No, 4clojure!

20:04 doomlord: :)

20:05 "i know economic collapse"

20:05 TimMc: haha

20:05 callen: Are you envisioning purely algorithmic stuff?

20:06 emezeske: aperiodic: After "Show me," I prove that there is no halting problem after all, and compress something below the threshold of its Kolgomorov complexity.

20:06 aperiodic: as Math crumbles around you like so many cathode-green glyphs

20:07 emezeske: :)

20:07 aperiodic: i'd watch that movie

20:07 TimMc: What if I told you...

20:08 ...that you can parse XML with one regular expression?

20:10 emezeske: *irregular expression

20:16 TimMc: (I *have* used a regular expression to parse HTML, but I also had a stack, so it was OK.)

20:19 Raynes: I once parsed a regular expression with a regular expression.

20:20 TimMc: Is that...

20:20 No, you can't. OK.

20:21 Whoa! I think this is right: Regular expressions are a context-free language at minimum, and CFGs are regular at minimum.

20:21 ivan: too often I've replaced >< with >\n< and used a state machine to pull something out

20:21 maybe because I was working in a language with a vulnerable XML parser

20:24 aperiodic: TimMc: doesn't the second statement follow from the equivalences between regular langs & DFAs and CFGs & stack machines (which are just DFAs with memory)?

20:24 ohpauleez: By the code of the internet we must tell the obligatory RE joke:

20:25 You have a problem and you think, "I'll solve this with a regular expression." Now you have two problems.

20:25 gfredericks: aperiodic: those things aren't equivalent

20:25 (RE == DFA) != (CFG == SM)

20:25 or maybe you meant that

20:26 now that I distinguish 'and' and '&'

20:26 aperiodic: yeah, two pairs of equivalances

20:29 amalloy: i don't think i understand TimMc's "whoa" at all. though i'm totally in favor of his "what if i told you"

20:30 aperiodic: amalloy: i think TimMC is positing that anything that can describe a regular language in the way regular expressions do (what does that mean?) is necessarily a CFG

20:30 TimMc: aperiodic: RE's are a way of describing regular languages, but I am claiming the *set of RE's* is non-regular, and is in fact context-free.

20:30 Nope, not saying anything about the relationship between regular langs and context-free langs.

20:30 gfredericks: are non-balanced parens legal?

20:31 aperiodic: oh, ok

20:31 gfredericks: ,#"(6"

20:31 clojurebot: #<ExecutionException java.util.concurrent.ExecutionException: java.lang.RuntimeException: java.lang.ExceptionInInitializerError>

20:31 gfredericks: &#"(6"

20:31 lazybot: java.util.regex.PatternSyntaxException: Unclosed group near index 2(6 ^

20:31 TimMc: ,#"\Q(\E"

20:31 * ivan tries to locate where Java's XML parser does some actual parsing

20:31 clojurebot: #"\Q(\E"

20:31 TimMc: *10 days later*

20:31 gfredericks: TimMc: is there anything else non-regular aside from the parens?

20:32 TimMc: gfredericks: Not that I'm aware of.

20:32 gfredericks: of course programming language regular expressions do not describe only regular languages

20:32 amalloy: TimMc: to be clear: you're saying that to recognize whether something is a valid regex, you need a context-free grammar?

20:33 TimMc: amalloy: Yes.

20:33 gfredericks: that's been my assumption too

20:33 TimMc: Recognizing ((((())))) requires a stack.

20:33 amalloy: i wouldn't be astonished to discover you need a context-sensitive grammer

20:34 gfredericks: &#"()\4"

20:34 lazybot: ⇒ #"()\4"

20:34 gfredericks: ^ is that a back-reference?

20:34 TimMc: I can never remember what each re parser uses for back references.

20:34 clojurebot: That's not my job.

20:34 TimMc: Mine neither.

20:35 gfredericks: in any case it's the back-references that allow the regexes to describe non-regular languages

20:35 amalloy: &(re-seq #"(a)\4" "aba\\4")

20:35 lazybot: ⇒ nil

20:35 amalloy: &(re-seq #"(a)\1" "aa\\4")

20:35 lazybot: ⇒ (["aa" "a"])

20:36 gfredericks: so java at least allows out-of-bounds backrefs

20:36 amalloy: i think #"(a)\4" is a regex recognizing nothing, because the \4 backref can't ever be matched

20:44 TimMc: amalloy: I never learned CSGs. :-/

20:45 Anyway, CFGs would be fine for REs.

20:51 Hodapp: damn, why do I always code myself into corners where I run into problems like "Well, this is easily solved if I just MAKE A MAP REFER TO ITSELF RECURSIVELY!"?

20:55 emezeske: Hodapp: Because cyclic graphs are useful? :)

20:58 Hodapp: emezeske: Out of curiosity, can I make a map refer to itself sanely?

20:59 emezeske: An immutable map technically can't have a reference (i.e. a pointer) to itself

20:59 But...

20:59 It could contain a sort of path to a submap

20:59 e.g. {:a {:b {:c [:a :b]}}

20:59 gfredericks: maps of refs of maps of refs of maps of atoms of futures to themselves!

21:00 TimMc: emezeske: Unless you're in Haskell.

21:00 Hodapp: since I know Clojure allows lazy sequences, but lazy maps are another matter I suppose

21:00 * gfredericks realizes a future could return itself

21:00 emezeske: TimMc: Is that so?

21:00 TimMc: I think so.

21:00 gfredericks: Hodapp: https://github.com/fredericksgary/lazy-map

21:00 TimMc: some kind of delayed binding

21:00 emezeske: TimMc: I guess if you know where the map will be before you create it?

21:00 Ah

21:01 TimMc: http://www.haskell.org/haskellwiki/Tying_the_Knot

21:01 emezeske: TimMc: Thanks, looks like a neat read!

21:01 TimMc: And I believe there are some Schemes wherein a future/promise/delay/what-have-you is actually replaced by its referent when realized.

21:02 Hodapp: the situation I've found myself in is that I'm trying to make an API that mimics what is available in CF3 (Context Free version 3), in which you have definitions like "blah { ... }" which include instantiations of other definitions, and it's normal for a definition to refer to itself recursively

21:02 gfredericks: &(let [p (promise) coll (lazy-seq [@p]), m {:selfs coll}] (deliver p m) m)

21:02 lazybot: java.lang.StackOverflowError

21:02 hiredman: I wlll trot out letfn-

21:03 Hodapp: hiredman: to me?

21:03 hiredman: https://gist.github.com/1179073

21:04 Hodapp: in other words, CF3 lets you express a scene graph that can be, er, recursive.

21:04 and rendering simply bails out when things become too small

21:05 or your computer catches on fire.

21:11 amalloy: hiredman: i can't tell, is letfn- just a clojure-side implementation of letfn, so that it wouldn't have to be a compiler special?

21:11 TimMc: &(let [p (promise) s (lazy-seq (cons @p nil))] (deliver p s) (identical? s (first s)))

21:11 lazybot: ⇒ true

21:12 hiredman: amalloy: yes

21:12 TimMc: Oh hah, I ended up with the same solution.

21:12 hiredman: all immutable like

21:19 nightfly_: If I use clojail to blacklist clojure.java.shell/sh does that mean any function that is called within the sandbox that contains calls to clojure.java.shell/sh will also fail?

21:20 TimMc: I don't believe so. Raynes?

21:21 Raynes: nightfly_: No. We can't look inside of functions like that. It will block any macros that call it though, since they can be expanded.

21:21 xeqi: nightfly_: no, it just prevents forms with that

21:22 nightfly_: Raynes: Cool, thank you

21:22 Raynes: You could, theoretically, write a tester function that looks up the source and looks for it now that I think about it. That'd be pretty slow though, since you'd have to run that source code through the sandbox too.

21:23 cemerick: Raynes: can't you hook the blacklisted var to throw when it's called?

21:23 Raynes: That is an option to.

21:23 too*

21:23 It still isn't great though.

21:23 cemerick: sounds like a future feature

21:24 Raynes: I don't think I'd do it. It's too unreliable.

21:24 A function might refer to the actual function and not the var.

21:24 quidnunc: Are Ubuntu packages sufficiently current?

21:24 Raynes: It'd be easy enough to break, seems like.

21:24 You'll want leiningen and not any 'clojure' packages.

21:25 I'd suggest not using Ubuntu packages for anything Clojure related though.

21:25 TimMc: quidnunc: And don't get leiningen via APT.

21:25 cemerick: Raynes: as long as the blacklist was "applied" prior to the untrusted code being loaded, that shouldn't matter

21:26 Raynes: cemerick: Fair enough. It'd be a nice feature. It'd have to be optional though, because clojail sandboxes aren't meant to be destructive by default.

21:26 xeqi: it'd be inconsistent with blacklisting namespaces or java calls

21:26 quidnunc: leiningen.org since no one else plugged it

21:38 Sgeo: antares... isn't here

21:38 darnit

21:56 ivan: ,(persistent! (let [x (transient {})] (conj! x [1 (persistent! x)])))

21:56 clojurebot: #<RuntimeException java.lang.RuntimeException: java.lang.IllegalAccessError: Transient used after persistent! call>

21:59 S11001001: ivan: cheeky but ultimately futile attempt to tie a knot

22:00 ivan: gotta exploit CLJ-893 for that nonsense

22:01 ivan: hah, neat

22:08 gfredericks: S11001001: lazy-seq + promise

22:09 ivan: &(let [a (to-array [nil]), v (vec a)] (do (aset a 0 v) (v 0)))

22:09 lazybot: java.lang.StackOverflowError

22:10 gfredericks: yes you can also do it with mutable data structures

22:10 &(let [a (to-array [nil])] (aset a 0 a) a)

22:10 lazybot: ⇒ #<Object[] [Ljava.lang.Object;@4d031d>

22:10 S11001001: gfredericks: that's patently mutating an immutable data structure

22:11 gfredericks: S11001001: lazy-seq and promise is?

22:11 S11001001: gfredericks: no, the 893 method

22:11 gfredericks: oh okay

22:11 S11001001: gfredericks: but sure, use mutables in documented ways and you get knots

22:11 gfredericks: not so much mutable as lazy

22:12 it's like half-mutable

22:12 ivan: I was kind of hoping immutables were actually immutable

22:12 S11001001: ivan: me too

22:12 TimMc: gfredericks: mutate-once

22:12 S11001001: mutable/immutable is a dichotomy

22:12 TimMc: mutate-before-read

22:12 gfredericks: TimMc: that still sort of implies it had two different values

22:13 S11001001: I claim lazy-seqs do not obviously fall on either side, intuitively. So to make it a dichotomy you'll have to contrive some definition.

22:13 callen: TimMc: far from it @ envisioning purely algorithmic stuff

22:13 TimMc: more like, "how do I cope with the fact that I am surrounded on all sides by terrible Java libraries?"

22:13 ivan: you can blow up just about anything with the recursive vector constructed above

22:19 if someone really likes the current behavior maybe it could be hidden behind an *unsafe-alias* true binding

22:21 (do Java arrays have some internal version number?)

22:21 eh, who am I kidding, there's no way

22:22 gfredericks: what would that be used for?

22:22 ivan: throwing an exception if it's mutated and you didn't expect it to be mutated

22:23 gfredericks: but this is java. not expecting your array to be mutated is like not expecting your program to be run.

22:23 ivan: right :)

22:23 gfredericks: ....and that would be pretty bad for perf

22:23 Hodapp: gfredericks: If you get away without having your program run at all, I'd say that's a fairly substantial optimization

22:24 Khaoz: Hi all.

22:24 TimMc: gfredericks: Maybe you could use it to detect if your array *hasn't* been mutated recently, and throw in that case.

22:24 Clearly, something must be wrong, right?

22:24 gfredericks: lol

22:24 ivan: Warning: code has no side effects

22:25 TimMc: cons¡

22:26 Khaoz: I'm trying to setup nrelp on my emacs, but without success

22:26 i have lein 2 installed using brew and it's under /usr/local/bin

22:26 aperiodic: TimMc: lol!

22:26 Khaoz: i also have this in my init.el: (add-to-list 'exec-path "/usr/local/bin")

22:26 TimMc: aperiodic: A destructive lol.

22:27 Khaoz: and also tried to setup nrepl-lein-command to the full path of lein (/usr/local/bin/lein)

22:27 but ... error in process sentinel: Could not start nREPL server: /bin/bash: lein: command not found

22:27 :(

22:28 technomancy: Khaoz: there are other ways to fix the path fiasco on OS X

22:28 I think maybe the clojure-mode doc/ directory covers that?

22:28 Khaoz: humm

22:29 technomancy: thank. I will take a look

22:30 Emacs Setup on OS X - todo

22:31 technomancy: supposedly the "proper" fix involves editing plist xml files

22:31 so even if I knew the answer I couldn't tell you it with a clean conscience

22:32 Khaoz: no problem

22:33 callen: Khaoz: I've used nrepl quite a bit on my mac.

22:33 Khaoz: and I have a rather elaborate emacs setup that I use between Linux and Macs regularly.

22:33 Khaoz: can I help?

22:33 Khaoz: but did you installed it using homebrew ?

22:33 callen: did I installed what?

22:33 Khaoz: lein

22:33 callen: there are like, 10 possible components you could be talking about here.

22:33 why the hell would you do that?

22:33 don't do that.

22:33 Khaoz: humm

22:34 it's a good start

22:34 callen: technomancy went to the trouble of making a nice magical script.

22:34 go use that.

22:34 Khaoz: i have everything installed using homebrew

22:34 clojure, lein..

22:34 technomancy: I would say use whatever's consistent with the rest of your system, except homebrew is kind of clown shoes

22:35 callen: Khaoz: stop using homebrew for stuff like that, it's not like apt or yum.

22:35 technomancy: definitely don't need to bother installing clojure

22:35 callen: Khaoz: reserve it for libraries and random odds and ends.

22:35 Khaoz: and like technomancy said...if you're using lein, you don't gotta install clojure.

22:35 technomancy: OTOH installing stuff by hand is kind of skooky

22:35 callen: lein just treats "clojure the language" as yet another jar. because it is.

22:35 technomancy: okay, I gotta know. skooky?

22:35 technomancy: but in this case it's probably the lesser of two evils

22:35 callen: it's not really a big deal.

22:35 technomancy: callen: sketchy; wacky; silly

22:36 callen: fair.

22:36 cemerick: lol @ clown shoes

22:36 callen: it really is clown shoes though.

22:36 technomancy: every time I have to install something by hand for a reason other than "the version in apt/nix isn't new enough" I feel like a Windows user

22:36 callen: to install clojure on my mac, I just make certain the java install is sane, install my emacs environment, then install lein.

22:36 Everything from there is managed by lein.

22:36 Khaoz: install things by hand is not a issue for someone that have used slackware for 4 years :)

22:36 cemerick: package management doesn't exist on the mac, period.

22:36 technomancy: cemerick: but but but... macports =D

22:36 Khaoz: i will review what i have made and try another method

22:36 cemerick: ~guards

22:36 clojurebot: SEIZE HIM!

22:37 technomancy: clojurebot: macports?

22:37 clojurebot: Huh?

22:37 callen: technomancy: macports is even worse.

22:37 technomancy: clojurebot: macports is not a package manager, it's a satire about package management.

22:37 clojurebot: Ack. Ack.

22:37 callen: fink is worse still.

22:37 lol ^^

22:37 cemerick: oh gawd fink

22:37 technomancy: hahaha

22:37 callen: Khaoz: get your emacs sane, check your java install, then just install lein as the plain vanilla script.

22:37 technomancy: cemerick: supposedly you can get nix working on OS X

22:37 callen: Khaoz: then just go from there.

22:37 cemerick: I was all about fink for about 3 weeks

22:37 nix?

22:37 callen: Khaoz: stop futzing around with homebrew for things its awful at.

22:37 clojurebot: nix is a purely functional package manager exhibiting many similar characteristics to Clojure's persistent data structures or git commit trees: http://nixos.org/nix/

22:38 callen: gotta say. Not a fan.

22:38 cemerick: oh, whatever

22:38 Khaoz: callen: ok. Thanks! :)

22:38 xeqi: leiningen isn't in the mac app store?

22:38 callen: ...

22:38 xeqi: missing out on an oppertunity there

22:38 callen: technomancy: start charging $4.99 for leiningen on the app store.

22:38 technomancy: you'll make...hundreds.

22:38 * callen laughs himself to death

22:39 cemerick: I'll bet cygwin has a better package manager than bew.

22:39 brew*

22:39 quidnunc: packaging has become mental again.

22:39 callen: cemerick: it does, they at least have the benefit of binaries.

22:39 quidnunc: After a few years of sanity

22:39 technomancy: callen: would that even be legal?

22:39 I kind of hope not

22:39 callen: technomancy: doesn't it belong to you?

22:40 technomancy: leiningen that is.

22:40 xeqi: just parts of it

22:40 cemerick: It's all EPL; anyone could package it up and sell it.

22:40 callen: oh wow, time to go make some beer money

22:40 cemerick: Except, it requires the JVM, so the app store is out anyway.

22:40 * callen grabs his macbook and fires up XCode.

22:40 callen: cemerick: nah you could wrap it up in a GUI.

22:41 aperiodic: hot on the mac app store: leiningen wizard

22:41 cemerick: That downloads and exec's the JVM? Probably not.

22:41 Hodapp: Cygwin's package manager appears to basically be "run the installer again and add packages"

22:41 callen: cemerick: is that a bet?

22:41 technomancy: will you get offended if I start selling a GUI wizard to leiningen for $4.99?

22:41 just to make cemerick mad.

22:41 cemerick: hardly :-P Just what I remember of the app store policy w.r.t. the JVM

22:42 callen: Mac App Store is looser than iOS App Store.

22:42 cemerick: *shrug*

22:42 callen: tons of non-cocoa+obj-c stuff on there.

22:42 tali713: callen: that sounds like a great idea.

22:42 doomlord: are there converters to compile jvm code -> native

22:42 (some subset of )

22:42 callen: tali713: what? the graphical leiningen wizard?

22:43 tali713: yes.

22:43 cemerick: Hodapp: you can't run apt or something with a different set up cygwin-only repos?

22:43 callen: tali713: you really don't want to encourage my craziness.

22:43 Hodapp: doomlord: Yes.

22:43 tali713: I enjoy good jokes made into tools.

22:43 callen: I enjoy tools that make good jokes.

22:45 Hodapp: doomlord: Look up NestedVM.

22:45 cemerick: Apropos of nothing, I predict seeing more Surface Pros at confs in 2013 than laptops running linux.

22:46 callen: cemerick: wat.

22:46 cemerick: callen: heard it here first. :-P

22:46 aperiodic: it seems like that would be heavily dependent on which conferences exactly you mean

22:47 callen: everybody forgets the incorrect predictions...

22:47 cemerick: eh, the ones I care about. :-) Strange Loop, Conj, etc.

22:47 callen: no need to buy a surface, the laptop was perfected long ago thanks to the Thinkpad.

22:47 tali713: i don't, but i should keep a journal for better verification.

22:49 aperiodic: huh. seems bold, then. but maybe i'm just skewed because i've only been to one conference, and hardly saw technomancy away from his laptop the entire time

22:49 technomancy: callen: the app store is an offence to all that is good about computing

22:49 it would grieve me deeply to see my code on it

22:50 callen: technomancy: I feel similarly. I'm sorry for even evoking such agony.

22:50 tali713: technomancy: what about a gui that just uses exec to run lein?

22:50 cemerick: Hasn't Ubuntu already rebranded its apt GUI as an "app store"?

22:50 technomancy: callen: most of my non-clojure code is copylefted in such a way as to prevent that

22:50 callen: technomancy: did you know I use leiningen as the "good child" when larting other people over the head for their package/project management tools?

22:51 technomancy: EPL is still copylefted, but I'm not sure it's enough to prevent that kind of abuse

22:51 callen: haha; nice

22:51 tali713: well I have no idea as to its legality, but it would still bum me out

22:52 callen: technomancy: most recent example was in a github issue I filed with cabal. Their shit broke for the 4000th time and I did a compare/contrast with what it was like to solve a similar problem in a project.clj

22:52 tali713: technomancy: oh, well, I was more curious than anything. I pretty much loathe the appstore.

22:52 callen: technomancy: for people who are obsessed with reliability/stuff-not-breaking, the haskell community has an incredibly unreliable package manager.

22:52 technomancy: cemerick: yeah, that's a big part of why I've moved away from ubuntu. the labeling on the installer tricked me into installing flash.

22:53 cemerick: it's all "do you want other packages that may have distribution issues, such as mp3 codecs?" and I'm like "yes, screw US patent law"

22:53 quidnunc: technomancy: What do you use now?

22:53 technomancy: and I was in for a nasty shock

22:53 quidnunc: debian stable plus nix

22:53 quidnunc: technomancy: Why stable?

22:53 callen: technomancy: you definitely don't do web dev if you don't want flash :P

22:53 technomancy: quidnunc: because it never ever breaks

22:53 callen: thank goodness =)

22:54 quidnunc: and because nix gets me everything I need that's newer and not in stable

22:54 callen: technomancy: not that proper web devs *use* flash for anything serious, but you still have to be running it.

22:54 technomancy: and nix never ever breaks either, but for a different reason

22:54 callen: last time I used flash was for a websockets fallback.

22:54 cemerick: I don't think I've deployed an flv for ~4 years

22:54 technomancy: at least it never breaks in a nontrivial way

22:55 quidnunc: Was nix written by the guy who wrote ion? I remember he proposed this type of package manager many years ago

22:55 Hodapp: what is nix?

22:55 quidnunc: http://nixos.org/nix/

22:55 callen: nix?

22:55 clojurebot: nix is a purely functional package manager exhibiting many similar characteristics to Clojure's persistent data structures or git commit trees: http://nixos.org/nix/

22:55 callen: Hodapp: ^^

22:56 technomancy: nix is amazing

22:56 the papers they have on it are pretty accessible too

22:56 immutable package installation <3

22:57 callen: the weird package management/linux distro I was excited about was GoboLinux

22:57 I was so sad it didn't take off :(

22:58 quidnunc: Only 2500 packages :(

22:58 xeqi: technomancy: have you tried nixOS?

22:58 callen: you people ask strange questions.

23:00 technomancy: xeqi: haven't taken the plunge yet; I get the feeling it doesn't have critical mass yet

23:01 the millions of man-hours poured into Debian stable really count for something, and for stuff like hardware compatibility I don't think the immutable approach helps all that much; for that problem you just need a huge amount of effort put into finding all the edge cases.

23:03 callen: so, serious question. Who's thickey?

23:03 TimMc: Rich's brother, I believe.

23:04 callen: I'm incapable of seeing "*hickey*" without thinking of our glorious leader.

23:04 TimMc: Tom.

23:04 callen: oh lord, I was half-kidding.

23:04 so he's a programmer too?

23:04 TimMc: I think so.

23:04 ISTR he wrote some Clojure library...

23:05 callen: TimMc: http://tomhickey.com/ ?

23:05 technomancy: the enclojure logo is really great

23:05 callen: this twitter picture is hilarious.

23:07 TimMc: well, guessing from his twitter, Rich's brother is quite the character.

23:08 Khaoz: Well.. good night guys.

23:09 thanks for the help. I will continue tomorrow :)

23:11 jodaro: so

23:12 is clojurescript one still the best place to start for a not really front end web guy?

23:13 i've been noir'ing but i figured i should see what all the kids are doing

23:14 callen: jodaro: clojurescript is a tower of abstraction you don't want to get into unless you already understand frontend.

23:14 jodaro: stick with plain DOM + jQuery until you feel comfortable, then add a layer.

23:15 jodaro: callen: cool, sounds like a good idea

23:15 i'm putting together a pretty basic app for a friends company

23:16 technomancy: is clojurescript one still maintained?

23:17 I got the impression it was pretty wonky from a tooling perspective

23:18 callen: hasn't been touched in 9 months.

23:18 I really think a single-language stack built on cljs for a web app is for people who are going to be comfortable unraveling the rest when it inevitably breaks.

23:19 so many great clojure presentations, yet they're all on InfoQ

23:20 I...really hate infoQ.

23:20 technomancy: wait a second, how do you watch Hickey's talks if you don't use flash?

23:21 jodaro: yeah, i started to watch the clojurescript one video and started to get a little lost

23:22 and then noticed it hasn't been committed upon for a while

23:22 so was just wondering if there was a latest and greatest

23:22 but

23:22 callen: jodaro: just don't.

23:22 jodaro: i'll just stick with noir+hiccup+twitter bootstrap

23:22 which is what i've started with

23:22 callen: ...close enough.

23:23 I'd skip the bootstrap unless you need something tolerably attractive ASAP

23:23 if your goal is to learn.

23:23 jodaro: i want it to be reasonably attractive, yeah

23:23 technomancy: callen: view source, occasionally preceded by M-x user-agent android

23:23 jodaro: because its an internal tool for non technical types

23:23 but it doesn't have to do much

23:24 * technomancy digs http://getskeleton.com

23:24 technomancy: a lot easier to work with than bootstrap if you don't know what you're doing

23:24 for me anyway

23:24 jodaro: cool, i'll look at that too

23:24 callen: jodaro: internal tools are the best use-case for bootstrap, but just keep in mind that overriding bootstrap's somewhat idiosyncratic behavior can turn into more work than it saves you.

23:24 jodaro: bootstrap seems to be working for me so far

23:24 i don't think i'm going to use a ton of features

23:24 callen: my frontend guy at my company has been flipping his wig over ripping bootstrap out for awhile now.

23:25 technomancy: yeah, I felt like I was fighting it every step of the way

23:25 callen: technomancy: that works on InfoQ?

23:25 technomancy: setting your user-agent to android?

23:25 technomancy: callen: yeah

23:25 one of the sites you have to grab it from the rss; I forget which

23:26 TimMc: hyPiRion: I've got a working skeleton for "rest" in curje.

23:26 * callen curses loudly

23:26 TimMc: hyPiRion: https://gist.github.com/gists/3916042

23:26 callen: if only I'd known! :(

23:26 technomancy: I think one of the talks he gave at an oracle conf. isn't available for download, but the rest are easy

23:27 callen: technomancy: it says a lot that the state of "usability" for talks is so poor that you have to fight it to get at the content.

23:28 how much trouble would I get in if I started just ripping and transcribing all of hickey's talks and putting them on a site?

23:28 (I can't do audio, need text)

23:28 technomancy: callen: well, just follow the money

23:28 getting a good AV setup doesn't come for free

23:28 and it doesn't happen out of the goodness of their hearts

23:29 callen: so am I liable to get sued in htis hypothetical scenario?

23:30 jodaro: hypothetical federal prison

23:31 callen: wat.

23:31 it's content that's freely accessible on the web, when did scraping become illegal?

23:31 aperiodic: callen: well, what's the usual answer to "what happens if I try to distribute copyrighted content for free in the United States"?

23:31 callen: it's freely accessible.

23:31 just difficult to access.

23:32 aperiodic: doesn't matter

23:32 callen: well, guess I better host the servers in somalia.

23:32 aperiodic: it's still copyrighted, and they can still choose to exercise their copyright through a variety of legal avenues

23:33 technomancy: aperiodic: well, the video is copyrighted

23:33 callen: I expressly do not want the video.

23:33 Despise the video/audio.

23:33 Synchronous communication is slavery.

23:33 technomancy: I think the derivative work status of the words it contains is debatable

23:33 aperiodic: oh, sorry, missed the transcription bit

23:33 technomancy: probably depends on the wording of the release form he signed

23:34 infoq sends "please don't do that" notices to blogs that explain how to do the user-agent/view-source download trick

23:34 they don't seem overly hostile, but they do pay attention

23:35 quidnunc: callen: Hosting servers abroad didn't seem to work for Kim Dotcom

23:36 callen: No comment.

23:37 hiredman: infoq is great

23:37 tons of content for free

23:38 callen: hiredman: I'm going to find it hard to take your word for it if you tell me a library is great in future :(

23:38 ChongLi: doesn't the ADA require video be accessible to the deaf and hard of hearing?

23:38 callen: that's my issue, I need text/image only.

23:38 ChongLi: I wonder if that'd put a wrinkle into the copyright issue

23:40 technomancy: doesn't apply broadly commercially

23:40 TimMc: Right, there could be a fair use defense.

23:40 Maybe.

23:41 callen: reproductions of copyrighted content intended to enable accessibility by groups covered under the ADA are exempted from copyright liability/crime

23:41 17 USC 121

23:41 Section 1201 DMCA exception

23:42 Video Accessibility Act 2010

23:42 seems good enough to me.

23:42 90% odds they rip my genitals off, but say sorry afterwards.

23:43 aperiodic: suddenly, the number of deaf/hard-of-hearing clojurians skyrockets

23:43 callen: aperiodic: makes sense to me, why else all the def and defn'd people?

23:43 * callen chortles his way to his watery grave

23:43 TimMc: urgh

23:44 aperiodic: that was awful

23:44 (inc callen)

23:44 lazybot: ⇒ 2

23:44 callen: aperiodic: thank you, I take great pride in that. You should try sharing an office with me.

23:45 aperiodic: there are few things better in life than truly awful puns

23:50 callen: What is good in life? To defeat your enemies and drive them before you, to hear the groans of their women at your bad jokes?

23:50 s/\?/\!/g

23:59 TimMc: gfredericks, hyPiRion: Yay, I made 'rest in swearjure! https://gist.github.com/3916042

Logging service provided by n01se.net