#clojure logs

2012-10-29

00:00zackzackzackI don't know, is it possible to keep a repl sandboxed with full access to the process while preventing it from crashing the app?
00:00amalloyi don't think so. the jvm security measures aren't strong enough if you're running code in-process
00:01flying_rhinoit doesn't have to have full acess to everything
00:01flying_rhinoit is just for scripting, like JS
00:03zackzackzackflying_rhino: Can you provide a concrete use case? JS is, for better or worse, getting full access to many things nowadays in various environments and so I am not entirely sure what you are looking for.
00:05flying_rhinoconcrete use case would be console for RPG I am conteplating (still haven't started to actualy write code, because I am looking for right lang). I need things like AI scripts and quests. It doens't have to have acess to game engine (networking, filesystem) itself.
00:05flying_rhino*doesn't
00:06flying_rhinoI would like to give gamers option to change how game world behaves (to an extent), but I would not like people to accidentaly crash JVM
00:07zackzackzackHmm
00:07AtKaaZany reason why clojure.java.io/delete-file doesn't return true/false to indicate why file is deleted? since I notice (.delete fFile) always fails for some reason
00:07AtKaaZwhy=that
00:08flying_rhinoone opetion is to develop my own scripting language
00:08flying_rhino*option
00:08zackzackzackflying_rhino, it should be a fine language for what you've outlined
00:08callenflying_rhino: you're making a game in Clojure?
00:08flying_rhinocallen: possiby
00:08callenflying_rhino: what kind of game?
00:09flying_rhinocallen: type of rpg but with full world simulation. World simulation meaning that critters should hunt eachother even when player isn't around
00:09flying_rhinocallen: ambitious as hell
00:10callenflying_rhino: you're getting into the same territory as Dwarf Fortress in terms of simulation.
00:10callenflying_rhino: do you have a lot of experience making games?
00:10callenflying_rhino: you should expect to spend at least a decade on that sort of thing before it's even playable.
00:11flying_rhinocallen: some. I have one half finished RTS, and one fully finished 2d shotter in actionscript (with decent visual effects). I am fully aware that this is going to be several year long project
00:12callenflying_rhino: anything simulation-centric along those lines is not only going to be performance intensive in ways you cannot begin to fathom, but it's very labor intensive.
00:13callenflying_rhino: it might be better, if your goal is to "just" make a game is to focus on a small, concentrated idea that you want to test.
00:14flying_rhinocallen: hence clojure, mulithreading. Yes I do plan to start smal. Just a scriptable world with a few critters, that you can manipulate real time. But utlimate goal is as outlined
00:14flying_rhinocallen: basically I am exploring if what I want to do is doable at all in JVM. Then I can start small, but with massive goal in mind.
00:15callenflying_rhino: uhm, doable yes, playable/fast is up for debate.
00:15callenflying_rhino: you're just being too ambitious. You need to back it off and find something small/simple to validate an idea.
00:16flying_rhinocallen: I have to get at least some sort of scriptable world up and running. Then I can explore playability, and speed.
00:16flying_rhinocallen: right now all I want is 2d world + scriptable at runtime.
00:17flying_rhinocallen: then I look at scalability and playability
00:17callenflying_rhino: if all you want is to make a game quickly, then you should be looking at toolkits like Unity.
00:17callengames aren't scalable by definition, they're generally real-time constrained.
00:19flying_rhinocallen: I don't need premade thing like unity, Besides I want to use Entity Systems ( http://t-machine.org/ ) and unity uses different system.
00:20callenflying_rhino: then go do your thing, but my advice is to constrain the scope and use something made to make what you want.
00:20dnolenso getting a Mozart/Oz like distribute step into core.logic was pretty easy :)
00:21callendnolen: did you do any lisp before Clojure?
00:23dnolencallen: not that much, I went through the first 3 chapters + exercises of SICP around 2003, then I played around w/ CL for 3 months or so in 2008.
00:26flying_rhinocallen: thanks for the warning. I am planning to develop the thing in similar way as Age of Empires. Meaning that it is actually turn-based, but turn expires every 0.25 seconds so it appears real time. I think that modern processors probably can pull off small sized world simulation.
00:28flying_rhinocallen: I agree that first person real time would have been a tall order
00:29flying_rhinocallen: I don't think I am getting int Dwarf Fortress theritory. DF, if I am not mistaken mostly simulates terrain and dwarf cities. I am almost entirely focused on critters you can hunt.
00:37flying_rhinocallen: do you have experience making games, by the way?
01:09flying_rhinogenerally speaking I like of idea of Lisp-like language on JVM, but I frankly see Clojure as a bit too dogmatic for my tastes
01:25luxbockthis might be a silly question, but what exactly is the difference between a collection, and a sequence?
01:26luxbockall collections are sequences I take, but not all sequences are collections?
01:30amalloyother way round
01:31amalloyall sequences are collections, and all collections can be made into a sequence, but many (eg maps) are not one
01:32luxbockah ok, thanks
01:36flying_rhinodoes clojure have something like triple quotes """ in scala and python for explicit quoting?
01:37SgeoThe regular double-quotes can be multi-line
01:37flying_rhino(I know that syntax isn't lispy thing to do, but I think that one would be immensely usefull)
01:38flying_rhinoSgeo: that's good, too.
02:08ambrosebsNew version of Typed Clojure dissertation, with some corrections and rewrites. Further corrections welcome. https://github.com/downloads/frenchy64/papers/paper.pdf
02:49brainproxysimple/recommended way to have clojure.test based tests to re-run on source / test-source change?
03:47Jal_Flandersbrainproxy, I.. am optimus prime
04:22arrdemis there a way to define an "init method" in deftype?
04:23luxbockis there a variable for the result of the last valid evaluation in REPL?
04:24francis-@luxbock *1
04:24luxbockthanks
06:53ro_stRaynes: ping
07:00Cheiron_Hi, why gen-class is generating a main method (according to javap) ? I didn't specify it
07:28AtKaaZhi, I need some suggestions about what can I do if I have a reader and I'm using with-open but I want to assign some let variables that remain after with-open is done
07:35borkdudeAtKaaZ then use with-open inside a let and not vice versa?
07:36AtKaaZbut can I let within the with-open ?
07:36AtKaaZwhy do I have the feeling I'd have to use vars?
07:36AtKaaZsomething like define the var in the outside let and inside the with-open assign/change it or something
07:37AtKaaZor something like this: http://clojuredocs.org/clojure_core/clojure.core/with-local-vars
07:37AtKaaZbut I don't want it to be imperative:/
07:38_ulisesAtKaaZ: what's the specific thing you're trying to do?
07:39AtKaaZtake simple example: count number of lines from the reader within a with-open and after with-open is done, still remember the number (but of course I'm doing more than just count)... ok I just realized it should be a function returning that?
07:40AtKaaZso instead of using let, I should use a function return the stuff? in this case if I have to return 3 things what's the idiomatic way to do so ? a map ?
07:41_ulisesAtKaaZ: it depends, a map would let you name the 3 things, you could use a vector and use positions, etc.
07:41_ulisesAtKaaZ: as for counting the number of lines, then that's just a function that'd operate on a reader opened with with-open
07:41AtKaaZ_ulises: what would you use?
07:41_ulisesAtKaaZ: I'd say
07:42AtKaaZ_ulises: I think you're right, that does seem more idiomatic than with vars or I can't imagine anything else
07:42_ulisesAtKaaZ: I normally use maps as they also provide better documentation than a vector and having to remember the positions inside a vector, etc.
07:42AtKaaZyeah I was wondering about that, cool then
07:44AtKaaZthat's definitely the way I'd want to go, function and return a map, just in case I'll change order of returned things or add more inbetween, thank you for this
07:45_ulisesAtKaaZ: sure, no worries, another thing to keep in mind is that with maps now you can do (:returned-value the-map)
07:45_ulisesAtKaaZ: which is a great improvement over (get the-vector 1) or something
07:45AtKaaZyep for sure!
07:45AtKaaZ,(:c {:a 1 :b 2} :not-found)
07:45clojurebot:not-found
07:46_ulisesAtKaaZ: however, I'd encourage you to have wrapper functions like (returned-value-1 the-map) even if initially they are simply (defn returned-value-1 [the-map] (:returned-value-1 the-map))
07:46AtKaaZexcellent sugestion!
07:46_ulisesAtKaaZ: and the reason is that sooner rather than later you'll want to add checks, maybe ACLs, etc.
07:46AtKaaZmy thoughts exactly
07:46_ulisesAtKaaZ: and it'll be far easier to change that function instead of *all* your code ;)
07:47AtKaaZjust awesome:)
07:47AtKaaZ(inc _ulises)
07:47lazybot⇒ 1
07:47_ulisesAtKaaZ: not just that, if you find that eventually maps are too slow for you, you can then rewrite returned-value-1 fn to take a vector and hide the positional extracting there
07:47_ulisesAtKaaZ: basically, indirection saves the day again
07:47_ulisesAtKaaZ: I'm just trying to save you some pain from the beginning :)
07:47AtKaaZmuch appreciated
07:48_ulisesnp
07:54degHi... I'm a newbie to this IRC and, pretty much, to Clojure. Is it appropriate to ask a question here looking for basic help?
07:55_ulisesdeg: don't ask if you can ask :)
07:56shachafBe bold, deg. Ask your question.
07:56shachafIn the worst case, you'll be referred elsewhere.
07:56shachaf("referred" may be a euphemism, in the very worst case.)
07:56deg:-) Yup, I was afraid that would be a reaction... Anyway, then, I'm having trouble figuring out how to debug effectively (I'm working in an Eclipse/CCW env). In particular, I have a local that I think is always a vector... my code only inits it to [] or conj's on to it, but... at one point it prints out as #<core$conj clojure.core$conj@e86a5f>
07:57degAnd, when my code tries to take first of it, I get the error "IllegalArgumentException Don't know how to create ISeq from: clojure.core$conj clojure.lang.RT.seqFrom (RT.java:494
07:57AtKaaZ_ulises: could I maybe enforce the use of wrapper functions on the returned map ? maybe make the returned object be something else which wraps the map?
07:58_ulisesAtKaaZ: perhaps, but I personally wouldn't do that
07:58AtKaaZ_ulises, why not?
07:58_ulisesdeg: maybe paste the code?
07:58_ulisesAtKaaZ: well, it's sort of a philosophical position
07:59_ulisesAtKaaZ: I mean, I would rather keep the data open and provide utility functions to the users of my lib/myself
07:59_ulisesAtKaaZ: than to police it
07:59degOk. give me a minute to extract the relevant pieces....
07:59_ulisesAtKaaZ: because police-ing the data takes times and effort
07:59_ulisesAtKaaZ: and it doesn't make that much sense anyway in most scenarios
07:59_ulisesAtKaaZ: I'm lazy you see :)
08:00AtKaaZ_ulises: but if I wanted to do it what should I look into? something to build a new class and have that map as a field with possibly replacing toString to show the map contents
08:01_ulisesAtKaaZ: then the world is your oyster my son, you can do whatever you want and not necessarily wrap a map
08:02deg(defmacro dbg[x] `(let [x# ~x] (println "dbg:" '~x "=" x#) x#)) ... {:chromatin chromatin :rules rules :rule-path []} ; passed into a function ... (defn f [input] (let [chromatin (:chromatin input) rules (:rules input) rule-path (:rule-path input)] (dev/dbg rule-path) (dev/dbg (first rule-path))
08:02deg(oops, lost the newlines... let me try that again)
08:02deg(defmacro dbg[x] `(let [x# ~x] (println "dbg:" '~x "=" x#) x#))
08:03deg...
08:03_ulisesdeg: use friendpaste/refheap/etc.
08:03AtKaaZyou can use refheap.com
08:03AtKaaZfor pastes
08:03deghttps://www.refheap.com/paste/6232
08:04degObviously, not all the code is there, and the error is somewhere else. But (I claim) the only thing I'm doing is conj'ing on to the vector.
08:05_ulisesdeg: well, the error is probably in that claim; I mean, something's going wrong while you conj because you're ending up with an fn instead of a vector and then (first...) complains
08:05degI will probably be able to find my error, if I can udnerstand what it is. But, I don't understand what the "#<core$conj clojure.core$conj@e86a5f>" is.
08:05_ulisesdeg: so without seeing that code (or a simpler version of) there's not uch I can do
08:05degOh, it is a function?
08:06_ulisesdeg: yes, that message is a function
08:06_ulises,(str identity)
08:06clojurebot"clojure.core$identity@35d3694a"
08:06degk... one minute... let me stare at my code and see if it becomes glaringly obvious now.
08:06_ulises,(str #(+ 1 %))
08:06clojurebot"sandbox$eval54$fn__55@5a9875d1"
08:06_ulisesdeg: cool
08:07degIkes... yeah, glaringly obvious typo.
08:07degSorry, all!
08:09degSo, I guess my next question becomes: what doc describes the printed rep of different objects? Does "#<...>" always represent a function?
08:09borkdudeAtKaaZ sorry, was away for a minute
08:09AtKaaZborkdude, np
08:09borkdudeAtKaaZ maybe you should take a look at this article: http://blog.malcolmsparks.com/?p=17
08:10degAnd, broader question, where can I find a good description of debugging tools for Clojure in Eclipse? (Or am I better off just moving to Emacs, if it has a richer debug env)
08:11AtKaaZcan emacs refactor? i can see ccw doesn't
08:12AtKaaZlike rename functions for example
08:12degIdeally, I'd like a debugging environment where (1) stack traces show my functions only, not the java support structure; (2) an exception leaves me in a REPL in the lexical environment of my erring function; and (3) the debugger REPL lets me navigate into the lexical envs of calling stack frames.
08:13degDo such tools exist yet for Clojure?
08:14clgvdeg: in eclipse you can use breakpoints.
08:15clgvdeg: just make sure that the repl is started in debug mode
08:15degI tried using breakpoints yesterday. As far as I could tell, my breakpoint was never reached, and execution kept stopping at an unmarked breakpoint deep in the runtime support code.
08:16degDid I make a mistake by first starting the REPL and then (hours later) doing F11 (Eclipse's Run|Debug)? Or should that automatically start a debugging REPL?
08:17degOr, I guess I should ask, is there a doc that describes how to start a Clojure debugging session in Eclipse?
08:28degOk, so trying again to use breakpoints in Eclipse... Restarted Eclipse, set a few breakpoints, and then did Run|Debug from the Eclipse menu. It started a REPL, and broke in Clojure's core.clj, seemingly at line 101, in the def of ffirst.
08:29deg Eclipse does not show a breakpoint on that line. Continuing just breaks at another line in the runtime support.
08:30degHmm, my file is also called core.clj, and I have a breakpoint at line 101. Is it possible that Eclipse is setting the breakpoint in the wrong file, despite them being in different namespaces?
08:40babilenHi all -- Is it intentional that reduce and reduce-kv or map/mapv and reducers/map show different behaviour when called on nil? (cf. https://www.refheap.com/paste/6233)
08:40clgvdeg: you have to start the repl in debug mode
08:41babilenI find myself in the unfortunate position that I have to litter my code with "(nil? coll) (new-coll-of-expected-type)" which is IMHO quite ugly. Is this inconsistency intentional?
08:52deg(back) clgv: how do I start the repl in debug mode? It looks to me like Eclipse is starting the repl itself, when I do a Run|Debug. What other step(s) do I have to do?
08:52clgvuse debug ^^
08:53clgvdeg: close the open REPL and Run -> Debug As -> Clojure Application
08:54degthx. One minute while I restart and try that.
08:56degclgv: I restarted Eclipse, did Run|Debug As|Clojure Application, and then did Clojure
08:56deg.. Clojure|Load File In Repl. Now, all breakpoints are showing with a slash through them
08:57degand toggling breakpoint goes between no icon or breakpoint with a slash.
08:57clgvwell, I did nothing more than that and could use breakpoints
08:58degOk, thanks. I'll paly around. Surely just something in my env. Once I do get it to work, how powerful are the breakpoints? Do they leave me in the lexical env of each of my functions?
08:58deg"paly" -- "play"
09:06clgvdeg: yeah, you get local variables with values as in java. but afair there might be problems with "locals clearing"
09:11degclgv: thanks. I'm now playing with Eclipse and should have this figured out soon. (Turns out that the slashes were caused by a "skip all breakpoints" setting in Eclipse, but now I'm back to the original problem. But, I'm sure it's just something environmental.
09:12clgvdeg: I dont use breakpoints often though. It pays off more to test functions in the repl as you develop them
09:13degclgv: Agreed, but debugging is still an unavoidable evil sometimes.
09:14clgvdeg: I ve written some debug tools but they currently have a hard time with tail-recursion
09:14degAnd, even after years of suffering through C++ and Java, I'm still spoiled by early exposure to the Lisp dev env on Symbolics machines. Clojure has such potential, I hope it will soon reach and surpass those glory days.
09:20_ulisesdeg, clgv: surely you also write unit/integ tests too ;)
09:21clgv_ulises: definitely.
09:46ro_stdnolen: in cljs, how do protect a set! property from advanced mode munging?
09:46ro_stin vanilla gclosure i'd just goog.export the name or use a string eg foo["bar"] = "baz"
09:47ro_sti'm busy wiring in exception reporting with goog.debug.ErrorReporter/install
09:47ro_stand i need to write some additional stuff into the context so that the reports are useful
09:47ohpauleezro_st: You can use the ^:export metadata
09:47ro_sti know i can do that on def and defns
09:48ro_stbut what about ".-my-version" in (set! (.-my-version context) version/version) ?
09:48ohpauleezIf that
09:48ro_st"my-version" is being munged, which i don't want
09:49ro_stkudos on ttt, btw :-) i'm looking forward to spelunking in there
09:50ohpauleezThanks! Is that property specified outside of CLJS, in some other JS code?
09:50ro_stnope
09:50ro_stin cljs
09:50ro_strefheap inboud
09:51ohpauleezand it still munges even though context is ^:export 'd? That seems odd to me
09:51ohpauleezcool
09:52ro_sthttps://www.refheap.com/paste/6235
09:53ro_stsee the issue? i have to mutate an obj that gclosure passes to my fn
09:54ro_sti guess i could cheat and export empty defs
09:54ohpauleezro_st: What happens if you you ^:export error-context
09:55ohpauleezthat's also another work around
09:55ro_stneither of those seems to work
09:55ohpauleezor if you wanted to be dangerous, you can use the js* form
09:56ro_sthow would that look?
09:56ohpauleezand if you attach meta ^:export at the call location, does that result in a compilation error?
09:56ohpauleez(js* "raw JS syntax here to set the property you're talking about")
09:57ro_stlike this? (goog.debug.ErrorReporter/install "/client-error" ^:export error-context)
09:57ohpauleezyou're going to have to use, with-meta
09:57ohpauleezbut you'll need to extend the IWithMeta protocol to the context (if it doesn't already exist)
09:58ro_st(js* (str "context.c2-version = " version/version))
09:58ro_stcompiler laughed at me in multicolor stacktrace prose
09:58ohpauleez:(
09:58ro_stis there a way to do this?
09:58ro_stobj["foo"] = bar
09:59ohpauleezHmm, open up an enhancement ticket on the tracker - I'll see if I can come up with anything today/this week
09:59ro_stthe tracker that needs a CA?
09:59ro_sti'm all out of spare blood -grin-
10:00ohpauleezbeyond (set! (.-foo obj) bar), not that I know of
10:00ohpauleezhaha, there should be a digital CA soon - I'll open up the issue
10:01ohpauleezso where is the .-c2-version coming from?
10:01ro_stok cool. our jenkins writes git-describe into a cljs prior to cljs-build
10:01ro_stinto app.version/version
10:02ro_stso that the app knows which git tree it's built on. i want to write that into the outgoing errors so that we can precisely reproduce error conditions
10:02ohpauleezdo you have an externs file for the app.version?
10:03ro_stdon't need one:
10:03ro_st(ns app.version)
10:03ro_st(def version "#VERSION#")
10:03ro_stwe just sed #VERSION# with the actual version number
10:03ohpauleezahh, it's CLJS
10:03ro_styes
10:04ohpauleezthen were is the error happening? Name munging shouldn't matter if it's all internal
10:04ohpauleezOhhhhhh
10:04ro_stwell, the error reporter target is a server-side script
10:04ro_sti'm writing app version into the data going to the server
10:05ro_stso i do need ^:export, but on that particular js property name rather than a fn or namespaced declaration
10:05ohpauleezand you get passed a context, which a flat JS object, but generated after the fact, but the .-c2-version is munged and you get an error?
10:06ohpauleezso the .-c2...*
10:06ro_styes. gclosure passes me an anon js obj with stuff in it - stack trace, line number, etc - and i then add context.c2-version = app.version/version
10:06ro_sthence the need for set!
10:06ro_sti have to mutate an object passed to me
10:07dnolenro_st: use aset not set!
10:07ro_stdnolen to the rescue :-)
10:07ro_stwhere do i find docs for that? -curious-
10:07ro_stnothing on himera abouut it
10:08dnolenthere are no docs for that really. related - figuring how to expose GClosure support for this kind of thing. @expose seems to fit the bill.
10:09ro_st(aset context "c2-version" version/version) ?
10:09dnolenro_st: yes
10:09ohpauleezthis is a good little nugget - I've never run up against this before
10:10ro_stthanks dnolen. high five
10:10ro_styeah. a great thing to know.
10:11ro_stworks!
10:11ro_stohpauleez: do you log js exceptions in your cljs apps?
10:11ro_stif so, how?
10:11ro_st(f not, why not, you madman?)
10:12ro_stdnolen: how are things going with sourcemaps?
10:12dnolenro_st: not currently working on them. busy w/ core.logic stuff.
10:13ro_stthinking about it, i'm actually 100% happy with :advanced -> :simple sourcemap support, which i believe you said is already working
10:13ohpauleezro_st: In one internal app we just log to console, in another app we use Shoreleave's remotes
10:13ohpauleezand expose a server-side logger
10:14ro_stand how do you capture the exceptions?
10:14ohpauleezand in two others, no logging, but they are small
10:14ohpauleezwe just squash them and hit the logger
10:14dnolenro_st: hmm that's true I could probably cherry-pick that bit out.
10:15ohpauleezmost of the serious exceptions we hit in development (missing protocols, etc)
10:15ro_stdnolen: i would be most grateful if you could. it'd be great to be able to build 'normal' sourcemaps along side our :advanced js
10:16ohpauleezro_st: I'm sure dnolen would accept patches from you, passed through my CA :)
10:16ro_sti'm afraid it's a little beyond my ken at the moment
10:17ro_stCTO for a startup, and we're just about to tip. father of a toddler. spare time sliiiiightly on the non-existent side -grin-
10:18ro_sti'm really glad i decided on clojure 7 months ago. we'd be nowhere near where we are now.
10:21ro_stohpauleez: we've tested pretty thoroughly. i'm just putting something in to help us catch the stuff that didn't occur to us
10:22ohpauleezahhh cool!
10:30ro_stwas so happy to not have to support IE8. man that thing is a dog
10:44jonasendnolen: will there be a :column key in the cljs ast tree now when we have reader support for it?
10:54casperchi, anyone familiar with datomic in here?
10:55ro_styup
10:56caspercawesome, so I have a connection url for datomic which looks like this: datomic:ddb://datomic/<name>?aws_access_key_id=yyyy&aws_secret_key=xxxx
10:56caspercthing is I am behind a corporate firewall, and it doesn't work
10:57ro_stah, apologies. only been using free on single-machine setups
10:57ro_stbest place is the google group
10:58caspercyeah figured as much, was just hoping i might find someone here :)
10:58caspercthanks anyways
11:02dnolenro_st: ohpauleez: I added basic GClosure source map support to CLJS
11:02dnolenyou just need to add :source-map "name.json" to your build options
11:02ro_stah
11:03ro_sti've had :sourcemap true in for a while
11:03ro_stwhat does "name.json" describe?
11:03dnolenro_st: the name/path of the source map file.
11:03ro_strooted where? the project?
11:03dnolenro_st: :sourcemap true doesn't do anything.
11:04dnolenro_st: relative to where you run the compiler. improvements welcome
11:04ro_stlet me try that out
11:06ro_stwhich version did that land in, dnolen?
11:06ro_sti currently have 0.0-1450
11:06dnolenro_st: it's not in a released version - fixed in master.
11:08ro_stah. i can chuck it into checkouts to test it, right?
11:09ohpauleezdnolen: Awesome, I'll check it out today
11:09ro_stsorry, i've not had to work with a jar dep as a git checkout before
11:13ro_sthmm. looks like it's not that simple
11:13dnolenro_st: hopefully another release soon, I'd like to see the let issue CLJS-411 to get resolved first.
11:13ro_sti'm using cljsbuild in my project. is it a big mission to get it using a checkout of clojurescript instead of some jar? sorry, this is stuff i've never had to deal with before :-)
11:14dnolenro_st: it's pretty simple - make a directory called checkouts in your project. git clone clojurescript into it. use leins :extra-class-paths
11:14dnolenro_st: the master version of CLJS will be used by lein-cljsbuild
11:15ro_sti'm using these deps https://www.refheap.com/paste/6240 due to needing a modern enough version of gclosure to support shoreleave and enfocus/domina at the same time
11:15ro_sti'm guessing doing so complicates this somewhat?
11:16ro_sti'm guessing "clojurescript/src" is sufficient for :source-paths?
11:17ro_styeah, i'm getting this error "WARN ignoring checkouts directory clojurescript as it does not contain a project.clj file."
11:17dnolenro_st: lein 1 / 2 ?
11:17ro_st2
11:18dnolenro_st: no you need full paths
11:18dnolenro_st: yeah i don't use 2 so I don't know about that warning.
11:18ro_stok cool
11:18ro_sti'll pester ohpauleez once he's given it a go :-)
11:18ro_stor wait until the next release
11:18dnolenro_st: http://gist.github.com/3974095 is an example of how I do it.
11:19ro_stah you include both clj and cljs directly
11:19ohpauleezro_st: If you see that warning, just make your own branch of CLJS, and add a standup project.clj
11:20ohpauleezor, follow dnolen's suggestion (which is also what I do with other contrib libs)
11:20dnolenro_st: yes
11:21joroI'm using aleph.http http-server with ring middleware, and compojure static route. With 2GHz i7 I'm getting 30 req/s. Any ideas how to improve that?
11:21ro_stit fetched org/clojure/clojurescript/0.0-1513/clojurescript-0.0-1513.jar, and i'm getting new deprecation warnings for shoreleave
11:21ro_stso i'm guessing it's using 1513 and not my checkout
11:22ro_stohpauleez: you've probably fixed already? Protocol IPrintable is deprecated at line 27 .lein-cljsbuild-compiler-1/shoreleave/browser/cookies.cljs
11:22ohpauleezgist or refheap me the deprecation warnings
11:22ohpauleezahh no, I haven't fixed that one
11:22ro_stit's just that one
11:22ohpauleezahhh that's an easy update
11:23ro_stthat's in 0.2.3-snapshot (which i'm still using)
11:24ro_stok. i'm going to hold out for the next version of cljs, dnolen. thanks for your time. do you tweet when cljs is released? where should i watch for news?
11:24dnolenro_st: stuart sierra usually makes an announcement on the list.
11:24ro_ston the clojure ggroup, right?
11:25dnolenro_st: yep
11:25ro_stcool
11:25ro_stis there a way to set up an alert on ggroups?
11:26ro_sti'll google :-)
11:26ro_stdnolen: you seem to be having lots of fun with logic!
11:27ro_stgetting a small taste of it with datalog in datomic now. starting to appreciate its power. queries that would have been walls of sql are so simple and straightforward in datalog
11:28ro_stbtw, someone with high scale experience needs to represent clojure at http://scaleconf.org/
11:28ro_sti'm printing an Ask me about clojure tshirt to wear when i attend
11:30quadrocubeHi all! Is there anyone who may explain how to use (no-loop) in clj-processing? I have been running my head into it for quite a while, but still am unable to find out why this (quite prosaic) example fails http://pastebin.com/LYR86vVq Thank you in advance!
11:30dnolenro_st: it is fun - but it's also annoying :)
11:30quadrocube*quil, which was earlier a clj-processing
11:31clgvquadrocube: it's a property setter on the sketch
11:32dnolensamaaron: look forward to hanging at TechMesh!
11:32samaarondnolen: haha, me too!
11:35quadrocubeclgv: not sure I caught corretly what you meen.. Can you, please, elaborate a little bit. (Kinda newbie into quil all in all)
11:35clgvquadrocube: i think that (no-loop) says "dont call the draw method and only execute the setup method"
11:37clgvquadrocube: the docstring of "no-loop" is quite instructive
11:38quadrocubeyeah, that's what the prototype method noLoop in processing is meant to be. But as the majour purpouse of it, it provides you wtih the possibility to call (redraw) to manually redraw the sketch as you need. Nevertheless, i'm failing to force the redraw by calling (redraw) func outside the setup - e.g. mouse handlers do not trigger at all
11:39quadrocubeAnd, e.g., here: http://processing.org/learning/basics/noloop.html there is an example, which shows that a (redraw) inside mouse-handler is possiblke
11:41quadrocubeso, mainly, the question is: why no-loop behaves in the similiar way as sketch-stop in terms of ignoring all the possible outside-world events?
11:43quadrocubedocs say that it's not the correct behaviour and most probably it's me who is doing smth wrong
11:49CubicDamn, paredit mode hates my curly braces
11:49clgvquadrocube: since this is all running in a different thread wrap some try-catch blocks around your code and output the stacktraces if any
11:49samaaronquadrocube: please file any quil issues on Github :-)
11:51quadrocubethank you all =) Yeah, perhaps it's not the best place..)
11:53CubicHas anyone here managed to get paredit-mode to properly work with curly braces? If so, how?
11:57samaaronCubic: what do you mean by "properly work"
11:57samaaroni.e. what doesn't it do that you would expect it to do?
11:58CubicIt doesn't close {'s when I write them, although it does recognize {} as a SEXP when I close it myself (and I can't delete a single { without closing it first). It's all very weird
11:59samaaronCubic: check out how Emacs Live does it
12:00samaaronit works perfectly there
12:00ro_stcubic: i suggest swapping out your own .emacs.d for emacs live and trying it out
12:00ro_sti use an emacs live based config and paredit is awesomesauce
12:01CubicDoes it actually glow weird like in the screenshots?
12:01ro_stno that's a filter on the video :-)
12:02samaaronCubic: sadly not :-)
12:02ro_stalthough i must admit i did think it would when i first saw the vid
12:08mikerose357hey there is supposed to be a branch of vimclojure that can connect to nrepl anyone use this/
12:10ohpauleezmikerose357: The latest version of vimclojure connects via nrepl I believe
12:14technomancymikerose357: I think that's still in development
12:17CubicWow, the emacs live package is pretty cool. Only downside is, now I gotta find my old theme again. The preconfigured one has too much contrast
12:31mpanAnyone know what's happening lately with Light Table?
12:36jrajavmpan: http://www.chris-granger.com/ https://twitter.com/ibdknox
12:36mpanthanks!
12:43francis-I need a fn that does devision but discards the remainder. The name of it is escaping me at the moment.
12:43francis-EG:
12:44francis-(some-fn 7 3)
12:44francis-;=>2
12:45Wild_Catfrancis-: (int (/ 7 3))
12:45francis-thanks
12:45Wild_Catfrancis-: meaning the function you want is in fact (comp int /)
12:50metellus$findfn 7 2 3
12:50lazybot[clojure.core/bit-flip clojure.core/bit-clear clojure.core/quot clojure.core/unchecked-divide-int]
12:51metellus$findfn 7 2 3
12:51metellus$findfn 7 3 2
12:51lazybot[clojure.core/bit-flip clojure.core/bit-clear clojure.core/quot clojure.core/unchecked-divide-int]
12:51lazybot[clojure.core/quot clojure.core/unchecked-divide-int]
12:51metellus,(quot 7 2)
12:51clojurebot3
12:52mpandoes findfn do something special? or just brute force?
12:52technomancybrute force is special in its own way
12:52mpanI never claimed to be good with natural language, I suppose
12:53technomancyjust messing with you
12:54mpanI seem to have lost my train of thought of what I wanted to ask
12:54technomancypretty sure it's doing brute force; type inference in Clojure is still in its infancy
12:54mpandue to looking into findfn
12:55ToBeReplacedtechnomancy: is there a way to get the release branch of clojure-test-mode with package.el or do I need to clone the repos? i hit this: https://github.com/technomancy/clojure-mode/issues/98
12:56gfredericksI wonder if adding typed-clojure to lazybot could make find-fn a lot more smarterer?
12:56technomancyToBeReplaced: I don't understand
12:57technomancyToBeReplaced: only the releases are on marmalade
12:57technomancygfredericks: only if someone went to the trouble of annotating everything in core first
12:58hiredmantechnomancy: seems likely
12:58mpantechnomancy: is everything annotatable?
12:59ToBeReplacedtechnomancy: understood... so i guess i'm hitting an issue with the release then dated 09/14, which is the same one as proofit404; should i just add an issue?
12:59technomancyToBeReplaced: there's no release with that date
13:00technomancyToBeReplaced: maybe you're using melpa? they generate their own releases from git master automatically.
13:00technomancywhich obviously leads to all kinds of breakages in the normal course of usage
13:00ToBeReplacedyes you're correct; it's from melpa... i'll switch to marmalade
13:03dnolentechnomancy: hiredman: typed clojure already annotates a good chunk of core http://github.com/frenchy64/typed-clojure/blob/master/src/typed/core.clj#L6229
13:04technomancyoh, gotcha
13:04technomancyso the other problem with using an explicit ann function for annotations (as opposed to just metadata) is that it creates a runtime dependency on typed clojure, which is unfortunate for a dev-time tool
13:05technomancyI guess I should mention that when ambrose is online
13:05dnolentechnomancy: actually perhaps not as much as I had thought - but seems like a good starting point
13:06technomancywell doubtless it will happen with time
13:07dnolenbbloom: ping
13:08lynaghkdnolen: stay dry, David
13:08dnolenlynaghk: will do, thanks
13:12ToBeReplacedtechnomancy: thanks; issue resolved
13:14technomancyyeah melpa is an interesting idea, but until they offer a repo that only includes explicitly tagged releases I think it's just more trouble than it's worth
13:18ToBeReplacedi'm using emacs for the first time, so after you brought it up i went to go learn about them. i think i'm inclined to agree with you, but i haven't felt its power yet so hard to know
13:21technomancyoh, did I tell you to use it? my bad =\
13:22uvtcOnly catching the tail end of this conversation, but I tell folks to use melpa in http://www.unexpected-vortices.com/clojure/10-minute-emacs-for-clojure.html . technomancy, not good advice?
13:23technomancyuvtc: I don't think so. newbies shouldn't be following git master; that's just asking for breakage.
13:23technomancyas evidenced above
13:24uvtcAh. In that doc, I'm using it to install only clojure-mode.
13:24technomancyyeah, but people will go on to install other things
13:24technomancyand clojure-mode breaks on master sometimes too
13:24uvtcright.
13:25uvtcSo, it's better to use marmalade. Ok.
13:25pyrI suppose warnings like this one: Warning: protocol foo is overriding method bar of protocol baz are unavoidable ?
13:25pyrand to be clear, the only risk that protocol overriding presents is a single record/type/class implementing both protocols
13:26Baldanders`Speaking of newbies and breakage... technomancy, you are the author of Leiningen, right?
13:26technomancydepends, what's the question? =)
13:26Baldanders`heh
13:26Baldanders`Well I posted something to thegoogle group about this right before you moved the list.
13:27Baldanders`But I had a lot of problems with Leiningen under my Win 7 machine at work. It's possible that I did something stupid, but I don't think so.
13:27Baldanders`Because I followed the same steps on both my Win 7 laptop and on a Linux VM and things worked...
13:28Baldanders`So I think Lein 2may have some problems gettingpackages with certain setups under Win 7.
13:28technomancyhm; yeah I think I remember that email
13:28technomancyunfortunately I don't know where to look to debug that kind of problem on Windows
13:29Baldanders`I've been able togetaround it for nowby using Linux in a VM at work, but I thought I I'd give you a heads-up about it.
13:29Baldanders`Yeah- I am not sure what to do to try to diagnose what is happening.
13:30Baldanders`Otherwise I would dig into it and try to figure it out. But it has been quite a while since I did anything with the JVM, and I am just starting to use Clojure seriously.
13:35Baldanders`I do have one question about working around it though- since I can get packages OK on my Win 7 laptop, would it work to set up a project with the dependencies I want on that machine, and then move the downloaded files to my desktop at work? I'm not quite clear on where Leiningen puts stuff, but I imagine I could figure it out.
13:36Baldanders`And by the way, other than this little problem, Leiningen is very cool.
13:38technomancyBaldanders`: sure; copying ~/.m2/ over should get you what you need
13:40Baldanders`Cool, thanks.
13:43ToBeReplacedsorry; one more :) how do you connect clojure-test-mode to nrepl? if i do C-u M-x nrepl-jack-in, then C-c C-t to a test file, then C-c C-,, it says Not connected.
14:00ToBeReplaced;; figured out that clojure-test-mode doesn't support nrepl... works with swank
14:01ToBeReplacedor maybe i have bad blobs from previous release :)
14:03ToBeReplacedyes, 1.6.0 runs with slime, 1.7, when it is released, will work with nrepl, but it doesn't quite get there yet
14:36nbeloglazovHi. I have a problem with proxies. Base class has empty public method mouseClicked. Proxy based on this class is created where mouseClicked overridden. This mouseClicked method called by base class in 2 different places from 2 different threads. In one thread overridden version is called, in other - empty. How it is possible?
14:37nbeloglazovProxy is created here: https://github.com/quil/quil/blob/master/src/quil/applet.clj on line 275
14:40Cheironhi, when using gen-class , should i pass 'this' to every function ?
14:41nbeloglazovI tried to log all invocations of mouseClicked and here what I have: https://www.refheap.com/paste/6242
14:42Cheironwhat happened if we didn't pass this to functions for gen-class?
15:02jweiss_am i the only one would would find this useful? (binding [*print-lazy* true] (iterate inc 0)) => () (where *print-lazy* would only print the already realized portion of a lazy sequence?) i know it's not that hard to do for lazy seq's, not sure about Cons's.
15:04jweiss_sorry (binding [*print-lazy* true] (prn (iterate inc 0))) => ()
15:04jweiss_
15:06ro_stRaynes: ping
15:06ro_stanyone using ring and have a solution for logging exceptions?
15:06ro_sti'm wondering if there's any more to consider beyond the solution here: http://stackoverflow.com/questions/12627410/idiomatic-way-to-catch-exceptions-in-ring-apps
15:10ro_stibdknox: ping
15:14ro_styay. found it
15:25rbxbxIf anyone is having difficultly with getting vimclojure-nailgun-client working and you're on OSX, I wrote a little homebrew recipe that should take away the pain – http://regretful.ly/clojure/2012/10/28/up-and-running-with-vimclojure/
15:27tgoossensI'm really getting frustrated at university
15:28hyPiRiontgoossens: oh?
15:28tgoossensWe are obligated to do our assignment OO
15:28tgoossensAnd clojure is so cool :P
15:28ro_styuck
15:28solussdhow do I remove a protocol implementation from a record? I moved the protocol implementation from one namespace to another, but now I get "blah blah blah already directly implements interface blahblah for protocol blah"
15:28tgoossensEven though i've only been working with clojure for 1 month
15:28tgoossensI love it
15:29tgoossensI forget to study though :S
15:30ro_sttgoossens: you can do FP in an OO language
15:30rbxbxro_st tgoossens and vice versa ;)
15:30tgoossensI know.
15:30tgoossensI like multiparadigm
15:30tgoossensBut it is a course on OOP :p
15:31ro_stcan you unsubscribe?
15:31ro_stswitch to, say, scheme?
15:31tomojsolussd: I don't understand https://gist.github.com/c06b191ee5657ce8a668
15:31tgoossensIts a course in java
15:31ro_stthis is why i dislike uni. pay lots of money to fill your precious braincells with crap.
15:32tomojif the protocols are in separate namespaces, they're separate protocols, and there should be no problem
15:32tomojoh, the implementation. hmm
15:32ro_sttrusty way to test exception handlers: (/ 1 0)
15:32ro_stmuch more fun than (throw "up")
15:32solussdtomoj: actually, I'm implementing the protocol inline with the defrecord declaration (defrecord Blah [key key2] Proto (func [_] "hi"))
15:33solussdthen I moved it elsewhere and recompiling (without restarting my repl) complains
15:33tomojthat seems like it should also work..
15:33tomojsince it will be a completely new record type in a new namespace
15:34hyPiRionro_st: I wouldn't say uni is crap, but it's teaching you the current industry standard and gives you a proof that you know it
15:34ro_stbut is it the current industry standard?
15:34hyPiRionJava is, at least over here
15:34ro_stand is it proof?
15:34ro_stand is that the best way to turn that money into that result?
15:34solussdtomoj: I'm replacing the protocol implementation using (extend-type Blah Proto (func [_] "hi again)) after removing it from the defrecord declaration and recompiling it first, of course
15:35tgoossensThe nice thing is if you are obligated to make a program in java
15:35hyPiRionBut, important aspect I should tell - I'm not paying for my education, so maybe I'm biased
15:35tgoossensYou can do it in clojure :)
15:35ro_sti'm self taught. 33 yrs old, 15 years work experience. got paid for all my learning
15:36tomojsolussd: I don't think you can do what you want
15:36solussd:/ REPL, i'm sorry, I'm going to have to disconnect you.
15:36tomojyou could remove an extended-on impl by altering the protocol
15:36tomojwell, just undef the record
15:36solussdoh, ok
15:36solussdill do that. :)
15:36tomojer, hmm
15:36Cubicro_st: Well, I pay roughly $300 per year (and earn roughly $250 per month) at university, so money wise it's not a problem. Also, I don't mind Java being taught here because we're really not doing very much programming either way
15:37tomojyeah, (ns-unmap *ns* 'TheRecord) seems to work
15:37Cubictgoossens: Unfortunately we can't, at least at our uni they're checking source codes.
15:37ro_st$300/year is for nothing!
15:37tgoossensSame here
15:37tgoossensUnfortunately
15:37tomojheck even (defrecord TheRecord [])
15:37solussdtomoj: thank you
15:38ro_sttgoossens: how big is the project?
15:38solussdha
15:38tgoossensBut what i meant is : in a working environment
15:38ro_stoh yes. clojure, no question.
15:38tgoossensShort story : controlling nxt robots
15:38ro_stwe're using clojure everywhere. cljs, clj, datomic, pallet. only html and css aren't strictly clojure, although half the html is, as hiccup
15:39tgoossens:D
15:39tgoossensWhat do you do for living
15:39tomojhiring? :P
15:39ro_stand clojure as the wire format. so refreshing.
15:39ro_sttomoj next year :-)
15:39ro_sti'm a chief technical chicken for a startup
15:40ro_st3 devs, including myself, so far
15:40solussdtomoj: we're hiring, and we use clojure…….. but we're only hiring for a asp.net position. :D
15:40tgoossensNice
15:40tomojhah
15:40tgoossensI still have 2.5 years to go at univ.
15:41tgoossensand i'm really annoyed on how
15:41ro_sttgoossens: i'd get the OO project done as quickly and as simply as possible. get it behind you. then you can have fun with clojure afterward
15:41tgoossensOOP is teached to us as the best way
15:41tgoossensProblem with that:
15:42tgoossensIt is a year project
15:42tgoossensIn group
15:42ro_stthen write clojure that generates the code you'll need to provide
15:42tgoossensAnd at regular moments we need to report
15:42ro_st"what would you like, java? javascript? lua, perhaps?"
15:43tgoossensOther members won't agree
15:43ro_stcan you unsubscribe?
15:43tgoossensNo obligated
15:44ro_stif not, do your best. you've already committed your money.
15:44tgoossensSure
15:44tgoossensI mean
15:44tgoossensI have a lot of fun
15:44tgoossensBut i want the time to do othet stuff than Oop
15:44ro_sti personally wouldn't waste precious time and brains on it, but then i'm in a different place to you
15:45ro_sti've done my decade of OOP already. you're lucky, you only have to do 2.5 yrs :-)
15:45ro_styou can still learn something. make that your mission: see what you can learn
15:46ro_stand have fun with clojure in your endless spare time ;-)
15:47emezesketgoossens: It's good to have a wide breadth of programming knowledge -- knowing OOP inside-out will help your FP, and vice-versa
15:47tgoossensYes :)
15:47ro_stemezeske: thanks for your help with *assert*. it's proving super handy
15:48ro_stemezeske: what do you do for cljs exception logging, if anything?
15:48emezeskero_st: np!
15:48tgoossensI'll minimize the work
15:48tgoossensGot2go
15:48tgoossensBye
15:48ro_stenjoy
15:48emezeskero_st: Heh, that's super high up on my priority list, but I do basically nothing right now O_o
15:48emezeskero_st: Which is horrible.
15:49tgoossensWe speak again
15:49emezeskero_st: I was planning to just make an AJAX call and have the server log it
15:51tomojneed a longbottom for cljs
15:52tomojbut getting stacktraces past async boundaries requires cooperation. hmm
15:54ro_stemezeske: all done. https://www.refheap.com/paste/6243
15:55emezeskero_st: Oh, nice, I didn't know about ErrorReporter, that was the part I was least looking forward to writing! Thanks!
15:55ro_stgoogle closure is full of goodies
15:56ro_sti find it's better to dig when you need something. there is a LOT of stuff in there
15:56CubicAre any of the people that recommended emacs live earlier still here? I'm trying to get the nrepl buffer to do syntax highlighting, but it somehow doesn't work
15:56callenso a few things
15:57samaaronCubic: howdy
15:57callen1. Don't use Emacs Live, or any other pre-baked Emacs environ.
15:57callen2. Don't expect something to work that you don't understand well enough to fix
15:57callen3. Just learn Emacs
15:57muhooro_st: what's the "?" in that paste do?
15:57callenCubic: https://github.com/bitemyapp/dotfiles/ *learn* from but do not *copy* my dotfiles repo.
15:57muhooon line 10
15:57callenCubic: you can see how my .emacs.d is laid out and how the clojure directory is setup.
15:58Cubiccallen: Thanks for the _advice_ but I personally am more interested in writing code rather than writing the tools I need to write my code.
15:58callenCubic: it takes like 2 minutes for me to setup Emacs + nrepl.
15:58callenif that.
15:58samaaroncallen: sometimes learning by example is beneficial
15:58callenCubic: it's better to start from a minimal base, take the 5-15 minutes it takes to add the bare minimum you need, and then go back to coding.
15:58ro_stcollorary to 1: unless, of course, you want to. to 2: except stuff like cars, or routers, or cpus, or refridgerators, or fish knives. 3: once you've made enough money doing real work and have time to spelunk down a black hole
15:58callenCubic: that minimal base is easier to understand, and since you only added the minimum you wanted, you understand those bits.
15:59callenro_st: we're programmers, not consumers of manufactured products.
15:59ro_stmuhoo: whatever you like :-)
15:59samaaroncallen: I have spent many, many man-months on Emacs Live - it's going to be more useful for some people than 2 minutes of setting up nrepl
15:59ro_stcallen: wrote your own OS, did you?
15:59callenro_st: a decade ago, yes. Why?
15:59ro_ststill using it?
15:59muhooro_st: metasyntax?
15:59callenro_st: I'm still using the knowledge from the experience. Don't be an idiot.
16:00ro_sthardware drivers? hardware? make your own furniture?
16:00callenhe tried to use something he didn't understand
16:00callenit bit him.
16:00callenI'm providing an alternative.
16:00callenStop wasting my time and screen space.
16:00samaaronoh, and 2 for Emacs Live: I'll fix things if they're an issue on vanilla Emacs Live.
16:00llasram`*plonk*
16:00emezeskellasram: Who did you plonk?
16:00ro_stno, you're suggesting that there are no alternatives to your own suggestion. there's a difference. he (like i and many other users) don't have the luxury of time that you do
16:01tomoj`(read-string (str "#inst \"" s "\""))` bothers me
16:01callenyou don't have the luxury of 15 minutes?
16:01CubicI installed Emacs Live because it did a few things that my minimal setup didn't do, e.g. the Paredit mode I downloaded from Marmalade was broken, and I'm not about to either fiddle around in paredit.el nor start installing packages by hand. I know configuring every little thing yourself is more of the emacs spirit, but I really just want emacs the editor that works, not emacs the religion.
16:01ro_stalso, i'm an idiot, and have far too much flu medication in my bloodstream.
16:01tomojbut I think the relevant helpers are private?
16:01ro_stcallen: no, because i'm too busy arguing with you.
16:01ro_st-grin-
16:01llasramemezeske: The hopefully-obvious
16:01callenonly being incredibly callow and lazy could lead you to believe you don't have 15 minutes to learn how your tools work.
16:01Apage43tomoj: yeah. I actually copy-pasted the helpers out
16:01muhooomg emacs flamewar
16:01callensorta not really.
16:01emezeskellasram: Oh, now that I read up, I think maybe it is obvious
16:01samaaronCubic: I do recommend tinkering with Emacs now and then - it pays off to know how to hack it.
16:01ro_stcallen: i dropped a week on emacs. i barely made it out alive
16:02callenro_st: I'm sorry learning is that painful for you.
16:02ro_stmuhoo: no, just a placeholder for whatever you want to record
16:02samaaronro_st: only a week? ;-)
16:02Apage43tomoj: the important bit is https://github.com/clojure/clojure/blob/master/src/clj/clojure/instant.clj#L165
16:02ro_stcallen: thank you :-)
16:02tomojthen in reader.cljs read-date is private
16:02samaaroncallen: there's really no need to be so pretentious
16:02ro_stsamaaron: only a week. once i could clode and git, i stopped fussing
16:03tomojoh but there is a public parse-timestame
16:03ro_sti'm going to have to go back in though because i want nrepl.el goodness
16:03Apage43Oh yeah, forgot that one
16:03tomojwhich is just what #inst uses
16:03Apage43I actually needed to print one sans the #inst ""
16:03emezeskecallen: Only being incredibly arrogant could lead you to believe that you should tell other people how to work. :) :)
16:03ro_sttomoj: i use #inst because rich hickey told me to
16:03ro_stand i've got the datomic group post to prove it
16:04tomojwould like to read that
16:04samaaronCubic: so what's your issue?
16:04muhooit's funny, the discussion turns to emacs, and the tone turns to rms/esr/jwz style discourse :-)
16:04muhoosoemthing about emacs that makes people cranky?
16:04samaaronmuhoo: yeah, it's crazy
16:05ro_sttomoj: second rhickey one on https://groups.google.com/forum/#!searchin/datomic/date$20parse/datomic/M6zmtbfw9-w/ez2XK7n2DyAJ
16:05tomojyeah saw that
16:05samaaronpeople should be allowed to use the tools they want without other people going nuts
16:05tomojin cljs cljs.reader/parse-timestamp seems to make more sense
16:05hiredmanas long as the tools they want are emacs
16:05tomojand actually clojure.instant has that public too
16:05samaaronhiredman: what about xemacs?
16:06Cubicsamaaron: No problem, turns out the repl buffer just didn't have clojure-mode active for some reason
16:06ro_stsamaaron: i'm curious why you didn't include magit?
16:06samaaronro_st: I did, I perhaps haven't plugged it in properly yet
16:06ro_stok, it wasn't in the build i grabbed, which was probably 4-5 months ago now
16:07samaaronunless you're just looking at the README - which is woefully outdated
16:07samaaronro_st: oh man, *much* has changed since then
16:07ro_stpoor thing needs help. tried installing helm from melpa and it just crashes
16:07ro_sti so badly miss Textmate's Cmd-T fuzzy find
16:07ro_sti have ido with fuzzy on but it's just not the same
16:08samaaronro_st: does that do a fuzzy find on open buffers or somethign else?
16:08ro_sti am ashamed to say that i use SublimeText2 for search/replace and browsing and emacs for everything else
16:08tomojro_st: do you have *read-eval* false? :)
16:08ro_stfor finding files in the project (git root)
16:09pandeirojust wrapped most of phonegap in cljs and it works! yay
16:09samaaronro_st: no need to be ashamed - do what works best for you
16:09ro_sttomoj: you mean for the #inst thing?
16:09tomojyeah
16:09ro_stmy colleague got helm installed and it looks fab. incremental search.
16:09dnolenro_st: anything.el is pretty good if you take a little time to configure it. haven't tried helm myself yet.
16:09ro_stthank you tomoj
16:09samaaronhelm looks pretty cool
16:10samaaronit's like a better, more modular Emacs Live
16:10samaaronexcept, Emacs Live has the benefit of being curated as a whole
16:11llasramro_st: http://marmalade-repo.org/packages/find-file-in-project ?
16:11tomojI think you might be safe even with *read-eval*
16:12ro_stllasram: i am using that. but i can't find out how to tell it about .cljs and .dtm files
16:12ro_stand how to tell it to stop with the .js files
16:12ro_sthaven't looked very hard, to be perfectly honest
16:12tomojsince read-string will only read the first form, so passing "2012-10-29\" #=(println \"foo\") \"" doesn't work
16:12technomancyro_st: just set ffip-patterns
16:13ro_stoh. i didn't realise that was one of yours, technomancy
16:13ro_st(defvar ffip-patterns '("*.whatever" "*.i" "*.want")) ?
16:14technomancyro_st: defvar won't work; it has defonce semantics
16:14technomancyyou can use setq or .dir-locals.el
16:14ro_st15 minutes indeed -grin-
16:15technomancyI learned my lesson from the starter kit v1: lots of little libraries focused on one thing is definitely the way to go.
16:15ro_st(set 'ffip-patterns '("*.whatever" "*.i" "*.want"))
16:15ro_stlike so?
16:15technomancysure
16:15frawrHi, how can i change a agent's state to the empy vector?
16:16ro_stit is, once you're comfortable composing them. but what emacs live brings is a running start. the fact that it was all nicely structured into folders and lib vs config helped me to get a sense of what sort of thing belongs where
16:16technomancydir-locals are better long-term but that'll do for now anyway
16:16ro_sthow do i see what it's currently set to?
16:16clojurebotexcusez-moi
16:16technomancyhm; similar situation to noir vs compojure I suppose
16:16technomancyro_st: C-h v
16:17ro_stthis is awesome. Cmd-T just became infinitely more useful.
16:18ro_stthank you, callen. without you, i'd still be using C-x C-f
16:18ro_stmay i assume that less patterns means faster execution?
16:19technomancyro_st: fewer matches means faster, but under the hood it's just using find(1)
16:19technomancyyou'd have to be in a pretty ridiculous project to notice a difference I think
16:19technomancymakes me lol every time: http://www.smbc-comics.com/index.php?db=comics&amp;id=2491
16:19ro_stok. i notice it's seeking inside jars
16:19ro_stcan i stop that?
16:20technomancyreeeeeeally
16:20ro_stoh man
16:20technomancyI don't know how that's possible
16:20ro_sti don't want to see all the jar src files :-) just my own
16:20llasramWhat distribution of `find` do you have installed???
16:20lazybotllasram: How could that be wrong?
16:21ro_stoh haha
16:21ro_stit's cljsbuild's temp files -phew-
16:21ro_stok. how do i get it to ignore some folders?
16:22ro_st.folders, basically
16:22technomancyro_st: ffip-find-options; not sure of the syntax to add
16:24tomojseems problematic
16:24ro_stthanks technomancy
16:24tomojfind . -not -path ./.lein-clsbuild-compiler\*
16:24tomojbut the ./ is required
16:25tomojI guess \*.lein-cljbuild-compiler\* would work
16:25technomancyfind is crazytown
16:25ro_sttomoj: this looks promosing: https://github.com/ahobson/dot-emacs/blob/master/ahobson/my-dir-local.el#L10
16:26ro_sti need to exclude .crossover-cljs too
16:26amalloytomoj: whaaaat. $ find -name .lein* -prune -or ...
16:27tomojnice
16:27ro_stso what would i set? -utter newbie-
16:28tomojbut how do you do it twice?
16:29amalloyfind -name .lein* -or -name .crossover* -prune -or ... ## i think so, anyway
16:29amalloymight need parens
16:29samaarontechnomancy: does ffip work with ido?
16:30technomancysamaaron: yeah, looks like it
16:30samaarontechnomancy: awesome
16:30technomancy(I wrote most of this in 2008)
16:31tomojthank you, ro_st. without you, i'd still be using C-x C-f
16:31technomancyman... it really sucks that emacs's uniquify functionality isn't well-factored-out
16:31ro_st(set 'ffip-find-options "-name .lein* -or -name .crossover* -prune -or") ?
16:32tomojthose don't seem to work for me
16:32technomancyro_st: setq is more idiomatic than set+' though they're functionally equivalent
16:32technomancyro_st: might need to be a list of strings
16:33ro_stwrong type argument
16:34ro_stnm
16:34ro_stzsh: no matches found: .lein*
16:35ro_stah, .lein* needs to be quoted
16:36tomojseems ffip can't C-x 4 yet?
16:36ro_stgah this is arcane
16:37tomojI don't think those args will work even if you get it right for emacs
16:37tomojtry with just find
16:37ro_styeah. i'm seeing this.
16:37technomancyfind is nuts, but it's fast
16:37ro_stamalloy: when you say might need parens, what do you mean?
16:38amalloy$ find \( -name foo -or -name bar \) -prune -or ...
16:38mklappstuhlI want to analyze a fictional stock portfolio but I don't know which data structures/clojure tools to use to "build" the portfolio...
16:38mklappstuhlI have a rough idea here: https://github.com/mklappstuhl/computational-investing.clj/blob/master/src/mklappstuhl/stock_utils/simulate.clj
16:39mklappstuhlI'd love to learn about other ways to approach this kind of problem
16:39dnolenmklappstuhl: what kind data structure seems appropriate to you? and why?
16:39ro_stnawp. sod it. i'll live with ST2 and wait till i get a fresh set up with helm and nrepl going
16:40ro_stthanks all for your help
16:40mpenetro_st: This might help you get started https://github.com/mpenet/emax/blob/master/config/modes.el#L183
16:40mpenetro_st: I allow everything then blacklist some unwanted files/dirs (everything starting with ., jars etc)
16:41ro_stthat makes sense
16:41mklappstuhldnolen, I think hash-maps because it allows me to structure the data in a way that is easily accessible later on.
16:42mklappstuhldnolen, I also don't see a real problem with my current implementation but I'm curious about other possible ways
16:42dnolenmklappstuhl: then you're probably on the right track ;)
16:43ro_st^5 mpenet. working. thank you!
16:43mklappstuhldnolen, does that mean you would probably do something similar?
16:43mklappstuhl#
16:43ro_stmklappstuhl: the beauty of clojure is that you can change your mind whenever you realise you need to
16:44ro_stthat's been my experience, so far, anyway
16:44dnolenmklappstuhl: I note that trades in your code is a seq - not sure if random access matters here, if it does you might want to use something else.
16:46mklappstuhldnolen, I think it does not really matter but yeah, could be easily changed if needed, thanks
16:46tomojwell, C-x 4 C-x f for now..: https://www.refheap.com/paste/6245
16:53wingymultimethods are so powerful
16:55jcromartiewingy yes they are :)
16:55ro_sta whole area of clojure i've yet to even touch are protocols, records, and multimethods
16:55jcromartiethis is my attempt at a multimethod-based state machine for simple text games https://gist.github.com/4ba56804cee48fc0e709
16:55jcromartiewant to use it for platformers etc
16:56wingyand extensible .. no need to worry about me implementing everything .. i just do some of the methods and users can extend with their
16:56wingyjcromartie: nice
16:57mklappstuhldnolen, I'd also like to get feedback on the whole structure of the "project" ... most functions take the symbol of a stock as argument... I'm still exploring the possibilites of clojure so there might be other ways to chain stuff together
16:58wingyro_st: you were new to clj as well?
16:59wingyi need to use macros .. haven't yet had a good reason to use them
16:59wingygive me a reason!
16:59ro_styeah. been using it about 7 months. but basic stuff. lots of fns and HO fns. one macro. atoms. that's it
16:59ro_sthaven't needed anything else, yet!
16:59wingyi remember now you were like 2 months ahead of me
17:00wingythat must be a good sign
17:00ro_sti think so, too.
17:00technomancyro_st: that's pretty typical I think
17:00ro_stoh, and one agent.
17:00ro_stto watch a filesystem for changes
17:00technomancygenuine need for polymorphism just isn't very common
17:01ro_styeah. my approach is to use the most idiomatic stuff (maps lists seqs vectors) and then profile performance. we've yet to profile. but i know for sure what we'll need to to do improve performance; lots of low hanging fruit
17:01brehautclojurebot: polymorphism |reply| genuine need for polymorphism just isn't very common
17:01clojurebotIk begrijp
17:02brehaut~polymorphism
17:02clojurebotpolymorphism reply genuine need for polymorphism just isn't very common
17:02brehautsonova
17:02brehauthow do i make him forget that?
17:02brehaut(and do it right)
17:02technomancyclojurebot: forget polymorphism |reply| genuine need for polymorphism just isn't very common
17:02clojurebotI forgot that polymorphism reply genuine need for polymorphism just isn't very common
17:03ro_stthe whole backend is stateless (if you exclude ring session state, which'll be in memcached), so we haven't needed to do anything fancy
17:03dnolenmklappstuhl: at a glance seems reasonable but you don't have a lot of code to look at :)
17:03ro_sti use a whole bunch of atoms in cljs, but they're all in a single namespace
17:03brehauttechnomancy: thanks
17:03technomancyclojurebot: polymorphism is <reply>genuine need for polymorphism just isn't very common
17:03clojurebotOk.
17:03technomancybrehaut: I think that's the syntax?
17:03mklappstuhldnolen, okay, cool
17:03brehaut~polymorphism
17:03clojurebotgenuine need for polymorphism just isn't very common
17:03brehauttechnomancy: i'm makling that a note for my wall
17:04technomancywhy not teach it to clojurebot?
17:04brehauthaha
17:06brehautclojurebot: reply is<reply>key is<reply>witty phrase
17:06clojurebotwhose job is<reply>that is rlbs job
17:06brehaut~reply
17:06clojurebotreply is the new high-powered repl that powers lein2's repl task https://github.com/trptcolin/reply
17:06brehautha
17:06wingywho owns the clojurebot?
17:07brehauthiredman
17:07wingyeveryone can create his own clojurebot? how do you know all commands
17:07hiredmanyes?
17:07clojurebotyes isn't is
17:07RaynesIt's probably easier to get lazybot running.
17:08brehauthiredman: sorry, i was replying to wingy
17:08ro_stRaynes: is it possible to add metadata to defpage declarations?
17:09RaynesNo clue.
17:09RaynesI imagine in theory you could.
17:09ro_sti want to decorate a whole bunch of urls and process them in a middleware
17:09RaynesYou would probably have to mutate the atom holding all the routes.
17:10RaynesBut defpage might support metadata. Not sure.
17:10brehauthiredman: incidentally i had a little laugh at @(promise) in the clojuerbot source. nice trick
17:10Raynesbrehaut: I think I did something similar in Irclj.
17:13wingyhelp : https://www.refheap.com/paste/6246
17:13wingyi wanna use the rest params in my multimethod
17:16brehautwingy: try your code in a fresh repl
17:16brehautwingy: i think you have been bitten by the pseudo-defonce nature of defmulti
17:16wingybrehaut: that was it :)
17:16ro_stthat's right, you can't redef the defmulti
17:17brehaut(doc ns-unmap)
17:17clojurebot"([ns sym]); Removes the mappings for the symbol from the namespace."
17:17technomancyor (def mymulti nil)
17:17brehautoh. thats much simpler. thanks technomancy
17:18technomancyevery time I write a defmulti I always precede it with that
17:18technomancywhich granted is only like once or twice a year but whatever
17:18technomancybecause it's basically guaranteed you're going to want to change the dispatch function at least once or twice
17:20wingyyou cannot add a docstring to defmethod?
17:21wingynot according to the doc
17:21brehauta defmethod doesnt really exist as its own thing; its part of the multi
17:23gfredericksyeah; hard to imagine how you would even obtain a reference to a defmethod if you wanted one
17:24wingyif i make a library for validation and add a few validators (as defmethods) and let anyone extend it with their own validator .. if they do (doc validate) they can only read my docstring where i list my core validators. i guess it makes sense in a way
17:27tomojseems like it would be nice if (= :clojure.string/foo (do (require '[clojure.string :as str]) ::str/foo))
17:28gfredericks,::str/foo
17:28clojurebot#<ExecutionException java.util.concurrent.ExecutionException: java.lang.RuntimeException: Invalid token: ::str/foo>
17:28gfredericks,(keyword ":str/foo")
17:28clojurebot::str/foo
17:30ro_stdo wildcard ssl certificates nested subdomains?
17:30ro_steg, www.staging.domain.com
17:30nDuffro_st: No.
17:30tomojoh wait
17:30wingywhat is the idiomatic way to destruct rest arguments: [x y user password] or [x y & [user password]]
17:31ro_stthanks nDuff
17:31tomoj&(= :clojure.string/foo (do (require '[clojure.string :as str]) ::str/foo))
17:31lazybotjava.lang.RuntimeException: Invalid token: ::str/foo
17:32emezeskewingy: Your first example doesn't use rest arguments, e.g. it will fail if called with less than 4 arguments
17:32tomojwell, it works here. except you obviously have to require beforehand
17:32emezeskewingy: Your second example is correct.
17:32wingyemezeske: right
17:43Bronsabunga bunga?
17:48callenis there an equivalent to ipdb for Clojure? I'm used to being able to inject a first-class REPL into arbitrary code.
17:48callenbeing able to do that for Clojure would be ideal, particularly since it's...a lisp.
17:48technomancycallen: https://github.com/technomancy/limit-break
17:49callentechnomancy: you're on the ball like a golden retriever. Thank you.
17:49technomancycallen: caveat being I've hardly used it and haven't gotten around to getting it working smoothly with nrepl yet
17:50callentechnomancy: I'll take what I can get.
17:50technomancyalso I didn't write it; I just cleaned up and repackaged an older lib designed for clojure 1.2
17:51technomancyalso it has a single-segment namespace; heh. but it's optional.
17:53callentechnomancy: what do you use for debugging if not this, though?
17:54callentechnomancy: I can't seriously be the only lisper that is obsessed with interactive/REPL/debugger based programming.
17:54technomancyI write smaller functions =)
17:54brehautlol
17:54callentechnomancy: do ho ho. but seriously, sometimes I have to call outside services, etc etc. Being able to examine intermediate data and test hypotheses makes me work a lot quicker.
17:54callenit has a *lot* to do with how productive I am in Python and was in Common Lisp
17:56technomancyyou don't need a repl inside another function unless you're working against a bunch of state that has been painstakenly constructed
17:56technomancyif you can avoid that, you don't need any fancy tooling
17:56technomancyof course you can't always avoid that, but I've been fortunate recently =)
17:56technomancyI think I'm pretty repl-obsessed though
17:57technomancycallen: yeah, definitely. literally all the clojure code I've been writing in the past couple months has been Leiningen, so that hasn't been the case for me.
17:57technomancyI used swank.core/break a lot before this, which is based on the same original project.
17:59technomancythough anyway, with outside services what I typically do is (def response (call-outside-service)) (my-fn response) ; rinse, repeat, etc
18:00technomancyjust use vars
18:00technomancyvars are the best thing ever
18:05gfredericks~vars
18:05clojurebotvars are a linking construct
18:12lynaghktechnomancy: I'm putting up a demo server on heroku for my grammar of graphics compiler, but for security reasons I'd prefer to keep the actual compiler source off of webserver machines. Do you foresee any issues with just AOT compiling a JAR and manually including that somehow on the Heroku deploy?
18:13technomancylynaghk: you can use :omit-source true
18:13lynaghktechnomancy: The demo server is in a separate git repo than the actual compiler source
18:13technomancytechnically you could also check a jar into git but that's a bit gross
18:13shurizzleBronsa: http://bit.ly/S8nVqU
18:14technomancylynaghk: I guess for a demo putting a jar in git might be the lesser of N evils
18:14lynaghktechnomancy: yeah, I was thinking about that. Other options are to set up a private mvn repo somewhere or put it on password-protected S3?
18:14callenhow do you AOT compile a jar?
18:15technomancylynaghk: right-o. and getting proper creds exposed to the build process is slightly annoying.
18:15technomancyworth doing if you've got a Real Project, but possibly overkill for a demo
18:15technomancycallen: :aot :all in project.clj, possibly in a profile if you don't want it to mess with your regular development
18:15lynaghktechnomancy: eventually it will be Real Project = )
18:17lynaghktechnomancy: s3-wagon-private would be the thing to use, if I want to go down that route?
18:17technomancylynaghk: yeah, if you don't already have a server set up that you can use for static files
18:18lynaghktechnomancy: yeah, I've never done mvn stuff. S3 looks easiest, unless there is some way to give the Heroku app a pubkey it can use to get deps via SSH
18:18technomancySCP is supposedly possible, but it's basically undocumented
18:18technomancyhttp basic auth is easy though
18:19lynaghktechnomancy: okay. Thanks for the pointers
18:25tolsen_has anyone ever seen an error like this when type-hinting? java.lang.ClassCastException: jux.layout.quark_preview_context.GalleryInfo cannot be cast to jux.layout.quark_preview_context.GalleryInfo
18:26tolsen_(note the types are the same)
18:26Apage43hm
18:26Apage43possible you created an object of that type and reloaded the library?
18:27tolsen_the clojure namespace where the defrecord is actually jux.layout.quark-preview-context . I wonder if the hyphen to underscore conversion for java packagespaces is confusing things
18:27tolsen_@Apage43. I'll try restarting nrepl again
18:27Apage43oh!
18:27Apage43if that type is a Record and you reload the file its in
18:27Apage43it's a new class with same name
18:27Apage43and you'll get that
18:27Apage43if you use an object that was around from before the reload
18:29tolsen_still getting the error even after restarting nrepl :-(
18:29hiredmantolsen_: restarting nrepl or restarting the jvm?
18:30tolsen_I kill the *nrepl-server* buffer. Does that kill the jam?
18:30tolsen_*jvm
18:30hiredmanno
18:30tolsen_ahh… how do I kill the jam?
18:30tolsen_lol. why do i keep typing jam
18:31tolsen_hmm.. I get the error even if I run it outside of nrepl
18:31hiredmantolsen_: have you cleaned out classes/ ?
18:32tolsen_no. I'll try that
18:32technomancykilling *nrepl-server* should kill the jvm
18:33hiredmanhttps://groups.google.com/d/msg/clojure/FgE4MHAbMRo/SNDcLUWlpMwJ
18:33tolsen_interesting. the problem started happening right after I started using instance?
18:36tolsen_cleaning out classes worked. thanks!
18:36tolsen_should I add :gen-class to the ns where I declare the record?
18:39tgoossensDo any of you know some good practices on good use of maps in java (instead of classes?)
18:39nDufftgoossens: Could you make that question a bit more specific?
18:40tgoossensSure.
18:41tgoossensI like using maps in clojure. And I would love to use more of the map idiom in java. But because it is statically typed, it makes it hard. Question:"How do you make you life easier with maps in java?"
18:44emezesketgoossens: I think the big problem you're going to run into is that maps of heterogeneous objects will always be ugly, due to typecasts, etc
18:45technomancyyeah, probably a lost cause
18:52tgoossensmmyes
18:53tgoossensYou are right
18:53tgoossensover the past few weeks
18:53tgoossensi've been trying things out with maps
18:53tgoossensjust to get some similar experience (because i'm obligated to program in java for university)
18:54tgoossensbut :(
18:54hiredmanyou
18:54hiredmanyou can use type specifc static get methods
18:55tgoossenscan you clear this a bit up,
18:55tgoossens?
18:55technomancyany university program that sticks with java exclusively is probably not going to teach you as much as you could learn on your own on IRC
18:55tgoossensprobably
18:55tgoossensthat's why I started opening my eyes about a month ago
18:55tgoossensat univ. always java, always OO is the best way and blablabla
18:56tgoossensso I started with something radically different
18:56hiredmanint Ootisl.getInt(Map m)
18:56tgoossensclojure :)
18:56hiredmanUser Ootisl.getUser(Map m)
18:56tgoossensMm
18:56hiredmanpardon me
18:56hiredmanOotils
18:56hiredmanI am really lagged
18:56tgoossensno prob
18:57tgoossensmmm
18:57tgoossensand the map is then
18:57tgoossensMap<KeyType,Object>
18:57emezeskehiredman: May as well just use member variables at that point :)
18:57tgoossensthat might work yes
18:58tgoossensbut I'm never going to be able to convince my teammates of that
18:58emezeskehiredman: I guess if you have a bunch of dynamic int fields, though, that could be concise
18:58tgoossensalso I need to think about whether it is even a better solution than using classes
18:58tgoossens(in java)
18:58hiredmanemezeske: yeah, the point is, that would work any map from any where
18:58hiredmannot jsut a specific data holding type
18:59emezeskehiredman: Right. Unchecked, that Ootils class might get a bit ridiculous after a while, though, as the grand list of getters for all types
18:59emezeskeI guess you could use generics, like a .<Whatever>get() method
19:00emezeskeThat's essentially just as bad as casts everywhere, though
19:00tgoossensyes
19:00hiredmanemezeske: write some clojure code to generate Ootils
19:00emezeskehiredman: now you're talking!
19:00tgoossenshiredman: cool! :p
19:00hiredmanit combines the cast and the method call in to a single thing
19:01tgoossensnot entirely seeing how that is going to work
19:01hiredmanyou would have a types.clj with just a set of type names, and as part of the build it would generate a some/package/Ootils.java
19:02lynaghktechnomancy: I'm getting a no matching ctor error for class org.sonatype.aether.repository.Authentication when trying to push to heroku
19:02tgoossensthe question is . In java. What do we win by using maps like that
19:02lynaghktechnomancy: uploading the jar worked fine. Does Heroku not take a project.clj's :plugins key into account?
19:02hiredmanalso you need some kind of thing where a a weight drops, which causes an arm to rotate, which strikes a match, which lights a candal, which sets off the smoke alarms, which turns on the spinklers which fill the cup on top of the easy button to fill with water, which actives the easy button
19:02hiredmanwhich causes a deploy
19:02tgoossens:D
19:02emezesketgoossens: You win the ability to have type errors at runtime instead of at compile time
19:03hiredmanyou get generic Data you can manipulate as data
19:03tgoossensemezeske: interesting
19:03tgoossensand for the map
19:03emezesketgoossens: Sorry, I was kind of being sarcastic (not very obviously)
19:03hiredmaninstead of every project having different data carrying objects that you have to treat differently
19:03tgoossenswould you use the PersistentMap or the (guava) ImmutableMap
19:04tgoossensyes
19:04lynaghktechnomancy: here's my project.clj https://gist.github.com/be4fa039fc3f79e77775
19:06tgoossensWhen I find the time (that goddamn java project at unif .... bah!). I'll experiment with using maps like that in java
19:08tgoossensBut I will never -ever be able to convince my teammates (yes its teamwork with other people who are still in the java domain and OO is the best, "if it is not 'nice' OO" it is not a good program
19:11emezeskeMy unimportant opinion is that if you have to use Java, you should probably do things the Java Way™
19:11tgoossensyeah probably thats the best =D
19:11tgoossensbut that doesn't stop me from experimenting :D
19:12emezeskeOh, by all means, I agree.
19:12tgoossensand comparing the (dis)advantages of both ways in java
19:12tgoossenswhich would probably learn me much more
19:12SegFaultAXBut what if the Java Way is really terrible? :(
19:12tgoossensthat just being the faithfull OO programmer
19:12tgoossenshaha
19:12emezeskeSegFaultAX: Then don't use Java :)
19:13tgoossensemezeske: I have to :(
19:13tgoossenshowever
19:13tgoossensto be honest
19:13SegFaultAXtgoossens: Is it impossible for you to use some other JVM language and interoperate with the stuff you already have?
19:13emezeskeI say, do Java the Java Way™, and Clojure the Clojure Way™. Doing Clojure in Java or Java in Clojure seems like a suboptimal choice.
19:14tgoossensSegFaultAX: the problem is. i have teammates who only know java. and the tutors expect us to program "nice OO" and "design by contract"
19:14SegFaultAXemezeske: I guess it depends on which bits of the Clojure way you're talking about. Creating idiomatic Java implementations for Clojures persistent data structures seems very appealing to me.
19:15SegFaultAXtgoossens: I don't know what "nice OO" means. But Clojure natively supports pre- and post-conditions.
19:15tgoossenswell i don't know either what "nice OO" means (hence the brackets)
19:15SegFaultAXtgoossens: And the only choices are not Java or Clojure. There are lots of JVM languages these days.
19:15tgoossens(i mean quotes)
19:16emezeskeSegFaultAX: The second that you start using maps in place of statically-typed classes, you're not really writing "idiomatic" java anymore
19:16tgoossensSeqFaultAX: of course. But again. My teammates only know java. So its a no-go for my assignment
19:16emezeskeSegFaultAX: (Not that I think immutability is bad in Java -- it's great)
19:17SegFaultAXemezeske: No, you're right. But it's just so damn useful... :(
19:17SegFaultAXtgoossens: Do you know any other JVM languages?
19:18SegFaultAXOr languages that have JVM implementations? (eg JRuby)
19:18tgoossensheard of them. never tried them. Clojure is the first non-OO language I began with
19:18tgoossensScala right?
19:18SegFaultAXtgoossens: Scala is a thing, yes.
19:18tgoossensNot sure what your opinion is on this: but OO seems quite natural for me when controlling gui's (but I don't know other ways yet so maybe it is that)
19:19SegFaultAXtgoossens: OO is generally very useful.
19:19tgoossensalso for the project i'm doing
19:19tgoossensit is actually quite useful
19:19SegFaultAXtgoossens: It's the artifacts of certain implementations that made it hard to deal with. Eg the conflation of state and identity.
19:20tgoossensyes
19:20tgoossenslong story short: control NXT (lego) robots from the computer. There is is quite useful to have a "Motor" "Robot" "Sensor" etc
19:20tgoossensI love the idea of identity
19:20tgoossensdon't get me wrong
19:21jonasac(javadoc) is a function in clojure right, not leininingen?
19:21tgoossensThis month has been my first experience with a non-OO language
19:21tgoossensits has been quite exciting
19:21tgoossenswatched a LOT of talks about it :p
19:21tgoossens(clojure)
19:22SegFaultAXtgoossens: Awesome! Welcome!
19:22thorbjornDXtgoossens: read "Clojure Programming" and "Joy of Clojure" :)
19:22SegFaultAX(inc thorbjornDX)
19:22lazybot⇒ 1
19:24emezesketgoossens: A probably-unrealistic-but-fun-idea: while you and your teammates build out your project in Java, quietly build the same project in Clojure by yourself, and at the end of the year when you present it, casually mention that you also have a Clojure implementation that is written in 1/N the number of lines of the Java one. :)
19:25friotgoossens: that was the original intent behind OO though, IIRC
19:25friomodelling physical objects, like the mouse/keyboard/etc., that didn't have easy interfaces
19:25SegFaultAXDoes Scala have the same level of support for persistent data structures as Clojure?
19:26frioso having objects for motor/robot/sensor closely matches the original intent
19:26SegFaultAXfrio: I thought the original intent of OO was message passing between subprograms?
19:27jonasactgoossens: im new to clojure to and labrepl is something worth checking out, accompanied by books
19:27friothat was absolutely part of it iirc SegFaultAX. it's all sadly loose in my mind right now, but i do recall reading about modelling physical objects with it
19:27tgoossenssorry was gone for a sec
19:27tgoossensI read "Programming Clojure" of stuart
19:29tgoossensemezeske: "emezeske: A probably-unrealistic-but-fun-idea:" Yeah kinda. I'm now already sometimes forget I still have stuff to study
19:29tgoossensfrio: IIRC?
19:29thorbjornDXtgoossens: I read "Clojure Programming" (Emerick)
19:30tgoossensAaargh so much to read.. so much to learn and so little time (i really have no time. I hate it !)
19:30tgoossensI'm 100% sure that if I had no courses at all (or just less) I would still be able to use 100% of my time in a useful way :p
19:31thorbjornDXtgoossens: don't go to class then :)
19:31emezesketgoossens: If I Recall Correctly
19:31thorbjornDXtgoossens: I learned a lot more at school not "studying" or in class
19:31thorbjornDXjust make up a project and do it, if you can tie it in with schoolwork then it's two birds with one stone
19:32tgoossensI have maybe an interesting opportunity of writing a web project for use in schools in the Province i live (Antwerp)
19:32tgoossensWould it be a good idea to make it in clojure perhaps =D
19:33tgoossensusing noir or something
19:33emezesketgoossens: I can attest that web development in Clojure is fun.
19:33emezesketgoossens: Plus, you could maybe try out ClojureScript too :)
19:33tgoossensHeard a lot about that too
19:34jonasacanyone on osx experiencing the repl completely crashing whenever (javadoc) is called ? considering reporting it somewhere
19:35tgoossensthorbjornDX: about not going to class. I've always been the "dutiful" student. Always passing my exams. This year (because i'm so amazingly fascinated by clojure) i've been putting already a lot of time into clojure. But i'm afraid that i'll neglect my studies too much. I still want my 3 months of vacation (I always learn a lot during that period)
19:37thorbjornDXtgoossens: going to class is fine, just know that you won't learn best practices (or good ways of thinking) through the lecture material alone.
19:37tgoossensI've experienced that during my student job last month
19:38tgoossensthere was a guy
19:38thorbjornDXtgoossens: depends on the professor, class, and students too
19:38tgoossensthat introduced me to clojure :)
19:38tgoossensopened my eyes a lot. Because I was a bit monosighted on how to program
19:39tgoossensi've been really shocked by that fact how outdated the material is I learn at university
19:39tgoossensand how in practice it differs A LOT
19:40tgoossensnevertheless
19:40tgoossensthanks for all the info
19:40tgoossensbut i really need to go. Class tomorrow morning ;)
19:41thorbjornDXhave fun, keep learning!
19:41tgoossenswe speak again!
20:00gnarmishey, trying to install VimClojure on debian. Can't seem to get http://kotka.de/projects/vimclojure/vimclojure-nailgun-client-0.7.1.zip to not 404
20:00gnarmisthe nailgun client I mean
20:02ohpauleezgnarmis: I think in the latest version, VimClojure uses nrepl and not nailgun
20:02gnarmisoh wow nice
20:02ohpauleeznrepl+lein
20:02gnarmisI guess I should try it out
20:03ohpauleezI might be wrong, but I believe that's what the most recent release was about
20:03ohpauleezAlso, take a look at lein-tarsier
20:03technomancyoh did they finally release the nrepl-backed vimclojure?
20:05rbxbxohpauleez gnarmis I don't believe that's an offical branch yet
20:05gnarmisJust read about it, yeah
20:06rbxbxgnarmis you should try this url http://kotka.de/projects/vimclojure/vimclojure-nailgun-client-2.3.4.zip
20:06ohpauleezoh, total bummer
20:06gnarmisah sweet
20:06gnarmiswell, i'll try the nrepl branch
20:07rbxbxI believe the nrepl branch is even more "here there be dragons" than master, which is fairly dragon-full
20:07rbxbxbut feel free to try ;)
20:07gnarmishaha, should be interesting...
20:07rbxbxreport back, I'd love to get off nailgun
20:08gnarmisfor sure
20:21gnarmishmm…I'll need to do a gradle build
20:22gnarmisI'll mess with this later
20:22rbxbxgnarmis try out that url I gave you earlier... imagine you'll sink a lot less time than trying to get up and running with nrepl
20:22gnarmishaha yes
20:22rbxbxunless your goal is to sink time/improve the state of things. Then by all means ;)
20:23gnarmisI'll def be looking into it. nrepl is the way forward
20:23rbxbxIt is, it still seems a bit young to me to deprecate the other solutions though
20:23rbxbxthe edge, it bleeds.
20:24technomancyeverything bleeds
20:25rbxbxtruth. It simply depends which mode you're operating in.
20:26Pierre____hello
20:26Pierre____Newby here. I am having troubles getting started with Quil. I am trying to build a vector containing mouse coordinates.
20:27rbxbxtechnomancy however as demonstrated by http://www.cs.virginia.edu/~robins/YouAndYourResearch.html, ideally I'd love to arrive at the _general_ solution. It just depends on the day
20:27Pierre____IE, when the mouse button is pressed down, until it is released, I'd like to collect the successive mouse coordinates.
20:27Pierre____what is the best way to do that?
20:27Pierre____(sorry to be interrupting on-going conversations btw)
20:28rbxbxno worries Pierre____.
20:30rbxbxseems like you could listen for the mouse-button event?
20:31lynaghkIs it possible to set reader literals dynamically in a Clojure app? I'm calling a fn which calls set! on *reader-readers* but read-string is still throwing exceptions about tags. Of course, running the exact same code in a REPL works fine.
20:31lynaghkso my
20:31lynaghkquestion should be: is there any reason why I can't do that in an AOT compiled fn?
20:32hiredman*data-readers* is bound at the repl, but not otherwise
20:32Pierre____rbxbx: ok, but once I access the coordinates, how can I append them to the list of past coordinates?
20:32hiredmanlynaghk: your function set! *data-readers* should be throwing an exception
20:32rbxbxPierre____ store past coordinates as an atom and append them, perhaps?
20:32lynaghkhiredman: you're the best. So I need to write a handler fn and reference it in data_readers.clj?
20:33hiredmanyou can still do it dynamically, either by binding *data-readers* yourself, or using alter-var-root
20:33lynaghkhiredman: it doesn't throw; this is on clojure 1.4.
20:33rbxbxPierre____ via swap!
20:34hiredmanlynaghk: are you calling the fn that does the set! from a repl?
20:34Pierre____rbxbx: ok, great. I had a mental block about that, thought it was a smell.
20:34Pierre____rbxbx: thank you!
20:34lynaghkhiredman: yeah. Calling it toplevel on the code though, and it runs when I do "lein run"
20:35lynaghkhiredman: ah, using a binding form works great. thanks!
20:35rbxbxPierre____ to be fair, just because I suggested it doesn't mean it's _not_ a smell. Hopefully it'll work out for you though :D
20:36hiredman*data-readers* may be bound while the code compiles (so the top level doesn't fail) but not when the code runs or something
20:37Pierre____rbxbx: I guess smell is relative then
20:37emezeskePierre____: If you're using a callback-based GUI library, you might not have much choice other than using an atom (or equivalent) for state
20:37emezeskePierre____: At least using an atom, the state is managed in a very sane way
20:37emezeskePierre____: *can be managed
20:38rbxbxconcessions made in clojure are often less harmful than concessions made in other languages (relativly speaking ;) )
20:38hiredmandata_readers.clj is a nice declarative way to avoid all the mucky muck with binding and set!
20:39Pierre____emezeske rbxbx :ok, good to know there was no obvious answer hidden in plain sight. TY both
20:39lynaghkhiredman: yeah. My issue with that is that all of the readers have to be vars---I'm building up a ton of reader fns based on registered methods of a multimethod
20:40hiredmanah
20:41rbxbxPierre____ np, glad to help!
20:43Pierre____rbxbx: to make you regret to be so helpful :) : would you know why I am not able to print debug statements to the REPL using (print "...") from inside the (quil/setup ..) or (quil/draw ..) fns? It's prob a quil-specific question tho...
20:44rbxbxPierre____ is it throwing an error or simply not printing?
20:44Pierre____rbxbx: not printing
20:45emezeskePierre____: Possibly because your terminal is line-buffered and you're not printing a newline?
20:47Pierre____emezeske: actual code is (println "hello\n"). It's in draw, which is called once per frame, so many times in a row..
20:47emezeskePierre____: Ah, nevermind then
20:49gnarmisrbxbx: lein-tarsier just worked
20:49gnarmispretty nifty
20:49rbxbxgnarmis lein-tarsier is nice :)
20:49rbxbxgnarmis did it work for nrepl or nailgun?
20:49gnarmisnailgun
20:49gnarmisI
20:49gnarmisI'll try the other one later
20:54rbxbxgnarmis I should probably add lein-tarsier to my blawgpost
20:54gnarmisgood idea
20:55gnarmissuper simple for linux users in particular
20:57rbxbxgnarmis good to know :)
21:06ghacheyHi any clojure user. I have recently starting learning clojure and am now trying out IRC fo the first time, so not too sure how this all works.
21:08nDuffghachey: Howdy. Just as a note -- while sometimes there's a lot of social chatter, at times when the channel is quieter (now being onesuch), you'll get more response from a direct technical question (if you have something we can help with) than a general introduction.
21:09nDuffghachey: ...also, being willing to wait for a bit for a response tends to be appreciated during slow hours; folks may only check their IRC client very occasionally if in the middle of getting code written. Anyhow, all that said -- welcome!
21:16ghacheyThanks nDuff. I do in fact have a technical question. I am trying to read a JSON serialized file from another program and some of the values contains MAC addresses (e.g. "ethAddressString": "00:26:37:64:96:95"). This seems to cause problems when I try to read with clojure.data.json 0.2.1. I get this error: "Exception JSON error (non-string key in object) clojure.data.json/read-object (json.clj:93)"
21:21bbloomghachey: can you provide a minimal json file (via a paste bin) that causes the issue?
21:22nDuffghachey: this works fine: (clojure.data.json/read-str "{\"00:26:37:64:96:95\": 123}")
21:23nDuffghachey: ...so, yes, if you could provide a reproducer, that'd be useful.
21:23nDuff(if you can get that reproducer down to a one-liner, that'd be even better).
21:27ghacheyI copied this from within the file {"host_key": "68.232.45.223", "index": 0, "ethAddressString": "00:26:37:64:96:95"}.
21:29ghacheyThis works. (json/read-str "{\"host_key\": \"68.232.45.223\", \"index\": 0, \"ethAddressString\": \"00:26:37:64:96:95\"}")
21:29rbxbxghachey you could also try using https://github.com/dakrone/cheshire, data.json is somewhat out of favor.
21:30ghacheyBut if I try to read it from the file directly with (json/read (FileReader. "my-file.json")) it fails.
21:31ghacheyThanks rbxbx, I will have a look. I was under the impression that data.json was sort of the canonical JSON lib for clojure.
21:33rbxbxghachey it sort of was... isn't necessarily so at the moment. Which is not to say that it's parsing capabilities are lagging... I imagine for your purposes either library would server you well... but it's worth checking out. Plus, you'll save yourself a (somewhat inevitable) later move to cheshire ;D
21:38jonasacim trying to get this example to work from a book, im running lein repl and i have a file that im trying to get loaded into the repl, completely new clojurian btw :p
21:39nDuffjonasac: You'll need to provide more information (what you're entering, what you expect, what you get instead) before we can be very helpful.
21:40jonasacnDuff: i have a file one directory below the one im currently at, im trying to evaluate this at the repl, i get a classpath error
21:41nDuff"this"?
21:41nDuffjonasac: You'll need to provide enough information for us to reproduce your problem -- ie. *exactly* what you typed, *exactly* what happened in response.
21:44jonasacim have a directory called test containing a file called date_operations_spec.clj test/date_operations_spec.clj so in the repl i tried (use 'test/date_operations_spec.clj) and i get a classpath error saying test/date_operations_spec.clj could not be located at the classpath
21:45nDuff...so, first, use takes namespaces, not filenames
21:46nDuffsecond, the location your source is relative to has to actually be in your classpath.
21:46nDuffAre you using leiningen?
21:46jonasacyes
21:47nDuffDo you actually use underscores, as opposed to dashes, in your namespace declaration? (It's more typical to use dashes in the ns declaration, even if you're using underscores in the filename)
21:47jonasacdashes in namespace, underscore in filename
21:47nDuffOkay. Then you'll want the dashes in the use declaration too.
21:47nDuffie. make the argument to use match the ns name
21:48jonasacok did that now, (use 'test/date-operations-spec), but still same error
21:49nDuff"test/"?
21:49jonasacmeant test.
21:49nDuffand does the ns declaration start with "test."?
21:49jonasacyep (ns test.date-operations-spec)
21:50nDuff...well, first note is that test is usually in the classpath directly
21:51nDuffso, for instance, if you look at the example template, it includes a file test/yourproj/core_test.clj with ns yourproj.core-test
21:51nDuffnotably, "test." isn't at the front of it there
21:52jonasacright, i didnt use lein new because im trying to follow this book
21:52jonasaci just did lein repl
21:52jonasacso i guess i need to modify the classpath then?
21:52nDuffWhy modify the classpath?
21:53nDuffModify the namespace to stick with convention.
21:53nDuff...or make it src/test/...
21:53nDuffwhere you put the "test.*" files
21:54nDuff(the "test/" directory is reserved for unit tests; if that's not what you're doing here, it doesn't make so much sense)
22:04jonasacnDuff: thanks for the help, your advice combined with some googling got me there :)
22:12ghacheyI tried reading JSON using cheshire this time. A paste bin of the JSON dump from an external program is available at http://pastebin.com/rajRLgGf and the repl code I tried at http://pastebin.com/aJMzr59m. I do not have control over the incoming JSON.
22:22bbloomghachey: that json is invalid. try it at http://jsonlint.com/
22:24bbloomghachey: search for "ipsecRcvd", the line after that is clearly invalid
22:24bbloomghachey: no json parser will accept that. I don't think it's valid javascript either
22:25bbloomghachey: you'll need to report a bug to whoever produces that JSON, or you'll need to figure out how to work around their invalid document
22:27ghacheyThanks bbloom, it makes sense now. Thanks for the http://jsonlint.com/ pointer too.
22:35amalloyghachey: that looks like one valid json document pasted at random into the middle of another valid json document, by the way
22:45ghacheyamalloy: true, but this is directly from the application. It consistently returns this. I'll check with latest version to make sure, otherwise I will report a bug with that project.
23:09tomojhuh, did we lose some logs at n01se?
23:10tomojI swear dakrone showed me how cheshire allows you to choose whether to use core or custom, but I can find no trace of it, neither in the logs nor in cheshire
23:11Apage43tomoj: you just use the encode/decode functions from cheshire.custom instead of cheshire.core
23:12Apage43well, encode anyway
23:12Apage43there's not any sort of custom decoding
23:12Apage43but the cheshire.custom namespace has aliases for it anyway
23:12tomojsure, but what if my library uses cheshire and I want to let the user pick?
23:13tomojof course you could just let them pass the decode function
23:13tomojbut I thought there was some dynamic var somewhere..
23:13tomojs/decode/encode/
23:14Apage43unno, dakrone's own clj-http just has it as a var that the user can rebind how they wish: https://github.com/dakrone/clj-http/blob/master/src/clj_http/client.clj#L41
23:14Apage43defaulting to cheshire.core/encode if it's available: https://github.com/dakrone/clj-http/blob/master/src/clj_http/client.clj#L20
23:15tomojoh right
23:15tomojthat makes more sense
23:15tomojthanks