#clojure logs

2012-10-18

00:04ForSparePartsHave 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.
00:04ForSparePartsThought about attaching "update behaviors" to elements of the state, also considering an event queue-like...thing.
00:14doomlordyou mean realtimey like games or something else
00:43ForSparePartsdoomlord, Sorry I missed your message before, but yeah.
00:44ForSparePartsI'm interested in games specifically, but I'm guessing the problems I'm working on here have broader applications.
00:46doomlordi'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
00:47doomlordi 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)
00:47doomlordwhen 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;
00:48doomlord(i made some helper function that made it easier)
00:49ForSparePartsYeah, I wasn't really thinking in monads, myself.
00:49ForSparePartsHad a notion that I'd build a data structure for my state and map transforming functions over it, somehow.
00:49ForSparePartsI've found a few methods for doing this, but they seem... inelegant.
00:50doomlordmy '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
00:51duck1123does a send-off inside a dosync still only fire when the transaction completes?
00:51doomlordi was happy with the haskel representation , but haskel records suck - i find that a barrier
00:51ForSparePartsdoomlord, Haskell's a neat language, but I'm not fond of its syntax -- personal preference.
00:51ForSparePartsFeels too math-y to me.
00:51doomlordi was happy with the core concept of data entity{ update::UpdateFunc, ....}
00:52duck1123also, what about logging inside a dosync? My send-off, nor my log statement seem to be firing
00:52tomojsends are held until the transaction ends
00:52tomojIO is not
00:53doomlordi 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;
00:54duck1123I wasn't expecting the io to be safe, it was only there because I can't figure out why the send isn't running
00:54doomlordits 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
00:56doomlordis 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
00:59doomlordsort 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
01:02ForSparePartsdoomlord, I've seen some stuff about using functional-reactive programming for that -- somthing else I've been thinking about in relation to games.
01:02ForSparePartsGoogle "yampa" -- it's a Haskell library that implements it, though I can't say I exactly grok it yet.
01:03duck1123okay, I just took the agent out of the equation. It's working now.
01:05doomlordtrying to find java opengl bindings.. they're not in the javasdk's by default are they? is it 'jogl' that i'm after
01:06ForSparePartsdoomlord, LWJGL, perhaps?
01:18abpHell-o
01:18technomancysalut
01:18doomlordhas anyone here installed jogl?
01:19doomlordwhere is the best place to get it, how do you install it
01:22abpdoomlord: google said that for example: http://stackoverflow.com/questions/1962718/maven-and-the-jogl-library
01:23abpdoomlord: searching jogl maven, because you probably meant a dependency in leinigen when saying "how to install it".
01:26aperiodicdoomlord: have you looked at penumbra? https://github.com/ztellman/penumbra
01:26doomlordi am a complete noob with java environment
01:28doomlordinteresting so it turns begin/end , push/pop into single forms
01:29doomlordi think i'll probably stick with the interface as close to C as possible
01:30brainproxyhmm, 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
02:45doomlordeek, where is sqrt
02:52fredyr(Math/sqrt 2)
02:52fredyr?
02:52antares_,(Math/sqrt 2)
02:53clojurebot1.4142135623730951
02:53doomlordah. i was trying (use 'clojure.contrib.math) ... and gettnig errors
02:53doomlordyes that works here
02:53fredyroh gotta try the bot
02:53antares_doomlord: clojure.contrib.* is obsolete, see http://dev.clojure.org/display/design/Where+Did+Clojure.Contrib+Go
02:54doomlordok. the perils of distributed info
02:55doomlordis it possible to pull that into the main namespace.. i'm trying (use Math) & various combinations with clojure\; ' etc
02:55fredyr,(/ (+ 1 (Math/sqrt 5)) 2)
02:55clojurebot1.618033988749895
02:55antares_doomlord: Math is a java class (java.lang.Math)
02:56antares_you cannot refer to Java methods
02:56doomlordyikes,ok.
02:56ChongLiyou can use import-static to turn them into macros
02:56goraciohello can anyone help with this https://gist.github.com/3910191 mongo query ...
02:56doomlordi was about to say, should i just make my own wrappers, but "import-static" will do that for me?
02:57ChongLithat's what it does
02:57ChongLithough it's not ideal
02:57ChongLimacros are not first class functions
02:57clj_newb_234mvn install:install-file ... <-- this installs *.jar fles. How do I instlal jnilibs ? So I can use them via lein.
02:58doomlordwould it not do the same job as #defines in C :)
02:58doomlordoh.. you can't pass to map :(
02:58ChongLiyeah
02:58doomlordi 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
02:59ChongLito use something like sqrt with map
02:59ChongLiyou need to wrap with a lambda
03:00ChongLi,(map #(Math/sqrt %) [4 9 16 25])
03:00clojurebot(2.0 3.0 4.0 5.0)
03:01doomlord,(map Math/sqrt [1 2 3 4 5])
03:01clojurebot#<CompilerException java.lang.RuntimeException: Unable to find static field: sqrt in class java.lang.Math, compiling:(NO_SOURCE_PATH:0)>
03:01doomlord,(map (fn[x](Math/sqrt x)) [1 2 3 4 5])
03:01clojurebot(1.0 1.4142135623730951 1.7320508075688772 2.0 2.23606797749979)
03:01arrdemClojure doesn't have an "import *" now does it.
03:01aperiodicclj_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
03:02clj_newb_234what is the "proper arrangement" ?
03:03doomlordclojure 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?
03:03ChongLiit's not trash, it's just old
03:04doomlordi was trying to get clojure working with emacs aswell... is there more to it than just (set-inferior-lisp "clojure")
03:04ChongLiyeah
03:04ChongLinrepl
03:04doomlordslime sorry not emacs
03:04aperiodicclj_newb_234: this is the best documentation about it i've been able to find: https://github.com/swannodette/native-deps
03:05ChongLiyou can use slime or nrepl
03:05doomlordhaving second thoughts about exposing myself to the JVM and letting it occupy any neurons in my skull , but clojure itself appears very interesting
03:06ChongLiwhat's wrong with the JVM?
03:06clj_newb_234aperiodic: nice thanks
03:07doomlordi've used c++ mostly. lisps weren't so shocking or 'far away' because they can be embeded
03:08doomlordi'd never touch java.
03:08ChongLiwell if you do you're missing out
03:09ChongLithere are a lot of great java libraries you can use with clojure
03:09doomlordclojure 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
03:09ChongLithere are so many nice "small" languages out there that languish due to lack of library support
03:09ChongLithe fact that clojure can leverage java libraries is a huge advantage
03:10doomlordok fair enough.
03:10ChongLiand clojure really takes the pain out of writing java anyway
03:11aperiodicalso, there's a huge difference between "Java" and "the JVM"
03:11ChongLithanks to macros and the lack of checked exceptions
03:12doomlordyeah, 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
03:13ChongLiI haven't looked at scala very much
03:13ChongLiit seems like a really weird language
03:13ChongLidue to being multi-paradigm
03:14doomlordheh. on the contrary i would say "it looks interesting due to being multi-paradigm" :) mult-paradigm seems the most useful to me
03:14doomlordshift style to whatever suits
03:14ChongLiI wouldn't be so sure
03:15doomlordhaskell being very pure FP makes some basic tasks hard
03:15ChongLithere's always a price to be paid in terms of cognitive load
03:15ChongLiyeah, haskell can have a very high price
03:16ChongLisome of the type signatures get way out of hand
03:16doomlordscala compared to C++ , i think it will be a lightened load.
03:17ChongLiI don't know; scala's got quite a complex type system itself
03:17doomlordmany things which require hacking with #defines should be easier when built-in
03:17ChongLialso I find that nothing beats S-exps for reducing cognitive load
03:18ChongLihaving a lot of special syntax and weird operators can make you go cross-eyed after a while
03:18doomlordone 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
03:18doomlordhaskell is really bad for special operators .
03:18doomlord<$> .. wtf
03:18ChongLior it's really good
03:18ChongLidepending on your perspective
03:19ChongLiguys who like to play perl golf will feel right at home
03:19doomlordin 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.
03:20ChongLiwhat's wrong with using keywords?
03:20doomlordbut clojure seems to help quite a bit with destructuring and callable objects, i like that
03:20ChongLidestructuring is really nice
03:20doomlord(object :component) is still not as good as object.component
03:20ChongLiespecially the :keys form
03:21doomlordwhat i really like away from c++ is tuples, not having to declare or wrap multiple values.
03:21doomlordi like opportunities to avoid naming things
03:22doomlordin c++ you're having to make or refer to temporary classes alot
03:23ChongLialso did you know you can use sets as predicates for filtering?
03:24ChongLi,(filter #{:a :b :c :d} [1 9 :a 19 :c 'x \u])
03:24clojurebot(:a :c)
03:24doomlordi didn't realise that no
03:24ChongListuff like that is so cool and useful
03:24doomlordyes it definitely is
03:25doomlordthe ability to make literal maps (like anon structs i guess) seems really good.
03:25scottjdoomlord: it's actually easy to do object.component in your own clojure build, though you can't use "." http://youtu.be/OiaYxaONChg?t=2m
03:26ChongLiI love how clojure's data structures lead to a different style of working
03:26doomlordinteresting
03:26ChongLisince you can make most things using only the built-in data structures
03:26ChongLino need to declare new ones the way you do in most languages
03:26doomlordyeah the combination of maps and vectors is really powerful
03:26ChongLiand the sequences library
03:27ChongLilets you leverage them all in a very clean way
03:27doomlord object:value , interseting
03:28doomlordi'll persevere with the parens. there's enough else to like
03:28scottjI think I also did #.object.value once
03:29scottjat that point though (:value object) is better :)
03:29doomlordits (slot-value object value) that is too much :) (object :value) is tolerable
03:31doomlordjust tried writing vector maths routines, these are very pleasing with destructuring
03:31ChongLiyeah
03:31ChongLihave you looked into multimethods?
03:32ChongLithey're an extremely powerful feature of clojure that aren't talked about that much
03:32ChongLia la carte polymorphism with ad-hoc hierarchies is really nice
03:32doomlordi'm aware of how CLOS does it, i much prefer this sort of thing to the traditional OO style of defining methods inside classes
03:32doomlordmultiple dispatch is rather interesting too
03:33doomlordi really despise class heirachies. i like the way Go does things.
03:33ChongLiad-hoc hierarchies are just really nice and clean
03:33ChongLiyou use derives to build them
03:34ChongLi(derive ::rect ::shape)
03:34ChongLifor example
03:34ChongLithe other really cool thing about multimethods is they can dispatch on any arbitrary function
03:35doomlordwhat do you mean by that
03:35ChongLi(defmulti cool even?)
03:35doomlordsomeone said clojure gives more control over the dispatch compared to CLOS
03:36ChongLiin this case, even? is the dispatch function
03:36ChongLiwith this multimethod you dispatch on whether something is even or odd
03:37doomlorda bit like pattern matching on steroids perhaps
03:37ChongLiso you don't even need to care about types, you dispatch on values
03:37ChongLi,(defmulti cool even?)
03:37clojurebot#<Exception java.lang.Exception: SANBOX DENIED>
03:37ChongLioh
03:37doomlordcan that emulate c++ style overloading , eg make 'add' work on values or vectors
03:38doomlord,(vector? [1 2 3])
03:38clojurebottrue
03:38ChongLiwell for that you usually use protocols or java interfaces
03:39doomlordi 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
03:40ChongLiI think many people find manual memory management a big irritation
03:40noididoomlord, isn't D pretty much a fixed C++?
03:41doomlordmust be reasons its not so popular . its still got a garbage collector in there so its more overlapping with other languages than c++ perhaps
03:41ChongLiD's GC is optional
03:43noididoomlord, didn't you just mention manual memory management as one of the irritations that should be fixed? :)
03:43noidiah, sorry, I misread
03:43ChongLiI think it could be read either way
03:43doomlordbecause 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
03:44ChongLiand yet linus hates it
03:44noidiI prefer C+Lua over C++
03:44ChongLihttp://article.gmane.org/gmane.comp.version-control.git/57918
03:44ChongLithis always cracks me up
03:44doomlordyeah that seems a good combination
03:44clojurebotcemerick: Yeah, MacKay's book is great too.
03:45doomlordi find C++ templates are useful for expressing solutions to low level problems like making offset pointers. but the high level parts suck
03:47noidihttps://twitter.com/AlecMuffett/statuses/252512427567108097
03:47noidi"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"
03:47doomlordheh.
03:52arrdemhey. I managed to teach myself the C parts of C++ in one summer...
03:52arrdemgave up when I hit the actual C++
03:53arrdemso can't be that hard right? XP
04:08doomlordis there a function to modify an element of a vector (??? [10 20 30] 1 5) -> [10 5 30]
04:09doomlord(nondestructive)
04:09doomlordprobably want to do that as a batch... indices to replace and new values
04:12Chousukedoomlord: replace
04:15hoeckdoomlord: vectors are associative
04:15ivan,(assoc [10 20 30] 1 5) ; or the thing that isn't replace
04:15clojurebot[10 5 30]
04:15hoeck,(assoc [1 2 3] 0 0 2 0)
04:15clojurebot[0 2 0]
04:15doomlordinteresting
04:17ejacksonlpetit: bonjour
04:18lpetitejackson: hello dear
04:18ejacksonlpetit: happy hacking-day :)
04:18lpetitthank you :)
04:19lpetitcurrently fighting my limitations in writing macro-defining macros :)
04:20lpetitejackson: how are you?
04:26ejacksonmacro-defining macros !
04:26ejacksonthat turtles all the way down dude... you can't win !
04:26ejacksoni'm fine, myself.
04:29lpetitejackson: 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 :)
04:30lpetitI believe I can fly ! :)
04:30ejacksonit might be easier...
04:30ejackson:)
04:31ejacksonyou are a brave, brave man
04:36lpetitejackson: I am a fool, you mean :)
04:36ejacksonhahaha - not at all.
04:37ejacksonbut you'd better put some wine in the fridge for this evening :)
04:37lpetit:-D
04:38ejacksonfailing to do *that* would be foolish
04:39clgv"macros generating macros - thats perverse!" (structural quote... ;) )
04:40lpetitclgv: and it's for you
04:41lpetitI want to be able to leave traces in ccw, while not polluting everybody … so configurable traces … so Eclipse Trace API :)
04:41clgvlpetit: not for us all - the tools for a better future in debugging CCW? ;)
04:41lpetit… or how spending 5 hours what could have been hacked in 5 seconds :)
04:42lpetitclgv: yes
04:42lpetitbut you meant "no", not "not", right?
04:42clgvI meant "not for us all?" ... badly puncutated...
04:47lpetitclgv: 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 ? :)
04:49clgvlpetit: I've been pretty busy last weekend and will be next weekend. so my changes wont be made until the end of next week...
04:49lpetitclgv: noted, thx for the status update
05:03lpetitclgv, 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 :)
05:04clgvlpetit: oh I gather some experience with that. are you struggeling with somethin particular right now?
05:04clgv*gathered
05:04ejacksonlpetit: aah, yeah I did that (if I understand you !)
05:04clgvI have written a Meta-DSL to generate a DSL which is used for concrete documents then
05:05ejacksonotfrom: mornin' Mr Wayne
05:05lpetitclgv: 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
05:07lpetitarch, reflection code added by clojure adding noise to my stack and preventing eclipse to properly report calling function name :)
05:07lpetits/arch/argh
05:10otfrommorning ejackson
05:23Kototamahi, any ideas why I get compilation warning with the jaqy library even if compiling without optimization? https://gist.github.com/3910617
05:24KototamaI mean jayq
05:31mpenetKototama: this disapears with alpha4
05:44Kototamaah! okay
07:16abpHm, how do I set up a Clojurescript REPL attached to the code running in my browser?
07:18abpI 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?
07:47goracioanyone use monger ?
07:48antares_goracio: I am the author of monger
07:49goracioantares: great have couple questions :)
07:49goracioantares_: great have couple questions :)
07:51goracioantares_: 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
07:51goracioantares_: a for example ["dave" "martin"]
07:51antares_goracio: using MongoDB query operators
07:52antares_$in, $all, etc
07:52goracioantares_: and :nik field is a string like :nik "dave"
07:52antares_goracio: see http://clojuremongodb.info/articles/querying.html#using_mongodb_query_operators and MongoDB query docs
07:53goracioantares_: suppose we have this (mg/find-maps "messages" {:nik {$in : a} }) something like this ?
07:56nonrecursiveHi 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"
07:56nonrecursivewould anyone know how to debug this?
07:56antares_goracio: yes. It's the same as in mongo shell. See the docs.
07:56antares_nonrecursive: are you sure you are not using Clojure 1.2-only code?
07:57nonrecursiveantares_: yeah, i'm using clojure 1.4 for a web app
07:58antares_nonrecursive: yes but are you sure you are not using old contrib libraries or any other 1.2-only code?
07:58antares_that exception is from the 1.2-to-1.3 migration age as far as I remember
07:58goracioantares_: seems works :) thanks
07:58antares_although "too many arguments to def" is probably an issue in your own code
07:58nonrecursiveantares_: ah ok - I'm not sure about that
07:59nonrecursiveantares_: it's bizarre because the error changes every time, even when I don't make changes in code
08:01antares_nonrecursive: files that do not require each other can be compiled in different order
08:01clgvnonrecursive:yeah your code has probably some wrongly place parantheses
08:01nonrecursiveantares_: ok it looks like requiring clojure 1.3 instead of 1.4 fixed the issue
08:02clgvnonrecursive: thats no good sign
08:02antares_nonrecursive: 1.4 is a drop in replacement for 1.3, has been the case for me in almost 30 codebases
08:02nonrecursiveclgv: 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
08:04clgvnonrecursive: if I were you I'd switch back to 1.4 and hunt down the error in the code.
08:04nonrecursiveok now this is weird - i've switched the clojure version back to 1.4 and now it's working again
08:04nonrecursivei mean, still working
08:04antares_nonrecursive: run lein clean and try again
08:04antares_you possibly have some AOT-compiled code around
08:04clgvnonrecursive: well, then a "lein clean" would have solved it as well, I guess ;)
08:05nonrecursiveoh shoot, the error is back
08:05nonrecursiveafter doing lein clean
08:06nonrecursiveok I'm going to dig into this more to see if I can resolve that "too many arguments" error - thanks for the help
08:07clgvlpetit: still around?
08:08lpetitstill, and having greatly improved my macro-foo so far
08:08john2xhi.
08:08lpetitnested syntax quotes have no secret for me anymore :)
08:08abplpetit: How is CCW Clojurescript integration going? ;)
08:08clgvlpetit: I was wondering whether maybe the history search should be displayed similar to the autocompletion in an additional widget.
08:08john2xis there a way to reload all the files currently loaded in the repl?
08:09clgvlpetit: ok insider comment ~'~'my-symbol ;)
08:09abplpetit: About to start piggieback browser-connected ccw repl battle..
08:09lpetitclgv: and sometimes ~'~(symbol (name (ns-name *ns*)) "foo") :)
08:10lpetitabp: ?
08:10clgvlpetit: been there ;)
08:10clgvlpetit: your first reaction to the above suggestion?
08:11abplpetit: 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?
08:12lpetitclgv: so that before "accepting" (hitting enter?) the input area stays the same, and the filtered history appears in a list ?
08:12nonrecursiveantares_: clvv: it looks like I get the error whenever I put (:use korma.core) in a namespace declaration
08:12lpetitabp: what's not straightforward is to launch this browser connected repl from ccw
08:12clgvlpetit: yeah that was the rough idea - but I dont know yet how to incorporate different search modes there.
08:13clgvlpetit: what I wanted to know is whether that would be rejected by you at once for some reasons ;)
08:13lpetitabp: 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
08:13lpetitclgv: seems interesting idea
08:14lpetitclgv: no great idea out of the box right now
08:14lpetit(out of my head, I mean)
08:14clgvlpetit: and a lot of work compared with the current state of it
08:15lpetitclgv: indeed, which will probably be the compelling reason for you to postpone this enhancement :)
08:15clgvlpetit: very likely ^^
08:15Tichodroma(source my-stuff.core/foo
08:15lpetitabp: will be around for the next couple hours, so if you're having problem, feel free to ping me
08:15Tichodromawoops, wrong buffer
08:15abplpetit: 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?
08:16antares_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.
08:17lpetitabp: 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.
08:18lpetitabp: 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
08:18lpetitabp: https://github.com/cemerick/drawbridge
08:20abpI 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 ;)
08:20abp*project.clj
08:21lpetitabp: so currently you're having ring started serving http on port 3000, and an nrepl server inside the same JVM started on another port
08:21abplpetit: yep, nrepl on 7888
08:22lpetitabp: you could have started a :repl on port 7888, and used the :injections (or whatever) from it to start your ring handler LOL too :)
08:23lpetitabp: 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.
08:24lpetitabp: 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.
08:25lpetitabp: 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)
08:26lpetitabp: really, it'll be a piggyback / lein2 configuration battle :)
08:26lpetit(and I cannot help here, I have no experience)
08:28abplpetit: 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 :)
08:31nonrecursiveOK I think I've fixed the problem. Where I had (defdb db …) I now have (if (not (resolve 'db)) (defdb db …)
08:31lpetitabp: 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 :)
08:34abplpetit: 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.
08:36lpetitabp: 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
08:36abplpetit: That's it.
08:39djanatynI started playing around with threads in sbcl and it's defeinitely not as fun as it is in clojure
08:39djanatynclojure was my first experience with multiple threads. now I appreciate clojure's concurrency model even more
08:44lpetitclgv: yeepee ! macro-defingin-macro working !
08:44lpetitdo you want to see the mess i created ? :)
08:44clgvlpetit: :) sure, lets see
08:46lpetitclgv: not final state, but a working state ! : https://gist.github.com/3911545
08:48clgvlpetit: not too messy. but I can only guess how to use it ;)
08:48lpetitI'll show you in a dozen minutes, there are still simplifications to be made
08:48clgvlpetit: dont hurry. I might be leaving early today since I caught a cold...
08:48nonrecursiveclgv: antares_: ok I found the actual culprit, it was a bug in Korma - https://github.com/korma/Korma/issues/51
08:49lpetitclgv: ok
09:01alex_baranoskyhey guys, what are some common solutions for handling composure routes that can optionally end in a trailing slash?
09:01alex_baranoskyit looks like Compojure used to accept regexes as routes, but doesn't any longer
09:03alex_baranoskyhas anyone extended the Route protocol to regexes for their projects? https://github.com/weavejester/clout/blob/master/src/clout/core.clj#L71
09:08LordPinkyalex_baranosky, ZvZ is such a beautiful matchup
09:13xeqialex_baranosky: I've seen middleware that rewrites the :uri
09:13xeqianother option is to redirect instead of serve the page on both uris
09:13alex_baranoskyxeqi: yeah seen that too… Seems silly to have to work around the framework
09:13alex_baranoskyLordPinky: I don't understand
09:14LordPinkyalex_baranosky, ah, you don't play StarCraft?
09:14alex_baranoskyxeqi: what do you think of the Compojure protocol extending approach?
09:14LordPinkyYou should, everyone here does.
09:14LordPinkyIf you don't, you're not part of it.
09:14LordPinkyCan't sit at the cool table if you don't bro, those are the rules and we do enforce them.
09:14alex_baranoskyLordPinky: correction: everyone here does CLojure
09:15AdmiralBumbleBeenot everyone here does clojure
09:15LordPinkyjust 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.
09:15AdmiralBumbleBeepretty sure sgeo only does haskell with lots of parens ;)
09:16alex_baranoskyxeqi: looks like it might be complicated (bad) to extend that protocol, because the String implementation is doing a ton of parsing etc
09:18xeqialex_baranosky: yeah, I can't follow it on quick glance so it might be messy
09:30lpetitclgv: here's the way to install the code for ccw.core: https://gist.github.com/3911733
09:31clgvlpetit: pretty compact. after that statement it will trace every eclipse event?
09:31lpetitclgv: hell no :)
09:32clgvlpetit: what does it do? I see no config in that gist ;)
09:32lpetitclgv: after that statement, it will install in ccw.core.trace a handful of macros wrapping the eclipse tracing api
09:32SgeoAdmiralBumbleBee, heh
09:34lpetitI'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)
09:34AdmiralBumbleBeeSgeo: I learn a lot from your musings, so no harm intended :)
09:35antares_Sgeo: do you mind a small haskell question? I am scared of hardcore academics in #haskell :)
09:35lpetitclgv: starting from Juno, Eclipse will let the user toggle the trace flags from the preferences > trace page.
09:35lpetitclgv: 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
09:38Sgeoantares_, in general I don't mind, but right now I'm running late for class
09:46antares_Sgeo: ok
10:25abpxeqi: 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:25dfdDo 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:39cemerickabp: you mean the cljs side of the browser repl, or the cljs for your app?
10:40abpcemerick: Hi there. I want to execute cljs in my browser from a ccw repl.
10:41cemerickabp: 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:42cemerickYou'll still need to set up your app to look for a browser-repl connection (e.g. on port 9000).
10:42abpcemerick: Currently I have that in lein-rings :init, starting an nrepl server with piggieback middleware
10:42abpcemerick: Ah ok, so that port is separate from everything else?
10:42cemerickah, ok, that'll work too
10:43abpcemerick: Then I think it's just about to work ;)
10:43cemerickYes, the browser-repl controls its own set of resources.
10:43abpcemerick: Let me try.
10:43cemerickThere 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:45abpcemerick: 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:46cemerickYou certainly need to be using the same version of clojurescript in both places.
10:46abpcemerick: Sure, I think cljsbuild uses a newer version, but not via lein deps but bundled.
10:47cemerickabp: nothing is bundled; the cljsbuild jar is ~8kb
10:49abpcemerick: https://github.com/emezeske/lein-cljsbuild/issues/105
10:49abpcemerick: Not bundled, but pulled, sorry.
10:54abpcemerick: Ehm, so I still need to serve an index.html from port 9000 then, not integrating the repl into my ring-apps cljs?
10:55cemerickabp: No; at least, I don't
10:55cemerickBut, I don't grok that cljsbuild issue, either.
10:57cemerickAFAICT, cljsbuild always uses whatever version of ClojureScript you have in your :deps vector
10:59abpcemerick: 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:00cemerickabp: deps folder? What version of leiningen are you using?
11:00casperchey
11:01caspercstupid question: Is there a function in core which returns true if it gets nil and nil otherwise?
11:01abpcemerick: lein2, I don't mean a physical folder, only the view in eclipse "Leiningen Dependencies"
11:01cemerickah
11:01andrewmcveigh|wocasperc: nil?
11:02caspercthat returns false if not nil unfortunately
11:02andrewmcveigh|wocasperc: ah, sorry. didn't read your question properly.
11:02caspercit should be like this (if val nil true)
11:02cemerickcasperc: what are you trying to do?
11:02caspercnp
11:03caspercbit hard to explain the whole thing, but i need a nil value when i get something which is not nil
11:03casperci guess i can just do the if thing, but i just feel stupid for doing it :)
11:04cemericksounds like a specious requirement :-)
11:05abpcemerick: 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&quot;) from there, should that work? Despite me having no index.html served from localhost:9000 etc.
11:07cemerickabp: You have no control over what's served from 9000 at all; that server comes up when you call (cemerick.piggieback/cljs-repl ………)
11:09antares_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:09abpcemerick: Ok, but the cljs-repl does not work. I can't evaluate anything.
11:10cemerickabp: make sure you're loading your web page that connects to :9000 after starting the cljs REPL.
11:22notsonerdysunnyIs it possible to import 2 classes of same name from two different packages into the same clojure namespace?
11:22notsonerdysunnyI seem to be running into name clash related compilation errors..
11:22abpcemerick: Doesn't work either. But I should be able to see the browser polling on localhost:9000 in chrome developer tools?
11:23cemerickYes, though it only attempts to connect once; I don't think it polls.
11:23abpcemerick: Ok, but still a visible network connection. I've got none.
11:28abpcemerick: It's getting better, sorted out one error of my own.
11:29abpcemerick: Do you use lein-cljsbuild?
11:29cemerickyes
11:29cemerickthough I still don't see how that's related to browser-repl
11:30chouser4clojure is down. Did I kill it?
11:30abpcemerick: Not at all. Having no issues with it? In terms of stability, reproducible errors.
11:30cemericknope, it's been solid
11:30chouserhm, back up
11:31abpcemerick: 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:32ohpauleezabp: Shoreleave related errors or just general errors?
11:33abpcemerick: Done. browser-repl works, thanks for another great job on an astonishing tool. ;)
11:33cemerickabp: what was the issue?
11:35abpohpauleez: 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:35xeqiabp: glad to here you got it working
11:35abpcemerick: A bug in my code and not having repl/connect "http://localhost:9000/repl&quot;) eval'd.
11:35cemerickah :-)
11:35ohpauleezabp: Good to hear. Feel free to ping me or email me (via the shoreleave ml) if you have any questions
11:36abplpetit: Would it be hard to highlight (comment ...) blocks in ccw?
11:36ohpauleezthere is one outstanding pubsub bug I need to patch up
11:36abpcemerick laughs hard. :D
11:36ohpauleezbut I'm also sitting on a few other changes I need to polish up before releasing
11:36lpetitabp: you mean show them as ;#_ comments?
11:36cemerickabp: FWIW, I have this as a top-level in one of my app's cljs files:
11:36cemerick(when (-> js/window .-location .-hostname (= "localhost"))
11:36cemerick (connect "http://localhost:9000/repl&quot;))
11:37ohpauleezcemerick: That deserves to be in Shoreleave haha
11:37ohpauleezmy trick is query args (so I can use it in production)
11:37abpohpauleez: Didn't ran into that bug. ;) I have one function publish changes from a user typing in an input. Not much more.
11:37cemerickohpauleez: nah, shouldn't be in libraries :-)
11:37abplpetit: Yes, please.
11:38xeqiohpauleez: where is the shoreleave ml?
11:38cemerickabp: once ccw uses leiningen to start its REPLs, then stuff around piggieback etc. will get a lot easier
11:38lpetitabp, cemerick : dunno. Highlighting (comment) as ; or #_ comments … what if the user uses something else than clojure.core/comment ?
11:39abpWhen get things in cljs files executed? Is there some auto-wrapping into a jquery-ready like handler?
11:39lpetitcemerick: 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:40hldfrHmm why isn't some named as some? , just like the every? sequence predicate ?
11:40S11001001hldfr: because some isn't a predicate
11:41S11001001,(some seq '[() [] [1]])
11:41clojurebot(1)
11:41hldfr,(some odd? [])
11:41clojurebotnil
11:41hldfrah
11:41cemericklpetit: The difference between setting up your own nREPL stack vs. using the easy lein2 configuration available for doing the same is significant.
11:42cemerickNevermind other plugins, middleware, hooks, etc.
11:42S11001001hldfr: it's worth comparing some to (comp first filter), and considering which is appropriate in each situation
11:42gfredericksabp: I believe it's all at the top level; you can check the compiled file though
11:42lpetitcemerick: you mean in case one does not want to start lein2 from the command line without waiting for better integration with ccw ?
11:43S11001001,((comp first filter) seq '[() [] [1]])
11:43clojurebot[1]
11:43cemericklpetit: Right; you lose code completion and such doing that.
11:44lpetitooh, I wasn't aware of that
11:45cemericklpetit: Reason #43 I've been harping on about completion as middleware, instead of using eval for it.
11:49abpcemerick: Seems like the next stop for me would be lerning to use lein2 properly. ;)
11:50abplpetit: You can't get at the ns of a symbol for highlighting currently?
11:51wingywhat version of eclipse should i download for clojure?
11:52abpgfredericks: Sure
11:52wingyEclipse IDE for Java Developers or Eclipse Classic
11:52lpetitwingy: both should do. Go for "for Java Developers", I guess
11:52lpetitbbl
11:52abpgfredericks: Just wondering why everybody is happily hacking top-level code while that wasn't good in plain js
11:57gfredericksabp: everybody?
11:57abpcemerick: "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:58abpgfredericks: Ok, some folks in examples I've seen.
11:58gfredericksabp: when I need dom-related side-effects I always wrap the call to the side-effecting function
11:58gfrederickssomething like (js/jQuery init)
11:59gfredericksabp: if you see people doing otherwise you have my permission to frown
12:00abpgfredericks: Yes, that's what I'm doing too, until now in an anonymus function, because I'm only tampering.
12:03doomlordwas 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:04gfredericksdoomlord: are you using lein?
12:04doomlordjust started trying that aswell
12:05doomlordis this extra complexity imposed by the jvm
12:06doomlord(heh i guess i could try a script that concatenates source files :) )
12:06gfredericksdoomlord: lein is pretty easy once you're familiar with it
12:07doomlorddo i need a whole lein generated directory structure for a library
12:07gfredericksone big win over manually compiling source files is that with lein it is trivial to tap into the ecosystem of clojure/java libraries
12:07gfredericksyeah that's generally what you want; `lein new ...` will set one up for you
12:08gfredericksputting the source files in directories that match the namespace is standard java/clj procedure
12:08doomlordok 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:09doomlordok thats my first mistake
12:09doomlordi just setup a lein project and stuck all my sources in there
12:09doomlord(in the one directory it made)
12:10gfredericksI'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:10doomlordin this 'middle ground' my "library" is merely one file
12:11noidicreating a new project with lein only takes a couple of seconds, so there's not much need for a middle ground, imo
12:11gfredericksthere's a lot of uniformity gain with a small amount of effort
12:11noidilein new foo; cd foo; lein repl
12:11doomlordfoo\src\foo .. :(
12:11gfrederickshundreds of libraries on github with standard directory structures
12:12doomlordok i guess i can stil a bunch of my helpers together to avoid directory overhead
12:13noididoomlord, there's also this https://github.com/mtyaka/lein-oneoff
12:13noidioops, apparently that's for leiningen1
12:14noidiso disregard that :)
12:14doomlordif 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:15doomlorddeeply nested directories (foo/src/foo) makes commandline use much more awkward :(
12:16doomlordif you've got hundreds of sources then great
12:16gfrederickscould make a symlink
12:17doomlord"if you use things like clojure.core/load"... how would that look
12:18gfredericksI think you just give it a filename and it evals the file
12:19doomlord1st attempt: in the repl, in the directory where the source is - "(load "sourcrname.clj") ... errors about classpath :(
12:20gfredericksoh there's a load-file as well
12:20gfredericksthat must be what I was thinking of
12:20doomlordso 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:21gfredericksyou 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:21doomlordok load-file works - thanks :)
12:21gfredericksnp
12:22doomlordok i guess "lein" is worth getting into if i want to, say, dable with clojure + scala
12:22doomlordor when i've written more than 5 sources
12:22gfredericksand it will ease your ability to do lots of other common build-related tasks
12:23gfrederickse.g., make executable jarfiles
12:23doomlordso by default java land has many .classes which can be loaded add-hoc? but jarfiles are a self-contained bundle?
12:24konr_trabIs 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:24doomlordmap gets them i think
12:25doomlordi think mapping a hash gets[key value] 's passed in?
12:25doomlord,(map #(print %) { :a 1 :b 2 :c 3})
12:25clojurebot([:a 1][:c 3]nil [:b 2]nil nil)
12:26konr_trabhmm, but can't I do something like (let [{a {b c}} {:foo {:bar "baz"}}] (list a b c))?
12:27gfrederickskonr_trab: you can
12:27gfrederickswell
12:27doomlordyou could build a vector and destructure the vector perhaps? is there a better way
12:27gfredericksif you don't know the keys ahead of time then it's messier
12:27gfredericksthat is a much less common thing to want to do
12:28gfredericks,(let [[[a [[b c]]]] {:foo {:bar "baz"}}] (list a b c))
12:28clojurebot#<UnsupportedOperationException java.lang.UnsupportedOperationException: nth not supported on this type: PersistentArrayMap>
12:28dnolenkonr_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:28gfrederickshrm :(
12:28AdmiralBumbleBeeI thought you couldn't destructure nested maps?
12:28doomlord,(let [ [k0 v0][k1 v1] ] (map #([%1 %2]) { :foo 1 :bar 2} ) )
12:28clojurebot#<CompilerException java.lang.RuntimeException: Unable to resolve symbol: k1 in this context, compiling:(NO_SOURCE_PATH:0)>
12:29dnolenAdmiralBumbleBee: you can
12:29AdmiralBumbleBeehas that always been the case?
12:29doomlord,(let [[ [k0 v0][k1 v1] ] (map #([%1 %2]) { :foo 1 :bar 2} )] (print k0 v0 k1 v1) )
12:29clojurebot#<ArityException clojure.lang.ArityException: Wrong number of args (1) passed to: sandbox$eval127$fn>
12:29dnolenAdmiralBumbleBee: yes
12:30gfredericksdoomlord: 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:30doomlord,( let [ [[k0 v0][k1 v1]] (map #([%1 %2]) { :foo 1 :bar 2}) ] (print k0 v0 k1 v1) )
12:30clojurebot#<ArityException clojure.lang.ArityException: Wrong number of args (1) passed to: sandbox$eval163$fn>
12:30doomlord,( let [ [[k0 v0][k1 v1]] (map #(list %1 %2) { :foo 1 :bar 2}) ] (print k0 v0 k1 v1) )
12:30clojurebot#<ArityException clojure.lang.ArityException: Wrong number of args (1) passed to: sandbox$eval199$fn>
12:31AdmiralBumbleBeeI even have code in the project I'm working on that destructures a nested map… and I wrote the code
12:31doomlord,( let [ [[k0 v0][k1 v1]] [[:a 1][:b 2]] ] (print k0 v0 k1 v1) )
12:31clojurebot:a 1 :b 2
12:31doomlord(map #(list %1 %2) {:a 1 :b 2})
12:31doomlord,(map #(list %1 %2) {:a 1 :b 2})
12:31clojurebot#<ExecutionException java.util.concurrent.ExecutionException: clojure.lang.ArityException: Wrong number of args (1) passed to: sandbox$eval261$fn>
12:32AdmiralBumbleBeedoomlord: could you use a local repl?
12:32doomlordheh sorry
12:34doomlord,( let [ [[k0 v0][k1 v1]] (map (fn[x]x) { :foo 1 :bar 2}) ] (print k0 v0 k1 v1) )
12:34clojurebot:foo 1 :bar 2
12:39doomlordmulti-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:10TimMc&(-> "\ud834\udd1e" (.substring 0 1) (.codePointCount 0 1))
13:10lazybot⇒ 1
13:10muhoo_doomlord: wat?
13:11doomlordi'oll figure out lein once i've written more code..
13:12TimMcdoomlord: Don't use load-file.
13:13muhoothere's not much to figure out about using lein
13:13TimMcdoomlord: https://github.com/baznex/crosscram/tree/master/src/crosscram -- just takea look at this project structure.
13:22AtKaaZ,(quote 1 2 3)
13:22clojurebot1
13:23AtKaaZmaybe it should err ? if the programmer expected something else other than ignoring 2 3
13:25AtKaaZadded to the list:) https://gist.github.com/3895312
13:29AtKaaZquote is a special form ? ##(apply quote '(1 2 3))
13:29lazybotjava.lang.RuntimeException: Unable to resolve symbol: quote in this context
13:30antares_AtKaaZ: yes
13:30AtKaaZcool, thanks
13:32AtKaaZthis is cool: ##(. 1 toString)
13:32lazybot⇒ "1"
13:32AtKaaZ,(. 1/2 toString)
13:32clojurebot"1/2"
13:32AtKaaZ,(str 1/2)
13:32clojurebot"1/2"
13:33AtKaaZhmm I notice str uses this internally: ##(. 1 (toString))
13:33lazybot⇒ "1"
13:33S11001001AtKaaZ: try on nil
13:33AtKaaZ,(. nil toString)
13:33clojurebot#<NullPointerException java.lang.NullPointerException>
13:34AtKaaZthat's why I should use str, good point:)
13:34AtKaaZbut why is str using (. 1 (toString)) ?
13:34AtKaaZinstead of (. 1 toString)
13:34AtKaaZ,(. 1 (str "toString"))
13:34clojurebot#<IllegalArgumentException java.lang.IllegalArgumentException: No matching method found: str for class java.lang.Long>
13:35AtKaaZso I can't execute clojure code there
13:39AtKaaZlooks like the two forms are equivalent: http://clojure.org/java_interop#dot
13:39AtKaaZ(. Classname-symbol (method-symbol args*)) or (. Classname-symbol method-symbol args*)
13:41AtKaaZexcept 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:41AtKaaZ,(. 1 (bitCount))
13:41clojurebot#<IllegalArgumentException java.lang.IllegalArgumentException: No matching method found: bitCount for class java.lang.Long>
13:41AtKaaZ(. 1 bitCount)
13:41AtKaaZ,(. 1 bitCount)
13:41clojurebot#<IllegalArgumentException java.lang.IllegalArgumentException: No matching field found: bitCount for class java.lang.Long>
13:43AtKaaZthat doc actually says so if I read :) i'll stfu now
14:11dimovichhello people...
14:12dimovichhow hard is finding some freelance Clojure projects?
14:12dimovichdoes anyone have experience in this area?
14:15dnolenwow did know about :strs or :syms feature of map destructuring
14:15dbushenkonever seen such projects
14:16hiredmandimovich: from what I have seen, clojure jobs tend to be around core infrastructure, not really around stuff you send out or contract
14:16Frozenlo`dnolen: learned it around 4 days ago. Blew my mind :P
14:16dnolendimovich: I think it depends on what you do - data / analytics folks don't seem to have a hard time I think.
14:17dimovichthanks for the tips
14:18pepijndevosIs there am ebook of Lisp In Small Pieces?
14:18hiredmanhttps://twitter.com/wunki/statuses/228408001655087104
14:19nickmbaileydnolen: woah, and now i know about :strs and :syms, thanks :)
14:22dnolenpepijndevos: not that I know of, though that seems like a book worth having in print.
14:22pepijndevosdnolen: yea, they seem rather expensive though.
14:25dnolenpepijndevos: in this case I think it's worth it - filled with goodies you can keep coming back to.
14:26pepijndevosdnolen: heh, once I have some money to spend, i'll consider it.
14:32DaReaper5Hi, what is the server address to this irc?
14:37DaReaper5I 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:40hiredmanDaReaper5: I would just use jaspher reports
14:40hiredmanDaReaper5: it's an existing java library, clojure interops very well with java, and your done
14:40hiredman:/
14:40DaReaper5I am thinking about using DynamicJasper to simplifiy things.
14:40hiredmanyou're
14:40hiredmanwhatever, I don't know anything about jasper, just that it is a java library
14:40DaReaper5as well*
14:50TimMcDaReaper5: That's not a question that can actually be answered meaningfully.
14:50DaReaper5Ok, to simplify my current issue: How do i enable a clojure web server to allow a client to download a file?
14:50DaReaper5TimMc i agree
14:51DaReaper5... that may not be the best wording either
14:51TimMcA file that is statically sitting on the server, or one that is generated dynamically by the server?
14:53DaReaper5an example of both would be nice. However, I need the client to be able to download dynamically generated files more so.
14:56amalloyDaReaper5: look up what http headers/content you need to send, and then do that
14:57pjstadigjasper is a disaster
14:57pjstadigat least it was when i used it from java or rails or something
14:57pjstadigmaybe clojure could make it nicer
15:00gfrederickspjstadig: I find your claim plausible because it rhymes
15:00DaReaper5pjstadig i am hoping to avoid uglyness and issues by using DynamicJasper
15:00DaReaper5haha
15:01TimMcDaReaper5: It's really all about the Content-Disposition header or some such.
15:02TimMcEverything else is glue.
15:03DaReaper5ok, 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:12lnostdalperhaps 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:12hyPiRionwhat do you mean?
15:12lnostdali suppose the GC might move objects around in memory .. and the addresses printed for the objects will then change
15:13lnostdal(move things around to avoid fragmentation etc.)
15:13amalloy&(str (lazy-seq nil))
15:13lazybot⇒ "clojure.lang.LazySeq@1"
15:13hiredmanlnostdal: it is the object's hashcode
15:13amalloyhm. lazy-seqs don't print as their hashcode anymore?
15:13lnostdalhiredman: oh, ok
15:13gfredericks&(str (range))
15:13hyPiRionheh.
15:13lazybotExecution Timed Out!
15:13hiredmanthe default impl for Object is often the pointer, but it gets cached, since yes, the gc can move thrings around
15:13raek&(pr-str (lazy-seq nil))
15:13lazybot⇒ "()"
15:14lnostdalhiredman: i see .. interesting .. thank you :)
15:14hyPiRion,(pr (Object.))
15:14clojurebot#<Object java.lang.Object@427c6d2e>
15:14lnostdalhmm, this opens up another question; since it is cached .. is there a chance another object might end up with the same address then?
15:15lnostdal(since the real underlying address might be freed up while the GC moves things around)
15:15amalloylnostdal: it wouldn't matter if that happened
15:15hyPiRionlnostdal: I'm quite sure that's a negative, the JVM would be strange if that would occur.
15:15hyPiRionat least not visibly.
15:15lnostdalok
15:16gfrederickshyPiRion: based on what hiredman said I would assume the opposite
15:16hiredmanlnostdal: there is, but it doesn't matter
15:16hiredmanit's just a hash collision for Objects
15:17gfredericksI suppose it would be unreasonable to expect a runtime to assign all objects a permamently unique ID
15:19hiredmannot a lot of utility there
15:19gfredericksand lots of wasted space
15:19hiredmanthat is basically what a pointer is, but the pointer can change
15:19TimMcObject.equals() must have some guarantee that objects can't be moved in memory in between address dereferences.
15:20hiredmanand you don't want the hashcode changing
15:24hiredmanTimMc: I think are confusing Object.equals() with the object identity check it uses
15:24hiredmanyou
15:24amalloyTimMc: i can't imagine why it would make that guarantee
15:24TimMcMmm, right.
15:24TimMc.equals would just use ==
15:25gfredericksbut 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:25TimMcamalloy: I don't mean the contract of .equals() in general, just Object's impl.
15:25hiredmanor use *shudder* handles
15:26gfrederickshiredman: are those pointer pointers?
15:26hiredmanyes
15:26amalloyTimMc: right. i don't see why it would make that guarantee. there's no point
15:27gfredericksI must be missing a detail about this
15:27oskarthI 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:27amalloywhen the gc moves an object around, it also necessarily must update all references to that object in active stack frames
15:28TimMcOh, hmm... are you saying that when I have a reference to an object, I actually have a pointer to the real memory location?
15:28gfredericksamalloy: 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:28amalloyso 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:28hiredmanuh, what do you think the word reference implies?
15:28TimMcThat does seem to ring more true.
15:28TimMchiredman: I was in fact thinking of pointers to pointers. :-/
15:29gfredericksamalloy: implicit in your statement is that <gc....> is atomic
15:29hiredmanTimMc: that is sort of an unfortunate overload
15:29TimMcI haven't had to think about memory management details for a while.
15:29amalloygfredericks: indeed, that is implied. and not necessarily true, but the jvm cooperates with your bytecode to make sure it appears atomic
15:30hiredmanhttp://www.artima.com/insidejvm/ed2/jvmP.html might be a good reference (I have not read it)
15:30gfredericksamalloy: all of the things make sense now
15:30hyPiRionHuh
15:30hyPiRion,(vector)
15:30clojurebot#<ExecutionException java.util.concurrent.ExecutionException: java.lang.NoClassDefFoundError: Could not initialize class clojure.lang.RT>
15:31Bronsa_wtf
15:31hiredmansandbox is broken, it should right itself in 10 minutes
15:32madsyhiredman: It's your bot?
15:32amalloy&(vector) in the mean time
15:32lazybot⇒ []
15:33gfredericks&((reduce comp (repeat 15 vector)))
15:33lazybot⇒ [[[[[[[[[[[[[[[]]]]]]]]]]]]]]]
15:33madsy&(map {} [1 2 3] [:a :b :c])
15:33lazybot⇒ (:a :b :c)
15:33madsy&(map into [1 2 3] [:a :b :c])
15:33lazybotjava.lang.IllegalArgumentException: Don't know how to create ISeq from: clojure.lang.Keyword
15:33madsyEh, I suck. Been a while since I wrote any clojure code
15:33gfredericks(def identity (partial {} :foo))
15:35hyPiRion(def identity #(do %))
15:36gfredericksnow accepting submissions for most surprising implementation of identity
15:37gfredericks&((#'and 7 8) 19)
15:37lazybotjava.lang.ClassCastException: java.lang.Boolean cannot be cast to clojure.lang.IFn
15:37gfredericks&((@#'and 7 8) 19)
15:37lazybotjava.lang.ClassCastException: java.lang.Boolean cannot be cast to clojure.lang.IFn
15:38Bronsa&(#'and nil nil 23)
15:38lazybot⇒ 23
15:39gfredericksoh I shoulda used partial
15:39Bronsayeah
15:40gfredericks&(#'and nil nil 1 2 3)
15:40lazybot⇒ (clojure.core/let [and__3822__auto__ 1] (if and__3822__auto__ (clojure.core/and 2 3) and__3822__auto__))
15:40llasram(def identity (partial 'identity nil))
15:42mattmoss,(range 6 3 -1)
15:42clojurebot(6 5 4)
15:43mattmoss&(or 25 (range 6 3 -1))
15:43lazybot⇒ 25
15:43Bronsa,(or 1)
15:43clojurebot1
15:44mattmoss&(range (or 25 6) 3 -1)
15:44lazybot⇒ (25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4)
15:45AdmiralBumbleBeemattmoss: what are you trying to do?
15:45mattmossChicago song lyric: "Twenty-five or -six to four..."
15:45aperiodicgfredericks: (def id (fn [x] @(reify clojure.lang.IDeref (deref [_] x))))
15:46mjg123What is the current status of Source Maps in ClojureScript? Do they work? Can I use them?
15:46aperiodicgfredericks: more "convoluted" than "surprising", i guess
15:46dnolenmjg123: they do not work. I'm the only person that has worked on them. very half-finished.
15:46hyPiRion(def identity (comp (partial apply reduce nil) reverse (partial list nil)))
15:46dnolenmjg123: feel free to lend a helping hand tho ;)
15:46mattmoss&(range (+ 20 (or 5 6)) 3 -1)
15:46lazybot⇒ (25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4)
15:47mattmossThere we go.
15:47aperiodicinternational obfuscated clojure identity contest?
15:48gfredericksyes.
15:48mjg123dnolen: not sure how much help I could be - but there must be a good ref. somewhere? What's browser support like?
15:48gfredericks((apply comp (take 10000 (cycle [:foo (partial hash-map :foo)]))) 41)
15:48gfredericks&((apply comp (take 10000 (cycle [:foo (partial hash-map :foo)]))) 41)
15:48lazybot⇒ 41
15:49mattmosso_O
15:50hyPiRionI assume we're going to bring in the big guns now?
15:50gfredericks"Ah, that's what's slowing it down. That call to identity creates five thousand array maps"
15:51dnolenmjg123: already supported in Chrome
15:51dnolenmjg123: http://www.html5rocks.com/en/tutorials/developertools/sourcemaps/
15:52dnolenmjg123: is the primary resource, they link to the Google SourceMap v3 doc
15:52mjg123dnolen: thanks.
15:52aperiodicdnolen: 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:52dnolenmjg123: http://github.com/clojure/clojurescript/tree/source-map, is the branch
15:53dnolenmjg123: https://github.com/clojure/clojurescript/tree/source-map/src/clj/cljs you can see source_map.clj and the source_map directory there.
15:53dnolenaperiodic: 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:53dnolenaperiodic: Clojure 1.5.0 now has column data, so now's a good time to wrap this up.
15:55dnolenhttp://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:58dnolenso ClojureScript is pretty fast on Raspberry Pi via V8
15:58muhooreally? wow.
15:58scriptornice
15:59dnolenhttp://twitter.com/swannodette/status/258994509755609088
15:59muhooi was running jvm clj on a beagleboard for a while
15:59Frozenlo`dnolen: What have you done! Nooo! No I'll have to buy one!
15:59dnolenwell according to Martin Trojer
15:59Frozenlo`*now
15:59muhoojit compillation and repl was painful, but with the embedded-optimized jvm, an aot compiled clj project worked well
16:00muhoobeagleboard ships with node.js
16:00Frozenlo`While on the subject, anyone tested jvm clj on the raspberry?
16:00scriptoris anyone still selling them, actually?
16:02Mr_Bondthere is something called cubieboard as well which looks cool
16:02Mr_Bondprob not long they get gigE as well
16:02muhoo1gb a8? nice
16:06Mr_BondIt's crazy how cheap small computers are getting these days
16:09Frozenlo`Eh. Code will eat the world :P
16:11hyPiRionhm
16:11hyPiRion(def identity #(`[~@%&](+)))
16:11gfredericksyou win
16:12Bronsawtf
16:13gfredericks&(#(`[~@%&](+)) "swearing in clojure")
16:13lazybot⇒ "swearing in clojure"
16:13CheironHi, 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:13Bronsais github down?
16:13gfredericksCheiron: I like doseq; not sure why you need anything else
16:14thorbjornDXBronsa: it is for me
16:14gfredericksyou can do it with dorun and map
16:14aperiodicyup
16:14Cheironjust expanding my knowledge :)
16:15mattmossGithub was fine for me just a few minutes ago... now very very slow.
16:15hyPiRionBronsa: Looks down from here.
16:15Cheironabout the new reducers. it is a built-in hadoop feature for Clojure?
16:15scriptorhttps://status.github.com/ minor interruption apparently
16:15Bronsajust as i was git pushing :(
16:20thorbjornDXgfredericks: awesome
16:20Bronsagfredericks: lol
16:20dnolenCheiron: nothing to do w/ Hadoop http://clojure.com/blog/2012/05/08/reducers-a-library-and-model-for-collection-processing.html
16:21scriptorgit bash now means something very different
16:22TimMchyPiRion: Now do factorial. :-P
16:23hyPiRion~Factorial
16:23clojurebotfactorial is not something you need alphanumeric characters for: https://gist.github.com/3036120
16:24hyPiRionExcept it's down.
16:24gfredericksthis is that scene where the local champion walks into the arcade with his groupies
16:24hyPiRionheh
16:24Bronsayoutube is down too.
16:25gfrederickswell that's like the whole internet then
16:25scriptorcached: http://webcache.googleusercontent.com/search?q=cache:RmuaRRSWE90J:https://gist.github.com/3036120+&amp;cd=1&amp;hl=en&amp;ct=clnk&amp;gl=us
16:27DaReaper5wow that is rare
16:27TimMchyPiRion: Seriously though, that's a pretty good identify fn.
16:27gfredericks"But watch out." he warns and leaves the arcade.
16:27Frozenlo`What is happening?! Is this the internet kill switch?
16:29xeqihow are we still talking?
16:29TimMcYour local IRC server is running simulations of the other participants.
16:29TimMcbeep boop
16:30gfredericksdoes not compute
16:30emezeskeTimMc: For a second I thought you were the real TimMc. But you gave away your robotness with that beep boop.
16:30DaReaper5this explains everything
16:31hyPiRionTimMc: If you by good mean obscure, then thanks.
16:31TimMcxeqi: When the netsplit is over, your client will use eventual consistency protocols to correct your logs.
16:32DaReaper5ok serious question: i still cannot figure out how to return dynamically created files with a clojure web service
16:32DaReaper5i can do static files
16:32DaReaper5and do not want to create temp files
16:32TimMcIt's just output streams and headers.
16:33DaReaper5ok ill look more into output streams in clojure
16:33xeqiDaReaper5: what do you have so far?
16:33TimMcPick 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:34Mr_Bondmuhoo: I came across this as well: http://lispm.dyndns.org/ccl
16:35DaReaper5xeqi: 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:35DaReaper5functionality to the web service
16:35duck11231DaReaper5: This is a pretty good getting started guide for compojure: http://www.booleanknot.com/blog/2012/09/18/routing-in-compojure.html
16:35xeqi(inc duck11231)
16:35lazybot⇒ 1
16:36DaReaper5just fyi, i am still very new to clojure but am fine with everything else involved (java and client front end stuff)
16:37DaReaper5thanks duck11231
16:39TimMcgfredericks: I can conj onto a list or vector in "swearjure", but I can't figure out how to destructure.
16:40TimMc&(let [existing [1 2 3]] `(~(+) ~@existing))
16:40lazybot⇒ (0 1 2 3)
16:40gfredericksTimMc: you don't have any general way to get locals do you?
16:40gfredericksjust #() args?
16:41TimMcRight.
16:41TimMcI can't bind.
16:41gfredericksis flat lambda calculus turing-complete?
16:41TimMcFlat?
16:41gfredericks#() can't be nested
16:41TimMcOh, heh.
16:42Bronsaoh, github is being DDoSed
16:42TimMcI guess if I can write an interpreter in swearjure then it is.
16:42AimHereWho would DDoS github?
16:42TimMcBitbucket? :-P
16:42xeqiah, beat by TimMc
16:43TimMcAn extortionist, perhaps.
16:43gfredericksleave $1000 in the whole in the south tree in the park and we will let your servers go
16:43xeqiA company trying to lower th price on an aquihire?
16:43gfrederickss/whole/hole/
16:45xeqioooh, someone who really really wants to make sure their project is backed up by constantly creating and pushing to new repos
16:46Mr_Bondis that on beanstalk?
16:47DaReaper5TimMc thanks again for your help
16:47hyPiRion,(#([`[~@(%(+))~@(%(*))]](+))(#([`[~@%&]](+)) [1 2 3] [4 5 6]))
16:47clojurebot[1 2 3 4 5 ...]
16:48hyPiRionAhh, concatenation.
16:48Bronsatfw
16:48scriptor...
16:48hyPiRionYou can destructure with that TimMc
16:48thorbjornDXhyPiRion: what have you done
16:48TimMcI'm so proud.
16:49duck11231I'm a little scared
16:49technomancygreat time to remind folks how easy it is to mirror to gitorious
16:50technomancyand use http://p.hagelb.org instead of gist =)
16:50emezeskePhagelborg
16:50emezeskeThat's fun to say
16:50gfredericksI almost had to type that out myself
16:51gfredericksemezeske: it NEEDs to be a flavor of bagel
16:51hyPiRion"You will be assimilated" - hagelborg
16:51xeqiI'm not suppose to be using refheap.el for my pastes?
16:52technomancyoh I guess
16:52technomancyjust saying: fewer moving parts -> less downtime
16:52technomancythough refheap is on heroku, which is awesome
16:52TimMchyPiRion: I'm all ears.
16:54RaynesConj flights are booked.
16:54Rayneso/
16:54emezeske\o
16:54gfredericks\\\\\o
16:54dnoleno/
16:54TimMc\o/
16:54xeqi/o\
16:54TimMc\o/ /o\ \o/ /o\
16:55TimMc~\o/~ help I'm drowning
16:55clojurebotforget ~paste is gist.github.com
16:55TimMcclojurebot: Fickle, are you?
16:55clojurebotIt's greek to me.
16:55emezeske\o/ /o/ /o\ \o\
16:55gfredericksclojurebot: I forgot that ~paste is gist.github.com
16:55clojurebotAck. Ack.
16:55technomancygfredericks: head asplode
16:56hyPiRionSo if you want to produce e.g. (fn [[a b] c] (+ a b c)) you can just do ##(#(+(%(+))(%(*))(%(+(*)(*))))(#([`[~@(%(+))~(%(*))]](+))(#([`[~@%&]](+)) [4 7] 9)))
16:56lazybot⇒ 20
16:56gfrederickstechnomancy: you gotta recognize when the bots want to play; to not do so is negligent
16:57TimMchyPiRion: If I give you [0 1 2 3 4] can you give me [1 2 3 4]?
16:57bhenryis noir still the preferred way to do web with clojure?
16:58TimMcbhenry: It's never been the preferred way -- it's just one way.
16:58emezeskebhenry: My suggestion is to use compojure, FWIW. Opinions vary.
16:58Frozenlockbhenry: That's what I use, but I think most use compojure directly.
16:58TimMcI found it great for getting something simple running very quickly.
16:58hyPiRionTimMc: Yeah, probably. Let me massage it.
16:59TimMchyPiRion: The best I can figure is a recusive procedure that takes element 1 and recurs to get element 2..n, then prepends.
17:00TimMcHow do you tell when it is done recurring?
17:00ToBeReplacedbhenry: 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:01TimMchyPiRion: Vectors don't support the 2-arity get: ##([1 2] 5 :nope)
17:01lazybotclojure.lang.ArityException: Wrong number of args (2) passed to: PersistentVector
17:01bhenrymaybe i'll just go back to mustache? did anyone find major problems with that library by cgrande?
17:02ToBeReplacedi thought it wasn't supported anymore
17:02cemerickbhenry: mustache isn't very widely used at all
17:02bhenrydag. i liked it better than compojure
17:02TimMchyPiRion: Oh, but ##({[] :empty} [] :not-empty)
17:02lazybot⇒ :empty
17:03TimMcClearly the next step is to write a swearjure assembler.
17:03ToBeReplacedi think compojure/ring are pretty solidly established for at least a little while... whether you use noir on top of that is preference
17:03hyPiRionTimMc: Surely.
17:03cemerickbhenry: 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:03TimMccurje
17:04hyPiRionTimMc: As a vector or as varargs? ##(#({%`[~@%&]}%) 0 1 2 3 4)
17:04lazybot⇒ [1 2 3 4]
17:04bhenrycemerick: that could be. i haven't started a new web project in clojure for some time. i'll look at it again.
17:06hyPiRionHum, it shouldn't be that far for a vector version
17:14TimMchyPiRion: Oh hey, that's right!
17:14TimMchyPiRion: For some reason I was thinking that %& was all-args, not rest-args. >_<
17:16TimMcNow you just need apply. :-P
17:20hyPiRionyeah dangit
17:20TimMcwhich can't be had
17:30TimMcOK, it can be done, but it would be longer than factorial.
17:30TimMcIt needs a helper fn and two if clauses.
17:31TimMcAnd my code's done compiling, so I'll have to do it another time. :-P
17:31hyPiRionoh dog.
17:32hyPiRionAlright, new identity function time
17:32TimMchyPiRion: 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:32hyPiRion(def identity #(`%%%))
17:33TimMcwat
17:33ToBeReplacedit 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:34hyPiRionTimMc: Bleh, I was kind of hoping one could use some tricks with backquoting.
17:34TimMc&('foo 5 5)
17:34lazybot⇒ 5
17:34TimMc_nice_
17:34hyPiRion(#(identity `%) :foo)
17:34hyPiRion,(#(identity `%) :foo)
17:34clojurebotp1__27__28__auto__
17:35ToBeReplacedexamples: 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:36TimMcToBeReplaced: The issue of key vs coll as fn is mostly one of intended semantics.
17:37TimMcE.g. if your associative coll could be nil, you'd use the key as the fn for sure.
17:37gfredericksToBeReplaced: and the second point sounds correct
17:37TimMc&(:foo nil)
17:37lazybot⇒ nil
17:37TimMcIf the key is unknown, the associative coll would be used as the fn.
17:37gfredericksor if the key isn't a keyword
17:38ToBeReplacedi thought in that case you would use (get collection :key)
17:38gfredericksalso that
17:38gfredericksat the very least maps as functions are useful instead of #(get collection %)
17:39ToBeReplacedah, right
17:41ToBeReplacedmaybe 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:42TimMchyPiRion: I know how to stop the recursion!
17:42ToBeReplacedor maybe i just gotta get used to people using :use anyway :)
17:43TimMcIf 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:43aperiodicwait, symbols are functions?
17:43aperiodicthis is news to me
17:43gfredericksaperiodic: just like keywords
17:44technomancyaperiodic: a feature never before invoked on purpose
17:44TimMc&(:key 5 6)
17:44lazybot⇒ 6
17:44hyPiRionTimMc: Sweet
17:44gfredericksaperiodic: it's a secret of clojure which, once you know it, causes you to never again write bad code
17:44aperiodicoh sweet
17:45aperiodicwhen would you want to actually use that, if you're not trying to turn clojure into brainfuck?
17:45technomancyafaict it's only used for obfuscation purposes
17:45gfrederickssymbols-as-keys might come up in macros
17:46gfredericksDue to a copyright claim by Microsoft this code sample has been obfuscated.
17:47aperiodicbut you'd need to quote or unquote-quote the symbol in the macro either way
17:47hyPiRionIt may be used to lookup stuff in a symbol table. (cue bad joke)
17:48aperiodicalthough i guess you might have fully qualified symbols in the collection
17:48emezeske~badum
17:48clojurebotHuh?
17:48gfrederickshyPiRion: a symbol, a keyword, and a string walk into a bar
17:48emezeske~rimshot
17:48clojurebotBadum, *tish*
17:49gfredericksI 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:50hyPiRiongfredericks: The string isn't IFn though.
17:50gfrederickshyPiRion: that's the punchline!
17:50gfredericksnow to figure out the middle of the joke...
17:51hyPiRionheh, well, the keyword is the only one to guaranteed have a colon.
17:51gfredericks,(keyword ":://")
17:51clojurebot::://
17:52hyPiRionor multiple.
17:53gfredericksThree stringoids walked into a bar. Two fell out. Who was left?
17:54aperiodici don't know, gfredericks. who?
17:54amalloygfredericks: 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:55amalloyeg, `(do ~@(map sym->value symbols))
17:55gfredericksaperiodic: one of them!
17:56hiredmanI 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:57aperiodicgfredericks: you like telling shaggy dog stories, don't you?
17:59gfredericksaperiodic: I couldn't orally perform such a thing; my straight faces have a halflife of ~5sec
17:59aperiodicthat's probably a good thing
18:00aperiodici 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:00TimMcheh
18:03PipIs Clojure cool shit?
18:03TimMcVery cool shit.
18:03TimMcBut not the coolest.
18:04TimMcI don't know, what are you trying to ask?
18:04thmzltPip: clojure is just legacy bullshit (https://twitter.com/ryah/status/258634435161899009)
18:05TimMcaperiodic: 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:05TimMcIt was pretty impressive.
18:05gfredericks(->> shit (sort-by coolness) (take 3))
18:05Piplol
18:05PipThat's really impressive
18:05aperiodicTimMc: yeah, it sounds like the same one
18:05technomancyyeah you really need to get on a real non-legacy language like C++
18:06technomancyeverything else just keeps confusing everyone
18:06emezeskeIs this ryah guy a troll?
18:07hiredmanyes
18:07technomancyobvs
18:07aperiodicTimMc: i'm impressed; 30 minutes or so is the longest i've been able to stretch that
18:07TimMcIt might have only been 15 minutes, for all I know -- it *felt* like 30. :-P
18:07technomancyemezeske: so much so that it's actually kind of impressive
18:08emezesketechnomancy: :)
18:09thmzlttechnomancy: touche
18:10dnolenemezeske: normally wouldn't get any attention but he's the creator of Node.js
18:10technomancydnolen: https://mobile.twitter.com/robey/status/258676358086029312 =)
18:10emezeskednolen: Ahhh, I thought that name sounded familiar
18:14thmzlttoo bad I blocked HN here, would love to see what kind of discussion is going on there today
18:15emezeskethmzlt: None, AFAICT.
18:15technomancyyou can catch up at http://shitryandahlsays.tumblr.com/
18:15technomancyI think this is below even the standards of HN
18:16emezesketechnomancy: Even below proggit's radar.
18:16emezeskeImpressive
18:16scriptoroh cool, clojure needs to be euthanized
18:16scriptorat least that'll be quick and painless
18:18amalloyit's aught, isn't it?
18:19emezeskeCan't say I've ever typed it out before :) aught looks better.
18:19hiredman~google aught
18:19ToBeReplacedwow, that guy's awesome... great tumblr
18:19clojurebotFirst, out of 199000 results is:
18:19clojurebotAught - Definition and More from the Free Merriam-Webster Dictionary
18:19clojurebothttp://www.merriam-webster.com/dictionary/aught
18:20hiredman~google ought
18:20clojurebotFirst, out of 8420000 results is:
18:20clojurebotOught - Definition and More from the Free Merriam-Webster Dictionary
18:20clojurebothttp://www.merriam-webster.com/dictionary/ought
18:21hiredmanoh, 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:21emezeskeIt sounds like "aught" is a bastardization of "naught"
18:21emezeskeWhich makes sense, as "naught" means nothing (zero)
18:21aperiodicaught prounoun 1) anything 2) all, everything; noun 1) zero 2) nothing
18:21aperiodici <3 english
18:21emezeskeAlthough "nought" is apparently a valid variant of "naught"
18:21hiredmanhttp://i.imgur.com/OfN6N.jpg
18:22aperiodic^ truth
18:22emezeskehiredman: hahahaha
18:22aperiodicthat's why it's so much fun
18:57callena 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:00dnolencallen: perhaps, but partition is pretty useful when writing macros that involving the binding forms.
19:00emezeskecallen: A bit contrived? Things like 4clj and clojure-koans are completely contrived, that's the point.
19:00emezeskecallen: If you want non-contrived, give yourself a project and build it.
19:01technomancynon-contrived exercises don't scale
19:01technomancyactually "non-contrived exercise" is probably self-contradictory
19:01emezesketechnomancy: Exactly
19:03TimMccallen: OK, we can write some nice little exercises involving JDBC or shelling out.
19:43doomlordthe 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:43doomlorddo i need to turn the result of the map into an actual vector first or something
19:43emezeskedoomlord: Maybe use mapcat?
19:44emezeske,(mapcat (fn [x] [x x]) [1 2 3 4])
19:44clojurebot(1 1 2 2 3 ...)
19:44doomlorddidn'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:44gfredericksdoomlord: almost certainly your issue is not about the difference between vectors and seqs
19:44emezeske,(apply concat (map (fn [x] [x x]) [1 2 3 4]))
19:44clojurebot(1 1 2 2 3 ...)
19:45doomlordmapcat works ; but i'd like to know what went wrong before
19:45emezeskesee above ^
19:45emezeskemapcat is not really a special case, it's just a convenience function because that's so common
19:45emezeskeI'm guessing you left off the apply before?
19:46doomlordok apply works too. yes i left of the apply. why is the apply needed
19:46gfredericksconcat is variadic
19:47doomlord(i knew of "apply" from common-lisp being apply a function to an arg array)
19:47gfrederickssame thing, it sounds like
19:47doomlordok silly me i see it now.
19:47emezeske,(concat [1 2] [3 4] [5 6])
19:47clojurebot(1 2 3 4 5 ...)
19:48emezeske,(apply concat [[1 2] [3 4] [5 6]])
19:48clojurebot(1 2 3 4 5 ...)
19:48doomlordi was doing (concat [ other lists]). idiot.
19:48gfredericksa side effect is that concat with one arg does nothing, which is confusing
19:48emezeskedoomlord: Not idiot! Just learning.
19:49doomlordthe repl is an awesome tool for breaking down what the expressions do, i should have been able to figure that out :)
19:54callenTimMc: JDBC? Who do you think I am, Mark Pilgrim?
19:56callenmy deeper point is that using things like partition isn't the hard part, although knowing the idioms is useful.
20:01amalloyif 4clojure could effectively teach whatever you think is "the hard part" of programming, we'd have venture capital by now
20:03emezeskeamalloy: Please make 4clojure download a decade of experience into my brain, matrix style.
20:03emezeske"I know computer science."
20:04doomlordforeclosure ?!
20:04TimMcdoomlord: No, 4clojure!
20:04doomlord:)
20:05doomlord"i know economic collapse"
20:05TimMchaha
20:05TimMccallen: Are you envisioning purely algorithmic stuff?
20:06emezeskeaperiodic: After "Show me," I prove that there is no halting problem after all, and compress something below the threshold of its Kolgomorov complexity.
20:06aperiodicas Math crumbles around you like so many cathode-green glyphs
20:07emezeske:)
20:07aperiodici'd watch that movie
20:07TimMcWhat if I told you...
20:08TimMc...that you can parse XML with one regular expression?
20:10emezeske*irregular expression
20:16TimMc(I *have* used a regular expression to parse HTML, but I also had a stack, so it was OK.)
20:19RaynesI once parsed a regular expression with a regular expression.
20:20TimMcIs that...
20:20TimMcNo, you can't. OK.
20:21TimMcWhoa! I think this is right: Regular expressions are a context-free language at minimum, and CFGs are regular at minimum.
20:21ivantoo often I've replaced >< with >\n< and used a state machine to pull something out
20:21ivanmaybe because I was working in a language with a vulnerable XML parser
20:24aperiodicTimMc: doesn't the second statement follow from the equivalences between regular langs & DFAs and CFGs & stack machines (which are just DFAs with memory)?
20:24ohpauleezBy the code of the internet we must tell the obligatory RE joke:
20:25ohpauleezYou have a problem and you think, "I'll solve this with a regular expression." Now you have two problems.
20:25gfredericksaperiodic: those things aren't equivalent
20:25gfredericks(RE == DFA) != (CFG == SM)
20:25gfredericksor maybe you meant that
20:26gfredericksnow that I distinguish 'and' and '&'
20:26aperiodicyeah, two pairs of equivalances
20:29amalloyi don't think i understand TimMc's "whoa" at all. though i'm totally in favor of his "what if i told you"
20:30aperiodicamalloy: 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:30TimMcaperiodic: 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:30TimMcNope, not saying anything about the relationship between regular langs and context-free langs.
20:30gfredericksare non-balanced parens legal?
20:31aperiodicoh, ok
20:31gfredericks,#"(6"
20:31clojurebot#<ExecutionException java.util.concurrent.ExecutionException: java.lang.RuntimeException: java.lang.ExceptionInInitializerError>
20:31gfredericks&#"(6"
20:31lazybotjava.util.regex.PatternSyntaxException: Unclosed group near index 2(6 ^
20:31TimMc,#"\Q(\E"
20:31clojurebot#"\Q(\E"
20:31TimMc*10 days later*
20:31gfredericksTimMc: is there anything else non-regular aside from the parens?
20:32TimMcgfredericks: Not that I'm aware of.
20:32gfredericksof course programming language regular expressions do not describe only regular languages
20:32amalloyTimMc: to be clear: you're saying that to recognize whether something is a valid regex, you need a context-free grammar?
20:33TimMcamalloy: Yes.
20:33gfredericksthat's been my assumption too
20:33TimMcRecognizing ((((())))) requires a stack.
20:33amalloyi wouldn't be astonished to discover you need a context-sensitive grammer
20:34gfredericks&#"()\4"
20:34lazybot⇒ #"()\4"
20:34gfredericks^ is that a back-reference?
20:34TimMcI can never remember what each re parser uses for back references.
20:34clojurebotThat's not my job.
20:34TimMcMine neither.
20:35gfredericksin any case it's the back-references that allow the regexes to describe non-regular languages
20:35amalloy&(re-seq #"(a)\4" "aba\\4")
20:35lazybot⇒ nil
20:35amalloy&(re-seq #"(a)\1" "aa\\4")
20:35lazybot⇒ (["aa" "a"])
20:36gfredericksso java at least allows out-of-bounds backrefs
20:36amalloyi think #"(a)\4" is a regex recognizing nothing, because the \4 backref can't ever be matched
20:44TimMcamalloy: I never learned CSGs. :-/
20:45TimMcAnyway, CFGs would be fine for REs.
20:51Hodappdamn, 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:55emezeskeHodapp: Because cyclic graphs are useful? :)
20:58Hodappemezeske: Out of curiosity, can I make a map refer to itself sanely?
20:59emezeskeAn immutable map technically can't have a reference (i.e. a pointer) to itself
20:59emezeskeBut...
20:59emezeskeIt could contain a sort of path to a submap
20:59emezeskee.g. {:a {:b {:c [:a :b]}}
20:59gfredericksmaps of refs of maps of refs of maps of atoms of futures to themselves!
21:00TimMcemezeske: Unless you're in Haskell.
21:00Hodappsince I know Clojure allows lazy sequences, but lazy maps are another matter I suppose
21:00emezeskeTimMc: Is that so?
21:00TimMcI think so.
21:00gfredericksHodapp: https://github.com/fredericksgary/lazy-map
21:00TimMcsome kind of delayed binding
21:00emezeskeTimMc: I guess if you know where the map will be before you create it?
21:00emezeskeAh
21:01TimMchttp://www.haskell.org/haskellwiki/Tying_the_Knot
21:01emezeskeTimMc: Thanks, looks like a neat read!
21:01TimMcAnd I believe there are some Schemes wherein a future/promise/delay/what-have-you is actually replaced by its referent when realized.
21:02Hodappthe 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:02gfredericks&(let [p (promise) coll (lazy-seq [@p]), m {:selfs coll}] (deliver p m) m)
21:02lazybotjava.lang.StackOverflowError
21:02hiredmanI wlll trot out letfn-
21:03Hodapphiredman: to me?
21:03hiredmanhttps://gist.github.com/1179073
21:04Hodappin other words, CF3 lets you express a scene graph that can be, er, recursive.
21:04Hodappand rendering simply bails out when things become too small
21:05Hodappor your computer catches on fire.
21:11amalloyhiredman: 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:11TimMc&(let [p (promise) s (lazy-seq (cons @p nil))] (deliver p s) (identical? s (first s)))
21:11lazybot⇒ true
21:12hiredmanamalloy: yes
21:12TimMcOh hah, I ended up with the same solution.
21:12hiredmanall immutable like
21:19nightfly_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:20TimMcI don't believe so. Raynes?
21:21Raynesnightfly_: 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:21xeqinightfly_: no, it just prevents forms with that
21:22nightfly_Raynes: Cool, thank you
21:22RaynesYou 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:23cemerickRaynes: can't you hook the blacklisted var to throw when it's called?
21:23RaynesThat is an option to.
21:23Raynestoo*
21:23RaynesIt still isn't great though.
21:23cemericksounds like a future feature
21:24RaynesI don't think I'd do it. It's too unreliable.
21:24RaynesA function might refer to the actual function and not the var.
21:24quidnuncAre Ubuntu packages sufficiently current?
21:24RaynesIt'd be easy enough to break, seems like.
21:24RaynesYou'll want leiningen and not any 'clojure' packages.
21:25RaynesI'd suggest not using Ubuntu packages for anything Clojure related though.
21:25TimMcquidnunc: And don't get leiningen via APT.
21:25cemerickRaynes: as long as the blacklist was "applied" prior to the untrusted code being loaded, that shouldn't matter
21:26Raynescemerick: 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:26xeqiit'd be inconsistent with blacklisting namespaces or java calls
21:26xeqiquidnunc: leiningen.org since no one else plugged it
21:38Sgeoantares... isn't here
21:38Sgeodarnit
21:56ivan,(persistent! (let [x (transient {})] (conj! x [1 (persistent! x)])))
21:56clojurebot#<RuntimeException java.lang.RuntimeException: java.lang.IllegalAccessError: Transient used after persistent! call>
21:59S11001001ivan: cheeky but ultimately futile attempt to tie a knot
22:00S11001001ivan: gotta exploit CLJ-893 for that nonsense
22:01ivanhah, neat
22:08gfredericksS11001001: lazy-seq + promise
22:09ivan&(let [a (to-array [nil]), v (vec a)] (do (aset a 0 v) (v 0)))
22:09lazybotjava.lang.StackOverflowError
22:10gfredericksyes you can also do it with mutable data structures
22:10gfredericks&(let [a (to-array [nil])] (aset a 0 a) a)
22:10lazybot⇒ #<Object[] [Ljava.lang.Object;@4d031d>
22:10S11001001gfredericks: that's patently mutating an immutable data structure
22:11gfredericksS11001001: lazy-seq and promise is?
22:11S11001001gfredericks: no, the 893 method
22:11gfredericksoh okay
22:11S11001001gfredericks: but sure, use mutables in documented ways and you get knots
22:11gfredericksnot so much mutable as lazy
22:12gfredericksit's like half-mutable
22:12ivanI was kind of hoping immutables were actually immutable
22:12S11001001ivan: me too
22:12TimMcgfredericks: mutate-once
22:12S11001001mutable/immutable is a dichotomy
22:12TimMcmutate-before-read
22:12gfredericksTimMc: that still sort of implies it had two different values
22:13gfredericksS11001001: 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:13callenTimMc: far from it @ envisioning purely algorithmic stuff
22:13callenTimMc: more like, "how do I cope with the fact that I am surrounded on all sides by terrible Java libraries?"
22:13ivanyou can blow up just about anything with the recursive vector constructed above
22:19ivanif someone really likes the current behavior maybe it could be hidden behind an *unsafe-alias* true binding
22:21ivan(do Java arrays have some internal version number?)
22:21ivaneh, who am I kidding, there's no way
22:22gfrederickswhat would that be used for?
22:22ivanthrowing an exception if it's mutated and you didn't expect it to be mutated
22:23gfredericksbut this is java. not expecting your array to be mutated is like not expecting your program to be run.
22:23ivanright :)
22:23gfredericks....and that would be pretty bad for perf
22:23Hodappgfredericks: If you get away without having your program run at all, I'd say that's a fairly substantial optimization
22:24KhaozHi all.
22:24TimMcgfredericks: Maybe you could use it to detect if your array *hasn't* been mutated recently, and throw in that case.
22:24TimMcClearly, something must be wrong, right?
22:24gfrederickslol
22:24ivanWarning: code has no side effects
22:25TimMccons¡
22:26KhaozI'm trying to setup nrelp on my emacs, but without success
22:26Khaozi have lein 2 installed using brew and it's under /usr/local/bin
22:26aperiodicTimMc: lol!
22:26Khaozi also have this in my init.el: (add-to-list 'exec-path "/usr/local/bin")
22:26TimMcaperiodic: A destructive lol.
22:27Khaozand also tried to setup nrepl-lein-command to the full path of lein (/usr/local/bin/lein)
22:27Khaozbut ... error in process sentinel: Could not start nREPL server: /bin/bash: lein: command not found
22:27Khaoz:(
22:28technomancyKhaoz: there are other ways to fix the path fiasco on OS X
22:28technomancyI think maybe the clojure-mode doc/ directory covers that?
22:28Khaozhumm
22:29Khaoztechnomancy: thank. I will take a look
22:30KhaozEmacs Setup on OS X - todo
22:31technomancysupposedly the "proper" fix involves editing plist xml files
22:31technomancyso even if I knew the answer I couldn't tell you it with a clean conscience
22:32Khaozno problem
22:33callenKhaoz: I've used nrepl quite a bit on my mac.
22:33callenKhaoz: and I have a rather elaborate emacs setup that I use between Linux and Macs regularly.
22:33callenKhaoz: can I help?
22:33Khaozbut did you installed it using homebrew ?
22:33callendid I installed what?
22:33Khaozlein
22:33callenthere are like, 10 possible components you could be talking about here.
22:33callenwhy the hell would you do that?
22:33callendon't do that.
22:33Khaozhumm
22:34Khaozit's a good start
22:34callentechnomancy went to the trouble of making a nice magical script.
22:34callengo use that.
22:34Khaozi have everything installed using homebrew
22:34Khaozclojure, lein..
22:34technomancyI would say use whatever's consistent with the rest of your system, except homebrew is kind of clown shoes
22:35callenKhaoz: stop using homebrew for stuff like that, it's not like apt or yum.
22:35technomancydefinitely don't need to bother installing clojure
22:35callenKhaoz: reserve it for libraries and random odds and ends.
22:35callenKhaoz: and like technomancy said...if you're using lein, you don't gotta install clojure.
22:35technomancyOTOH installing stuff by hand is kind of skooky
22:35callenlein just treats "clojure the language" as yet another jar. because it is.
22:35callentechnomancy: okay, I gotta know. skooky?
22:35technomancybut in this case it's probably the lesser of two evils
22:35callenit's not really a big deal.
22:35technomancycallen: sketchy; wacky; silly
22:36callenfair.
22:36cemericklol @ clown shoes
22:36callenit really is clown shoes though.
22:36technomancyevery 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:36callento install clojure on my mac, I just make certain the java install is sane, install my emacs environment, then install lein.
22:36callenEverything from there is managed by lein.
22:36Khaozinstall things by hand is not a issue for someone that have used slackware for 4 years :)
22:36cemerickpackage management doesn't exist on the mac, period.
22:36technomancycemerick: but but but... macports =D
22:36Khaozi will review what i have made and try another method
22:36cemerick~guards
22:36clojurebotSEIZE HIM!
22:37technomancyclojurebot: macports?
22:37clojurebotHuh?
22:37callentechnomancy: macports is even worse.
22:37technomancyclojurebot: macports is not a package manager, it's a satire about package management.
22:37clojurebotAck. Ack.
22:37callenfink is worse still.
22:37callenlol ^^
22:37cemerickoh gawd fink
22:37technomancyhahaha
22:37callenKhaoz: get your emacs sane, check your java install, then just install lein as the plain vanilla script.
22:37technomancycemerick: supposedly you can get nix working on OS X
22:37callenKhaoz: then just go from there.
22:37cemerickI was all about fink for about 3 weeks
22:37cemericknix?
22:37callenKhaoz: stop futzing around with homebrew for things its awful at.
22:37clojurebotnix 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:38callengotta say. Not a fan.
22:38cemerickoh, whatever
22:38Khaozcallen: ok. Thanks! :)
22:38xeqileiningen isn't in the mac app store?
22:38callen...
22:38xeqimissing out on an oppertunity there
22:38callentechnomancy: start charging $4.99 for leiningen on the app store.
22:38callentechnomancy: you'll make...hundreds.
22:39cemerickI'll bet cygwin has a better package manager than bew.
22:39cemerickbrew*
22:39quidnuncpackaging has become mental again.
22:39callencemerick: it does, they at least have the benefit of binaries.
22:39quidnuncAfter a few years of sanity
22:39technomancycallen: would that even be legal?
22:39technomancyI kind of hope not
22:39callentechnomancy: doesn't it belong to you?
22:40callentechnomancy: leiningen that is.
22:40xeqijust parts of it
22:40cemerickIt's all EPL; anyone could package it up and sell it.
22:40callenoh wow, time to go make some beer money
22:40cemerickExcept, it requires the JVM, so the app store is out anyway.
22:40callencemerick: nah you could wrap it up in a GUI.
22:41aperiodichot on the mac app store: leiningen wizard
22:41cemerickThat downloads and exec's the JVM? Probably not.
22:41HodappCygwin's package manager appears to basically be "run the installer again and add packages"
22:41callencemerick: is that a bet?
22:41callentechnomancy: will you get offended if I start selling a GUI wizard to leiningen for $4.99?
22:41callenjust to make cemerick mad.
22:41cemerickhardly :-P Just what I remember of the app store policy w.r.t. the JVM
22:42callenMac App Store is looser than iOS App Store.
22:42cemerick*shrug*
22:42callentons of non-cocoa+obj-c stuff on there.
22:42tali713callen: that sounds like a great idea.
22:42doomlordare there converters to compile jvm code -> native
22:42doomlord(some subset of )
22:42callentali713: what? the graphical leiningen wizard?
22:43tali713yes.
22:43cemerickHodapp: you can't run apt or something with a different set up cygwin-only repos?
22:43callentali713: you really don't want to encourage my craziness.
22:43Hodappdoomlord: Yes.
22:43tali713I enjoy good jokes made into tools.
22:43callenI enjoy tools that make good jokes.
22:45Hodappdoomlord: Look up NestedVM.
22:45cemerickApropos of nothing, I predict seeing more Surface Pros at confs in 2013 than laptops running linux.
22:46callencemerick: wat.
22:46cemerickcallen: heard it here first. :-P
22:46aperiodicit seems like that would be heavily dependent on which conferences exactly you mean
22:47calleneverybody forgets the incorrect predictions...
22:47cemerickeh, the ones I care about. :-) Strange Loop, Conj, etc.
22:47callenno need to buy a surface, the laptop was perfected long ago thanks to the Thinkpad.
22:47tali713i don't, but i should keep a journal for better verification.
22:49aperiodichuh. 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:49technomancycallen: the app store is an offence to all that is good about computing
22:49technomancyit would grieve me deeply to see my code on it
22:50callentechnomancy: I feel similarly. I'm sorry for even evoking such agony.
22:50tali713technomancy: what about a gui that just uses exec to run lein?
22:50cemerickHasn't Ubuntu already rebranded its apt GUI as an "app store"?
22:50technomancycallen: most of my non-clojure code is copylefted in such a way as to prevent that
22:50callentechnomancy: did you know I use leiningen as the "good child" when larting other people over the head for their package/project management tools?
22:51technomancyEPL is still copylefted, but I'm not sure it's enough to prevent that kind of abuse
22:51technomancycallen: haha; nice
22:51technomancytali713: well I have no idea as to its legality, but it would still bum me out
22:52callentechnomancy: 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:52tali713technomancy: oh, well, I was more curious than anything. I pretty much loathe the appstore.
22:52callentechnomancy: for people who are obsessed with reliability/stuff-not-breaking, the haskell community has an incredibly unreliable package manager.
22:52technomancycemerick: 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:53technomancycemerick: 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:53quidnunctechnomancy: What do you use now?
22:53technomancyand I was in for a nasty shock
22:53technomancyquidnunc: debian stable plus nix
22:53quidnunctechnomancy: Why stable?
22:53callentechnomancy: you definitely don't do web dev if you don't want flash :P
22:53technomancyquidnunc: because it never ever breaks
22:53technomancycallen: thank goodness =)
22:54technomancyquidnunc: and because nix gets me everything I need that's newer and not in stable
22:54callentechnomancy: not that proper web devs *use* flash for anything serious, but you still have to be running it.
22:54technomancyand nix never ever breaks either, but for a different reason
22:54callenlast time I used flash was for a websockets fallback.
22:54cemerickI don't think I've deployed an flv for ~4 years
22:54technomancyat least it never breaks in a nontrivial way
22:55quidnuncWas nix written by the guy who wrote ion? I remember he proposed this type of package manager many years ago
22:55Hodappwhat is nix?
22:55quidnunchttp://nixos.org/nix/
22:55callennix?
22:55clojurebotnix 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:55callenHodapp: ^^
22:56technomancynix is amazing
22:56technomancythe papers they have on it are pretty accessible too
22:56technomancyimmutable package installation <3
22:57callenthe weird package management/linux distro I was excited about was GoboLinux
22:57callenI was so sad it didn't take off :(
22:58quidnuncOnly 2500 packages :(
22:58xeqitechnomancy: have you tried nixOS?
22:58callenyou people ask strange questions.
23:00technomancyxeqi: haven't taken the plunge yet; I get the feeling it doesn't have critical mass yet
23:01technomancythe 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:03callenso, serious question. Who's thickey?
23:03TimMcRich's brother, I believe.
23:04callenI'm incapable of seeing "*hickey*" without thinking of our glorious leader.
23:04TimMcTom.
23:04callenoh lord, I was half-kidding.
23:04callenso he's a programmer too?
23:04TimMcI think so.
23:04TimMcISTR he wrote some Clojure library...
23:05callenTimMc: http://tomhickey.com/ ?
23:05technomancythe enclojure logo is really great
23:05callenthis twitter picture is hilarious.
23:07callenTimMc: well, guessing from his twitter, Rich's brother is quite the character.
23:08KhaozWell.. good night guys.
23:09Khaozthanks for the help. I will continue tomorrow :)
23:11jodaroso
23:12jodarois clojurescript one still the best place to start for a not really front end web guy?
23:13jodaroi've been noir'ing but i figured i should see what all the kids are doing
23:14callenjodaro: clojurescript is a tower of abstraction you don't want to get into unless you already understand frontend.
23:14callenjodaro: stick with plain DOM + jQuery until you feel comfortable, then add a layer.
23:15jodarocallen: cool, sounds like a good idea
23:15jodaroi'm putting together a pretty basic app for a friends company
23:16technomancyis clojurescript one still maintained?
23:17technomancyI got the impression it was pretty wonky from a tooling perspective
23:18callenhasn't been touched in 9 months.
23:18callenI 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:19callenso many great clojure presentations, yet they're all on InfoQ
23:20callenI...really hate infoQ.
23:20callentechnomancy: wait a second, how do you watch Hickey's talks if you don't use flash?
23:21jodaro yeah, i started to watch the clojurescript one video and started to get a little lost
23:22jodaroand then noticed it hasn't been committed upon for a while
23:22jodaroso was just wondering if there was a latest and greatest
23:22jodarobut
23:22callenjodaro: just don't.
23:22jodaroi'll just stick with noir+hiccup+twitter bootstrap
23:22jodarowhich is what i've started with
23:22callen...close enough.
23:23callenI'd skip the bootstrap unless you need something tolerably attractive ASAP
23:23callenif your goal is to learn.
23:23jodaroi want it to be reasonably attractive, yeah
23:23technomancycallen: view source, occasionally preceded by M-x user-agent android
23:23jodarobecause its an internal tool for non technical types
23:23jodarobut it doesn't have to do much
23:24technomancya lot easier to work with than bootstrap if you don't know what you're doing
23:24technomancyfor me anyway
23:24jodarocool, i'll look at that too
23:24callenjodaro: 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:24jodarobootstrap seems to be working for me so far
23:24jodaroi don't think i'm going to use a ton of features
23:24callenmy frontend guy at my company has been flipping his wig over ripping bootstrap out for awhile now.
23:25technomancyyeah, I felt like I was fighting it every step of the way
23:25callentechnomancy: that works on InfoQ?
23:25callentechnomancy: setting your user-agent to android?
23:25technomancycallen: yeah
23:25technomancyone of the sites you have to grab it from the rss; I forget which
23:26TimMchyPiRion: I've got a working skeleton for "rest" in curje.
23:26TimMchyPiRion: https://gist.github.com/gists/3916042
23:26callenif only I'd known! :(
23:26technomancyI think one of the talks he gave at an oracle conf. isn't available for download, but the rest are easy
23:27callentechnomancy: 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:28callenhow 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:28callen(I can't do audio, need text)
23:28technomancycallen: well, just follow the money
23:28technomancygetting a good AV setup doesn't come for free
23:28technomancyand it doesn't happen out of the goodness of their hearts
23:29callenso am I liable to get sued in htis hypothetical scenario?
23:30jodarohypothetical federal prison
23:31callenwat.
23:31callenit's content that's freely accessible on the web, when did scraping become illegal?
23:31aperiodiccallen: well, what's the usual answer to "what happens if I try to distribute copyrighted content for free in the United States"?
23:31callenit's freely accessible.
23:31callenjust difficult to access.
23:32aperiodicdoesn't matter
23:32callenwell, guess I better host the servers in somalia.
23:32aperiodicit's still copyrighted, and they can still choose to exercise their copyright through a variety of legal avenues
23:33technomancyaperiodic: well, the video is copyrighted
23:33callenI expressly do not want the video.
23:33callenDespise the video/audio.
23:33callenSynchronous communication is slavery.
23:33technomancyI think the derivative work status of the words it contains is debatable
23:33aperiodicoh, sorry, missed the transcription bit
23:33technomancyprobably depends on the wording of the release form he signed
23:34technomancyinfoq sends "please don't do that" notices to blogs that explain how to do the user-agent/view-source download trick
23:34technomancythey don't seem overly hostile, but they do pay attention
23:35quidnunccallen: Hosting servers abroad didn't seem to work for Kim Dotcom
23:36callenNo comment.
23:37hiredmaninfoq is great
23:37hiredmantons of content for free
23:38callenhiredman: I'm going to find it hard to take your word for it if you tell me a library is great in future :(
23:38ChongLidoesn't the ADA require video be accessible to the deaf and hard of hearing?
23:38callenthat's my issue, I need text/image only.
23:38ChongLiI wonder if that'd put a wrinkle into the copyright issue
23:40technomancydoesn't apply broadly commercially
23:40TimMcRight, there could be a fair use defense.
23:40TimMcMaybe.
23:41callenreproductions of copyrighted content intended to enable accessibility by groups covered under the ADA are exempted from copyright liability/crime
23:41callen17 USC 121
23:41callenSection 1201 DMCA exception
23:42callenVideo Accessibility Act 2010
23:42callenseems good enough to me.
23:42callen90% odds they rip my genitals off, but say sorry afterwards.
23:43aperiodicsuddenly, the number of deaf/hard-of-hearing clojurians skyrockets
23:43callenaperiodic: makes sense to me, why else all the def and defn'd people?
23:43TimMcurgh
23:44aperiodicthat was awful
23:44aperiodic(inc callen)
23:44lazybot⇒ 2
23:44callenaperiodic: thank you, I take great pride in that. You should try sharing an office with me.
23:45aperiodicthere are few things better in life than truly awful puns
23:50callenWhat 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:50callens/\?/\!/g
23:59TimMcgfredericks, hyPiRion: Yay, I made 'rest in swearjure! https://gist.github.com/3916042