#clojure logs

2012-10-08

00:09Goshis there a way to create local variables?
00:09Goshi meant private*
00:09Goshlike defn- for functions
00:24SgeoGosh, yes
00:24SgeoSet the private metadata
00:24Sgeo(def ^:private foo 5)
00:25SgeoOr (def ^{:private true} foo 5)
00:37Goshthanks
00:38SgeoYou're welcome
00:48callenwhat are the main differences between using Noir and a normal Jetty server?
00:48callenis there any reason not to use Netty?
00:48callenoh I see, Jetty is actually faster most of the time, interesting.
00:52GoshI am wondering if, when Java will support lambda expressions, will we be able to use #() instead of proxies?
00:59SgeoGosh, well, there's still a lot of old APIs that would be written in terms of accepting an instance of a class that implements an interface...
00:59SgeoBluh, mouthful
01:00SgeoNew APIs would probably accept fns directly, but old ones might not, but that depends if Java might provide some convenience for dealing with the situation
01:00SgeoI should note that I'm not particularly a Java person
01:00frioi wonder if they'll simply equate a newstyle lambda with a callable Sgeo
01:01frio(Callableis the standard Java interface for a closure, basically)
01:03Sgeofrio, what about APIs that don't accept Callable? I believe that all Clojure fns are Callable, aren't they, so in situations where an API does accept Callable, there should already be no need for reify
01:04frioyeah, true enough.
01:16SgeoWait, all Clojure fns being Callable doesn't make sense
01:17Sgeo,(supers #(+ 1 1))
01:17clojurebot#<ClassCastException java.lang.ClassCastException: sandbox$eval27$fn__28 cannot be cast to java.lang.Class>
01:17Sgeo,((comp supers class) +)
01:17clojurebot#{clojure.lang.IMeta clojure.lang.AFunction clojure.lang.IFn clojure.lang.AFn java.io.Serializable ...}
01:19SgeoHmm, apparently it can be
01:20SgeoI don't entirely get what happens if you .call a function that requires arguments
01:20Sgeo,(.call (fn [x] x))
01:21clojurebot#<ArityException clojure.lang.ArityException: Wrong number of args (0) passed to: sandbox$eval81$fn>
01:21SgeoAh
01:33amalloylast time i read the java lambda proposal, it was syntactic sugar over one-method interfaces
01:36amalloyso {x => x + 1} or whatever their syntax is gets "expanded" to new MyFunctionType<Integer, Integer>() {public int call(int x) {return x + 1;}} // based on the expected interface
02:08john2xis there a color library for clojure? or the preferred way to convert between color values (hex to rgb, vice versa, etc.)
02:34hyPiRionjohn2x: ##(Integer/parseInt "AABBCC" 16) ?
02:34lazybot⇒ 11189196
02:35hyPiRion,(format "%x" 0xAABBCC)
02:35clojurebot"aabbcc"
02:36john2xhyPiRion: for rgb, i was thinking something more like [128 128 128]
02:37john2xi already wrote a helper function for rgb-to-hex, and I'm about to write one for the reverse, but maybe there's already a wheel for this.
02:39hyPiRionI'm not aware of any, I'm afraid.
03:03AmarylHi!
03:04AmarylThe book "Clojure programming" talk about the Clojure programming language, but does not even explain what is a closure :(
03:04AmarylI see this example in the book
03:04Amaryl(defn doubler [f] (fn [& args] (* 2 (apply f args))))
03:04Amarylis this a closure?
03:18hyPiRionAmaryl: yes, indeed it is
03:18hyPiRionIt's the same as (defn doubler [f] (let [f f] (fn [& args] (* 2 (apply f args)))))
03:19amalloyhyPiRion: in what way is that an interesting comparison? anytime f is in scope, you can add as many instances of (let [f f]) as you want
03:22augustlis there a way to make lein-ring use one handler for dev and another when running as a .war in prod?
03:24hyPiRionamalloy: Closures are "more visible" when shown within a let
03:27hyPiRionOr well, closures are introduced as (let [foo ...] (fn [...] (... foo ...)))
03:53AmarylThanks hyPiRion
04:22wei_is there yet a clojurescript library that wrap the google closure animation libs?
04:22wei_or for doing any kind of animation, for that matter
07:54CheironHi, is it idiomatic to let inside a let?
07:55adufrom my experience from other lisps, only if it's a different type of let, like letrec or let*
07:59pandeirois it possible to output just a 'blank' js file with only gclosure + cljs.core with lein-cljsbuild?
07:59Cheironedu: i have this http://pastie.org/4932599
08:00Cheironfirst i need to log, then start operations
08:01Cheironin my sample, the log might not even issued if operations throw exceptions
08:05WasserkraftwerkCheiron, do you play StarCraft?
08:06CheironWasserkraftwerk: should I ?
08:06WasserkraftwerkNot really, just wondering.
08:07GoshHow do you cast to a java class in clojure?
08:07ChousukeTheFinnMINÄ OLEN CHOUSUKE SUOMALAINEN, MINÄ SYÖN POROT
08:09clgvGosh: you dont. you can use type hints to tell the compiler which method to use
08:42Gosh(def ^Foo test (-> obj .method .toFoo))
08:42Gosh(-> test .someFooMethod) => No matching method found: someFooMethod for class $Proxy1
08:43GoshI would like to cast to Foo after calling toFoo method
08:43GoshtoFoo returns an Object
08:44Goshan object of class Object*
08:45gfredericksthings are generally considered objects at runtime in clojure. If the method exists on the actual class of the object in question then it should work fine
08:45gfredericksfor some reason your .toFoo method is returning a $Proxy1 instead of a Foo
08:55Goshworks now, forgot to pass some arguments to someFoo method >_>
08:55GoshI dont even need ^Foo hint anymore, nice
09:00gfredericksyeah it's generally not needed
09:10_ulisesI've just installed nrepl (been using slime/swank for a good while now) and I'm a bit lost as to how to do things. In my previous setup I'd C-x C-k to compile a clj file and if I changed namespaces in the REPL I'd have everything ready. When I try to do this using nrepl I get a bunch of class not found exceptions.
09:11_ulisesI've started nrepl using jack-in however this never asked me for a project directory or anything so it's not surprising it's not finding anything.
09:48kralnamaste
09:59antoineBhello, is "(def ^{:dynamic true :private true} *global-var* nil)" is ok, for a var which shouldn't be seen outside namespace?
10:00chousersure
10:00chouseror (def ^:dynamic ^:private *global-var* nil)
10:01antoineBok
10:01antoineBso "^:" is some sugar for ^{:... true} ?
10:02Bronsayes
10:02Bronsabut it's only available for >=clojure-1.3.0
10:06antoineBi do some clojure script
10:06Cheiron_hi, what is the diff between map and mapcat? mapcat will call concat but .. so what? what is the impact
10:07gfredericksCheiron_: you get a flatter sequence than with map
10:07gfredericksassuming your map function returns a sequence itself
10:07gfredericks,(map range [1 2 3])
10:07clojurebot((0) (0 1) (0 1 2))
10:07gfredericks,(mapcat range [1 2 3])
10:07clojurebot(0 0 1 0 1 ...)
10:08Cheiron_gfredericks: eye c!
10:08gfredericks~yay
10:08clojurebotPardon?
10:08casionI see
10:08gfredericksclojurebot: yay is sweet
10:08clojurebotc'est bon!
10:08casionwee
10:08Cheiron_gfredericks: muchas gracias
10:08gfredericksCheiron_: no probalo
10:09Cheiron_clojurebot: if you make yourself more than just a man, if you devote yourself to an ideal, then you will become something else entirely
10:09clojurebothiredman is slightly retarded
10:09casionLOL
10:09gfredericks~rimshot
10:09clojurebotBadum, *tish*
10:39doomlordis there an existing macro for repeated application: (((f)a)b)c) = (??? f a b c) ... kind of like -> but backwards
10:40doomlordif not, any suggestions on what you'd call that
10:40casiondoomlord: your example is confusing to me
10:40doomlorduse case: accessing nested datastructurse
10:41casiondoomlord: you'd just use -> for that
10:42doomlordisn't that repeated *functoins*; i'm after repeatedly treating the return value *as* a function, and applying given arguments
10:42joly``"curried-application"?
10:42doomlordyeah
10:43doomlordthe use case i have in mind is accessing nested datastructures - which i gather are 'funcallable' in clojure
10:44doomlordeg (def a { :foo [10 20 30] } ) (print ((a :foo)1) => 10 ... simple example, but with more nesting i might make myself a macro if one doesn't exist
10:44doomlordeg (def a { :foo [10 20 30] } ) (print ((a :foo)1) => 20 ... simple example, but with more nesting i might make myself a macro if one doesn't exist
10:46joly``,(get-in {:a {:b 1} :c {:d 2}} [:a :b])
10:46clojurebot1
10:46casion,(let [a {:foo [10 20 30]}] (-> a :foo first))
10:46clojurebot10
10:47doomlordoh thanks.. What i was missing is that :foo is also an acessor function
10:48gfredericks,(let [a {:foo [10 20 30]}] (get-in a :foo 1))
10:48clojurebot#<IllegalArgumentException java.lang.IllegalArgumentException: Don't know how to create ISeq from: clojure.lang.Keyword>
10:48doomlord(-> a :foo (nth 1))
10:48antoineBis it possible to make a private def visible for a special namespace?
10:49gfredericks,(let [a {:foo [10 20 30]}] (get-in a [:foo 1]))
10:49clojurebot20
10:49doomlord(let [a {:foo[10 20 30]}] (-> :foo (nth 1)))
10:49doomlord,(let [a {:foo[10 20 30]}] (-> :foo (nth 1)))
10:49clojurebot#<UnsupportedOperationException java.lang.UnsupportedOperationException: nth not supported on this type: Keyword>
10:49doomlord,(let [a {:foo[10 20 30]}] (->a :foo (nth 1)))
10:49clojurebot#<CompilerException java.lang.RuntimeException: Unable to resolve symbol: ->a in this context, compiling:(NO_SOURCE_PATH:0)>
10:49doomlord,(let [a {:foo[10 20 30]}] (-> a :foo (nth 1)))
10:49clojurebot20
10:50gfredericksantoineB: that would be a rather complicated visibility model if you could. Maybe rethink your namespace structure?
10:51antoineBgfredericks: is have a macro that use private def (and i use clojurescript)
10:51antoineBso i need to put macro apart
10:53gfrederickseven in clj-jvm you can't have macros that expand to call private things
10:53antoineBok
10:56casionI thought you could refer to private defs?
10:56gfredericksantoineB: I think best practice is to have a public API that just consists of functions, and then write simple macros for sugar that defer to the functions (which are public)
10:57gfrederickscasion: the expansion has to be valid code in the ns where it expands
10:57gfredericksso depends on the details really
10:59casionhttps://www.refheap.com/paste/5600
10:59casionis there something wrong with my understanding there?
11:00gfrederickscasion: all that looks normal to me -- what weren't you expecting?
11:01casiongfredericks: maybe I'm misunderstanding the discussion?
11:01gfrederickscasion: we're talking about macroexpansion
11:01gfrederickswhat I was saying you can't do is
11:02gfrederickspriv> (defmacro my-pub-macro [] `(privfun))
11:02gfrederickspubbie> (priv/my-pub-macro)
11:02gfredericksbecause the expansion isn't valid in pubbie even though it's defined in priv
11:07FrozenlockHow can I add a file in the uberjar? In this case I would like to include an image.
11:08FrozenlockAnd is there some special path I need to use if I intend to slurp it?
11:09gfredericks /resources
11:09FrozenlockOh, so simple :)
11:09Frozenlockthanks!
11:09gfredericksthen you can find it with clojure.java.io/resource (either in an uberjar or in the expanded lein project)
11:22Frozenlock(ns bacnet-logger.systray
11:22Frozenlock (:use [clojure.string :only (split join)]
11:22Frozenlock [seesaw.core]
11:22Frozenlock [seesaw.swingx]
11:22Frozenlock [seesaw.dev :only (show-options)]
11:22Frozenlock [seesaw.mig])
11:22Frozenlock (:require [seesaw.bind :as b]))
11:22casion...
11:22Frozenlock
11:22Frozenlock
11:22Frozenlock(import '(java.awt.SystemTray)
11:22casionrefheap myabe?
11:22Frozenlock '(java.awt.event ActionListener))
11:22Frozenlock
11:23Frozenlock(defn create-image
11:23Frozenlock [path description]
11:23casionor not
11:23Frozenlock (-> (javax.swing.ImageIcon. (clojure.java.io/resource path) description)
11:23Frozenlock (.getImage)))
11:23Frozenlock
11:23FrozenlockAHHHHHH
11:23FrozenlockSorry
11:23FrozenlockNo, wrong buffer
11:23FrozenlockI'm so sorry!
11:23casion:)
11:23FrozenlockI should disable paste for my erc buffer
11:24casionseesaw doesn't have systemtray bindings?
11:24FrozenlockNot that I know of.. But I would be very happy if it did.
11:25duck1123Doesn't ERC have a plugin that disallows long pastes? Might be worth looking into
11:26casionFrozenlock: at the very least I think making your own seesaw widget for it would be beneficial
11:27casionFrozenlock: it has seesaw.icon though, so that's something :)
11:30FrozenlockRight! No need for my silly create-image then!
11:51doomlordcan clojure & the jvm utilize SIMD instructions
11:52S11001001doomlord: not directly
11:53doomlordi guess its not a priority in the use cases (web concurency?) what made me ask is that SIMD is a form of parallelism, and functoinal programming is good at expresing parallelism.
11:54fractaloopSIMD is directl parallelism. Clojure is better at things like concurrency from what I've gathered
11:56antares_doomlord: there is a new project in OpenJDK that explores using SIMD and GPUs in the JVM. There are also OpenCL bindings and such, although not very mature.
11:58doomlord(there is an example of a customized lisp being used for low-level work, naughty-dog GOAL on the ps2, although i gather it was more game-scripting with souped up inline asm)
11:58doomlordis/was
11:59fractaloopIf you need any serious performance, write it in C/C++ for the dirty work and control it from higher up (Clojure)
11:59fractaloopTrying to shoehorn low level optimizations into a very high level language is a recipe for pain
12:00doomlordits low level opt that got me interested in FP :) but there is no silver bullet
12:01casiondoomlord: you could mess with ocaml
12:02doomlordocaml did look interesting too, as did microsoft f# but i prefer something more crossplatform
12:03kilonfp ? as functional programming ?
12:03doomlordyes
12:03kiloni see
12:03casionocaml is pretty well cross-platform
12:03fractaloopdoomlord: What kind of work are you doing? Is it the kind of stuff you want GPU level parallelism for?
12:03kiloni thought you mean fp as free pascal
12:03kilon*meant
12:03SgeoI should do something productive
12:03fractaloopSgeo: A noble goal for early Monday
12:04arrdempfft productivity....
12:04doomlordi'm a c/c++ programmer just looking to try a different language; keeping my mind open. would be nice to write *something* in something else.
12:04doomlordof course it might just be that the combo of c++ (with embedded lua) isn't broken
12:05kilonlearning new languages is fun
12:05fractaloopI'm a C/C++/Java coder and moved to Ruby
12:05fractaloopIt was a relatively easy transition. Clojure/Lisp is another beast entirely
12:05kiloni learned smalltalk and lisp this year and brush up my pascal knowledge too after 10 years
12:05arrdemdoomlord: I would say if you really want to try something else, look at using Scheme instead of Lua for scripting within C/C++ apps
12:05doomlordits the macros that appeal to me in lisp
12:06casionfractaloop: I tried ruby before clojure and it was just… very strange to me
12:06arrdemit's not really clean, but doing Scheme/Clisp -> C bindings is easiser that extending the JVM and hooking in from Clojure
12:06doomlordfair enough
12:06casionI was constantly confused by why things were done how they are in ruby
12:07Sgeocasion, if you try Smalltalk, Ruby will anger you even more
12:07doomlordi can see the sense to c++ & scheme
12:07fractaloopcasion: Convention is a lot of it. Ruby basically lets you do anything which is too powerful a tool for many coders. People go crazy implementing harebrained software that is impossible to unwind
12:08dustingetzis that any different than macros?
12:08fractaloopI'm learning Clojure mainly because because of Storm and Pallet
12:08arrdemwhat fractaloop said. A good friend of mine spent several hellish months debugging a Ruby webserver that used eval all over the place and was almost impossible to unwind
12:08gfredericksdustingetz: quite. macros are compile-time
12:08gfredericksdustingetz: their effects are a one-time thing and can be completely laid bare with macroexpand
12:09casionfractaloop: that's sort of the feeling I got. There was a lot of times I thought people were solving problems that didn't exist as well
12:09gfrederickscompare with the ruby approach of "redefine anything at any time from anywhere"
12:09Sgeoarrdem, it's eval that's the problem? So I guess Tcl would be similar?
12:09casiona lot of times I'd ask questions and be told that's not really what I want to do because in the future I _may_ want to do something else
12:09casionthat mindset is on vhe verge of infuriating for someone coming from C
12:10doomlordafter using various combinations of #defines & templates in c++ i figure lisp macros would probably do that sort of thing more elegantly... declaring structures with serialization & UI definitons embedded, that sort of thing
12:10casionI've come to love clojure because you can embrace abstraction, or ignore it when it doesn't make sense… and that's OK
12:11doomlordlisps the macros are the draw, but i also really like the way type inference works in haskell(& ml?)
12:11fractaloopcasion: Yea, I work someone that uses the metaprogramming shit all the time. It fucks our code up and makes it untestable. So obnoxious.
12:11dustingetzwhy do they use it?
12:11dustingetzwhat are their thoughts?
12:11fractaloopHence why I'm in #clojure and not #ruby =P
12:11gfredericksfractaloop: have you ever seen `def method_missing _; nil; end`?
12:12fractaloopgfredericks: Thankfully no.
12:12casionfractaloop: 90% of the time I want to do something, I want to do that. Not the 50 other things that may also be related to that
12:12gfredericksI don't think that's even possible in clojure
12:12dustingetzi mean, some of my OOP colleagues say the same thing about FP code
12:12casionseems ruby programmers always want to make sure their code can do those 50 other things, even if it will never happen
12:12arrdemSgeo: perhapse, I have no experience with either directly. From the accounting I heard the issue was more that the Rubyist who perpetrated the server to start with used eval all over the place and did inline code generation which made debugging much harder than it needed to be because the server was constantly injecting more code into itself
12:12fractaloopcasion: Trufax
12:13casionI messed with python a bit as well, and I found it rather pleasant except it was just too ridiculously slow
12:14fractaloopHehehe
12:14casionmaybe there's something where python is reasonable or 'fast'
12:14fractaloopI was always scared of Python because of the 'pythonic way'
12:14casionbut everything I do, it's slow as fuck
12:15casionfractaloop: I actually liked that. I like that clojure has a similar emphasis on producing idiomatic code as well
12:15arrdemwhat with JVM bootup overhead I find that my Clojure scripts really aren't faster than my Cpython equivalents
12:15arrdembut that's __only__ for once-off scripts. Big stuff Clojure and Java are way faster
12:15casionarrdem: most everything I do is lots of crunching on 1 process
12:15arrdemcasion: yerp. and python is really slow at that I can't deny it.
12:18fractaloopHave y'all read Pragmatic Programmers "Programming Clojure" >
12:18fractaloop?
12:18casionfractaloop: yes
12:18arrdemwith p>.85
12:18casionthat was my favorite clojure book
12:18fractaloopI like the PP. Was considering it's purchase
12:19fractaloopBosses wont buy it for me though because we're all Ruby apparently =(
12:19casionI should also complain about ruby being slow, just to be fair
12:19casionso consider that done :)
12:20S11001001everything's slow
12:20S11001001except C. C is too fast
12:20arrdemS11001001: RAW METAL OR NOTHING
12:20casionruby and python take slow to a new level of wtf
12:20jrajav*cue jokes about assembly and/or magnets*
12:20Iceland_jackcasion: and yet they are used so what of it
12:21casionIceland_jack: they're slow?
12:21fractaloopYea...Ruby is painfully slow >_<
12:21casionnot sure what else would be 'of it'
12:22Iceland_jackIt goes to show that obviously it doesn't matter that much for many tasks
12:22casionand it does for some
12:23SgeoIs Common Lisp optimized for speed faster than Clojure?
12:23casionCL is usually a good bit faster than clojure
12:24casionfairly sure 'always' would apply
12:24arrdemSgeo: it should be... CL can build straight to C and then benifit from ICC etc. while we're stuck with the JVM JIT
12:24S11001001straight to assembly
12:25S11001001I think there are more CLs that *don't* go through C than do
12:25arrdembecause lack of libraries and lein
12:25fractaloopBecause Java is badass.
12:25fractaloopOr at least, helpful.
12:25SgeoHmm. It's not very functional, and lack of libraries, and quicklisp is a sort of closed environment
12:25lucianCL also tends to have crappy GCs
12:25lucianthe jvm is a pain in the ass, though
12:26SgeoWant to put something on QuickLisp? You have to contact the maintainer of QL, and when they add it, it will usually be a month before it becomes available
12:26arrdemI was on CL before Clojure.. and my first reaction to the CLJ world was "holy **** a Lisp with actual usable libraries"
12:27arrdembesides, we get all the Java libraries for free
12:27SgeoAlthough cl-cont > delimc and I'm guessing that whatever monadic libaries exist for CL > the Clojure monadic stuff
12:27doomlordi wold have thought the JVM would have had the most developped garbage collectors,due to how widespread it is no idea in practice though
12:28luciandoomlord: it does tend to have the best GCs, yes
12:28lucianmost languages don't even let you choose
12:29doomlordi really like the idea of seperating front & back end
12:29lucians/languages/runtimes/
12:29doomlordlike with LLVM for c++
12:30casionSgeo: why don't you just use haskell?
12:31SgeoEasy macros and easy to change running programs
12:31SgeoThere is Template Haskell for macros, and there are tricks to change running Haskell programs if you're careful about designing it, but...
12:31casionSgeo: seems like you spend more time trying to recreate things that haskell has than the time those things would save you
12:31doomlordnice, clojure can destructure function arguments
12:32kilonpascal is as fast as C too
12:32SgeoDon't underestimate my desire for easy macros.
12:32antares_ohpauleez: heya
12:33ohpauleezantares_: Hello
12:33antares_so, clojure-doc.org is "officially" announced and ready for others to join: https://groups.google.com/forum/?fromgroups=#!topic/clojure/ixtfzCHCOWI
12:33dnolendoomlord: you can destructure anywhere where binding is supported - let, fn args, binding, doseq, etc
12:35magnarsidiomatic way of taking a list of maps with an id [ {:id 1} {:id 2} ] and turn it into a map on those ids { 1 {:id 1} 2 {:id 2} } ?
12:36arrdem,(let [s [{:id 1} {:id 2}]] (zip-map (map #(:id %) s) s))
12:36clojurebot#<CompilerException java.lang.RuntimeException: Unable to resolve symbol: zip-map in this context, compiling:(NO_SOURCE_PATH:0)>
12:36arrdemdamn
12:36arrdem,(let [s [{:id 1} {:id 2}]] (zipmap (map #(:id %) s) s))
12:36clojurebot{2 {:id 2}, 1 {:id 1}}
12:36magnarsarrdem: many thanks!
12:37arrdemmagnars: no problem.. surprised it worked, first time I've used zipmap XP
12:37antares_ohpauleez: I'm curious if you have thoughts about the suggested workflow and if clojure/core will or won't have any recommendations
12:37Sgeo#(:id %) isn't that just :id
12:38arrdemSgeo: maybe...
12:38arrdem,(let [s [{:id 1} {:id 2}]] (zipmap (map :id s) s))
12:38clojurebot{2 {:id 2}, 1 {:id 1}}
12:38arrdemevidently
12:38dnolen_Sgeo: cl-cont isn't that great, it's simple code walker - delimc is exactly the same.
12:38Sgeodnolen_, but I imagine that cl-cont doesn't have that bug where you must bring all symbols directly in
12:39dnolen_Sgeo: I don't know, I never used it serious. I personally never cared for CL package control.
12:41ohpauleezantares_: I'd make the landing page a little easier to navigate (Where category listing link to the doc collections they contain). I think workflow is fine - I don't think clojure/core has any opinion about the workflow, so I think you're all set to go
12:43antares_ohpauleez: understood. The UI certainly needs work. We already have some ideas about how to make it a bit better. But writing content is by far more important right now.
12:43casionantares_: how will discussion about article content be handled?
12:43antares_casion: on the mailing list and in pull requests
12:45casionantagon: on the clojure mailing list or is there a cds list?
12:45antares_casion: on the main Clojure ML
12:46antares_there will be no separate list because docs is a problem of every clojure user and the process must be visible to everybody
12:46antares_I also always disliked the closed clojure-dev jazz
12:46casionantares_: do you think it would be useful to link to article discussions on the article page?
12:46antares_casion: maybe. Don't focus on details yet, we need to start writing the content.
12:47antares_everything other than writing and/or making it easier for people to start writing is secondary right now
12:47casionantares_: I was planning on contributing, but I was curious how things would be handled if someone says 'maybe this is better?' and I wanted to participate in such a discussion
12:49antares_casion: I think it's not any different from similar discussions about code
12:50casionantares_: my experience with any form of online collaboration is extremely limited, so forgive if I'm asking a question that seems overtly basic
12:50antares_casion: no problem. I understand that. And collaborative writing and editing is difficult because there are no fast and hard rules about "what is good".
12:50casionI've worked alone, or in person with another 1-2 people since the 90s… this is all rather new to me :)
12:51antares_but there is no way around this
12:52casionI guess I'll need to explore the pull system on github more
12:53ohpauleezcasion: Writers also are in #clojuredocs
12:53ohpauleezyou can always ask such questions there
12:53casionexcellent
13:12uvtccasion: ping
13:13pandeiroanyone know if lein-cljsbuild can be configured to produce a vanilla js file w/ just goog-closure and clojurescript core?
13:14dnolenpandeiro: you just mean no optimizations right?
13:17antares_mpenet: sorry for my comment on your CDS PR but I really think Casyn is not a library newcomers will be able to use.
13:18antares_cassaforte has its issues, but it is not different from clojure.java.jdbc and something like monger or neocons in the way you use it
13:19pandeirodnolen: yeah i need to inject the clojurescript api into a phantomjs-rendered page, so i just want a vanilla representation to be compiled from the same version of cljs that lein-cljsbuild is using
13:20pandeiro...i can do that manually by creating a dummy ns with no forms and then compile it; wanted to know if there is some other way
13:27wingyclj-http doesn't seem to parse the request json body for you .. should i use cheshire to do that?
13:27dakronewingy: clj-http will if you ask it to
13:27dakroneotherwise, you can do it manually with cheshire if you'd like
13:29sundbpquestion: let's say i want a multimethod foo with implementations for 2 different "situations". i define the multimethod (defmulti) in namespace x, then i add the 2 defmethods in namespace y and z that are related to the 2 sitautions. does that 1) work? and 2) is it weird to spread defmethods for the same defmulti over several namespaces?
13:29mpenetantares_: That is fine, I understand your goals, and why you'd prefer that.
13:30gfrederickssundbp: that ability is half of the point of multimethods
13:31wingydakrone: :as :json did the trick
13:31wingyI should RTFM
13:31sundbpmpenet, gfredericks: good!
13:32antares_mpenet: cool. that page certainly is somewhat controversial for library developers. But "just" users benefit from it dearly.
13:32sundbpwas just making sure i hadn't misunderstood it completely
13:33mpenetantares_: yes, I understand we don't want it to become a listing of all clj libs out there
13:33antares_so, who wants to write the books guide :) it's the lowest hanging fruit!
13:34antares_just list all the 6-7 books out there, with links to Kindle/PDF/ePub editions in popular stores, and mention what versions of Clojure they cover
13:35sundbpslight follow up: if i then in namespace A require ns x, but not y and z - will invocations of the multimethod in A be obvlivious to the implementations that exist in x and y? obviously y and z need to get "loaded" somehow before they're known, but is it independent or tied to namespace require/use.
13:36gfredericksthere's nothing magic about it; so whenever the ns the defmethods are in is loaded normally
13:37sundbpgfredericks: ok, so for namespace A to invoke the multimethod and be able to dispatch to the implementations in y and z it needs to reference x, y and z.
13:38magnarsI have a list of ~20k items that I want to make a map of. I'm reducing over a transient map to do this. However, I get the wonderful OutOfMemoryError Java heap space ... any ideas?
13:38gfrederickssundbp: yep
13:38gfrederickssundbp: or at least you need to be confident that they're already loaded somehow or another
13:39sundbpgfredericks: excellent. then it is indeed no magic or special things surrounding it and initial intutiotion holds. thanks for verifying
13:39gfredericksmagnars: not without seeing the code
13:39sundbpgfredericks: (not in front of repl so couldn't verify it manually)
13:40gfrederickssundbp: maybe it is a lazy seq of large objects and you run out of memory while realizing it?
13:40magnarsgfredericks: http://pastie.org/5019878
13:43gfrederickssundbp: sorry confused you with magnars :)
13:44gfredericksmagnars: that's pretty straightforward. The only idea I have is the one I missent to sundbp above.
13:44magnarsgfredericks: ah, yes, it is a lazy seq of objects - they're not very large, but they are plentiful. However, I didn't run out of heap space prior to trying this mapping. However, I guess working with these sizes I should expect to increase the heap size.
13:48FrozenlockOnce my app is in a jar, when I execute it, it exports files to my home folder. How could I export to the same folder as the .jar?
13:51Frozenlockoh right, that's a java thing, not clojure
14:23thorbjornDXis it common to have a side-effecting function that takes in some map, produces a side-effect, then returns the same map that was passed in? I feel like I'm breaking some golden rule or something
14:24arrdemthorbjornDX: I don't think so... it's unusual but I don't see it as evil
14:24nDuffthorbjornDX: Do you have a ! in the name to indicate that you're side-effecting?
14:25nDuffthorbjornDX: ...if so, I'd be OK with it.
14:25thorbjornDXnDuff: I will in 5 minutes :)
14:27thorbjornDXarrdem: my code flow looks something like this (-> (func-that-produces-map) dosomethingwithit! dosomethingelsewithit! ...)
14:28arrdem(doc doto)
14:28clojurebot"([x & forms]); Evaluates x then calls all of the methods and functions with the value of x supplied at the front of the given arguments. The forms are evaluated in order. Returns x. (doto (new java.util.HashMap) (.put \"a\" 1) (.put \"b\" 2))"
14:28arrdem,(doc doto)
14:28clojurebot"([x & forms]); Evaluates x then calls all of the methods and functions with the value of x supplied at the front of the given arguments. The forms are evaluated in order. Returns x. (doto (new java.util.HashMap) (.put \"a\" 1) (.put \"b\" 2))"
14:28arrdemnot wrong, just not how I would think to structure it.
14:29thorbjornDXarrdem: ah, I think this is what I'm looking for
14:30thorbjornDXarrdem: thanks for the info :)
14:31arrdemthorbjornDX: no problem. #clojure is where I found that one too, just passing it on
15:04wingydont complect!
15:05wingymade me use cheshire and form-decode to decode the response body from clj-http instead
15:06tomojis there any reason for the analyzer to add :require-macros/:use-macros ns's to deps for analysis?
15:07tomojthis means if you have (:require-macros [foo.bar :as b]) in foo/bar.cljs, you get a stackoverflow
15:07tomoj(when-not macros? (swap! deps conj lib)) seems to fix it but can't tell if it breaks something else
15:08SegFaultAX|workwingy: I made this for you: http://cdn.memegenerator.net/instances/400x/28015188.jpg
15:08Iceland_jackhaha
15:08SegFaultAX|workRe: Complect ^
15:08wingySegFaultAX|work: i dont get it though
15:08SegFaultAX|workwingy: :O have you not seen Mean Girls?
15:08wingyno :)
15:09SegFaultAX|workThat movie is hilarious.
15:09SegFaultAX|workEven if you're not a 14 year old girl.
15:10jrajavOr a 22 year old girl trying to pass as a 14 year old girl
15:10dnolentomoj: hmm file a ticket - I don't see any reason for macro files to be considered for analysis.
15:11arrdemSegFaultAX|work: oh gods that movie
15:11wingyor a 27 year old guy trying to be a 14 year old girl
15:11SegFaultAX|workarrdem: Are you a fan as well?
15:11arrdemthere was no part of that movie where I didn't want to shoot myself
15:12SegFaultAX|workHaha. Isn't that the point?
15:12wingynow i have to watch it
15:54bonegaAnyone know why Heroku's foreman ignores crossover-cljs? Thought it did something like "lein compile :all"
15:56tomojbonega: see https://github.com/heroku/heroku-buildpack-clojure/blob/master/bin/compile
15:57ivanso have you guys discovered the OQL Console in VisualVM? It is pretty cool.
15:59ziltiWhen I try to compile a sample cljs, all I get from "lein cljsbuild once" is "Could not locate clojure/instant__init.class or clojure/instant.clj on classpath", what could be the reasons for that?
16:00cemerickbonega: depends on what buildback rev you use, but you can override whatever the default is with a bin/build script.
16:01bonegafrom what I can see it should do something like "lein with-profile production compile :all"
16:01ziltiOh. I suddenly have clojure 1.3 in the deps... hmm
16:02bonegadoing it manually includes the crossovers, but not with foreman
16:03bonegausing a :hook [lein-cljsbuild]
16:04bonega:hooks [leiningen.cljsbuild]
16:04akhudekzilti: try https://github.com/xeqi/lein-pedantic
16:04akhudekI almost feel the above plugin should be default
16:04duck1123it's a tad too pedantic IMO
16:05akhudekperhaps, but knowing the actual versions of libraries you are using seems pretty crucial for reliability
16:06duck1123if it had a warn-only option, it would be more useful
16:07SgeoWould be nice if two different versions of libraries could be used at the same time
16:07xeqiduck1123: set :pedantic :warn in the project or user profile
16:07nDuffSgeo: For Java libraries, that can be done if you're in an OSGi container.
16:08nDuffSgeo: ...for Clojure libraries, even in OSGi, not so much, unless you have two completely separate Clojure environments.
16:08ziltiakhudek: Thanks!
16:08duck1123xeqi: very nice. I didn't see that when I first checked it out
16:08nDuff(but OSGi _can_ be used to maintain separate Clojure environments within one JVM. In theory, anyhow).
16:09SgeoPermGen?
16:09xeqiduck1123: I think I added it in 0.0.3
16:10zilticssgen caused the problem
16:10xeqifor anyone using it, I just released 0.0.5
16:11xeqicemerick: do you still have your project with the args error? could you check ^ and see if it still happens?
16:13xeqiakhudek: I'm glad to hear you find it useful
16:15akhudekxeqi: thanks for your work on it! I have some projects with pretty big dependency lists that it really helped sort out
16:17duck1123does lein-pedantic let me know when exclusions are no longer needed?
16:17cemerickxeqi: gah, I can't repro now.
16:18cemerickweird :-/
16:18bonegaIs there a way to choose :builds in :cljsbuild using :profile?
16:18xeqiduck1123: nope
16:18clojurebotCool story bro.
16:18xeqicemerick: heh, thanks for trying
16:19cemerickI've upgraded the pedantic dep though; will make noise if anything else crops up
16:25johnmn3good day
16:25ziltiHmm now that's weird. lein-pedantic tells me that I have a ring/ring-servlet dependency which I don't have and I can't find that dependency in any of my dependencies...
16:26johnmn3anyone working on clojure on android?
16:26dnolenjohnmn3: there are few people that do, not sure if they hangout much on IRC
16:27johnmn3dnolen: thanks. do you know if it is usable to make apps with?
16:28dnolenjohnmn3: seems so, but from what I understand Clojure is a bit demanding in terms of GC so it doesn't work well for some kinds of apps you might want to do.
16:29nDuffjohnmn3: from what I understand, clojurescript is more appropriate on Android at this point
16:29nDuff(using phonegap or another mechanism for doing Android apps in JavaScript)
16:29johnmn3nDuff: that makes sense
16:31cemerickzilti: do `lein deps :tree`, and you'll find out where it's coming from
16:31zilticemerick: Well, I'll try that too but I found out it happens only when using "lein ring uberwar", not when using "lein deps" so it must be caused there
16:33cemerickzilti: makes sense; wars are servlet-specific, so lein-ring adds the corresponding dep when producing any kind of war: https://github.com/weavejester/lein-ring/blob/master/src/leiningen/ring/war.clj#L224
16:34duck1123xeqi: Using the latest version, it's complaining about my cljsbuild deps, but I don't have that in my project. (I have lein-cljsbuild as a plugin, but I don't specify cljsbuild directly)
16:35tomoj&(class (empty (clojure.lang.ArraySeq/create (into-array [1 2 3]))))
16:35lazybot⇒ clojure.lang.PersistentList$EmptyList
16:35xeqiduck1123: its probably added by the plugin
16:35tomojis that correct?
16:35xeqizilti, duck1123: plugins adding dependencies does keep lein-pedantic from being as nice as I want :/
16:36cemerickway of the world, it seems
16:38xeqiyeah, I wonder if I can do some funny middleware stuff to track it and give a different message; maybe a superset of xeqi/lein-pedantic#7
16:38lazybotidentifying parent sources of dependencies -- https://github.com/xeqi/lein-pedantic/issues/7 is open
16:40wingyoff topic from clojure: does anyone here use the Twitter API (https://dev.twitter.com/docs/auth/creating-signature)
16:41wingyit looks very intimidating to implement it in clj or other langs
16:42duck1123wingy: oauth can be a pain, but there are some good clojure oauth libs out there
16:43wingyduck1123: i found this https://github.com/mattrepl/clj-oauth
16:43Bronsahttps://github.com/Bronsa/neurotic
16:44wingyduck1123: facebook login was a breeze to implement .. dont get why its that hard for twitter
16:44wingyperhaps its not using oauth2 ?
16:45duck1123no, 1.0a
16:46wingyok
16:46wingyfacebook is using oauth 2 .. perhaps that is why its so simple
16:47wingythat library link i pasted uses twitter as an example .. lets hope it will work :)
16:47devthfind myself doing: (some (fn [x] (when (re-find #"foo" x) x)) ["this is a bar" "this is a foo"]) lately (just using regex as an example). notice the anon fn has to use when and return the actual value since `some` returns the result of the matching fn instead of the value that matched. better way?
16:48TimMctomoj: That is a little surprising...
16:48duck1123wingy: https://github.com/mattrepl/clojure-twitter
16:49tomojTimMc: agreed. seems pretty consistent though that (empty seq) is ()
16:49TimMctomoj: The docs for empty say "the same category" -- maybe that means list vs. vector vs. ....
16:50TimMcso empty is preserving the access semantics, but not the JVM type.
16:50tomojyeah makes sense
16:50wingyduck1123: looks nice
16:50wingybut i prefer making raw http requests
16:51duck1123wingy: at the very least, it's a reference
16:51wingyyeah
16:56callenhttps://www.refheap.com/paste/5606 k, what the hell is going on? Why am I getting an NPE?
16:57callenis it because I'm multiplying a non-number?
16:57duck1123when n = 0, factorial returns nil
16:57callenn/m, fixed it.
16:57callenduck1123: yeah, I figured that's why I asked about the non-number
16:58callenduck1123: added an else case and it works fine now. Thank you.
17:13bonegaNot completely done, but feel free to check out my Clojurescript Tetris running at Heroku: http://clojure-tetris.herokuapp.com/
17:14bonegaAnd thanks everybody for answering questions
17:15fractaloopbonega: impressive
17:15ordnungswidrigbonega: good work!
17:16tomojsweet
17:16dnolenbonega: nice!
17:16akhudekibdknox: is it possible to run light table without X11? e.g. run on a local dev server and connect to it from other hosts?
17:20bonegathanks, I will try to do a short writeup on the mailinglist
17:20bonegalater
17:23SgeoHmm
17:23SgeoMaybe I could fork that to make the Tetris-like game I made in my game programming class in a more accessible language
17:25bonegaDo you mean forking just the clojurescript part or? Go for it anyhow
17:26SgeoI don't entirely understand Clojurescript
17:26SgeoDoes the game require a server-side component, or is it all client-side? If the latter, how does the Clojure code get run?
17:27bonegaall clientside
17:28bonegabasically all the clojure code is compiled to javascript
17:28Sgeomain.clj looks like Compojure code, which is serverside
17:28bonegaah, yeah sorry
17:28bonegabut that's mostly to get a server running
17:29tomojmore puzzling is core.clj
17:29bonegait's not a part of the tetris program by my definition, just there to serve some javascript to a clent
17:30tomojwhy doesn't the compiler blow up when it doesn't find core.cljs?
17:30bonegacore.clj is crossover
17:30bonegaoriginally a standard clojure project
17:30tomojaha
17:30gfredericksso being a crossover it is also a cljs file
17:30bonegaI share code with :crossover in lein-cljsbuild
17:31tomojgfredericks: thanks for the CLJS-383 patch, saved my day
17:31bonegait automatically gets moved to a special folder and then compiled to js with the rest of the cljs
17:31gfrederickstomoj: yeah? you just applied it locally?
17:33tomojyeah I've been using HEAD for.. ever :/
17:33gfrederickstomoj: I'm curious about the mechanics of using your own cljs with lein-cljsbuild because I haven't been able to
17:34tomojI almost feel like it would be wrong to tell you
17:34tomojI just have :source-paths ["src/clj" "vendor/clojurescript/src/clj" "vendor/clojurescript/src/cljs"]
17:34gfrederickshm; fascinating
17:34gfredericksthanks :)
17:35gfrederickshow did the issue manifest for you?
17:35gfredericksjust curious
17:38dnolengfredericks: btw, CLJS-383 - on the ticket what do you mean about errors under advanced compilation?
17:38tomojI hadn't actually run into it but I have a function with arglists ([x] [x y] [x y z] [x y z & ws])
17:38tomojthe last piece is (apply f x y z ws)
17:39SgeoWhat's the point of having ` without ~ and ~@ ?
17:39tomojso I guess if I had passed the right number of args in my test with +, it would have blown up
17:39Sgeo(Reading about cljs)
17:40gfrederickstomoj: are you set up to run script/test in the cljs project?
17:40gfredericksI only ran with v8
17:41gfredericksSgeo: it expands symbols into their fully-qualified form
17:41gfrederickswhich is nearly always what you want when you write a macro in one ns and use it in another
17:42gfredericksSgeo: interestingly it's possible to use ~ and ~@ without `
17:42tomojgfredericks: yes, but also only for v8
17:42gfrederickstomoj: so when you run it with my patch do you get any failures?
17:43tomojrunning
17:44tomojdo I have to tell it to try advanced or does it try automatically?
17:44gfredericksI never told it anything special
17:45tomojhttps://gist.github.com/c3d73e2fa792f89672b3
17:46gfrederickstomoj: yeah I believe that's what I saw
17:46gfrederickstomoj: had no idea how to investigate it
17:47gfrederickstomoj: also the spooky thing was how it went away when I changed the added tests from ABC to ABCB
17:48gfredericksbut maybe that's just advanced compilation being unpredictable
17:49dnolengfredericks: I doubt that
17:49gfredericksdnolen: which part?
17:49tomojhard to imagine debugging that!
17:49dnolengfredericks: advanced compilation being unpredictable
17:50dnolengfredericks: I suspect this may have something to do w/ optimizations that kick in during when :static-fns true, which implicit under :advanced
17:50gfredericksdnolen: you must be better at predicting than me
17:50dnolengfredericks: tomoj: can you all try :simple w/ :static-fns true ?
17:52tomojlooks like you can just modify line 10 of script/test
17:53dnolentomoj: yep
17:53tomojno exception :'(
18:04tomojthe error seems to occur on line 1373-ish of the tests
18:05tomojthe (assert (= (meta (with-meta (reify IFoo (foo [this] :foo)) {:foo :bar})) {:foo :bar}))
18:08dnolentomoj: hmm, I'll try looking into it later.
18:18wingyhow do i create a timestamp in clj?
18:19wingy(java.util.Date.) gives me a formatted date string
18:19wingyor perhaps not a string but not the timestamp
18:19antares_,(System/currentTimeMillis)
18:19gfrederickswingy: looks like a timestampish thing to me
18:19clojurebot1349734381827
18:20gfrederickswingy: the java.util.Date has millisecond resolution at least
18:20gfredericksor it does on my machine anyways
18:20wingygfredericks: how? it returns this to me: "2012-10-08T22:13:43.570-00:00"
18:20gfredericksI have clojure 1.4 and it prints as: #inst "2012-10-08T22:14:32.898-00:00"
18:21gfrederickswingy: that's a bunch of time info in there; not sure how you're interpreting it
18:21wingybut i need the seconds since Unix Epoch 1970
18:21gfredericksokay then definitely antares_'s suggestion :)
18:21wingyyeah
18:22gfredericksI mistinterpreted "a formatted date string"
18:22wingy"This value should be the number of seconds since the Unix epoch at the point the request is generated, and should be easily generated in most programming languages." antares answer gave me ms
18:22gfrederickstomoj: oh weirder; I just ran the tests on a different machine with v8 and got no errors o_O
18:22gfredericks(did not modify the advanced settings)
18:23gfredericks&(/ (System/currentTimeMillis) 1000)
18:23lazybot⇒ 67486735241/50
18:23gfrederickser
18:23antares_wingy: you can get that from a java.util.Date instance, too: http://docs.oracle.com/javase/7/docs/api/java/util/Date.html#getTime(), but it is in milliseconds everywhere
18:23gfredericks&(div (System/currentTimeMillis) 1000)
18:23lazybotjava.lang.RuntimeException: Unable to resolve symbol: div in this context
18:23gfredericks&(quot (System/currentTimeMillis) 1000)
18:23lazybot⇒ 1349734722
18:23wingyyeah
18:24antares_so you have to divide by 1000 like gfredericks shows
18:24wingyyeah
18:30tomojgfredericks: strange
18:55doomlorddoes the clojure compiler do much type-inference (immutability making it easier?).. eg does a small literal vector boil down to a tuple and will large homogeneous vectors forgo per item type information
18:58antares_doomlord: it does some type inference but not for collection contents. There is no special tuple type on the JVM.
19:01doomlordi was hoping tuples are anonymous classes/structs .. (i dont even know..does the jvm have PlainOldData in addition to classes..)
19:03antares_doomlord: it has primitives (int, long, etc) and array types, everything else is classes
19:03hiredmanand, at the jvm, level, there are no anonymous classes
19:04doomlordit could generate names i suppose
19:04hiredmananonymous classes are a mechanism in the java language
19:04hiredmandoomlord: right, which is what javac does
19:05hiredmanclojure's reify and proxy do the same
19:06SegFaultAX|workhiredman: Does the JVM just generate a name for an anonymous class?
19:06hiredmanhttps://github.com/hiredman/tuples is a project for providing something like a cross between tuples and vectors
19:06hiredmanSegFaultAX|work: no, the java compiler does
19:07hiredmansome.package.Foo$1 etc
19:07hiredmanthe jvm just knows about named classes
19:07SegFaultAX|workInteresting! Today I learned...
19:08SegFaultAX|workhiredman: Is there ever a time where that might actually matter?
19:08hiredmanSegFaultAX|work: the tuples link?
19:08SegFaultAX|workhiredman: No, the implementation detail of anon classes.
19:09antares_SegFaultAX|work: if you are inspecting things in the debugger, it will matter to you
19:09hiredmanI don't see that it really makes any kind of difference
19:09antares_technically, probably not, anonymous classes are not really special
19:09SegFaultAX|workI see. Interesting.
19:09antares_so, the only special thing about them is that they have generated names
19:10SegFaultAX|workWow, that tuple implementation is fast.
19:10doomlordhow does the tuple imlementation work, broadly..
19:11hiredmanit generates classes with fields, and gives each field indexed access
19:12hiredmanit also generates an implementation of most of the interfaces that vectors implement for the tuples, so they are sort of vector like
19:13SegFaultAX|workhiredman: That is one big 'ol macro. :)
19:14hiredmanbased on the idea that, while clojure's vectors are pretty fast (using a tree of nodes and arrays) the jvm is more likely to recognize and optimize a single instance + fields
19:19hiredmananyway, I don't think tuples is particular that great, but it is an example of the kind of tricks you can play with clojure's interfaces and macros
19:27arrdemis there a clean way to get a subset of a map?
19:28gfredericks&(doc select-keys)
19:28lazybot⇒ "([map keyseq]); Returns a map containing only those entries in map whose key is in keys"
19:28arrdem(inc gfredericks )
19:28lazybot⇒ 3
19:29arrdemdon't make me do it again....
19:30gfrederickseek! karma inflation!
19:31arrdem,(println "(" (rand-nth ["inc" "dec"]) " gfredericks)")
19:31clojurebot( inc gfredericks)
19:31arrdemtroll'df
19:31gfredericks"...back in my day, you could buy a leiningen feature for a nickel of karma!"
19:31arrdem,(println (str "(" (rand-nth ["inc" "dec"]) " gfredericks)"))
19:31clojurebot(inc gfredericks)
19:31lazybot⇒ 10
19:32arrdemwat
19:32gfredericksoh the original one referred to "gfredericks " apparently
19:32arrdem(inc 3)
19:32lazybot⇒ 1
19:32gfrederickshaha
19:32gfredericks(inc 3)
19:32lazybot⇒ 2
19:32gfredericks(inc 3)
19:32lazybot⇒ 3
19:32gfredericks(inc 3)
19:32lazybot⇒ 4
19:32gfredericksthat's better
19:33amalloyyou can tell gfredericks participates in "mess with the bots" games because his name with a space after it has already gotten karma twice
19:33gfredericksI really have no explanation for that
19:33amalloygfredericks: really? i remember it happening
19:34gfredericksamalloy: then I have a poor memory
19:34gfrederickswas it intentional?
19:34amalloydweebs going like: ,(doseq [nick '(gfredericks whoever blah)] (println "(inc" nick ")"))
19:36gfredericksaw man I hate being a dweeb
19:36arrdem,; (doseq [x (range)] (println (str "(" (rand-nth ["inc" "dec"]) " gfredericks)")))
19:36clojurebot#<ExecutionException java.util.concurrent.ExecutionException: java.lang.RuntimeException: EOF while reading>
19:39Sgeo,(do); blah blah blah
19:39clojurebotnil
19:41arrdemclojurebot: everyone I see
19:41clojurebotExcuse me?
19:41arrdem,(everyone-I-see)
19:41clojurebot#<CompilerException java.lang.RuntimeException: Unable to resolve symbol: everyone-I-see in this context, compiling:(NO_SOURCE_PATH:0)>
19:42hiredman,*clojure-version*
19:42clojurebot{:interim true, :major 1, :minor 4, :incremental 0, :qualifier "master"}
19:42Sgeo,(println "foo" "bar")
19:42clojurebotfoo bar
19:42Sgeo,(str "foo" "bar")
19:42clojurebot"foobar"
19:42arrdem,(use 'hiredman.clojurebot.core)(everyone-I-see)
19:42clojurebotarrdem: Pardon?
19:42arrdemdang.
19:44TimMc&(use 'hiredman.clojurebot.core) :-P
19:44lazybotjava.io.FileNotFoundException: Could not locate hiredman/clojurebot/core__init.class or hiredman/clojurebot/core.clj on classpath:
19:46hyPiRion,(use (symbol (str "hiredman.clojurebo" "t.core")))
19:46clojurebot#<RuntimeException java.lang.RuntimeException: java.io.FileNotFoundException: Could not locate hiredman/clojurebot/core__init.class or hiredman/clojurebot/core.clj on classpath: >
19:46hiredman,*clojure-version* ; take the hint
19:46clojurebot{:interim true, :major 1, :minor 4, :incremental 0, :qualifier "master"}
19:46arrdem,*ns*
19:46clojurebot#<Namespace sandbox>
19:47hiredmanhttps://github.com/hiredman/clojurebot/blob/master/project.clj#L5
19:49arrdem,(ns-map *ns*)
19:49clojurebot{sorted-map #'clojure.core/sorted-map, read-line #'clojure.core/read-line, re-pattern #'clojure.core/re-pattern, keyword? #'clojure.core/keyword?, unchecked-inc-int #'clojure.core/unchecked-inc-int, ...}
19:49amalloyarrdem: would you mind doing your clojurebot tomfoolery in a PM with him?
19:49arrdemamalloy: I was just about to call it as a matter of fact
19:50arrdemand my appologies, I usually do
19:50hyPiRion,(everyone-I-see)
19:51clojurebot()
19:54gfredericksO_O
20:08TimMcheh
20:13KaOSoFtHello. Is there a shared (as in accepted by a majority) set of public coding conventions for Clojure? You know, like variable and function naming, for instance.
20:14gfredericksif "public" means "documented somewhere" then that decreases the likelihood a lot
20:14akhudekKaOSoFt: http://dev.clojure.org/display/design/Library+Coding+Standards
20:14antares_KaOSoFt: http://dev.clojure.org/display/design/Library+Coding+Standards. Function and local names are-dasherized.
20:15gfredericksdecreases it to 100%
20:15KaOSoFtDéjà vu...
20:16gfredericksKaOSoFt: for any specific questions there are lots of people in #clojure with opinions they like sharing
20:16KaOSoFtOh, my bad, I jumped to Volkmann’s tutorial without reading the whole Clojure documentation.
20:16jrajavANY specific questions?
20:16gfredericksjrajav: totes
20:17gfredericksany question on any topic whatsoever never fails to elicit at least 4 simultaneous responses
20:18KaOSoFtgfredericks: that I just saw, heh. Thanks, I’ll keep digging through documentation and REPL in the meantime, while I get accostumed to functional programming, and Clojure, of course.
20:24antares_KaOSoFt: take a look at http://clojure-doc.org/articles/tutorials/getting_started.html. It's a work in progress but already pretty good for basics. And clojure-doc.org is where (hopefully) most of people will collaborate on tutorials and doc guides.
20:26KaOSoFtantares_: Hmm... is that one mentioned in the official documentation? I jumped to Volkmann’s because it was mentioned in the Getting Started of the official documenation.
20:26KaOSoFtIn any case, thank you. I’ll check it out right away.
20:27mosesHi, how would I execute something like "cat foo | anotherprocess" using sh from clojure.java.shell?
20:28antares_KaOSoFt: it is the next generation doc site that everyone can contribute to.
20:36MordusHi, I'm having trouble figuing out how to use clojure.java.shell http://pastie.org/5021571
20:38brehautMordus: perhaps look at https://github.com/Raynes/conch/
20:38MordusThank you brehaut.
20:56technomancymoses: I think you can provide an input string to sh
21:05johnmn3I have an off topic question about programming careers. Where should I ask? or anyone here willing to answer over PM?
21:06SegFaultAX|workjohnmn3: Just ask.
21:08johnmn3my sister wants to change careers and do programming. She has a biology degree. She's contemplating going back to school to get a masters in comp sci. I'm telling her to just learn programming on her own (with my help) and just try to break into the industry that way.
21:08johnmn3rather than taking a 30,000 student loan.
21:08johnmn3thoughts?
21:09SegFaultAX|workjohnmn3: I think you're on the right track. She also needs to determine if she a) likes writing software and probably more importantly b) is /capable/ of writing software.
21:09SegFaultAX|workShe might try it and find out that she hates it. Or sucks at it. Or both.
21:09dlitvakjohnmn3: Comp Sci is not programming...
21:09dlitvakthey are VERY VERY different
21:09SegFaultAX|workjohnmn3: Furthermore, since she already has a degree, she already has a good foundation in at least the lower level maths required by a standard CS degree.
21:10dlitvaka lot of brilliant programmers are not CS
21:10akhudekThese are good comments. If she really does enjoy programming and can learn it, then the second most important thing is for her to show potential employers that she can actually do it.
21:10SegFaultAX|workdlitvak: That's really a secondary point to his main question, I think.
21:10akhudekopen source projects are one good way to do this
21:11akhudekalso, she should absolutely do some of the new free online CS courses
21:11dlitvakSegFaultAX|work: of course it is secondary... but it is not worth to get a CS degree if you dont feel like studying CS... and you just want to code
21:12akhudekI think there is a near complete CS curriculum that someone put together that consists only of open and free online courses.
21:13johnmn3okay, you all have pretty much affirmed my feelings on the matter
21:14johnmn3if she gets a job doing and likes it and wants to continue, perhaps her employer can pay for her masters
21:14akhudekdlitvak: respectfully disagree with that. CS theory is important for all good programmers. You don't have to do a formal program to learn the basics though.
21:15dlitvakakhudek: i actually study systems engineering and wish i studied CS... but... because i like CS... not because it is useful for me as a developer
21:16dlitvakas a developer i think that the most important thing to do... is be a nerd... love your tools... experiment
21:16dlitvaktry to learn new things every dya
21:16dlitvaks/dya/day/
21:16johnmn3great comments guys. I just told my sister what you all said
21:16johnmn3appreciate it
21:17dlitvaklast week i spent a couple of hours learning couchdb to make a wrapper for my document db ODM
21:17dlitvakand it was awesome to experiment with a new database
21:18dlitvakit was a pain on the butt... but it was awesome
21:18antares_johnmn3: I do have a degree in CS (and math) but for a lot of what is called "software development" today all you need is curiosity
21:19antares_johnmn3: curiosity and interest in building things, maybe. You can pick up HTML, CSS, and some JS + basic Web and networking skills in a few months, all without spending tens of thousands and being bored out of your mind.
21:19johnmn3okay
21:19johnmn3saying she gets those basic understandings down.. basic web dev
21:20johnmn3and a project or two on github
21:20johnmn3will a web dev shop hire her as an entry level developer, seeing as how she already has a biology degree
21:21johnmn3?
21:21antares_johnmn3: that's a good start. I don't think the biology degree will matter much but as long as she is willing to show that she can build at least some Web apps and does not slack off, I think it won't be a problem in a few months.
21:22johnmn3and of course, I'm going to make her learn clojure /clojurescript ;)
21:22zackzackzackAny particularly good services/open source projects for monitoring a noir server?
21:22johnmn3that way she knows how to do it right too :)
21:27lancepantzjohnmn3: where is she have a friend starting a program in seattle she may be interested in
21:28lancepantzhe also knows some similar programs in other places that may be good for her
21:28johnmn3actually, the DC Metropolitan area, but in the long run, she'll be looking for telework situations
21:29antares_johnmn3: http://railsgirls.com/dc
21:29lancepantzjohnmn3: he suggested http://hungryacademy.com/
21:33johnmn3whats the catch? they pay you while you're in the academy? We'll look into it.
21:33johnmn3Awesome leads though, thanks!
21:33johnmn3she's looking at them now
21:34lancepantzbuddy says they treat it like an internship at livingsocial at that specific one
21:34lancepantzbut you dont have to work there afterwards
21:34antares_johnmn3: there is no catch. They filter out the best people, those people join their team (and they have a lot of time to evaluate them, too). It is way more reliable than getting someone (even with some experience) off the street.
21:35lancepantzanyways, my friend is in techstars starting a company that solves this problem, he knows the options very well if you'd like for me to put them in touch
21:37johnmn3That would be awesome!
21:38johnmn3please send any contact info to johnmn3@gmail.com
21:38lancepantzk, i'll send an introduction
21:40antares_johnmn3: there is also http://girldevelopit.com/chapters, no DC chapter as far as I can see but it's probably only a matter of time
21:44johnmn3This has been very instructive... very encouraging. My sister thanks you
21:44lancepantzjohnmn3: I just sent you an introduction email
21:44lancepantzfwiw, i don't have a degree in engineering
21:44lancepantzand it's been a very successful career for me
21:45lancepantzi just like to learn stuff :/
21:45lancepantzand get a thrill out of it
21:45johnmn3good deal!
21:45johnmn3I'll be tying my sister into the conversation in my reply. Thanks a lot!
21:49tomoj&(loop [recur inc] (recur 4))
21:49lazybotExecution Timed Out!
21:49tomojI am actually very happy about that...
21:52gfrederickstomoj: recur is a special form so you shouldn't be able to shadow it
21:52TimMc,recur
21:52clojurebot#<CompilerException java.lang.RuntimeException: Unable to resolve symbol: recur in this context, compiling:(NO_SOURCE_PATH:0)>
21:53gfredericks,(let [recur identity] (recur 5))
21:53clojurebot#<CompilerException java.lang.IllegalArgumentException: Mismatched argument count to recur, expected: 0 args, got: 1, compiling:(NO_SOURCE_PATH:0)>
21:53tomojhuh?
21:53tomoj,(recur)
21:53clojurebotExecution Timed Out
21:53TimMcFascinating.
21:54gfredericks&(recur)
21:54lazybotExecution Timed Out!
21:54TimMc&(let [recur 5] recur)
21:54lazybot⇒ 5
21:54gfredericksthe day we found out the bots were recurrable
21:54TimMcIt's not a special form, it's a captured symbol.
21:54tomoj(eval '(recur))
21:54gfredericksTimMc: what?
21:55TimMcI think the loop macro captures it.
21:55gfrederickswhat makes you think that?
21:55TimMc&(loop [] (let [recur 5] recur))
21:55lazybot⇒ 5
21:55gfredericksspecial forms are only special at the front of a list
21:55TimMcHrm.
21:55gfredericks&(loop [] (let [recur identity] (recur 10)))
21:55lazybotjava.lang.IllegalArgumentException: Mismatched argument count to recur, expected: 0 args, got: 1
21:55TimMc&(let [do 5] do)
21:55lazybot⇒ nil
21:55TimMc^ not really
21:56tomojdo is a weirdo
21:56gfrederickswhat the heck is that
21:56gfredericks&(let [if 5] if)
21:56lazybot⇒ 5
21:56TimMcMayyybe.
21:56gfrederickstomoj: what is different about do?
21:56gfredericks(&let [let* 10 fn* 12 loop* 16] [let* fn* loop*])
21:57gfredericks&(let [let* 10 fn* 12 loop* 16] [let* fn* loop*])
21:57lazybot⇒ [10 12 16]
21:57Sgeo,(special? 'do)
21:57clojurebot#<CompilerException java.lang.RuntimeException: Unable to resolve symbol: special? in this context, compiling:(NO_SOURCE_PATH:0)>
21:57tomojgfredericks: I dunno, I just remember it does that weird thing
21:57tomojmaybe it's really a bug
21:57TimMcSo maybe loop only captures 'recur in call position.
21:58gfredericksTimMc: why not just it's a special form?
21:58tomoj&(let [do 5] [do])
21:58lazybot⇒ [5]
21:58gfredericksit works with fns too
21:58Sgeo,(special-symbol? 'do)
21:58tomojwhat does "capture" mean?
21:58clojurebottrue
21:58Sgeo,(special-symbol? 'if)
21:58clojurebottrue
21:58Sgeo,(special-symbol? 'fn*)
21:58clojurebottrue
21:58gfredericksTimMc: clojure.org/special_forms lists it
21:58TimMcHrmph.
21:58Sgeo&(let [let* 5] let*])
21:58lazybotjava.lang.RuntimeException: Unmatched delimiter: ]
21:58Sgeo&(let [let* 5] let*)
21:58lazybot⇒ 5
21:59Apage43hmm
21:59TimMcI guess it has to be special, never mind.
21:59gfredericks,(doc special-symbol?)
21:59Apage43using aleph + compojure seems to be -working- okay, but it keeps printing out scary stack traces
21:59clojurebot"([s]); Returns true if s names a special form"
21:59Sgeo,(special-symbol? 'let)
21:59clojurebotfalse
21:59TimMc,(:added (meta (var special-symbol?)))
22:00clojurebot"1.0"
22:00SgeoWait, special symbols have vars?
22:00gfredericksTimMc: no matter how many decades I've spent with clojure there's always another thing in core I haven't heard of
22:00SgeoThat... I thought they didn't
22:00tomojno, special-symbol? has a var
22:00Sgeo,#'do
22:00clojurebot#<CompilerException java.lang.RuntimeException: Unable to resolve var: do in this context, compiling:(NO_SOURCE_PATH:0)>
22:00SgeoOh, derp
22:09TimMcOh man, I'd forgotten how infuriating it is to try to debug lein plugins.
22:09TimMc(or build tools in general, really)
22:15Apage43… :/ I attached clojure.tools.trace to the problem fn and the problem went away
22:15Apage43oh, no I lied
22:15Apage43I commented out the problem and the problem went away, different thing
22:20SgeoOoh, clojure.tools.trace looks useful
22:20SgeoI could use that
22:20antares_Apage43: that's the spirit!
22:21Apage43figured out my problem, didn't have a default route
22:21amalloytomoj: capture, in the sense of implicitly imbuing a symbol with meaning
22:21Apage43so compojure was spitting back out an essentially empty ring response in the event nothing matched, and aleph doesn't like that
22:45TimMctechnomancy: I tried updating lein-otf for lein 2.x, but I'm encountering an issue with trying to get the loader code into the uberjar. leiningen.uberjar/uberjar appears to ignore the project file I pass it...
22:45TimMcI know that doesn't make any sense.
22:51zerokarmaleftTimMc: thanks again btw, your map/reduce suggestion worked like a charm with some minor changes
22:51TimMcGreat!
22:52TimMctechnomancy: WTF, the project map's metadata is another project map? I'm so confused!
23:01amalloyTimMc: i don't really follow closely, but isn't lein2 brimming over with metadata? i think project maps contain in their metadata something like "what the project map looked like before profiles were applied"
23:06TimMcamalloy: Yes, that seems to be correct.
23:06TimMcThe damnedest thing is that the resulting project.clj *only* has the old :main value in :without-profiles in the project's metadata, but it is somehow getting plucked out.
23:09halgariwhat's the best way to remove reflection from an aget on an Object array?
23:09halgari(aget (make-array 32) 1) ; causes a reflection warning
23:09halgarierr....that should be: (aget (make-array Object 32) 1)
23:12TimMcI finally had to go stomping around in :without-profiles to get uberjar to see the right :main. :-(
23:29callenanyone set up an auto-reloading ring server in Clojure?
23:33akhudekthe lien-ring plugin will do this automatically for dev and seems to work.
23:37TimMchalgari: Still need an answer?
23:38TimMc&(class (make-array Object 32))
23:38lazybot⇒ [Ljava.lang.Object;
23:38TimMcI believe ^"[Ljava.lang.Object;" should do it.
23:41halgari@TimMc that did it, thanks. I was missing the ; from the string
23:52callenakhudek: dev what?