#clojure logs

2013-04-13

00:12andyfingerhutAnyone happen to know the motivation for creating Clojure's BigInt class?
00:15hiredmanandyfingerhut: I think motivation was two fold 1. hashing 2. performance
00:15hiredmanthat should be an ordered list
00:15hiredmanshouldn't
00:15hiredman,(.hashCode 1)
00:15clojurebot1
00:15hiredman,(.hashCode -1)
00:15clojurebot0
00:16hiredman,(.hashCode (BigInteger. -1))
00:16clojurebot#<IllegalArgumentException java.lang.IllegalArgumentException: No matching ctor found for class java.math.BigInteger>
00:16andyfingerhuthiredman: hashing, meaning control over its hash value so that it hashed to consistent values as Longs and smaller integers?
00:16hiredman,(.hashCode (BigInteger. "-1"))
00:16clojurebot-1
00:16hiredmanyeah
00:16hiredmanperformance is clojure's bigint's try to do long ops when the value is in the long range
00:17andyfingerhutI know BigInt's internally are stored as a long if they fit in that range, and have a Java ref to a BigInteger if they don't. Makes sense what you say.
00:17hiredmanhashing is not a huge issue now that clojure has it's own hashing and equality stuff
00:18andyfingerhutYeah, I've been looking through hasheq recently to understand it better, related to a CLJ ticket.
00:18andyfingerhutI guess hasheq came after BigInt was created?
00:18hiredmanbigint was introduced in clojure 1.3, 1.4 parted ways with java's hashing and equality
00:19andyfingerhutOK, I think I've fooled myself into believing that I understand all of that. :-) It certainly matches with what I've been poking through.
00:22andyfingerhutLooking back on the last few years, it is odd to think how much work it takes to get to = and hash (usually) being consistent with each other.
00:27hiredman~tell me about scala
00:27clojurebothttp://www2.palomar.edu/users/mhudelson/studyguides/rmnsqvsgothic_wa.html
00:27hiredman~more about scala
00:27clojurebothttp://www2.palomar.edu/users/mhudelson/studyguides/rmnsqvsgothic_wa.html
00:27hiredmanclojurebot: you suck
00:27clojurebotexcusez-moi
00:28muhoogawd this is driving me nuts, trying to figure out how to thread a bunch of little bits of state through a bunch of functions
00:28andyfingerhutWhere did Clojurebot get a link like that for scala?
00:28muhooi guess i could create one big god-map with everything in it and pass it down through every call in teh stack
00:29andyfingerhutmuhoo: I've done it, and it can be made somewhat manageable.
00:29hiredman"we are completely screwed on ==." -- seen in #scala
00:29muhooor maybe i need monads :-P
00:29hiredmanis the one I was looking for
00:30hiredmanfeh, someone changed the content of the link
00:30andyfingerhuthiredman: That is a Scala programmer's assessment of Scala's "==" operator?
00:31hiredmanI guess? It was something someone said years ago in #scala
00:31muhoowhy waste time dissing scala when there is so much java to diss.
00:36andyfingerhutI come here not to diss other languages, but to document Clojure better
00:37nightflyIs this a reason why (.start (Thread. #(println "Moo")))
00:37nightfly in nrepl doesn't seem to do anything?
00:38muhoonightfly: it might be, printing to stdout
00:38andyfingerhutYes :-)
00:38muhoobecause stdout is thread local IIRC
00:39muhooit's bound to the nrepl connection in the local thread. if you spawn another thread, all bets are off. there might be a way to force it to bind tho, i just don't happen to know it.
00:40muhoo,(.start (Thread. #(println "Moo")))
00:40clojurebot#<SecurityException java.lang.SecurityException: no threads please>
00:41muhooheh
00:44nightflyAlrigh, that makes sense. Thanks, I thought the world was breaking for a bit.
01:45shriphanihello. are there any specific NLP libraries that people recommend for use with clojure? I am looking for the equivalent of SUTime in StanfordCoreNLP.
02:09Apage43shriphani: there's https://github.com/dakrone/clojure-opennlp
02:10Apage43shriphani: but
02:10Apage43if there's a thing that's easy enough to use from java you can use it from Clojure with generally not much trouble
02:10shriphanibut what ?
02:12Apage43so just use SUTime if it does what you want
02:12shriphaniApage43: it just claims to do what I want :)
02:13shriphaniit took an eternity to make the sample code compile and then I get shit results using it.
02:15shriphanibut yeah maybe I am using the lib incorrectly but the documentation is shit and nobody who can help is awake now :)
02:19wliaoshriphani: What's the problem?
02:27muhoois there some way to do a def using a let form? like (deflet [x 2, y 3])
02:28muhoosuppose i could write a macro to do it, but i'm surprised it doesn't exist alreay
02:29metellushow is that different from a plain let?
02:30wliaoHe's using `def` like `let` format.
02:31muhooah http://www.learningclojure.com/2010/09/astonishing-macro-of-narayan-singhal.html
02:31metellusbut (let [x 2, y 3]) would od th esame thing
02:31metellusas far as I can see
02:31metellusdo the same*
02:32wliaonope..different scope.
02:32metellusah, okay
02:34muhooi'm at the repl
02:34muhoohiding a bunch of crap inside of let is useless
02:34muhooi need to be able to pick apart these things, to look at them. i suppose i could use ritz, but i'd rather do it at the repl
02:35muhooalso, helpful for use with deftest
02:41wliaomuhoo: I think your need is not as universal as `unsigned-bit-shift-right`, and that's why.
02:48Raynesmuhoo: Hai
02:57muhooRaynes: hey there, how goes?
02:58Raynesmuhoo: Well enough!
04:30wei_how do you use the "lein ring server" plugin with aleph instead of jetty?
07:33berdarioUhm, I realized I can't destructure a core.logic lvar
07:33berdarioand there's no secondo or ntho
07:34berdariois there a better approach than repeatedly use firsto and resto?
11:06naegis there a way to simplify a nested (map f ...) with same function?
11:08bbloomnaeg: you'll need to elaborate or show an example, but i'll assume the answer to your question is either function composition or the `for macro
11:09naegbbloom: was about to paste the example: http://pastebin.com/A8WdXaHw
11:11bbloomi'm not really sure what that's supposed to do
11:12naegI'm basically doing (map (partial bit-check bitboard) [6 7 8 1]) twice
11:12naegI thought I could handle that with reduce, but can't get it to work
11:12bbloomnaeg: your outer map is applied to two sequences in parallel
11:13bbloom,(map vector [1 2 3] "abc")
11:13clojurebot([1 \a] [2 \b] [3 \c])
11:13naegyes, and that how it's supposed to be
11:13bbloombut it's not the same as (partial bit-check bitboard)
11:14bbloomlet's rewind a second
11:14bbloomwhat is bitboard?
11:14bbloomwhat is bit-check?
11:16thalassios_xelonhello room:)),i use (recur (concat ..) ) and i get a stackoverflow,is it because of lazy evaluation?
11:16naegbbloom: that's a bit more complicated, I'll try to come up with a general example
11:18bbloomthalassios_xelon: lazy evaulation will generally reduce the likelyhood of a lazy evaluation. more likely the problem is that your recursion is explodin
11:18bbloomg
11:19thalassios_xelonyes it happens only in big values
11:19thalassios_xelonbut why it happens? it supposed tha recur doesnt cause stack overflows,i think the concat is doing it
11:20bbloomthalassios_xelon: i'd need to see a stack trace & some source code. not enough info provided
11:20thalassios_xelonok 1 min
11:26thalassios_xelonits difficult to paste my code,it says this StackOverflowError clojure.lang.LazySeq.sval (LazySeq.java:42)
11:26thalassios_xelonis there a problem when using lazyseq in recur?
11:26naegbbloom: that's basically the same as I'm doing, except that f does more complicated stuff than (+ a b) but still returns a single value: http://pastebin.com/EytSGcM3
11:27bbloomthalassios_xelon: use pst
11:29thalassios_xelonStackOverflowError
11:29thalassios_xelon clojure.core/concat/fn--3923 (core.clj:678)
11:29thalassios_xelon clojure.lang.LazySeq.sval (LazySeq.java:42)
11:29thalassios_xelon clojure.lang.LazySeq.seq (LazySeq.java:60)
11:29thalassios_xelon clojure.lang.RT.seq (RT.java:484)
11:29thalassios_xelon clojure.core/seq (core.clj:133)
11:29thalassios_xelon clojure.core/concat/fn--3923 (core.clj:678)
11:29thalassios_xelon clojure.lang.LazySeq.sval (LazySeq.java:42)
11:29thalassios_xelon clojure.lang.LazySeq.seq (LazySeq.java:60)
11:29thalassios_xelon clojure.lang.RT.seq (RT.java:484)
11:29bbloomthalassios_xelon: and use a pastebin....
11:30xeqilike refheap.com
11:32bbloomnaeg: are the vectors always the same input?
11:34naegbbloom: yes. I though about (reduce #(map f % %2) 1 (repeat 2 [1 2 3])) but that doesn't seem to work
11:35bbloomnaeg: why not something simple like https://www.refheap.com/paste/13596
11:40naegbbloom: that's better, thanks
11:44thalassios_xelonhttps://www.refheap.com/paste/13598 its take a boolean formula and produces a CNF /DNF normal form
11:44thalassios_xelonit causes stackoverflow exception dont know why...
11:58bakingbreadhi. coming from the ruby I have a little theoretical question.. why to use symbols in clojure at all if clojure's symbols are immutable - why not use strings as hash keys etc?
12:01thalassios_xelonbakingbread, i am new in programming,symbols evaluates to their value,string to themselfs
12:03thalassios_xelonin clojure the normal is to use keywords in maps
12:03thalassios_xelonas keys
12:04Foxboronbakingbread: if i am not wong, you can do as you wish?
12:06bakingbreadFoxboron yes.. but I just wonder why they exist
12:07Foxboronbakingbread: http://stackoverflow.com/questions/2320348/symbols-in-clojure read that?
12:11thalassios_xelonbakingbread, symbols are used to represent something else, px a cant be 5,or a can be "hello",symbols are immutable but with them we can produce new thinks
12:15anderson-chello all... i have a clojureclr quetion - i am having trouble interacting with COM and looking to get some advice
12:16anderson-cthe quetion is:
12:17anderson-cwhen trying to access properties or methods on the COM object, I am getting back that the compiler is not able to find the member, but not for all members
12:17anderson-csometimes, it will return a value
12:17anderson-cbut it does not seem that the underlying object is another COM, or something I would need to additionally import
12:18anderson-cif anyone has immediate advice on that, i will take it, in the meantime, i will put together a concrete example
12:21anderson-cprobably even more usefully, is how would one query a COM interface for its representations as seen from clojure?
12:25noidiunfortunately there are relatively few clojure-clr users, and those are very platform-specific questions
12:26noidibut let's hope some clojure-clr guru notices your question :)
12:27noidianderson-c, have you checked out clojure.reflect? http://clojure.github.io/clojure/clojure.reflect-api.html
12:27noidiit seems to be implemented in clojure-clr
12:32bakingbreadFoxboron: thanks, sorry. had a call. I read it. Also I was confusing Clojure's symbols and keywords (which is called symbols in Ruby)
12:36Foxboronbakingbread: ahhh.
12:37noidibakingbread, there are several benefits to having a separate keyword type. first, they can be interned, which allows for more efficient comparisons.
12:37noidisecond, keywords are functions, so you can do stuff like (map :first-name people)
12:38noidi,(= (System/identityHashCode :foo) (System/identityHashCode (keyword "foo")))
12:38clojurebottrue
12:49bakingbreadnoidi: interned?
12:51noidibakingbread, all keywords with the same value are actually the same object
12:52noidieven ones created dynamically using the `keyword` function
12:53noidihttp://en.wikipedia.org/wiki/String_interning
12:53bakingbreadnoidi: ok, but aren't immutable strings are the same object?
12:56noidinot necessarily
12:56noidi,(= (System/identityHashCode "foo") (System/identityHashCode (.toLowerCase "FOO")))
12:56clojurebotfalse
12:57noidi,(= "foo" (.toLowerCase "FOO"))
12:57clojurebottrue
12:58bakingbreadnoidi: oh I see
12:58bakingbreadthanks
13:21lsdslCould someone explain to me why you can't (map .toUpperCase ["a" "b" "c"]), but you can (map #(.toUpperCase %) ["a" "b" "c"]) ?
13:27mthvedtlsdsl: .toUpperCase is a special form, not a fn
13:28lsdslmthvedt: could you elaborate? I'm not much of a java guy. Could you explain why Clojure can't automatically turn .toUpperCase into an anonymous function?
13:29mthvedti'm not really qualified to say
13:29lsdslLike, internally, what is the barrier to dynamically making .toUpperCase an anonymous function?
13:29mthvedtmy guess is the core language wants to be as magic-free as possible
13:29mthvedtrather, the core evaluation process
13:29mthvedtalmost all "magic" in clojure is accomplished with macros
13:31lsdslI guess I could just make a jmap or something that wraps the argument to map in an anonymous function which takes one argument
13:31lsdslmaybe that's why? arities?
13:31lsdslhmmm
13:49juhu_chapatpope: Hi, how to re-evaluate whole namespace with fireplace?
14:01VFeAnyone familiar with how to "connect" projects to the insta-repl in current versions of Light-Table?
14:19augustlis there a way to exclude a specific dependency from "lein uberjar"?
15:26Foxboronlsdsl, .toUpperCase IIRC is a method for the class string
15:27SegFaultAXDoes anyone know if the new version of JoC will be released for Kindle as well?
15:27SegFaultAXOr some other digital pub format?
15:28bbloomgm
16:00mindbender1.
16:04danneuis Lobos the community favorite for db migrations
16:05mynomotoVFe: You only need to evaluate a form (ctrl + enter) in a file inside a project. It connects automatically.
16:10VFeThanks :)
16:30bruceadamsaugustl: you can exclude dependencies from your project overall with :exclusions. is that what you want?
16:31augustlbruceadams: I don't think so :) I tried various variations of excluding the dependency but it's still packaged into "lein uberjar"
16:31augustlthe dependency is present in my "dependencies" list so I guess excluding it doesn't make much of a difference..
16:33bruceadamsaugustl: does you project in fact need that dependency? and you just want to provide some other way that packaging it in the uberjar?
16:34bruceadamsor does you project not need that dependency at all? (then why is it in your project's dependecies?)
16:35augustlbruceadams: the project needs the dependency in order to build. It's a java library I subclass from
16:35augustlbut when my jar gets loaded in the environment it's made for, that dependency cannot be in the jar
16:35bruceadamsaugustl: ok. that makes sense to me now. thanks.
16:36bruceadamsmaven has a concept of "provided" a jar needed for build and test run, but not packaged into larger packages, etc.
16:36augustlah, I'll look that up. I guess I'm better of building my own pom.xml
16:36bruceadamsi don't know if leiningen/pomegranate has that concept.
16:40bruceadamsaugustl: for that dependency in project.clj, try adding this clause :scope "provided"
16:41bruceadams(i haven't tried it, but that snuggles in pretty close to the Maven concept of provided.)
16:53bruceadamsaugustl: nevermind. i tried it just now and :scope "provided" didn't do what i was hoping for (that dependency is still put into the uberjar)
17:00holohi
17:01holois it possible to catch multiple exceptions in the same catch block?
17:05holoI want to return the same expression for a couple of exceptions without having to repeat myself at each one. finally I would return a different expression for a specific exception
17:14wei_anyone have an example of deploying http-kit on heroku?
17:18smnirvenanybody have some experience with clojure.java.jdbc?
17:18smnirven*that would be willing to help me with something stupid
17:20mynomotosmnirven: Maybe I can help.
17:20smnirventy
17:20smnirvenI'm trying to add a "IN" condition to an update query
17:20smnirvenupdate table set x=3 where y IN(1,2)
17:21smnirven["id IN(?)" array-of-ids]
17:21smnirvenmynomoto: know what im getting at?
17:26smnirvenmynomoto: im trying to figure out how to the the sql string to build properly that allows me to do that
17:28r00kb
17:30mynomotosmnirven: I don't get. What are you trying to do?
17:31mynomotosmnirven: Are you trying to generate a query vector?
17:31smnirvenyes
17:33mynomotosmnirven: That would be ["update table set x=? where y IN(?,?)" 3 1 2]
17:34mynomotosmnirven: Does that work?
17:34smnirvenmynomoto: hmm, I guess that would work
17:35smnirvenmynomoto: but if I had a vector of like 100 ids that I want to put in the IN() clause, I'd have to put 100 question marks in the sql string
17:36smnirvenmynomoto: I guess I could build up that string programmatically - seems hackish though
17:38mynomotosmnirven: I think ["update table set x=? where y IN(?)" 3 [1 2]] also works.
17:39smnirvenmynomoto: yeah I was trying that, didnt seem to work
17:40mynomotosmnirven: What's the error?
17:41yacini only get one line of my stack trace in nrepl. where does the rest of it go?
17:49smnirvenmynomoto: I get this: PSQLException Can't infer the SQL type to use for an instance of clojure.lang.PersistentVector. Use setObject() with an explicit Type
17:56mynomotosmnirven: what is exactly the vector you are passing?
17:56smnirven[2 3]
17:57mynomotosmnirven: And the query?
17:58arrdemclojurebot: ping
17:58clojurebotPONG!
17:59smnirven(clojure.java.jdbc/update-values :table_name ["id IN(?)" [2 3]] {:user_id 1})
17:59smnirvenmynomoto: that's basically it right there
18:10gfrederickswhat does github do if you force-push to a branch that a pull-request is based on?
18:10gfrederickssmnirven: have you looked at the honeysql lib/
18:10RaynesIt dropkicks the pull requester in the manhood.
18:11mdeboardAnyone used cascalog with light table and gotten live eval working?
18:12mynomotosmnirven: I got the same error here. Not sure about the solution.
18:12mynomotosmnirven: Sorry.
18:23smnirvenmynomoto: no problem, thanks for making an attemp
18:23smnirven*attemp
18:23smnirven*attempt
18:25proctormacro question, and if I am doing it wrong please let me know (I know the first rule of macros is don't write them, so I understand I might be premature)
18:26proctorI would like some functions for DSL-ish type of function calls for each key in a map
18:27proctor{:mills 1 :second 1000 :hour (* 1000 60 60)}
18:27proctorand i would like a function for each corresponding entry in the map
18:27proctore.g. timestamp-millis, timestamp-second, timestamp-hour
18:27gfredericksyou want them def'd?
18:28proctorI would like to
18:28proctortrying to not have to write the same "function" for each different key
18:28gfredericksand what would the functions look like?
18:28proctor(defn timestamp-minute [record] (timestamp-to-resolution record :minute))
18:29proctor(defn timestamp-hour [record] (timestamp-to-resolution record :hour))
18:29gfredericksokay so it doesn't involve the vals in the map at all
18:29proctorit does, delegating to a different function....
18:29gfredericksbut not directly
18:30proctorcorrect
18:31gfredericksk so what's the question?
18:31proctor(defn timestamp-to-resolution [record resolution]
18:31proctor (let [r (resolution timestamp-resolutions)]
18:31proctor (* r (quot (timestamp-in-millis record) r))))
18:31gfredericksrefheap.com next time
18:32proctorsorry… will do
18:33proctorhttps://www.refheap.com/paste/13603
18:33proctorwas hoping to have the timestamp-*** functions be generated from the keys of the timestamp-resolutions hash
18:34proctorso when I add a new resolution, I would not have to define a key each time
18:34proctorcreated a macro I could call to generate the function timestamp-millis if I pass :millis to the macro
18:34proctorand that works
18:36proctordidn't know how to trigger that macro for each key in the timestamp-resolutions
18:37gfrederickswhelp
18:37gfredericksyou could have a macro that takes a collection of keys
18:37proctoror am I crazy?
18:38gfredericksand use (cons 'do (for [k ks] ... the same body as before ...))
18:38gfrederickswell that wouldn't work actually
18:38gfredericksyou'll probably just want a no-args macro
18:38gfredericksthat reads the map itself
18:38gfredericksand then use the cons trick
18:40proctorI'll try that, thanks
18:40proctorpart of me wanted to make sure I wasn't trying something crazy as well
18:41gfredericksdeffing things that aren't explicitely named isn't the most idiomatic
18:41proctorthat was part of it...
18:42proctorso general guideline would be just to write out each function declaration for clarity of where it is coming from
18:43gfredericksyeah; you could have a (deftimestampthing millis) macro call
18:43gfredericksand you'd have a series of those
18:43gfredericksI agree the repetition isn't very tasty
18:43gfredericksyou might have a good case for this sort of thing, and could just be very explicit with comments perhaps
18:44proctorbeen playing with clojure on the side, so wanted to be as idiomatic as possible, and learn the idioms
18:45proctorI will probably just go the redeclaration route in the code then
18:45proctoralthough I will play with the macro iteration to get a better handle on macros though :D
18:45proctorthanks again
18:45gfredericksnp
18:51smnirvenmynomoto: by the way it looks like a limitation of jdbc
18:51smnirvenmynomoto: http://stackoverflow.com/questions/178479/preparedstatement-in-clause-alternatives
19:37wei_what's the best version of java to use with clojure?
19:37wei_(on ubuntu)
19:52callenwei_: openjdk or Oracle JVM is fine
19:52wei_callen: thanks
20:26stompyjis there a way to add a library to leiningen without having to restart the repl
20:26stompyj?
20:32n_bstompyj: Does require not work?
20:32scottjstompyj: don't know, maybe something related to https://github.com/cemerick/pomegranate
20:33stompyjthanks guys, I'll look into those.
20:34Raynesrequire is not what you want.
20:34Raynesrequire is for using libraries already on the classpath.
20:35stompyjlooks like pomegranate is the right path to go down
20:40urlwolf__Is windows a tolerable platform for clojure?
20:41scottjurlwolf__: tolerable sure.
20:42capcrunchanyone works on jzos ?
20:42urlwolf__appart from sucky command line, any other showstoppers?
20:42capcrunchjvm segfautls using clojure
20:42capcrunchah i think is because i created a war , and i use slurp & spit to modify a file inside the jar at runtime
20:46doug4704hoping someone can clarify access to java libraries from clojure
20:46doug4704I have a jar file for reading outlook .msg files
20:47gfredericksand the jar is not already available on maven anywhere?
20:47doug4704does any sort of a clojure wrapper need to be written or should I be able to access the classes in the jar as-is?
20:47holourlwolf__, I use fish shell for shell scripting as a complement in my clj project. I gave up on clj as scripting language because of the bootstrap times. just checked, and there isn't any port of fish to windows. just a random remark hehe
20:47gfredericksjava interop is super easy. the maybe harder part is if you're using leiningen and want a random jar to be on the classpath
20:47urlwolf__holo: I love fish shell too
20:48urlwolf__hear some people got it compiled on cygwin
20:48holourlwolf__, that's great. get it tested first. if you see it's a show stopper, maybe you've got your answer there
20:48bruceadamscapcrunch: IBM (aka J9) Java 1.7 prior to SR4 had issues with Clojure
20:48bruceadamshttps://github.com/technomancy/leiningen/issues/954
20:49doug4704I thought I would need to start clojure (in order to access the extra .jar ) like java -cp [path-to-clojure.jar]:[path-to-extra-jar] clojure.main
20:49bruceadamsI don't specifically know about jzos, but it's pretty much the same code base.
20:50capcrunchthanks bruceadams, the thing always segfaults at slurp , i'll take a look at this
20:50gfredericksdoug4704: if you're using straight java (rather than leiningen) then you should have no issue and it should work like you're describing
20:50holourlwolf__, what do you use for string and list manipulation? I use pyp
20:50bruceadamscapcrunch: can you check on exactly which version you are running? I'm curious...
20:51bruceadamsthat is, version of java.
20:51capcrunch1.6
20:51doug4704gfredericks: I tried variations on this: (ns something (:import com.auxilii.msgparser MsgParser)
20:52bruceadamshmm.. i'm not aware of any issues with IBM java 1.6 (but have only done a little clojure on there)
20:52gfredericksdoug4704: (:import [com.auxilii.msgparser MsgParser]) should work
20:52urlwolf__holo: great find
20:52urlwolf__I don't have a need for it right now
20:53doug4704gfredericks: ok, I'll continue messing around with it. good to have it confirmed I was understanding it correctly on how it was supposed to work. thanks.
20:53holourlwolf__, I use it in conjunction with fish. very easy to get things done
20:53capcrunchbruceadams , according to the stacktrace of the bug report is not the same issue
20:55bruceadamsthe issue i pointed to could be avoided by disabling the JIT compiler (but that was only seen in IBM Java 1.7)
20:56capcrunchi'll try that i had to move my development from zos to solaris on sparc
20:57capcrunchbecause of this
20:57bruceadamscapcrunch: any chance you can open a problem report with IBM about the crash?
20:58bruceadamscertainly a JVM segfault is a JVM issue (not a Clojure issue).
21:01capcrunchbruceadams , i cannot open a report at the time i'm finishing my development first , i hope it is sorted out on a next version of the jvm
21:09bruceadamscapcrunch: my impression is there isn't much feedback to IBM JVM for Clojure triggered issues. i worry they won't know there is a problem that needs to be fixed.
21:17capcrunchbruceadams all mainframe guys i know just use cobol ,c,and jcl so i'm adding clojure to the scenario ,just a bummer it does not work on jzos but it is not a show stopper yet
21:24bruceadamscapcrunch: FWIW i can do a simple Clojure (1.5.1) slurp using IBM Java 1.6 (SR13 FP1) on 64bit Linux.
21:26bruceadams(i don't have ready access to a zos system.)
21:26capcrunchbruceadams yeah slurp works fine on the repl , but i think the issue is that im using a war and trying to modify the contents inside the war , so as i don't have leingen on the mainframe i use tomcat to test
21:36muhoocapcrunch: you're not.... http://en.wikipedia.org/wiki/John_Draper are you?
21:45capcrunchmuhoo nope
22:35devn,(defmacro eval-wrapper [form] `(defn wrapper# [] ~form))
22:35clojurebot#<Exception java.lang.Exception: SANBOX DENIED>
22:36devnSo, I was doing this: (defn -main (let [x (read)] (eval x)))
22:36devnBut eval breaks criterium at the moment, so I'm trying to skip the eval and instead wrap the form inside a fresh defn, and then call the generated function
22:36devnDoes that make sense?
22:38devnDoes my "eval-wrapper" do what I think it does? Am I going to get meaningful benchmark results from calling the (let [x (read-string "(+ 1 1)"), wrapped-fn (eval-wrapper x)] (wrapped-fn))?
22:40devnthe macroexpand looks right to me: (macroexpand-1 '(eval-wrapper (+ 1 1))) => (clojure.core/defn wrapper__7298__auto__ [] (+ 1 1))
22:42mynomotosmnirven: Thank you for the link. I didn't know that it was not possible, but makes sense to prevent injection attacks.
23:16hugoddevn (let [f (eval `(fn [] ~(read)))] ...) I would think
23:16anderson-c@noidi - thanks for the response, sorry, it has taken so long to get back to you on it. now that i have been away from the problem, and got a chance to come back, i was able the find the solution
23:18anderson-cthe thing i need to do, was to type-hint the member call. essentially, i have defn'd a variable, say 'f' and was trying to call it with the likes of (.get_Name f), and getting the above errors, I was trying it without the prefix, etc.
23:19anderson-cwhat needed to happen, was the instance needed to hinted as to the interface it supports, which i have from examining the il,
23:19anderson-cand when acted upon in this way, with a call structured like (.get_Name ^COMClass f)
23:19anderson-cit would then return the proper response
23:21anderson-cso, thanks for even responding to me, i appreciate it, and i hope that bit of info helps someone out down the road
23:27devnhugod: did you get those msgs on that closed PR on criterium?
23:27devnhugod: im actually trying to do exactly what you proposed above, but im still getting very weird results from criterium
23:28devnThread/sleep completes in 1ns, for example
23:28devnerr (Thread/sleep 1000)
23:31devnhugod: Cleaning JVM Allocations...\nException in thread "main" java.lang.ClassCastException: clojure.lang.Cons cannot be cast to clojure.lang.IFn
23:37carlw2hey what do people use for migrations? I tried getting ragtime going but I'm having some issues with it
23:47mynomotocarlw2: I'm using lobos. It's not perfect but does the job.
23:48mynomotocarlw2: But I never tried ragtime, can't say if it's better or worse.
23:50danielglausercarlw2: We use Migratus at work https://github.com/pjstadig/migratus
23:51carlw2mynomoto: thanks I'll give that a go instead. I liked ragtime cause it used straight sql
23:52chessguy,(clojure.core.unify/unifier '(red ?x) '(foo bar))
23:52clojurebot#<ClassNotFoundException java.lang.ClassNotFoundException: clojure.core.unify>
23:52carlw2how do you handle having your database credentials duplicated?
23:52carlw2do you have some single set of functions for that?
23:52carlw2im using sql korma
23:56mynomotocarlw2: The connection map? I place it in a config file and refer it in the migration ns.
23:57carlw2mynomoto: can please you gist an example of that config file and how you read it?
23:57carlw2i'd like to see how you have it setup