2012-05-11
| 00:02 | Null-A | gnight |
| 00:03 | _sz | is there a way to rename/alias java classes? (for the purpose of accessing static members in a less verbose fashion) |
| 00:03 | _sz | the closest thing i've found is http://stackoverflow.com/questions/2852133/clojure-vars-and-java-static-methods |
| 00:04 | _sz | which solves everything (fields, methods) but inner classes |
| 00:05 | _sz | unfortunately, i'm trying to use this package (javacv) which uses a ton of those... |
| 00:05 | ivan | _sz: (import ... :as x)? |
| 00:06 | _sz | does that actually work with import? |
| 00:06 | ivan | er, I should shut up :) |
| 00:06 | gfredericks | no it doesn't |
| 00:07 | _sz | you got my hopes up there for a sec :) |
| 00:12 | _sz | so i understand it's just not possible at this point? |
| 00:12 | kenneth | hey so the repeat function, can i use it to repeat steps of an algorithm |
| 00:13 | kenneth | right now it's returning a collection with the same value n times, but i'd like each to execute the function once |
| 00:13 | brehaut | repeatedly |
| 00:14 | kenneth | (doc repeatedly) |
| 00:14 | brehaut | but its still probably not what you want |
| 00:14 | clojurebot | "([f] [n f]); Takes a function of no args, presumably with side effects, and returns an infinite (or length n if supplied) lazy sequence of calls to it" |
| 00:15 | PeregrinePDX | (doc iterate) |
| 00:15 | clojurebot | "([f x]); Returns a lazy sequence of x, (f x), (f (f x)) etc. f must be free of side-effects" |
| 00:15 | kenneth | right, i want that, but minus the fact that it's passing the return value to the next step |
| 00:16 | metellus | maybe dorun |
| 00:16 | mefesto | kenneth: isn't repeatedly the function you want? |
| 00:17 | metellus | he wants the seq to be realized |
| 00:17 | mefesto | ,(take 5 (repeatedly rand)) |
| 00:17 | clojurebot | (0.4176372286247386 0.20749523847155404 0.6640069389829846 0.8634799445247344 0.7359045500862336) |
| 00:17 | brehaut | if you want to maintain pure functional logic, you have to pass some value in form theprevious itteation into the current iteration, otherwise there wont be any state maintained |
| 00:17 | amalloy | &(repeatedly 5 rand) ;; mefesto |
| 00:17 | lazybot | ⇒ (0.0868441376220952 0.055044885306857694 0.8384131280779435 0.7513873477507058 0.6478443025930312) |
| 00:18 | kenneth | i'm using clojurescript, is repeatedly not available in cljs? |
| 00:18 | dnolen` | kenneth: it is |
| 00:18 | kenneth | oh nvm |
| 00:18 | kenneth | i think i got it |
| 00:21 | PeregrinePDX | kenneth as brehaut constantly repeats to me. If you find a function that almost does what you want. Like repeat try (apropos 'repeat) |
| 00:21 | brehaut | it takes regexen too |
| 00:21 | PeregrinePDX | It'll find all the functions that contain repeat in the name. You often find some variant that does what you want. |
| 00:22 | kenneth | ooh neat trick |
| 00:23 | Cr8 | hmm |
| 00:23 | Cr8 | trying to do a getline method over a java.nio.ByteBufer |
| 00:23 | Cr8 | it.. works, but advances the position in the source buffer by two lines instead of one somehow |
| 00:24 | PeregrinePDX | Yeah, he's told me apropos this or that at least 5 or 6 times over the last few days when I complain to him that something almost works but not quite. |
| 00:24 | PeregrinePDX | Eventually I m ight learn. |
| 00:24 | Cr8 | https://www.refheap.com/paste/2685 |
| 00:24 | brehaut | lol |
| 00:25 | Cr8 | possibly just advancing twice as much as it should, the lines are the same length |
| 00:29 | Cr8 | ah, misread the docs :) |
| 00:33 | dnolen` | http://github.com/swannodette/mori |
| 00:35 | ivan | nice name |
| 00:36 | brehaut | dnolen`: holy crap |
| 00:37 | dnolen` | brehaut: just getting started, I want to make this super easy for JS devs. |
| 00:37 | brehaut | dnolen`: i suspect you might just have changed my life |
| 00:37 | brehaut | having real collections in JS is something i have wanted for years |
| 00:37 | brehaut | real _and persistent_ collections is even better |
| 00:39 | dnolen` | brehaut: yes! open to any and all suggestions (forEach, each, etc.) |
| 00:42 | dnolen` | awesome |
| 00:43 | brehaut | this might give me a way to work on clj(s) for work stuff |
| 00:43 | dnolen` | brehaut: will be more useful for most JS devs once the reduce frameworks lands in CLJS |
| 00:43 | brehaut | ah true |
| 00:43 | dnolen` | brehaut: having to interact with lazy seqs for JS devs will probably be an non-starter. |
| 00:44 | brehaut | meh :) |
| 00:44 | dnolen` | brehaut: ha, I certainly have no problem w/ lazy seqs but people will be confused :) |
| 00:44 | brehaut | dnolen`: a lot of the work i do, nobody else touches my code |
| 00:45 | brehaut | and ive written my own half arsed lazy seqs in the past |
| 00:45 | dnolen` | brehaut: heh, yes it will be useful for folks wanting this kind of thing right away. |
| 00:45 | dnolen` | brehaut: just that for more general usage people will want strict behavior. |
| 00:45 | brehaut | dnolen`: does the default build not run through closure? |
| 00:45 | brehaut | yeah i agree |
| 00:45 | dnolen` | brehaut: it does |
| 00:46 | brehaut | oh, just not a minifier |
| 00:46 | dnolen` | brehaut: it does get minified. |
| 00:46 | brehaut | hmm. maybe something is funny with my env, as it certainly isnt here |
| 00:47 | dnolen` | brehaut: what do you mean? like you doesn't see an obfuscated file? |
| 00:47 | spjt | clojurescript will give you job security, because nobody else will ever be able to figure out your code |
| 00:47 | dnolen` | brehaut: obfuscated but pretty-printed |
| 00:47 | brehaut | dnolen`: yeah, nicely laid out |
| 00:47 | dnolen` | brehaut: yes, I need to bug emezeske about that. |
| 00:47 | dnolen` | brehaut: that's the correct output. |
| 00:48 | brehaut | i certainly couldnt make head or tail of the code, but its got a lot of whitespace :) |
| 00:48 | dnolen` | brehaut: haha no need to make heads or tails of the code :) |
| 00:48 | brehaut | no :) |
| 00:48 | brehaut | im just wondering how small it can get |
| 00:48 | dnolen` | brehaut: 21k gzipped right now :) |
| 00:49 | brehaut | cheers :) |
| 00:51 | dnolen` | emezeske: ping |
| 00:53 | emezeske | dnolen`: hey! |
| 00:53 | dnolen` | emezeske: I noticed that compiled files always pretty print |
| 00:53 | dnolen` | emezeske: which is a code size hit |
| 00:54 | emezeske | dnolen`: oh? that's weird. |
| 00:54 | emezeske | dnolen`: did anything about the :whitespace option handling change? |
| 00:54 | dnolen` | emezeske: not that I'm aware of. |
| 00:54 | dnolen` | emezeske: cljs test output is not pretty printed. |
| 00:55 | dnolen` | emezeske: seems like this might be getting set accidentally in lein-cljsbuild? |
| 00:55 | emezeske | dnolen`: cljsbuild sets some default values for the :compiler map |
| 00:55 | emezeske | dnolen`: including :pretty-print true |
| 00:55 | emezeske | dnolen`: I wonder if it should do that; probably not |
| 00:56 | dnolen` | emezeske: yeah I see that it's set to true |
| 00:57 | emezeske | dnolen`: I opened an issue: https://github.com/emezeske/lein-cljsbuild/issues/89 |
| 00:57 | emezeske | dnolen`: I gotta run for now |
| 00:57 | dnolen` | emezeske: np, thx |
| 00:58 | brehaut | dnolen`: seems like persistent data structures would be ideal for farming off work to web workers |
| 00:58 | dnolen` | brehaut: sadly copying overhead destroys any benefits there I think. |
| 00:58 | brehaut | they still copy? i thought newer imps just froze? |
| 00:58 | brehaut | apparently i need to go do some reading |
| 00:59 | dnolen` | brehaut: would be awesome if that were true. |
| 00:59 | brehaut | if im just fabricating things in my head, it would be less awesome |
| 00:59 | dnolen` | brehaut: once problem is that engines like V8 convert to maps on freeze |
| 00:59 | dnolen` | one problem |
| 00:59 | dnolen` | which sucks |
| 00:59 | brehaut | yeah greatly |
| 01:00 | brehaut | JS is still the land of one hand giving, and the other taking away |
| 01:00 | dnolen` | brehaut: but yes, if there's ever a sensible fork/join like abstraction for JS, massive win. |
| 01:03 | dnolen` | brehaut: k, even from playing around just a tiny bit - being able to use CLJS api from JS just rules. |
| 01:03 | dnolen` | mori.into_array(mori.interpose("foo", mori.vector(1, 2, 3, 4))) |
| 01:03 | brehaut | thats awesome |
| 01:04 | dnolen` | brehaut: another JS plan I have in the works - Datalog for JS via core.logic |
| 01:04 | dnolen` | if the datomic team doesn't beat me to it of course. |
| 01:04 | brehaut | haha |
| 01:04 | brehaut | that'd be mind boggling |
| 01:04 | dnolen` | brehaut: I've been thinking about the new reduce framework and storing tuples as JS arrays |
| 01:05 | dnolen` | would be very efficient I think. |
| 01:05 | brehaut | i imagine so |
| 01:05 | brehaut | they are pretty well optimized if they arent growing |
| 01:16 | dnolen` | mori.first(mori.nth(mori.take(2, (mori.interpose("foo", mori.vector(1, 2, 3, 4)))), 1)) // => "f" |
| 01:16 | dnolen` | gotta love the fact that the API handles JS natives. |
| 01:20 | brehaut | dnolen`: is map missing? |
| 01:21 | dnolen` | brehaut: should be there. |
| 01:22 | dnolen` | brehaut: oops no |
| 01:22 | brehaut | mori.into_array(mori.filter(function (x) { return x % 2 == 0;}, mori.vector(1,2,3,4))) |
| 01:22 | brehaut | fantastic |
| 01:24 | dnolen` | brehaut: added map to master |
| 01:24 | brehaut | function fac (n) { return mori.reduce(star, mori.range(1, 5)); } |
| 01:24 | brehaut | also awesome |
| 01:27 | dnolen` | brehaut: http://github.com/swannodette/mori, added coffee example |
| 01:27 | brehaut | haha nice use of underscore :) |
| 01:32 | PeregrinePDX | Must not look at number 43 |
| 01:34 | brehaut | _.get(_.hash_map(_.set([1,2,3]), "a"), _.set([1,2,3])) |
| 01:34 | brehaut | that has totally made my day |
| 01:36 | dnolen` | brehaut: pull request welcome :) |
| 01:36 | clojurebot | Anyone can hack! http://images.wikia.com/pixar/images/0/0d/Http_alliedow-files-wordpress-com_2011-01_anyone-can-cook-445x355.png |
| 01:36 | dnolen` | brehaut: if you have improvements changes in mind. |
| 01:36 | brehaut | dnolen`: if i have anything to add i shall :) |
| 01:36 | dnolen` | brehaut: excellent. |
| 02:47 | ambrosebs | is (set? nil) => false, (coll? nil) => false, (seq? nil) => false in CLJS to keep compatibility with CLJ? |
| 02:48 | ambrosebs | they have weird method bodies (defn set? [a] (when-not (nil? a) (satisfies? IPersistentSet a))) |
| 02:48 | ambrosebs | even tho nil satisfies ISet |
| 02:48 | robertstuttaford | my function is returning a clojure.lang.Delay instead of the map i'm expecting. how do i get the function that calls this function to block until it gets the map instead of getting the Delay immediately? |
| 02:50 | amalloy | &(doc force) |
| 02:50 | lazybot | ⇒ "([x]); If x is a Delay, returns the (possibly cached) value of its expression, else returns x" |
| 02:50 | robertstuttaford | use the force! |
| 02:50 | robertstuttaford | thank you amalloy |
| 02:50 | amalloy | $findfn (delay 10) 10 |
| 02:50 | lazybot | [clojure.core/deref clojure.core/force] |
| 02:52 | flijten | Hmm< I use a group by on a list, but a group by seems to return a map of vectors by default. Now my pop does exactly the opposite of what expected (return a collection without the last instead of without the first) |
| 02:52 | flijten | Is there anyway around that |
| 02:53 | robertstuttaford | hmm. even though i'm (force data) it's still getting a delay |
| 02:54 | robertstuttaford | the functions in question are doing IO - mysql and files-on-disk access |
| 02:55 | robertstuttaford | when i call them in repl they return the map. when i trigger the compojure routes in repl i get the Delay |
| 03:08 | johnfn | in clojure, is there a reason why mapping over a set or a vector gives a list back? |
| 03:08 | amalloy | it gives back a lazy sequence, which prints the same as a list in the repl |
| 03:09 | johnfn | right |
| 03:09 | johnfn | so is the reason just laziness? |
| 03:09 | amalloy | wellllll |
| 03:09 | johnfn | and is there a better way to transform a set than (set (map […] |
| 03:09 | amalloy | if it weren't for laziness, it could give back a set or a vector or whatever |
| 03:10 | johnfn | yea |
| 03:10 | amalloy | but the fact that it gives back just "something seqable" is a nice design choice - you just have one interface for generally dealing with collections of things |
| 03:11 | amalloy | so i can't say it's "just" because of laziness |
| 03:11 | johnfn | but aren't vectors and sets also seqable? |
| 03:14 | amalloy | yes. but because there's one interface for seqable-ness, map just takes in seqs, it doesn't know anything about vectors or sets or whatever |
| 03:14 | amalloy | so all it can give out is a seq |
| 03:15 | johnfn | hmm. that makes sense. |
| 03:15 | amalloy | if you like, you can write map-preserving-type |
| 03:15 | johnfn | yea |
| 03:15 | amalloy | never mind, my suggested implementation sucks |
| 03:17 | robertstuttaford | a question about delays… https://gist.github.com/2658093 |
| 03:23 | dmi3y | Hi. While playing with example-projects in lein-cljsbuild I failed to start the ring server with 'lein ring server-headless'. Lein says 'ring is not a task'. How do I start the ring server with lein? |
| 03:23 | robertstuttaford | got lein-ring in your project? |
| 03:23 | robertstuttaford | *shoots from the hip* |
| 03:24 | dmi3y | yep, there's a dev-dependency on ring 0.7.0 |
| 03:31 | kral | morning |
| 03:32 | mmarczyk | reducers in ClojureScript: http://dev.clojure.org/jira/browse/CLJS-250 |
| 03:32 | johnfn | alright; why does #{(gensym) (gensym)} give me a duplicate key error? |
| 03:34 | hiredman | johnfn: because when the reader constructs the set #{(gensym) (gensym)} (gensym) is the same as (gensym) |
| 03:34 | echo-area | TimMc: I seem to find another bug of Clojure... This time about at least `keep'. I'm trying to make a simplest case to reproduce it |
| 03:35 | johnfn | hiredman: huh. yeah, that makes sense. |
| 03:36 | echo-area | TimMc: I'm encountering StackOverflowException; but by accessing the second item of the collection passed to `keep', it won't be thrown |
| 03:38 | echo-area | (inside the body of `keep') |
| 03:39 | hiredman | echo-area: it's not a bug, you've built up too many layers of lazy sequences, and realizing them all at once causes lots of method calls which blows the stack |
| 03:40 | echo-area | hiredman: How do you define "too many"? |
| 03:42 | echo-area | The program in which I'm having this issue tries to open a list of HDFS files. If I replace these HDFS files with local files, the issue goes away |
| 03:43 | echo-area | Nothing but the files, and the way to open the files, changes during that attempt to reduce program size but still keeping the issue. |
| 03:44 | echo-area | And hence the layer of lazy sequence is not changed in this course |
| 03:50 | fliebel | Raynes: How far by train from NYC? |
| 03:52 | amalloy | fliebel: a thousand miles by car, about the same by train probably |
| 03:52 | robertstuttaford | what's the idiomatic way to provide configuration data to a ring-based .war app? |
| 03:53 | robertstuttaford | stuff like database creds and filesystem paths |
| 03:55 | fliebel | amalloy: crap, america is big... |
| 03:55 | amalloy | fliebel: for me, NYC is 2800 miles |
| 03:56 | fliebel | europeans think 100km if far, americans think 100 years is long ago. |
| 03:56 | amalloy | *chuckle* |
| 04:07 | robertstuttaford | anyone using cemerick's friend? |
| 04:24 | bobry | is there a format function for clojurescript? |
| 04:30 | bobry | (format "%s" "foo") works fine in clojure, but raises an undefined error in clojurescript |
| 05:34 | robertstuttaford | javascript online/offline detection is a bag of pain :-( |
| 05:58 | ambrosebs | is there a type for protocols? |
| 05:58 | ambrosebs | just seems like a normal map to me |
| 06:04 | Madsy | exit |
| 06:38 | Borkdude | seems like light table is going to make it :) http://www.kickstarter.com/projects/306316578/light-table |
| 06:54 | robertstuttaford | that's awesome. chris writes great stuff, it'll be interesting to see what he comes up with |
| 07:54 | bobry | Is it possible to use enlive's 'deftemplate' with clojurescript? |
| 08:01 | solussd_ | is it possible to pass a symbol into a macro to be used as the symbol to be bound in a let? i.e. so an anaphoric macro can have the user name the anaphor? |
| 08:04 | jwr7 | How can I check if (seq s) will succee? |
| 08:04 | jwr7 | s/succee/succeed/ |
| 08:05 | jwr7 | Or, more precisely — how can I check if something is a nonempty string? |
| 08:07 | kmicu | jwr7: http://clojuredocs.org/clojure_core/clojure.string/blank_q |
| 08:08 | jwr7 | kmicu: that fails when passed a number. I'll stick with (and (string? s) (seq s)) for now, I think... |
| 08:09 | vijaykiran | , (> (.length (str 9)) 0) |
| 08:09 | clojurebot | true |
| 08:09 | stuartsierra | solussd: yes |
| 08:10 | stuartsierra | when-let, if-let work that way |
| 08:21 | solussd_ | stuartsierra: I meant to say, "the symbol to be bound to", e.g., a macro with args of, say, [a b] and call it like this: (mymacro (+ 1 2) x), and have my macro expand to (let x (+ 1 2)) …. etc |
| 08:22 | solussd_ | stuartsierra: right now I just do a postwalk and replace the anaphor in the passed in expression |
| 08:22 | stuartsierra | solussd: sure |
| 08:22 | solussd_ | can't seem to get the quoting right.. |
| 08:23 | stuartsierra | (defmacro mylet [sym expr & body] `(let [~sym ~expr] ~@body)) |
| 08:24 | solussd_ | erm.. ok. i feel dumb. |
| 08:24 | solussd_ | thanks |
| 08:24 | stuartsierra | no problem |
| 08:25 | solussd_ | I was mentally starting from the '~captureme form. :) |
| 08:27 | stuartsierra | solussd_: Right, you're not doing symbol capture in this case. |
| 08:28 | solussd_ | yup. no amount of elaborating on '~ would have saved me. missed the simple case. |
| 08:30 | robertstuttaford | why does CCW sometimes use clojure 1.2.1 for the repl instead of 1.3.0? bloody annoying |
| 08:37 | mmarczyk | letfn support for ClojureScript -- http://dev.clojure.org/jira/browse/CLJS-251 |
| 08:38 | mmarczyk | bug reports etc. would be much appreciated |
| 08:43 | dnolen | mmarczyk: ping |
| 08:43 | mmarczyk | dnolen: pong |
| 08:43 | mmarczyk | dnolen: have you seen CLJS-251? |
| 08:44 | mmarczyk | oh, you have :-D |
| 08:45 | pandeiro | anyone know how to include the clojure.tools.macro ns as a project dependency with lein |
| 08:45 | mmarczyk | dnolen: mori looks very cool :-) |
| 08:45 | dnolen | mmarczyk: yes :) will be cooler with the reducer framework. |
| 08:46 | mmarczyk | dnolen: oh yeah :-) |
| 08:46 | mmarczyk | dnolen: I was going to send you a pull req for list* but decided I'm not sure what to do with * :-P |
| 08:46 | stuartsierra | pandeiro: http://search.maven.org/#search%7Cga%7C1%7Cclojure%20tools%20macro |
| 08:46 | bobry | how can i apply a function to each key of the map and build a new map out of that? it looks like 'core/map' only returns lists :( |
| 08:47 | dnolen | mmarczyk: yeah, when exporting I change the name. |
| 08:47 | stuartsierra | bobry: reduce over the map or use (into {} ..>) |
| 08:48 | dnolen | mmarczyk: so the reducer stuff is working with the core data structures? |
| 08:48 | mmarczyk | dnolen: it should |
| 08:49 | bobry | stuartsierra: thanks! i thought there's a generic function for that, something like Haskell's 'fmap' |
| 08:49 | mmarczyk | dnolen: as in Clojure |
| 08:49 | mmarczyk | dnolen: I'll put together a test suite this weekend -- with the stuff in the (comment ...) in reduce.clj as the starting point |
| 08:50 | mmarczyk | dnolen: no better way to find bugs than trying to use it, of course |
| 08:50 | dnolen | mmarczyk: did the comment stuff work? |
| 08:50 | mmarczyk | dnolen: yes |
| 08:50 | dnolen | mmarczyk: cool |
| 08:51 | flijten | Anyone willing to comment on my quicksort implementation in clojure? Specifically since it seems written with a non-functional programming mindset still. It's my first attempt at clojure: http://pastebin.com/jbGFCDAa |
| 08:51 | mmarczyk | dnolen: the part that's meant to work, that is -- there is one expression which fails in Clojure, IIRC |
| 08:51 | stuartsierra | Hey ClojureScript dudes! |
| 08:51 | stuartsierra | Try out this G.Closure third-party JAR: |
| 08:51 | stuartsierra | https://oss.sonatype.org/content/repositories/orgclojure-308/org/clojure/google-closure-library-third-party/0.0-790/ |
| 08:52 | stuartsierra | Let me know if it works, and I'll release it to Maven Central Repos. |
| 08:53 | TimMc | bobry: (zipmap (map f (keys m)) (vals m)) perhaps |
| 08:54 | TimMc | keys and vals are guaranteed to provide the same ordering given an identical? object. |
| 08:56 | bobry | TimMc: looks good, thanks! |
| 08:56 | pandeiro | stuartsierra: thanks |
| 09:05 | mmarczyk | stuartsierra: that jar appears to be empty except for some metadata? |
| 09:05 | mmarczyk | hm, wait, let me double check |
| 09:06 | mmarczyk | oh no it isn't, sorry |
| 09:06 | mmarczyk | stuartsierra: ^ |
| 09:06 | mmarczyk | no idea what happened to my download then... anyway, checking now |
| 09:08 | timvisher | hey all |
| 09:08 | mdeboard | hi |
| 09:08 | stuartsierra | mmarczyk: ok, let me know |
| 09:09 | timvisher | am i wrong in thinking that `into` is lazy? |
| 09:09 | timvisher | i want to have an infinite sequence with the first element being ungenerated |
| 09:10 | mmarczyk | stuartsierra: the test suite passes |
| 09:10 | timvisher | so i was mapping over an infinite generator and i tried throwing an into in front of it and i got an OOM error |
| 09:10 | mmarczyk | timvisher: it's not lazy |
| 09:10 | mmarczyk | timvisher: actually uses reduce -- and transients if possible |
| 09:10 | timvisher | mmarczyk: sweet |
| 09:10 | timvisher | so how would i put something fixed in front an infinite sequence? |
| 09:11 | mmarczyk | timvisher: cons ? |
| 09:11 | mmarczyk | timvisher: concat, lazy-cat |
| 09:12 | timvisher | ah yes |
| 09:12 | timvisher | i suppose i should remember those from my own post |
| 09:12 | stuartsierra | mmarczyk: thanks |
| 09:12 | timvisher | it's been so long since i had to care :) |
| 09:12 | mmarczyk | stuartsierra: np; some other code also works fine; haven't checked browser-repl though |
| 09:13 | timvisher | by the by, something changed about my emacs set up recently and i no longer get the helpful little hints in the mini-buffer about the function i'm typing out |
| 09:13 | timvisher | what mode is that? |
| 09:13 | robertstuttaford | stuartsierra: for a newbie, what does that jar do? |
| 09:13 | dnolen | mmarczyk: reducers stuff in and works http://github.com/swannodette/mori |
| 09:13 | stuartsierra | robertstuttaford: It's a package of the third-party extensions to the Google Closure Library. It includes stuff like goog.dom.query, a CSS selector ported from Dojo. |
| 09:14 | mmarczyk | dnolen: :-D |
| 09:14 | dnolen | stuartsierra: I'm assuming you all want to stick with the older GClosure for your projects? |
| 09:14 | robertstuttaford | ah ok. i noticed the gclosure included in cljs was smaller than the gclosure i'm using from svn |
| 09:14 | robertstuttaford | so this brings the thirdparty stuff back to the party |
| 09:14 | stuartsierra | dnolen: I was actually looking for reports on whether the latest GClosure (compiler and/or library) works with ClojureScript. |
| 09:15 | stuartsierra | robertstuttaford: Yes, we want to keep them separate because the licenses differ. |
| 09:15 | robertstuttaford | makes sense |
| 09:15 | duck1123 | I've been using a more recent release, but I haven't tried the new patch yet |
| 09:15 | dnolen | stuartsierra: does as far as I know. bootstrap script has been updated. |
| 09:15 | robertstuttaford | is the library in cljs a direct export of google's? or is it a curated subset? |
| 09:15 | dnolen | stuartsierra: I noticed that HEAD does not work. |
| 09:15 | stuartsierra | robertstuttaford: direct export |
| 09:15 | dnolen | stuartsierra: I mean GClosure HEAD. |
| 09:15 | duck1123 | I needed websocket support |
| 09:16 | robertstuttaford | ok cool |
| 09:16 | robertstuttaford | stuartsierra: i ask this of everyone who talks about cljs. have you had to generate externs for exported symbols in any of your cljs projects? |
| 09:17 | stuartsierra | dnolen: OK. Does the G.Closure library r1376 work? |
| 09:17 | robertstuttaford | i want to do the base-app + modules thing with cljs for both |
| 09:17 | dnolen | stuartsierra: is that the latest relese? |
| 09:17 | stuartsierra | yes |
| 09:18 | dnolen | stuartsierra: yes that works and is a part of CLJS 1211 release |
| 09:18 | robertstuttaford | my closure library is at rev 1843 |
| 09:18 | dnolen | stuartsierra: meaning if you bootstrap that's what you get and what the tests run against. |
| 09:19 | stuartsierra | dnolen: OK, but the releases have a POM file that declares the dependency on G.Closure Lib r790. |
| 09:19 | stuartsierra | We need to keep these things in sync. |
| 09:19 | dnolen | stuartsierra: oh gotcha, I'm still a total Maven noob. |
| 09:20 | stuartsierra | dnolen: Are we still dependent on G.Closure compiler r1592? |
| 09:20 | dpritchett | would it be preferable to use "(partial = x)" or "#(= x %)" ? |
| 09:21 | dpritchett | they appear to work about the same |
| 09:21 | mmarczyk | stuartsierra: for some reason the browser-repl seems not to work with gclosure lib from that jar |
| 09:21 | dnolen | mmarczyk: you can no longer use file:// protocol |
| 09:21 | mmarczyk | dnolen: ohhhh of course |
| 09:21 | mmarczyk | dnolen: forgot about that |
| 09:22 | mmarczyk | dnolen: thanks |
| 09:22 | dnolen | stuartsierra: I always tests via bootstrapping. so I've run the test & browser REPL with GClosure lib r1376 and compiler-latest |
| 09:22 | dnolen | those work |
| 09:22 | stuartsierra | OK. Any idea what revision compiler-latest corresponds to? |
| 09:24 | stuartsierra | r1918 it looks like |
| 09:24 | dnolen | stuartsierra: yep |
| 09:24 | mmarczyk | stuartsierra: dnolen: still doesn't work for me -- "goog is not defined" |
| 09:24 | dnolen | mmarczyk: it's been confirmed to work for a lot of people. |
| 09:25 | mmarczyk | dnolen: I mean with stuartsierra's jar |
| 09:25 | stuartsierra | mmarczyk: Just checking - you know that JAR does not REPLACE the g.closure library JAR. It adds to it. |
| 09:26 | mmarczyk | stuartsierra: hm, I think that's what I did, but -- who knows -- let me start over |
| 09:26 | mmarczyk | stuartsierra: probably did sth stupid along the way. |
| 09:34 | timvisher | is there any way to get `lein ring server` to honor the checkouts directory? |
| 09:34 | timvisher | i'm still on lein 1 |
| 09:38 | dpritchett | dnolen is there anything in the standard lib that I could use to do simple branching logic? I don't really like nested ifs |
| 09:39 | dpritchett | I am playing with 4clojure and I assume core.match isn't an option |
| 09:39 | dnolen | dpritchett: cond, case, condp |
| 09:39 | dnolen | dpritchett: do you need something more than that? |
| 09:39 | dpritchett | nah |
| 09:39 | dpritchett | i found case but it didn't seem right |
| 09:39 | dpritchett | i'll look up the others |
| 09:40 | dnolen | dpritchett: you probably want cond |
| 09:40 | rhc | speaking of those, i was looking for a simple way to say something like: |
| 09:40 | dpritchett | yes, cond is exactly what i wanted |
| 09:40 | rhc | give me the first item of this list that (f item) returns logical true for, or, give me elseitem if none return true |
| 09:41 | dpritchett | although even my cond solution will likely be wordier than necessary |
| 09:41 | rhc | best i could do is something like: (if-let [a (first (drop-while f items))] a elseitem) |
| 09:41 | dpritchett | trying to figure out how to deal with the fact that the last element of my accumulator could be either a single value or a collection itself http://www.4clojure.com/problem/31 |
| 09:41 | dpritchett | so i'll just branch that out into conds as part of a reduction |
| 09:43 | ambrosebs | rhc: i'd use filter |
| 09:44 | rhc | ambrosebs: (first (filter f items)) ? |
| 09:44 | dnolen | rhc: (or (some pred coll) elseitem) |
| 09:44 | rhc | ahh dnolen, really nice |
| 09:44 | rhc | didn't even think of using 'or' in that way |
| 09:44 | ambrosebs | as long as no elements of ur collection are falsy that will work |
| 09:45 | rhc | 'some' returns falsey on no match i guess? |
| 09:45 | rhc | ambrosebs: thats correct |
| 09:46 | dnolen | rhc: some returns the matching thing. |
| 09:46 | dnolen | rhc: if the matching thing is falsey, that snippet won't work. |
| 09:46 | dnolen | (or (some nil? coll) :wat), for example |
| 09:47 | fliebel | dnolen: core.logic does not use seqs much, but rather something more like Scheme cons cells, right? |
| 09:47 | rhc | err wait, some returns the result of pred for the first non-falsey value of pred |
| 09:47 | dnolen | fliebel: internally yes. |
| 09:48 | dnolen | rhc: except it will return the first nil, nil is falsey, so you'll get :wat. |
| 09:48 | dnolen | which is not what you want. |
| 09:49 | fliebel | dnolen: I was thinking about your tweet about speedups by using reducers. |
| 09:49 | dnolen | fliebel: unification |
| 09:49 | ambrosebs | rhc: (if-let [rs (seq (filter pred coll))] (first rs) :default) |
| 09:50 | ambrosebs | rhc: I think that's more correct that ur drop-while version |
| 09:50 | rhc | yeah i guess it doesn't get much better than that :) |
| 09:50 | fliebel | dnolen: I wonder if VisualVM gives you any insight about the seq overhead. |
| 09:50 | rhc | yeah not sure why i was using drop-while over filter |
| 09:51 | dnolen | fliebel: probably |
| 09:51 | ambrosebs | rhc: the problem with your example was you were testing on (first ...) instead of (seq ...) |
| 09:51 | fliebel | Hm, I might try that... |
| 09:51 | dnolen | fliebel: in core.logic if I recall the most costly thing now is unification. |
| 09:52 | dnolen | fliebel: switching to PersistentHashMap maps eliminated the cost of walk. |
| 09:52 | rhc | ambrosebs: why would that be a problem? wouldn't (first '()) be falsey? |
| 09:52 | ambrosebs | (first '(nil)) |
| 09:53 | dnolen | fliebel: join the club :) |
| 09:53 | rhc | drop-while creates a '(nil) collection when it drops the whole collection? |
| 09:53 | ambrosebs | fliebel: :) |
| 09:53 | rhc | fliebel: which 300? (curious) |
| 09:54 | dnolen | fliebel: the implementation of miniKanren in Scheme. |
| 09:54 | dnolen | er, I mean rhc: ^ |
| 09:54 | fliebel | rhc: MiniKanren, see the conj unconference for quote. |
| 09:54 | rhc | dnolen: ahh |
| 09:54 | ambrosebs | rhc: hmm I'm probably wrong, bit distracted atm :) |
| 09:54 | rhc | still need to watch that minikanren pres |
| 09:55 | ambrosebs | rhc: my point is test for emptyness with seq, not first |
| 09:56 | rhc | ambrosebs: hmm, ok, i need to read more about sequences i think |
| 10:00 | fliebel | *watching again* http://blip.tv/clojure/dan-friedman-and-william-byrd-minikanren-5936333 |
| 10:01 | fliebel | (quote around 4:50) |
| 10:06 | stuartsierra | OK, updated G.Closure Library JAR for revision 1376 at https://oss.sonatype.org/content/repositories/orgclojure-314/org/clojure/google-closure-library/0.0-1376/ |
| 10:24 | dnolen | `fogus: heya, can't merge your pull request, I changed the readme :P |
| 10:25 | `fogus | Oh! I can submit another PR |
| 10:25 | dnolen | using ClojureScript from JavaScript rocks! :) |
| 10:25 | dnolen | `fogus: thx |
| 10:25 | `fogus | np |
| 10:30 | dpritchett | so apparently my 250 char submission is equivalent to "partition-by identity" |
| 10:31 | `fogus | dnolen: I get a provide error on the latest "required "clojure.core.reducers" namespace never provided" |
| 10:31 | dnolen | `fogus: are you using checkouts? |
| 10:32 | dnolen | `fogus: Mori has to be built with CLJS HEAD |
| 10:33 | `fogus | whoops lein deps fail |
| 10:33 | `fogus | Got it now |
| 10:36 | dnolen | gonna need a tutorial on all the goodies tailored for JS devs |
| 10:39 | `fogus | Agreed |
| 10:39 | jasonjckn | rhickey: wrt to interactive development for reducers, it'd be nice if evaling (r/map …) in the repl actually executed the collection recipe, i can file a jira issue for that (?) |
| 10:39 | pandeiro | dnolen: look forward to that for sure |
| 10:41 | @rhickey | jasonjckn: no, not looking for more magic |
| 10:41 | pandeiro | the way that maven works, if i want to update the versions of certain deps in a jar, i must update the version of the jar in order to avoid overriding the original, correct? |
| 10:41 | jasonjckn2 | disconnected |
| 10:43 | dnolen | could use some upvotes http://news.ycombinator.com/item?id=3959409 |
| 10:43 | jasonjckn | done |
| 10:44 | dnolen | jasonjckn: thx |
| 10:45 | @rhickey | dnolen: got the reducers in there fast! |
| 10:45 | @rhickey | nothing like portable Clojure code |
| 10:46 | `fogus | dnolen: Fresh PR headed your way |
| 10:46 | brainproxy | dnolen: I've figure out a way to have node-clojurescript to transparently use a "detached JVM", so you'll be able to do `ncljsc -S <port>` |
| 10:47 | stuartsierra | Summary of new G.Closure Library JARs: |
| 10:47 | stuartsierra | https://groups.google.com/d/topic/clojure-dev/TiJGSmM1gTo/discussion |
| 10:47 | dnolen | rhickey: haha, yes - thanks to mmarczyk :) |
| 10:47 | brainproxy | and then when using ncljsc to run/compile scripts, or when using node require to load .cljs, you'll be able to spec a port number |
| 10:47 | dnolen | `fogus: merged |
| 10:48 | brainproxy | should dramaticaly improve the experience, i.e. compile times will feel pretty snappy so long as you've got the `ncljsc -S` process running in the background |
| 10:48 | `fogus | dnolen: Thanks! |
| 10:53 | jasonjckn | Does CollFold need to be moved into core.protocols namespace? |
| 10:56 | brainproxy | dnolen: mori looks cool, would you be interested in a pull request that would make the thing nodejs and ender friendly, or do you think that would best be served by a derivate project? |
| 10:56 | bartj | hello, anyone from a computer vision background here ? |
| 10:56 | mmarczyk | rhickey: dnolen: just attached a patch to CLJS-250 w/ latest flatten and mapcat; or should I make a new ticket? |
| 10:57 | fliebel | bartj: Not me, but I'm already curious to your question. |
| 10:57 | bartj | fliebel, pvt? |
| 10:57 | fliebel | bartj: pvt? |
| 10:57 | bartj | fliebel, er, private chat ? |
| 10:58 | fliebel | bartj: Well, if you want to, sure. But the chance that anyone has anything usefull to say is larger in channel, I'd say. |
| 10:58 | RickInGA | bartj: fliebel: I would like to eeavesdrop |
| 11:00 | bartj | fliebel, RickInGA channel is called bartj |
| 11:14 | cmcbride | dnolen: I get this error when I try to compile mori |
| 11:14 | cmcbride | https://www.refheap.com/paste/2688 |
| 11:15 | dnolen | cmcbride: you need to compile with CLJS HEAD |
| 11:15 | cmcbride | I cloned the cljs repo in to the checkout folder |
| 11:16 | cmcbride | is there something more I have to do? |
| 11:20 | dnolen | wow reducers work is impressive |
| 11:20 | dnolen | https://github.com/swannodette/mori |
| 11:20 | dnolen | look at the reducer numbers |
| 11:22 | RickInGA | dnolen: reducer numbers? |
| 11:22 | RickInGA | the times? |
| 11:26 | askerOfDumbQuest | Guess I am not the only dumb one.. did they really schedule the atlanta code camp for the same weekend as georgia high school graduations? |
| 11:33 | fliebel | bartj: https://github.com/quil/quil |
| 11:34 | bartj | fliebel, thanks again! |
| 11:35 | gtrak | curious, what's with all the magic numbers in generated clojurescript? looking at mori.js specifically |
| 11:37 | TimMc | Hmm, this might be a viable approach for Java programmers needing to catch checked exceptions thrown by Clojure (if RTE-wrapping were removed): http://james-iry.blogspot.com/2010/08/on-removing-java-checked-exceptions-by.html |
| 11:38 | TimMc | (The first part shows how to throw "surprise" checked exceptions in Java; the second part shows how to catch them.) |
| 11:41 | TimMc | I mean, it *is* perverse -- but it works. |
| 11:41 | devn | lol, reducers in cljs already? |
| 11:42 | gtrak | TimMc: that's pretty awesome, the chucks thing |
| 11:43 | jasonjckn | amalloy_: currying iterate seems useless, albeit not harmless. However currying repeat would be harmful, because the core implementation has [n x] and [x] as oppose to [n x] and [n]. |
| 11:43 | jasonjckn | amalloy_: a consistently design would be to only allow currying for stuff that has coll as last param |
| 11:44 | jasonjckn | not harmful* |
| 11:53 | halgari | gtrak: if you mean things like fn1254 = function()...then that's just auto generated ids. The compiler has a auto-incrementing counter so that when you need a temp variable you just call gensym and it creates a unique symbol for you. |
| 11:56 | gtrak | for an example, in function qb(a,b){ this.I = a; this.A = b; this.o = 0; this.g=15990906} |
| 11:56 | cmcbride | I just did some underscore vs mori benchmark |
| 11:57 | halgari | gtrak: in that case.... Idk |
| 11:57 | cmcbride | underscore is still much faster |
| 11:57 | cmcbride | is this because it is using native reduce? |
| 11:59 | cmcbride | time(function(){mori.reduce(sum, mori.filter(mori.is_even,(mori.range(100000))))}) |
| 11:59 | cmcbride | 264ms |
| 12:00 | cmcbride | time(function(){_.reduce(_.filter(_.range(100000),function(num){ return num % 2 == 0; }), sum, 0)}) |
| 12:00 | cmcbride | 12ms |
| 12:00 | _KY_ | Enclojure project run error: "no main class found" -- what should I do? |
| 12:00 | jasonjckn | amalloy_: you there? |
| 12:05 | jsabeaudry | What is the proper way of supporting positioned head requests on files using noir? |
| 12:07 | technomancy | amalloy_: someone pointed me to a problem with ordered on openjdk 8 if you are interested |
| 12:08 | jsabeaudry | aka the "range" header? |
| 12:09 | _KY_ | Enclojure project run error: "<no main class found>" -- what should I do? |
| 12:11 | cmcbride | I got mori down to 95ms by using reducers and using my own is_even function, not bad |
| 12:12 | technomancy | amalloy_: specifically on the lambda branch |
| 12:14 | mmarczyk | devn: reducers in CLJS = copy, paste, adjust protocol & protocol method names, comment out fork/join stuff :-) |
| 12:20 | jonaskoelker | ^^ TimMc: surprise checked exceptions---do the pop up from behind the couch when you turn on the light and go "surprise! Con-crash-tulations!" |
| 12:30 | mmarczyk | dnolen: ping |
| 12:30 | dnolen | mmarczyk: ping |
| 12:30 | dnolen | oops pong |
| 12:31 | mmarczyk | :-) |
| 12:31 | dnolen | mmarczyk: what's up? |
| 12:32 | mmarczyk | dnolen: new reducers stuff @ cljs-250 -- sort of wondering about the process, i.e. reopen / new ticket for updates like this? |
| 12:32 | mmarczyk | dnolen: more interestingly |
| 12:33 | mmarczyk | dnolen: CLJS-247 -- protocol method test inlining |
| 12:33 | TimMc | jonaskoelker: I hope so! |
| 12:33 | dnolen | mmarczyk: at this point we should see if we can't just get you commit rights to the CLJS repo :D |
| 12:33 | mmarczyk | but, um, I need to find a lost window... just a sec |
| 12:34 | mmarczyk | :-) |
| 12:35 | mengu | nah |
| 12:35 | mengu | uhm sorry |
| 12:36 | gfredericks | dnolen: I just cloned mori and ran the build command and it gives an error about not finding the reducers ns |
| 12:36 | mmarczyk | dnolen: well, that would be marvellous :-) |
| 12:36 | gfredericks | dnolen: nm |
| 12:36 | dnolen | gfredericks: everyone keeps saying that even tho the build instructions are quite specific :) |
| 12:36 | mmarczyk | dnolen: though with you being super-responsive as you are, not necessarily much of a speedup :-) |
| 12:36 | gfredericks | first tell dnolen something is wrong, then read the README |
| 12:36 | dnolen | mmarczyk: I'll ask around. |
| 12:37 | dnolen | mmarczyk: so about CLJS-247? |
| 12:37 | mmarczyk | ok, found my lost window now |
| 12:37 | mmarczyk | dnolen: a sanity check, sort of |
| 12:38 | uvtc | I just noticed a change from Clojure 1.3 to 1.4 that I don't see mentioned in <https://github.com/clojure/clojure/blob/master/changes.md>. With 1.4, I can now use standard libs (such as clojure.string) without needing to `require` them (just as long as I fully qualify func names). |
| 12:38 | mmarczyk | dnolen: so would you like to just inline the whole -foo ? |
| 12:38 | dnolen | mmarczyk: no |
| 12:38 | dnolen | (null test && bit-mask && call direct) || protocol-fn |
| 12:39 | mmarczyk | dnolen: ok, makes sense |
| 12:39 | hiredman | uvtc: seems unlikely, most likely some tool you are using is loading them |
| 12:39 | uvtc | hiredman: I just tried it via `java -cp path/to/clojure.jar` ... |
| 12:40 | mmarczyk | dnolen: I think I might actually put the finishing touches on the benchmark runner first, if only to see some foolproof data on the result |
| 12:40 | dnolen | mmarczyk: k |
| 12:40 | uvtc | I've got 1.3 and 1.4 here, and clojure.string/split works with 1.4 without requiring it. |
| 12:40 | mmarczyk | dnolen: I love the reader branch, btw |
| 12:41 | dnolen | mmarczyk: the optimize-reader one? |
| 12:41 | mmarczyk | dnolen: yup |
| 12:41 | uvtc | hiredman: |
| 12:41 | uvtc | john@foil:~/opt$ java -cp clojure-1.4.0/clojure-1.4.0.jar clojure.main |
| 12:41 | uvtc | Clojure 1.4.0 |
| 12:41 | uvtc | user=> (clojure.string/split "hello" #"l+") |
| 12:41 | uvtc | ["he" "o"] |
| 12:41 | uvtc | user=> |
| 12:41 | dnolen | mmarczyk: yeah, even with all the perf enhancements still seems strangely slow. |
| 12:41 | dnolen | mmarczyk: but perhaps we should merge in what we have and continue to improve -since the gains are quite large. |
| 12:41 | mmarczyk | dnolen: I was actually going to suggest that :-) |
| 12:42 | hiredman | uvtc: the repl loads it, but if you launch your code outside of the repl it won't be there |
| 12:43 | hiredman | the repl loads clojure.java.javadoc for some reason, and that loads a few other things, which load other thrings, one of which is clojure.string |
| 12:45 | uvtc | hiredman: Weird. If I create a standalone script with a call to clojure.string/split in in --- and no require --- and then run it via `java -cp path/to/clojure-1.4.0.jar clojure.main foo.clj`, it works too. |
| 12:45 | dnolen | mmarczyk: merged optimize-reader into master. |
| 12:45 | mmarczyk | dnolen: great! |
| 12:45 | hiredman | uvtc: I would not recommend depending on it |
| 12:46 | uvtc | hiredman: Ok, thanks. |
| 13:05 | uvtc | Is there any convention regarding what you alias standard libs to when you `require` them? For example, maybe something like `:require [clojure.string :as c.s`? |
| 13:06 | uvtc | (oops, forgot closing `]` there) |
| 13:07 | uvtc | I've seen [clojure.string :as str], but that seems odd, given that there's already a core `str` function. |
| 13:09 | technomancy | yeah, but putting a slash after the str function is meaningless, so there's no chance of collision |
| 13:09 | uvtc | technomancy: Oh, right. Thanks. :) |
| 13:42 | mmarczyk | dnolen: http://dev.clojure.org/jira/browse/CLJS-252 -- first cut at a benchmark suite |
| 13:42 | dnolen | mmarczyk: excellent |
| 13:48 | mmarczyk | dnolen: ah, wait, I think I'll have a minor improvement |
| 13:51 | mmarczyk | dnolen: new patch attached |
| 13:52 | mmarczyk | hm, V8 runs circles around SpiderMonkey |
| 13:53 | dnolen | mmarczyk: you have to use the flags -m -n -a |
| 13:53 | mmarczyk | dnolen: you mean pass them to the js runtime in script/benchmark? what do they do? |
| 13:54 | dnolen | mmarczyk: turns on JIT, skips interpretation |
| 13:54 | dnolen | mmarczyk: only applies to spidermonkey |
| 13:54 | dnolen | mmarczyk: if you're testing spidermonkey you should be using the shell from the nightlies |
| 13:55 | mmarczyk | dnolen: I see, thanks |
| 13:55 | mmarczyk | dnolen: I'll update the patch to use it in the SM part then |
| 13:55 | dnolen | mmarczyk: oops already applied :) |
| 13:55 | mmarczyk | dnolen: :-) |
| 13:57 | mmarczyk | dnolen: mind applying the new patch on CLJS-250? mapcat for reducers :-) |
| 13:59 | mmarczyk | dnolen: also sent you a pull req w/ mapcat for mori |
| 14:00 | dnolen | mmarczyk: thx, merged |
| 14:00 | dnolen | added zippers and set ops to Mori |
| 14:00 | mmarczyk | zippers :-D |
| 14:01 | `fogus | Oh my! I go away for 90 minutes and Mori is already my favorite JS lib |
| 14:01 | TimMc | Better than jQuery? |
| 14:01 | TimMc | Better than Cornify? |
| 14:01 | mmarczyk | one might not be able to bring the ambrosia of macros to the JSers, but one can at least share the fire of PDSs |
| 14:01 | TimMc | haha |
| 14:03 | dnolen | mmarczyk: gotta do some other things but I'll apply those patches soon. |
| 14:03 | mmarczyk | dnolen: cool, thanks |
| 14:07 | mmarczyk | dnolen: any chance Wednesday next week might get recorded? |
| 14:07 | dnolen | mmarczyk: thickey is coming so fingers crossed? |
| 14:07 | mmarczyk | dnolen: oh good :-) |
| 14:09 | lynaghk` | damns clojure folks are fast at the retweets. |
| 14:09 | lynaghk` | = ) |
| 14:11 | Borkdude | ,(doc if-let) |
| 14:11 | clojurebot | "([bindings then] [bindings then else & oldform]); bindings => binding-form test If test is true, evaluates then with binding-form bound to the value of test, if not, yields else" |
| 14:11 | Borkdude | what is a binding? I assumed a name and a value, right? |
| 14:12 | Borkdude | ,(if-let [a true, b false] :then :else) |
| 14:12 | clojurebot | #<ExecutionException java.util.concurrent.ExecutionException: java.lang.IllegalArgumentException: if-let requires exactly 2 forms in binding vector in sandbox:> |
| 14:12 | lynaghk` | Borkdude: if-let and when-let only take one binding. |
| 14:13 | Borkdude | lynaghk`: then the doc of if-let is wrong, it should say binding |
| 14:13 | Borkdude | ,(doc when-let) |
| 14:13 | clojurebot | "([bindings & body]); bindings => binding-form test When test is true, evaluates body with binding-form bound to the value of test" |
| 14:13 | lynaghk` | Borkdude: agreed =( |
| 14:14 | ibdknox | I wish it took multiple :p |
| 14:23 | dnolen | ibdknox: you're like hours away now! |
| 14:23 | ibdknox | dnolen: yeah :) |
| 14:23 | ibdknox | there's lots of craziness that has happened otherwise too :) |
| 14:23 | dnolen | ibdknox: can't wait to hear more about that |
| 14:24 | ache | where can i read about what ibdknox is working on? |
| 14:24 | ibdknox | http://www.chris-granger.com/2012/04/12/light-table---a-new-ide-concept/ |
| 14:24 | ache | thanks! |
| 14:25 | ibdknox | dnolen: I'm going to get to chat with Tim O'Reilly at the beginning of June |
| 14:25 | dnolen | ibdknox: sweet! |
| 14:25 | ibdknox | talked with lots of very interesting people |
| 14:25 | mfex | hi all, a clojure library in a jar does not need to be aot-ed to be used from other jvm languages, right? |
| 14:26 | fliebel | dnolen: I still need to touch maven to run core.logic, right? |
| 14:26 | dnolen | fliebel: ? |
| 14:26 | ibdknox | mfex: from other languages? Yes it does |
| 14:26 | TimMc | ibdknox: Ah, you're at FooCamp or whatchamacallit? |
| 14:26 | technomancy | mfex: depends on the interface you want to expose |
| 14:27 | technomancy | mfex: if you make users consume it via clojure.lang.RT, then no AOT is needed. |
| 14:27 | fliebel | dnolen: I know I can add it as a dep just fine, but I mean, as a git checkout, I can't just use lein, right? |
| 14:27 | ibdknox | TimMc: yeah, I will be :) Which is an amazing opportunity. I'm very excited about it |
| 14:27 | dnolen | fliebel: all Clojure contribs are available from Maven central repo |
| 14:27 | dnolen | fliebel: you can just use lein |
| 14:28 | ibdknox | fliebel: you'd have to make a fake project.clj for it |
| 14:28 | ibdknox | fliebel: if you want it in your checkouts/ dir |
| 14:28 | technomancy | IIRC hugod has a plugin to make mvn checkouts work with lein |
| 14:28 | fliebel | I just want it as a project to hack on |
| 14:29 | ibdknox | dnolen: TimMc: I think I might get to talk to one of the main researchers on DARPA projects at SRI too |
| 14:29 | TimMc | Haha, sweet. |
| 14:29 | dnolen | ibdknox: haha wowzers |
| 14:29 | mfex | technomancy, I don't want to aot my library jar. Is supplying a small jar that is aot compiled as only a wrapper with a nicer interface a common solution to this? |
| 14:29 | amalloy | jasonjckn: yes, i wasn't sure whether to curry or what, but as you said it seemed at least harmless |
| 14:30 | technomancy | mfex: I've seen that done for distributing uberjars, but not for library consumption. no reason you couldn't make it work though |
| 14:30 | amalloy | technomancy: i guess i'm interested, but i don't know anything about jdk8 |
| 14:31 | technomancy | amalloy: me neither |
| 14:32 | nDuff | mfex: ...heck, if you _really_ didn't want anything to be native AOT-compiled Clojure, you could have a Java wrapper that just does clojure.lang.RT calls |
| 14:32 | technomancy | mfex: you could always AOT a single ns and have that ns do a runtime require of the rest of your code |
| 14:32 | technomancy | that way you won't get bitten by the annoying transitive AOT behaviour |
| 14:33 | amalloy | jasonjckn (or anyone else): i'm having trouble testing my foldable Range: everything compiles fine, and mvn dependency:classpath points to an existing jsr166y jar, but when i run mvn test i get a ClassNotFoundException: jsr166y.ForkJoinTask |
| 14:39 | fliebel | > (solve-nqueens) |
| 14:39 | fliebel | () |
| 14:39 | fliebel | dnolen: ^ |
| 14:39 | dnolen | fliebel: the one in bench.clj? |
| 14:39 | fliebel | yea |
| 14:41 | dnolen | fliebel: yeah I recall that one being broke |
| 14:41 | fliebel | dnolen: zebrao works, though. |
| 14:42 | dnolen | fliebel: will need to look into it at some point - probably a simple mistake. |
| 14:42 | jasonjckn | amalloy: I haven't had a chance to run mvn test yet, logically I don't know why that's happening |
| 14:43 | jasonjckn | amalloy: i'll get around to testing soon |
| 14:43 | jasonjckn | amalloy: you could always upgrade to java 7, it's possible rhickey never tested with jar |
| 14:46 | technomancy | going to release lein2 preview4 later today |
| 14:46 | technomancy | any last-minute issues to raise? |
| 14:46 | stuartsierra | jasonjckn: Clojure 1.5.0-SNAPSHOT declares jsr166y as a "scope = provided" dependency, not sure why. |
| 14:47 | technomancy | if you're using Leiningen from a checkout, could you pull and give it a run-through? |
| 14:47 | stuartsierra | But try removing <scope>provided</scope> from pom.xml to see if that fixes your problem. |
| 14:47 | jasonjckn | ah |
| 14:47 | jasonjckn | I wondered what that did |
| 14:50 | hiredman | stuartsierra: because you don't want to drag jsr166y around if you are running on 7+ |
| 14:51 | stuartsierra | hiredman: yes, I know |
| 14:51 | stuartsierra | but I don't see what good declaring it in the first place dose |
| 14:51 | jlongster | cjfrisz: hey, dnolen pointed me to clojure-tco. I'm working on compiling to CPS-ified javascript. How big is the performance hit in clojure-tco? |
| 14:51 | stuartsierra | oh, I see, it's available at compile time |
| 14:52 | hiredman | jlongster: the real problem with "cps" clojure is it destroys interop by adding trampolines to every call |
| 14:53 | jlongster | hiredman: I know, but I'm working in another Lisp. plus, that can be circumvented, since the only problem is callbacks. |
| 14:54 | acagle | ¯/flush |
| 15:04 | amalloy | jasonjckn: updated to jdk7, the fj stuff seems to be working and now i can debug my code. thanks |
| 15:05 | jasonjckn | amalloy: great, i'm curious when you say 'debug' do you mean print debugging? or do you use something else? |
| 15:05 | fliebel | dnolen: Maybe I'm inadequate at using VisualVM, but I can't seem to find any trace of seq overhead. |
| 15:06 | amalloy | in this case i mean "inspect the stacktrace" |
| 15:06 | amalloy | "and hope to remove bugs" |
| 15:06 | fliebel | that is, it crashes most of the time... |
| 15:09 | Raynes | fliebel: Hahaha, man, I love talking to people who don't know USA geography. |
| 15:10 | amalloy | Raynes: you should hang out in america, then |
| 15:10 | fliebel | Raynes: ? |
| 15:10 | amalloy | we've got tons of them |
| 15:10 | fliebel | I know where alabama is, now |
| 15:10 | Raynes | The depths of hell. |
| 15:11 | fliebel | Raynes: Any luck with the DVD hacking? |
| 15:11 | Raynes | I don't know what you mean by 'hacking'. |
| 15:12 | amalloy | $dict hacking |
| 15:12 | lazybot | amalloy: adjective: Short and interrupted, broken, jerky; hacky. |
| 15:12 | fliebel | Raynes: making your DVD player accept any DVD. |
| 15:13 | Raynes | I haven't really tried. Not sure I care enough. |
| 15:13 | TimMc | lazybot: wat |
| 15:13 | fliebel | Raynes: But you do care enough to have me send a DVD player over? :P |
| 15:14 | Raynes | I was asking if anybody had a random spare dvd player/optical drive lying around. My life shall continue without it for the time being. :P |
| 15:14 | fliebel | Raynes: I have. It's just a little tricky to get it to you. |
| 15:15 | rhc | Raynes: what city do you live in? i might be able to ship you one |
| 15:16 | Raynes | Eldridge, AL, if you can call that a city. |
| 15:17 | rhc | i have this old apex player i never use that's region unlocked (i think) |
| 15:17 | Raynes | In case anyone is wondering what the context of this discussion is, I have some region two discs and nothing that will read them, hence me asking people for spare drives because I'm cheap. |
| 15:18 | dnolen | fliebel: which fns float to the top in VisualVM? |
| 15:18 | fliebel | Raynes: If you send me a cake for my birthday, I'll send you the player :) |
| 15:18 | fliebel | dnolen: ... the pushbackreaders read method. Something is not right. |
| 15:19 | Raynes | I'd send you a box of hohos. |
| 15:19 | fliebel | $dict hoho |
| 15:19 | lazybot | fliebel: Word not found. |
| 15:19 | Wild_Cat | Raynes: depending on how region checking is implemented in your drive, you may be able to read the discs with VLC |
| 15:19 | Raynes | Wild_Cat: RPC_2. |
| 15:19 | Raynes | So nope. |
| 15:19 | Wild_Cat | (otherwise, look for a RPC-1 firmware for your drive on http://forum.rpc1.org/ ) |
| 15:20 | amalloy | $google hostess hoho |
| 15:20 | lazybot | [Ho Hos® from Hostess Cakes (Our Products)] http://www.hostesscakes.com/hohos.asp |
| 15:20 | fliebel | Raynes: That'll do. |
| 15:20 | Wild_Cat | Raynes: I know, but some drives, despite being region-locked, can still have their protection bypassed depending on the software you use. Others, however, will refuse to even list the contents of the disc. |
| 15:21 | Raynes | This drive will list the contents of the disc, but wont let anything read those contents. |
| 15:21 | Raynes | I have another drive that does the same thing. |
| 15:22 | Raynes | I could temporarily set the drives region to region two and then rip everything off of all of the region 2 discs I've found myself with and then set it back, since I have 5 switches. |
| 15:22 | Raynes | drive's* |
| 15:22 | Raynes | That's probably the easiest option. |
| 15:23 | Raynes | I've only got these few discs and I shouldn't be getting any others. |
| 15:23 | fliebel | Raynes: Oh, so no hohos for me? |
| 15:23 | Wild_Cat | Raynes: maybe. (sigh. once again, just pirating the bloody thing would be easier -- thank you, big content >.< ) |
| 15:23 | Raynes | :\ |
| 15:23 | Raynes | fliebel: Fraid not. |
| 15:24 | Raynes | I think ripping the discs is actually legal as long as I don't distribute the content (which I don't plan to do), so that's something. |
| 15:24 | Wild_Cat | region locking has to be the stupidest thing ever. |
| 15:26 | Raynes | Wild_Cat: Agreed. |
| 15:27 | Wild_Cat | it is, in fact, the one reason why I keep hating Nintendo, in spite of all the objectively awesome things they've done otherwise. |
| 15:31 | Raynes | gfredericks: There is a wild Raynes. |
| 15:32 | Raynes | gfredericks: One gas station, a few houses, and more churches than blades of grass. |
| 15:35 | dnolen | mmarczyk: reducer improvements applied to master |
| 15:39 | glitch99_ | I'm having a hard time understanding this syntax.. I'm using incanter and there is a ($where {:le 3}) example where it chooses data by checking if it's less than 3. How do french braces work in clojure |
| 15:39 | stuartsierra | That's something specific to Incanter. |
| 15:39 | stuartsierra | {:le 3} is just an ordinary Clojure map. |
| 15:40 | glitch99_ | stuartsierra: ahh |
| 15:42 | jasonjckn | is there a lein deps equivilent in maven? |
| 15:42 | jasonjckn | it's not grabbing the jsr166y |
| 15:43 | stuartsierra | jasonjckn: mvn dependency:copy-dependencies |
| 15:43 | stuartsierra | What are you trying to do? |
| 15:43 | jasonjckn | i'm getting forkjoin classnotfound |
| 15:43 | jasonjckn | even though I changed pom.xml as you said |
| 15:44 | stuartsierra | What are you running? |
| 15:44 | jasonjckn | trying again |
| 15:44 | jasonjckn | mvn test |
| 15:44 | amalloy | stuartsierra: i had the same issue until i upgraded to jdk 7 |
| 15:44 | amalloy | mvn dependency:build-classpath returned a classpath that pointed at a locally-fetched version of jsr166y, but mvn test still got ClassNotFound |
| 15:45 | jasonjckn | yah still getting the error |
| 15:45 | amalloy | jasonjckn: check the output of build-classpath just to verify you and i were having the same problem? |
| 15:46 | stuartsierra | jasonjckn: cannot reproduce here, with JDK 1.6 |
| 15:46 | amalloy | i'm on ubuntu 11.04, if that turns out to be relevant |
| 15:46 | Raynes | amalloy: Old softwares. |
| 15:47 | jasonjckn | [INFO] Dependencies classpath: |
| 15:47 | jasonjckn | /Users/jason/.m2/repository/org/codehaus/jsr166-mirror/jsr166y/1.7.0/jsr166y-1.7.0.jar |
| 15:47 | jasonjckn | Caused by: java.lang.ClassNotFoundException: jsr166y.ForkJoinTask |
| 15:47 | stuartsierra | jasonjckn: Have you run ./antsetup.sh |
| 15:47 | stuartsierra | ? |
| 15:48 | jasonjckn | yes |
| 15:48 | jasonjckn | not since changing pom.xml |
| 15:48 | stuartsierra | What's in the maven-classpath.properties file? |
| 15:49 | jasonjckn | stuartsierra: I just regenerated it before you asked |
| 15:49 | jasonjckn | maven.compile.classpath=/Users/jason/.m2/repository/org/codehaus/jsr166-mirror/jsr166y/1.7.0/jsr166y-1.7.0.jar |
| 15:49 | jasonjckn | i'll try mvn test again |
| 15:49 | stuartsierra | ok that looks right |
| 15:51 | jasonjckn | stuartsierra: mvn test still failing |
| 15:51 | stuartsierra | amalloy, jasonjckn: Which specific JDK are you using? And which version of Maven? |
| 15:51 | jasonjckn | stuartsierra: java version "1.6.0_31" Apache Maven 3.0.3 |
| 15:51 | stuartsierra | jasonjckn: Which JDK: Sun/Oracle, OpenJDK, ...? |
| 15:52 | jasonjckn | stuartsierra: vendor: Apple Inc |
| 15:52 | stuartsierra | ok |
| 15:52 | stuartsierra | Trying myself with an empty ~/.m2 |
| 15:52 | jasonjckn | amalloy: i installed sun jdk7 but java -version still remains 1.6, did you do anything else? maybe i'll reboot |
| 15:53 | stuartsierra | jasonjckn: You probably need to configure which JDK to use by default. |
| 15:53 | duck1123 | jasonjckn: IIRC, there's a settings pannel where you have to drag 7 up to the top |
| 15:53 | devn | Raynes: Should I be expecting this in noir 1.3.0-beta6 => escape-html already refers to: #'hiccup.core/escape-html in namespace: hiccup.page |
| 15:54 | jasonjckn | duck1123: k thanks |
| 15:54 | Raynes | devn: Probably not. Open an issue. |
| 15:54 | devn | Raynes: I'm requiring [noir.server :as server] |
| 15:54 | devn | Raynes: will do |
| 15:55 | stuartsierra | OK, even with an empty ~/.m2, cannot reproduce the problem. |
| 15:55 | duck1123 | jasonjckn: http://reviews.cnet.com/8301-13727_7-57423014-263/how-to-install-and-uninstall-java-7-for-os-x/ |
| 15:55 | jasonjckn | fixed it |
| 15:56 | jasonjckn | trying mvn test gaain |
| 15:56 | amalloy | stuartsierra: i was using openjdk, but now i'm on jdk7 and not having problems |
| 15:56 | stuartsierra | ok |
| 15:57 | ibdknox | devn: that sounds like you're doing a :use on hiccup.something? |
| 15:57 | amalloy | jasonjckn: the stuff i had to do on ubuntu is probably not relevant to what you have to do on macos. i had to move around some symlinks and call update-alternatives a few times |
| 15:57 | stuartsierra | amalloy: Clojure is currently passing on Hudson on OpenJDK 1.6, http://build.clojure.org/job/clojure-test-matrix/77/ |
| 15:58 | jasonjckn | amalloy: *nods* i managed to switch it |
| 15:59 | jasonjckn | my unit tests passed, ship 1.5 quick!! |
| 16:03 | stuartsierra | Clojure should still work all the way back to JDK 1.5 (not including ForkJoin stuff) but starting with Clojure 1.5.0 it can only be BUILD on a 1.6 JDK. |
| 16:05 | amalloy | stuartsierra: since it's open-source friday, could i trouble someone to look at http://dev.clojure.org/jira/browse/CLJ-993 and http://dev.clojure.org/jira/browse/CLJ-992? rich asked for a range reducer, and i want to make sure these didn't slip under the radar to get implemented by someone else |
| 16:05 | stuartsierra | amalloy: I'll take a look in a few minutes. |
| 16:08 | stuartsierra | amalloy: Are the patches on 993 replacements or accumulations? |
| 16:08 | amalloy | accumulations |
| 16:08 | stuartsierra | ok |
| 16:09 | jasonjckn | stuartsierra: amalloy: I just put my patch up at http://dev.clojure.org/jira/browse/CLJ-994 |
| 16:09 | jasonjckn | i've never contributed to clojure, so not sure if i'm suppose to do anything else |
| 16:10 | stuartsierra | jasonjckn: Have you sent in a signed C.A.? |
| 16:10 | jasonjckn | can I e-mail the agreement? |
| 16:10 | jasonjckn | no |
| 16:10 | amalloy | jasonjckn: no, signed on dead trees only |
| 16:10 | jasonjckn | ah that's annoying |
| 16:10 | stuartsierra | So far Rich has always asked for signed paper. |
| 16:11 | amalloy | ah, i like the invoke-2-fns thing, jasonjckn |
| 16:11 | jasonjckn | is there a contributors list for that trouble at least? |
| 16:11 | jasonjckn | ah i see |
| 16:11 | amalloy | ~contribute |
| 16:11 | clojurebot | contribute is http://clojure.org/contributing |
| 16:12 | jasonjckn | that's a lot more people than I thought |
| 16:12 | brehaut | not everyone on there has actually contrubuted to clojure though; just signed the form |
| 16:12 | amalloy | it's not the case that everyone with a CA has contributed |
| 16:13 | amalloy | that's the clojure/dev list, which is a lot larger and less powerful than clojure/core |
| 16:13 | jasonjckn | how backwards |
| 16:13 | technomancy | looks like the total number of contributors is 79 |
| 16:14 | jasonjckn | do I get git credentials? |
| 16:14 | brehaut | jasonjckn: i signed the form despite not having anything to contribute because its a bloody long way for snail mail from new zealand and didnt want to get caught waiting if i did have something to contribute |
| 16:14 | jasonjckn | *nods* |
| 16:14 | technomancy | jasonjckn: become Rich Hickey |
| 16:14 | jasonjckn | is he the only one? |
| 16:14 | brehaut | his hair has a seperate account |
| 16:14 | brehaut | its also got credentials |
| 16:15 | amalloy | jasonjckn: you (can) get commit rights to contrib, but not to core, i believe |
| 16:15 | samaaron | You could make a hammock out of Rich's hair |
| 16:15 | jasonjckn | I would be okay with reincarnating as Rich Hickey's hair, with git credentials |
| 16:15 | jasonjckn | it's already quite an honor |
| 16:15 | stuartsierra | Only 4 people have commit access on Clojure. |
| 16:15 | jasonjckn | k |
| 16:15 | amalloy | any changes you want to make go through JIRA patches, to be applied by someone else |
| 16:15 | technomancy | stuartsierra: is one of them named Hudson? |
| 16:16 | jasonjckn | as far as benevolent dictators go, rhickey is not too bad |
| 16:16 | stuartsierra | technomancy: yes |
| 16:16 | stuartsierra | And we're under strict instructions not to commit anything until Rich has personally OK'd it. |
| 16:18 | technomancy | clojurebot: bus factor is best if you try not to think about it. (https://github.com/clojure/clojure/graphs/contributors) |
| 16:18 | clojurebot | Ik begrijp |
| 16:25 | TimMc | How come there are all those other committers? |
| 16:25 | TimMc | (Or at least authors.) Were pull requests accepted once upon a time? |
| 16:25 | technomancy | TimMc: git format-patch maintains authorship data |
| 16:25 | stuartsierra | Git preserves the original patch author separate from the committer. |
| 16:25 | TimMc | Ah, right. |
| 16:33 | zanes | Getting this stacktrace when I try to lein autotest. Anyone seen this before? https://gist.github.com/cdaf4ee623e33d78f1db |
| 16:35 | muhoo | there's a big difference from wanting to create a cool language, and wanting to lead an open-source community |
| 16:39 | fliebel | muhoo: What makes you say that? |
| 16:39 | muhoo | earlier discussion about bus-factor, commmit access, jira, etc |
| 16:41 | cmcbride | if I have a string, is there a function in core that will give me all possible sub-strings of length n |
| 16:41 | fliebel | cmcbride: partition |
| 16:41 | cmcbride | I guess I could do a greedy regex |
| 16:42 | cmcbride | that doesnt seem like all of them |
| 16:42 | cmcbride | if I have "abcd", I want "ab", "bc", "cd" |
| 16:42 | fliebel | &(partition 3 1 "abcd") |
| 16:42 | lazybot | ⇒ ((\a \b \c) (\b \c \d)) |
| 16:42 | cmcbride | partiton would just give me "ab" "cd" |
| 16:42 | fliebel | &(partition 2 1 "abcd") |
| 16:42 | lazybot | ⇒ ((\a \b) (\b \c) (\c \d)) |
| 16:42 | cmcbride | oh oops |
| 16:42 | cmcbride | thanks |
| 16:43 | jasonjckn | i did some really basic benchmarking of reducers http://pastebin.com/DSm69GZu very impressive performance |
| 16:43 | jasonjckn | (dual core machine) |
| 16:44 | adeelkh | hey dnolen, mori looks really cool. what potential applications does it have, in your opinion? i mean, why wouldn't you just use clojurescript? :) |
| 16:45 | amalloy | jasonjckn: yeah, pretty impressive. and it should get better still if you compare multiple layers of lazy sequences like (reduce + (map inc (filter even? (range 10000)))) |
| 16:45 | jasonjckn | *nods* |
| 16:45 | dnolen | adeelkh: thanks |
| 16:45 | amalloy | cmcbride: you want combinations |
| 16:45 | technomancy | zanes: I think lein-autotest is abandoned |
| 16:45 | dnolen | adeelkh: I could but that means people I code w/ have to know Lisp. |
| 16:45 | amalloy | no, never mind |
| 16:46 | dnolen | adeelkh: Mori is a good way to get a lot of the good stuff w/o everyone needing to understand Clojure. |
| 16:46 | kmicu | (let [{k v} {:k 1}] println (str k v)) |
| 16:47 | dnolen | adeelkh: I think Mori is useful for any JS application where you want to have more sensible state management and perf is not the ultimate concern - which is a lot of JS programs :) |
| 16:47 | jasonjckn | amalloy: http://pastebin.com/iz8bzrdw with a map |
| 16:47 | zanes | technomancy: Okay, thanks. Seems like midje is the new hotness? |
| 16:48 | muhoo | is it expected behavior that a noir middleware would run 3 times per each request? https://www.refheap.com/paste/2684 |
| 16:48 | adeelkh | dnolen: ah, ok. makes sense. |
| 16:48 | jasonjckn | amalloy: the clojuer.core one is 2x slower, the others are more around 1.3x slower :) |
| 16:48 | technomancy | zanes: I think most people just use clojure.core with editor integration |
| 16:49 | technomancy | zanes: it's easy to make clojure.test tests run whenever you save in swank-clojure, for instance |
| 16:49 | dnolen | adeelkh: I would certainly use it over any other existing FP JS lib, Mori leverages CLJS so it's chock filled with data structures and tools :) |
| 16:49 | technomancy | zanes: no reason lein-autotest couldn't be upgraded to work with clojure.test though |
| 16:49 | technomancy | dakrone: ^ right? |
| 16:50 | zanes | technomancy: You mean with a post save hook or something like that? |
| 16:50 | technomancy | zanes: yeah |
| 16:50 | zanes | Got it. Okay. |
| 16:50 | brehaut | dnolen, adeelkh: has datastructurse at all puts it way above most JS libs |
| 16:50 | muhoo | i am looking to build a noir handler that has side-effects, is why i'm asking |
| 16:51 | muhoo | sorry, a middleware |
| 16:51 | technomancy | zanes: in fact, clojure-test-mode's "run these tests" command will prompt you to save anyway, so if you're using Emacs, that's the way to go |
| 16:51 | technomancy | seems like the whole "watch for filesystem changes and run X" should be extracted into its own library if it hasn't been already though; I know of at least three independent reimplementations |
| 16:52 | adeelkh | dnolen: what other FP libraries are there for javascript? |
| 16:53 | stuartsierra | technomancy: I've offered my Lazytest stuff as a contrib. Brenton Ashworth has been working on refactoring it into an independent library. |
| 16:53 | zanes | I didn't even know about clojure-test-mode. |
| 16:53 | dnolen | adeelkh: wu.js, underscore.js, fun.coffee (which I did), http://osteele.com/sources/javascript/functional/, probably many others. |
| 16:53 | technomancy | stuartsierra: cool. did your implementation poll, or did it hook into OS-level filesystem notifications? |
| 16:53 | stuartsierra | poll |
| 16:54 | technomancy | yeah, lot sure the latter is possible without JNI =( |
| 16:55 | adeelkh | dnolen: cool thanks. a while ago i was looking for a functional approach to DOM manipulation but there doesn't seem to be anything |
| 16:56 | dnolen | adeelkh: what kind of DOM manipulation? |
| 16:56 | nDuff | technomancy: believe it is currently, though that's a relatively new thing |
| 16:57 | technomancy | nDuff: nio or some such? |
| 16:57 | technomancy | nio2? |
| 16:59 | nDuff | Thought it was newer than NIO... but not having much luck googling it up; all the JNI-based libraries are adding a fair bit of clutter. |
| 16:59 | technomancy | I think NIO2 is new in java 7 |
| 16:59 | adeelkh | dnolen: well basically something along the lines of clojurescript's clojure.browser.dom, but in javascript |
| 17:00 | dnolen | adeelkh: i see |
| 17:03 | gozala | dnolen: question regarding mori and publishing to npm |
| 17:04 | dnolen | gozala: go ahead |
| 17:04 | gozala | dnolen: are you ok with adding package.json to your repo ? |
| 17:04 | dnolen | gozala: yep |
| 17:05 | gozala | but then you'll need to install npm and create an account to publish |
| 17:05 | gozala | I can send pull request with package.json |
| 17:05 | dnolen | gozala: excellent |
| 17:05 | dnolen | gozala: I have npm installed, just need to create an account I guess. |
| 17:06 | gozala | dnolen: oh and there is on more thing |
| 17:06 | gozala | exports have to be set on exports object |
| 17:07 | gozala | is that something that can be done with cljsbuild ? |
| 17:08 | dnolen | gozala: not really, we really need a shell script any how. |
| 17:08 | dnolen | gozala: to wrap mori.js in a function closure when running the browser. |
| 17:08 | dnolen | running in |
| 17:09 | dnolen | gozala: so one script for the node build, and one for browser I think. |
| 17:09 | clojurebot | ClojureScript is https://github.com/clojure/clojurescript |
| 17:09 | gozala | dnolen: btw readme sugests that non-reducers based map/filter is faster or do I missunderstand ? |
| 17:10 | dnolen | gozala: that's comparing native fp ops on primitive JS arrays. |
| 17:11 | dnolen | gozala: reducers will be faster than the CLJS seq oriented map/filter/reduce |
| 17:11 | gozala | dnolen: Oh right I have not realized it was native arrays |
| 17:12 | gozala | dnolen: BTW did you had chance to digg into reducers yet ? |
| 17:12 | dnolen | gozala: compared against primitive arrays that pretty impressive - given that there's a lot left to optimize in CLJS. |
| 17:12 | dnolen | gozala: nope |
| 17:12 | dnolen | gozala: but using them is easy :) |
| 17:12 | gozala | dnolen: I'm just trying to figure out if you can consume reducer lazily |
| 17:13 | gozala | or to be more precise pause consumption and then continue from wherever you left |
| 17:14 | dnolen | gozala: I don't know |
| 17:15 | gozala | Yeah maybe you can tweet after ny clojure ;) |
| 17:15 | ivan | jasonjckn: where did your r/repeat come from in the benchmark? |
| 17:16 | jasonjckn | ivan: uncommitted code http://dev.clojure.org/jira/browse/CLJ-994 |
| 17:16 | ivan | hah, thanks |
| 17:23 | TimMc | $mail foxdonut Urgh, Spring's JDBC thing apparently just splits on semicolons! http://stackoverflow.com/questions/3768815/spring-datasourceinitializer-splits-trigger-ins-sql-by-delimiter |
| 17:23 | lazybot | Message saved. |
| 17:23 | technomancy | ha ha |
| 17:23 | TimMc | :-( |
| 17:27 | gozala | dnolen: I can't load mori seems to dislike t("mori.rmap", reducers.map); |
| 17:27 | gozala | I suspect that may be something with my cljs version |
| 17:28 | cmcbride | gozala: you need the HEAD version of clojurescript |
| 17:28 | dnolen | gozala: mkdir checkouts, clone clojurescript into it. |
| 17:29 | gozala | dnolen: also version here has same issue https://github.com/swannodette/mori/downloads |
| 17:30 | dnolen | gozala: oops looking into it |
| 17:35 | weavejester | Does anyone have any ideas about the best way to bind a cached value to a record representing a ref? |
| 17:35 | uvtc | How can I access the docstring for a namespace? For a simple project named "foo", using lein 2, the following doesn't work: `(doc foo.core)` |
| 17:35 | weavejester | I mean, I could have the cache inside the record, but that seems inelegant. |
| 17:36 | technomancy | ,(doc (the-ns 'clojure.string)) |
| 17:36 | clojurebot | #<ExecutionException java.util.concurrent.ExecutionException: java.lang.ClassCastException: clojure.lang.PersistentList cannot be cast to clojure.lang.Symbol> |
| 17:36 | weavejester | uvtc: doc works for me. Have you required the namespace? |
| 17:36 | technomancy | oops |
| 17:36 | weavejester | ,(doc clojure.string) |
| 17:36 | clojurebot | #<ExecutionException java.util.concurrent.ExecutionException: java.lang.RuntimeException: java.lang.ClassNotFoundException: clojure.string> |
| 17:36 | uvtc | weavejester: This is after starting up `lein repl` |
| 17:37 | weavejester | uvtc: I just tested it. Try (require 'foo.core) then (doc foo.core) |
| 17:37 | dnolen | gozala: thx, should be fixed now |
| 17:37 | uvtc | weavejester: Thanks, but that's still not working. It's telling me: foo.core=> (doc foo.core) |
| 17:37 | uvtc | ClassNotFoundException foo.core java.net.URLClassLoader$1.run (URLClassLoader.java:217) |
| 17:37 | gozala | I'll give it a try |
| 17:38 | uvtc | weavejester: I've got ":main foo.core" in my project.clj. Trying it without that. |
| 17:38 | weavejester | uvtc: Have you required it? |
| 17:39 | weavejester | Not sure it would work if you were inside the ns... |
| 17:39 | uvtc | weavejester: Yes, I required it. |
| 17:39 | weavejester | Anyway… :) - caching… should a cache be stored inside a record, or weakly refed to the record? |
| 17:39 | weavejester | uvtc: When I load up a REPL and do: (require 'ragtime.core) (doc ragtime.core) it works |
| 17:40 | gozala | dnolen: can you successfully build it ? |
| 17:40 | dnolen | gozala: yes |
| 17:40 | dnolen | gozala: but you need to build against ClojureScript HEAD |
| 17:40 | gozala | I just got SEVERE: /Users/gozala/Projects/mori/.lein-cljsbuild-compiler-0/mori.js:4: ERROR - required "clojure.core.reducers" namespace never provided |
| 17:40 | gozala | goog.require('clojure.core.reducers'); |
| 17:40 | gozala | but it seems to work though |
| 17:40 | dnolen | gozala: lein cljsbuild clean |
| 17:41 | dnolen | gozala: try again |
| 17:41 | gozala | ahh |
| 17:41 | uvtc | weavejester: Hm. Thanks. I tried removing the ":main foo.core" from project.clj, but that didn't help. My ns macro in core.clj looks like this: (ns foo.core |
| 17:41 | uvtc | "docstring for this namespace" |
| 17:41 | uvtc | (:require fs.core clojure.string)) |
| 17:41 | gozala | dnolen: so does exports now create globals ? |
| 17:41 | gozala | in js version I mean |
| 17:42 | weavejester | uvtc: When I write: (ns foo.core "foobar") (doc foo.core) it works for me too. |
| 17:42 | dnolen | gozala: no ^:export just prevents GClosure symbol obfuscation |
| 17:42 | weavejester | uvtc: What version of Clojure are you running this under? |
| 17:42 | uvtc | weavejester: 1.4 (just a sec, afk) |
| 17:43 | dnolen | gozala: everything in mori.js gets added to a mori object. However all the CLJS stuff is global, thus we want a fn closure for that stuff. |
| 17:43 | gozala | dnolen: BTW I still see that warning even after `lein cljsbuild clean` |
| 17:44 | dnolen | gozala: did you change project.clj? |
| 17:44 | weavejester | uvtc: Ah, okay, I see the error. |
| 17:44 | gozala | I pulled from your repo |
| 17:44 | dnolen | gozala: which version of lein are you using? |
| 17:44 | pcavs | I have a core.logic question: How would I create a relation that would be similar to (== (> a b) true) or (== (> a 5) true) |
| 17:45 | dnolen | pcavs: look at core.logic.arithmetic |
| 17:45 | gozala | dnolen: 1.7.0 |
| 17:45 | dnolen | gozala: and that error occurs while building? |
| 17:45 | pcavs | dnolen: muchos gracias |
| 17:46 | gozala | yeah I run lein deps && lein cljsbuild once release |
| 17:46 | uvtc | weavejester: {back} sorry about that. |
| 17:46 | felideon | muchas* |
| 17:46 | uvtc | weavejester: What error do you see? |
| 17:46 | gozala | and I see it durinc compilation |
| 17:46 | weavejester | uvtc: The error exists in 1.4, not in 1.2. Let me check 1.3. |
| 17:47 | dnolen | gozala: and you made the checkouts directory? |
| 17:47 | weavejester | uvtc: In 1.3 too… at least when I'm in the namespace |
| 17:47 | dnolen | gozala: and cloned clojurescript into it? |
| 17:47 | gozala | yeap and symlinked to lates clojurescript |
| 17:47 | dnolen | gozala: try w/o symlink, just clone it into checkouts |
| 17:48 | gozala | ok |
| 17:48 | gozala | it worked with symlinks before though |
| 17:48 | dnolen | gozala: your probably right, but better just to do exactly the same steps. |
| 17:48 | weavejester | uvtc: Odd. "doc" doesn't seem to work for namespaces at all for 1.3 and above. You could do (:doc (meta (the-ns 'foo.core))) |
| 17:50 | weavejester | uvtc: (find-doc "foo.core") works |
| 17:51 | uvtc | weavejester: going straight into the repl and trying `(:doc (meta (the-ns 'foo.core)))` just returns nil for me. |
| 17:51 | gozala | dnolen: ok so it has to do something with symlink or with my clone |
| 17:51 | gozala | it works with just cloning |
| 17:51 | dnolen | gozala: cool |
| 17:51 | weavejester | uvtc: Try just (meta (the-ns 'foo.core)) then? |
| 17:52 | gozala | dnolen: thanks |
| 17:52 | weavejester | uvtc: Or even (the-ns 'foo.core) |
| 17:52 | uvtc | weavejester: Hm. `(find-doc "foo.core")` also returns nil. |
| 17:52 | uvtc | weavejester: as does ` (meta (the-ns 'foo.core))` |
| 17:52 | uvtc | weavejester: (I know I've got a docstring in there, and I know I'm in the right directory...) |
| 17:53 | weavejester | uvtc: Are you sure you have that namespace? If you do (the-ns 'foo.core) does it exist? Have you required it? |
| 17:53 | uvtc | weavejester: foo.core=> (the-ns 'foo.core) |
| 17:53 | uvtc | #<Namespace foo.core> |
| 17:53 | weavejester | uvtc: And it has no metadata? |
| 17:53 | uvtc | weavejester: foo.core=> (meta (the-ns 'foo.core)) |
| 17:53 | uvtc | nil |
| 17:53 | gozala | dnolen: symlinks work as well it's just I have fetched but forgot to merge in my cljs dir |
| 17:54 | weavejester | uvtc: Try: (ns foo.core "foobar") (meta (the-ns 'foo.core)) |
| 17:55 | dnolen | gozala: gotcha |
| 17:55 | uvtc | weavejester: foo.core=> (ns foo.core "foobar") (meta (the-ns 'foo.core)) |
| 17:55 | uvtc | nil |
| 17:55 | uvtc | nil |
| 17:56 | jasonjckn | in the reducers blog post rhickey writes "Those IFn.LLL, DDD etc primitive-taking function interfaces can now spring to life." |
| 17:56 | jasonjckn | can someone expand on this? |
| 17:56 | uvtc | weavejester: Just triple-checked. I'm in the correct dir, looking at the correct files. My lein repl prompt tells me I'm in: "foo.core=>". |
| 17:57 | jasonjckn | I googled LLL and DDD and nothing came up, except that blog post |
| 17:57 | ivan | jasonjckn: long long long, double double double? |
| 17:57 | jasonjckn | that was my guess too |
| 17:57 | jasonjckn | but I still don't know what he wants for reducers.. |
| 17:57 | TimMc | jasonjckn: Have you looked at IFn.java in clojure core? |
| 17:57 | jasonjckn | Is IFn.LLL a real thing right now? |
| 17:58 | jasonjckn | nop,i'll check it out |
| 17:58 | weavejester | uvtc: Maybe the problem is that ns doesn't overwrite |
| 17:58 | uvtc | weavejester: I can call the little functions I've defined in my core.clj file, and at the top of that file is the `(ns foo.core "docstring for this namespace" (:require fs.core clojure.string))`. Maybe I should try removing those :requires... |
| 17:58 | TimMc | &org.clojure.IFn$LOL |
| 17:58 | lazybot | java.lang.ClassNotFoundException: org.clojure.IFn$LOL |
| 17:58 | stuartsierra | jasonjckn: The nested classes in IFn are interfaces for primitive-taking functions. |
| 17:58 | TimMc | &clojure.lang.IFn$LOL |
| 17:58 | lazybot | ⇒ clojure.lang.IFn$LOL |
| 17:58 | weavejester | uvtc: Try a completely new namespace: (ns another.core "foobar") (meta (the-ns 'another.core)) |
| 17:59 | uvtc | weavejester: ok, just a sec. |
| 17:59 | stuartsierra | amalloy: I can't screen your patches until I know enough about the reducers implementation to understand them. But I've passed the word around. |
| 17:59 | uvtc | weavejester: lein new another ... changing the project.clj to use 1.4... |
| 18:00 | weavejester | uvtc: Don't actually create a file for it. Just generate the namespace in the REPL. |
| 18:00 | weavejester | uvtc: Literally just type: (ns another.core "foobar") (meta (the-ns 'another.core)) in your REPL. |
| 18:00 | uvtc | weavejester: Oh. Whoops. Ok. |
| 18:01 | uvtc | weavejester: foo.core=> (ns another.core "foobar") (meta (the-ns 'another.core)) |
| 18:01 | uvtc | nil |
| 18:01 | uvtc | {:doc "foobar"} |
| 18:01 | weavejester | uvtc: Okay, that's good :) |
| 18:02 | weavejester | uvtc: So you must be creating your other namespace without a docstring somehow. |
| 18:02 | uvtc | weavejester: :). Also, now my prompt says "another.core=>" |
| 18:02 | weavejester | uvtc: Change out of it with (in-ns 'user) |
| 18:02 | uvtc | weavejester: ok. |
| 18:03 | weavejester | uvtc: What does your foo.core ns declaration look like? |
| 18:03 | uvtc | weavejester: tried again (doc foo.core), (require 'foo.core) (doc foo.core) but got the same as before. |
| 18:03 | uvtc | (ns foo.core |
| 18:03 | uvtc | "docstring for this namespace") |
| 18:03 | uvtc | weavejester: ^ |
| 18:04 | weavejester | uvtc: Try restarting your REPL? Maybe ns doesn't overwrite the docstring and you loaded a version without the doc. |
| 18:05 | uvtc | weavejester: Thanks for the suggestion, though, I've been restarting it as we've been trying here. |
| 18:05 | weavejester | uvtc: Yes, it looks like ns doesn't override existing namespace metadata. |
| 18:05 | weavejester | uvtc: Are there any other instances in your source tree where you create the foo.core namespace? |
| 18:06 | uvtc | weavejester: no, this is just a trivial project I created for testing stuff. |
| 18:06 | weavejester | uvtc: Hm… So there's no other (ns foo.core) around? |
| 18:07 | weavejester | uvtc: Not even in, say, your test directory? |
| 18:07 | uvtc | weavejester: Just what lein2 put there (core_test.clj). |
| 18:07 | uvtc | weavejester: trying this with a clean new project... |
| 18:08 | weavejester | uvtc: You could also try seeing if Lein is hooking into any processes that are left running. |
| 18:08 | uvtc | weavejester: john@foil:~/temp/another$ ps -ef | grep -i lein |
| 18:08 | uvtc | john 28956 20523 0 18:07 pts/2 00:00:00 grep --color=auto -i lein |
| 18:08 | uvtc | john@foil:~/temp/another$ ps -ef | grep -i java |
| 18:08 | uvtc | john 28958 20523 0 18:07 pts/2 00:00:00 grep --color=auto -i java |
| 18:08 | weavejester | uvtc: Try it with a new project I guess... |
| 18:09 | uvtc | weavejester: user=> (doc another.core) |
| 18:09 | uvtc | ClassNotFoundException another.core java.net.URLClassLoader$1.run (URLClassLoader.java:217) |
| 18:09 | uvtc | weavejester: user=> (require 'another.core) |
| 18:09 | uvtc | nil |
| 18:09 | uvtc | user=> (doc another.core) |
| 18:09 | uvtc | ClassNotFoundException another.core java.net.URLClassLoader$1.run (URLClassLoader.java:217) |
| 18:09 | weavejester | uvtc: Yeah, but we know the doc macro is broken for namespaces |
| 18:09 | weavejester | uvtc: Try the (meta (the-ns 'another.core)) |
| 18:10 | weavejester | uvtc: Ensuring it has a docstring, of course. |
| 18:10 | uvtc | weavejester: thanks for the clarification. user=> (meta (the-ns 'another.core)) |
| 18:10 | uvtc | {:doc "docstring for another "} |
| 18:10 | uvtc | weavejester: works! |
| 18:10 | weavejester | uvtc: I wonder what's different to your other project then... |
| 18:10 | uvtc | weavejester: Oh, I hadn't added ":main another.core" yet. |
| 18:11 | uvtc | weavejester: trying that. ... |
| 18:11 | uvtc | weavejester: another.core=> (require 'another.core) |
| 18:11 | uvtc | nil |
| 18:11 | uvtc | another.core=> (meta (the-ns 'another.core)) |
| 18:11 | uvtc | nil |
| 18:12 | weavejester | uvtc: Curious. Raise it as an issue on Leiningen, perhaps. |
| 18:12 | uvtc | weavejester: thanks alot for your time! |
| 18:12 | pikapp | if i were to implement my own version of Long.valueOf(String) what would be a good way of doing it? |
| 18:12 | weavejester | uvtc: No problem. I'll send a message to clojure-dev about clojure.repl/doc |
| 18:12 | pikapp | whoops, wrong room |
| 18:13 | weavejester | uvtc: Ah, it's already a known issue: http://dev.clojure.org/jira/browse/CLJ-902 |
| 18:14 | patchwork | my app is depending on two different versions of hiccup, and I don't even have it listed in my dependencies! |
| 18:14 | uvtc | weavejester: thanks for that link. (Looks like it's slated to go in 1.5?) |
| 18:14 | patchwork | How is this possible? |
| 18:15 | patchwork | Is there a way to see what is depending on a certain jar? |
| 18:15 | weavejester | uvtc: Or 1.4.1. My guess about the Leiningen :main issue is that it creates a blank namespace before loading your source file. |
| 18:16 | weavejester | uvtc: And the ns macro doesn't add any metadata if the namespace already exists. |
| 18:16 | technomancy | patchwork: `lein deps :tree` if you're using lein2 |
| 18:16 | technomancy | patchwork: otherwise `lein pom && mvn dependency:tree` |
| 18:16 | uvtc | weavejester: Ok. Will add an issue in lein's issue tracker at github. Thanks. |
| 18:17 | weavejester | uvtc: No problem :) |
| 18:17 | patchwork | technomancy: perfect! thank you |
| 18:18 | weavejester | What do people think about putting atoms or other refs inside records or types? |
| 18:18 | di-csuehs | I'm beating my head against something stupid, trying to deploy a noir app in Tomcat |
| 18:18 | weavejester | It kinda ruins their print-ability. |
| 18:20 | pcavs | dnolen: do you have any examples for how to use core.logic.arithematic? |
| 18:20 | weavejester | I wonder if a cache pointer counts as metadata... |
| 18:20 | dnolen | pcavs: not handy no, are you confused by something? |
| 18:20 | eggsby | I want to see 'SEND MORE MONEY' in core.logic |
| 18:21 | dnolen | gozala: merged your changes, thx! |
| 18:21 | eggsby | google is my friend |
| 18:21 | eggsby | https://gist.github.com/2364695 |
| 18:22 | dnolen | eggsby: which is slow in the current core.logic, would be faster w/ cKanren extensions. |
| 18:22 | pcavs | dnolen: I think my problem is understanding how goals, run*, and relational vs non relational all interact. I think I just need to sit down with my reasoned schemer and read some more. |
| 18:22 | technomancy | weavejester: I've wanted memoize's cache atom to be stored in metadata since forever |
| 18:23 | gozala | dnolen: cool! you're welcome ;) |
| 18:23 | eggsby | tbh core.logic is way over my head and I have no idea how to approach it (it being my first introduction to logic programming), I'm in love w/ core.match, though |
| 18:23 | weavejester | technomancy: I guess it is data about data |
| 18:23 | dnolen | eggsby: great! |
| 18:24 | amalloy | weavejester: i put atoms and refs inside records and types whenever i have a record or type that needs an atom or a ref :P |
| 18:24 | weavejester | amalloy: It kinda spoils printability though… and I only need the atom for a cache. |
| 18:25 | eggsby | what is the best way to dip my toes into the logic programming world, it seems pretty all or nothing from what I can tell, whereas pattern matching I can integrate into stuff I've already written |
| 18:25 | eggsby | logic programs are pretty much purely logical programs, right? |
| 18:27 | eggsby | and another unrelated note... is there some lein plugin I can use to simplify stacktraces so they don't include the clojure implementation logic in the trace? (i.e. no .java files) |
| 18:27 | technomancy | oh crap |
| 18:27 | technomancy | I forgot to merge that branch of clj-stacktrace |
| 18:27 | weavejester | eggsby: I think they need to operate in their own little world, but their outputs can be used by anything. |
| 18:28 | technomancy | it's been sitting there forever =\ |
| 18:28 | weavejester | technomancy: I occassionally have times when that happens. |
| 18:28 | weavejester | technomancy: Occassionally ;) |
| 18:28 | dnolen | gozala: so will 'npm publish' trigger the build part? |
| 18:28 | technomancy | weavejester: I'd feel worse if it weren't my own branch =) |
| 18:29 | technomancy | oh that's right; I was waiting on longbottom. |
| 18:29 | gozala | dnolen: nope |
| 18:29 | gozala | you have to run npm run build first |
| 18:30 | gozala | dnolen: although it's a good point I think there might be a hook on npm to atuomate that |
| 18:30 | gozala | on publish |
| 18:30 | dnolen | gozala: k I think published it |
| 18:31 | gozala | dnolen: so if you change in package.json scritps bulid to prepublish |
| 18:31 | gozala | it should do it on npm publish |
| 18:32 | dnolen | gozala: so change "build" key to "prepublish" ? |
| 18:33 | gozala | yeah |
| 18:33 | tomoj | really excited about mori. getting this error trying to build: https://gist.github.com/7dab21323787b9ef35b5 |
| 18:33 | tomoj | clues? |
| 18:33 | tomoj | cleaned my clojurescript, pulled master, and rebootstrapped it |
| 18:34 | dnolen | tomoj: are you sure you pulled master? |
| 18:34 | ivan | maybe you have another closure-library in your classpath? |
| 18:34 | dnolen | Mori 0.1.0 on npm |
| 18:34 | tomoj | 2469b7c0 |
| 18:34 | tomoj | sweet |
| 18:35 | tomoj | src/cljs/clojure/core/reducers.cljs exists in $CLOJURESCRIPT_HOME |
| 18:36 | dnolen | tomoj: are you building via creating checkout dir and cloning into it? |
| 18:36 | dnolen | checkouts dir I mean |
| 18:36 | tomoj | my bad |
| 18:36 | tomoj | thanks |
| 18:37 | tomoj | was too excited to read apparently |
| 18:45 | devn | hmm, how does clojure.pprint/code-dispatch work |
| 18:45 | dnolen | tomoj: haha, makes sense. Mori is something JS devs can start using at work today :) |
| 18:46 | devn | i remember using (with-pprint-dispatch *code-dispatch* string) |
| 18:46 | devn | is that still the idea? the earmuffs are gone these days |
| 18:49 | devn | nevermind |
| 18:49 | devn | i needed to call read-string on it :\ |
| 18:51 | dakrone | technomancy: correct |
| 18:52 | technomancy | dakrone: re: autotest? |
| 18:56 | dakrone | technomancy: yea, albeit a fair about of work, I'll put it on the todo list |
| 18:56 | dpritchett | been staring at mapcat for a long time trying to figure it out |
| 18:56 | dpritchett | specifically (apply map list [[1 2 3] [4 5 6] [7 8 9]]) |
| 18:57 | dpritchett | i read the source so i understand that it's (apply concat (apply map f colls)) i just don't quite get it |
| 18:58 | technomancy | dakrone: maybe you can get zanes to do it =) |
| 18:58 | zanes | technomancy: Too late. I'm happy with clojure-test-mode. ;) |
| 18:58 | technomancy | oops, too late =) |
| 18:59 | ivan | &(map list [1 2] [3 4]) |
| 18:59 | lazybot | ⇒ ((1 3) (2 4)) |
| 18:59 | ivan | &(map vector [1 2] [3 4]) |
| 18:59 | lazybot | ⇒ ([1 3] [2 4]) |
| 18:59 | dpritchett | (i dont really understand that result ivan |
| 19:00 | dpritchett | ohh, i didnt understand how map worked with multiple collections |
| 19:00 | dpritchett | i only ever used it with a single collection |
| 19:00 | ivan | yep, it can do that :) |
| 19:14 | uvtc | weavejester: filed the issue, <https://github.com/technomancy/leiningen/issues/575>, but technomancy pointed out that it's actually a bug in Clojure (#CLJ-130) |
| 19:15 | weavejester | uvtc: Okay :) |
| 19:33 | KognizantKog | Hi, guys. I am currently learning clojure and was wondering if anyone knew of any examples of using XNA with ClojureCLR? I've tried searching, but came up with nothing. Just curious. |
| 19:52 | locojay | hi i m new to clojure. how can i map a function over a sequence the function takes two args one fixed and an iterator. (defn funtomap [val1,val1] (+ val1, val2)) now need to map funcmap to a vec [1,2,3] with a fixed value for val1 say 5 to get [6,7,8] |
| 19:53 | thearthur | locojay: (repeat [5]) |
| 19:54 | thearthur | err (repeat 5) |
| 19:54 | thearthur | no [] |
| 19:55 | thearthur | (map + [1 2 3] (repeat 5)) |
| 19:55 | locojay | thearthur: thanks |
| 20:05 | gfredericks | ,(map (partial + 5) [1 2 3]) |
| 20:05 | clojurebot | (6 7 8) |
| 20:06 | thearthur | ,(8) |
| 20:06 | clojurebot | #<ClassCastException java.lang.ClassCastException: java.lang.Long cannot be cast to clojure.lang.IFn> |
| 20:07 | thearthur | ,'(8) |
| 20:07 | clojurebot | (8) |
| 20:07 | tomoj | is it impossible to extend ISeqable etc to the arguments objects in js? |
| 20:08 | thearthur | hehe the 8) renders as an emoticon in Colloquy, clojure bot is happy to see me |
| 20:09 | tomoj | `(function() {return arguments.__proto__;})(1) == Object.prototype` returns true :'( |
| 20:11 | thearthur | ,`(function() {return arguments.__proto__;})(1) == Object.prototype` |
| 20:11 | clojurebot | #<ExecutionException java.util.concurrent.ExecutionException: java.lang.RuntimeException: EOF while reading> |
| 20:11 | thearthur | ,(function() {return arguments.__proto__;})(1) == Object.prototype |
| 20:11 | clojurebot | #<ExecutionException java.util.concurrent.ExecutionException: java.lang.RuntimeException: EOF while reading> |
| 20:11 | tomoj | in javascript of course |
| 20:12 | thearthur | ,(symbol ":'(") |
| 20:12 | clojurebot | :'( |
| 20:12 | gfredericks | ,:-D |
| 20:12 | clojurebot | :-D |
| 20:13 | thearthur | much easier to make clojurebot happy than sad |
| 20:16 | locojay | theatur : strange this does not work in my case on this https://gist.github.com/2663252 mq is zmqhelper |
| 20:16 | locojay | https://github.com/imatix/zguide/blob/master/examples/Clojure/zhelpers.clj |
| 20:17 | locojay | mq/send-more does not even get called |
| 20:19 | hiredman | ~map |
| 20:19 | clojurebot | map is hard |
| 20:19 | hiredman | ~map |
| 20:19 | clojurebot | map and the other sequence functions used to be lazy, but with the advent of chunked sequences, may or may not be lazy, consult your local ouija board |
| 20:19 | hiredman | ~map |
| 20:19 | clojurebot | map is hello, my name |
| 20:19 | hiredman | ~map |
| 20:19 | clojurebot | map is lazy |
| 20:19 | thearthur | locojay: map is lazy |
| 20:19 | hiredman | thats the one |
| 20:19 | locojay | ah k |
| 20:20 | thearthur | ~last |
| 20:20 | clojurebot | It's greek to me. |
| 20:20 | gfredericks | clojurebot: last is not lazy |
| 20:20 | clojurebot | In Ordnung |
| 20:23 | locojay | ~doseq |
| 20:23 | clojurebot | doseq is like for, but for side effects instead of values |
| 20:23 | locojay | and works in this case :) |
| 20:40 | muhoo | ~greek |
| 20:40 | clojurebot | Excuse me? |
| 20:40 | muhoo | ~opa! |
| 20:40 | clojurebot | Titim gan éirí ort. |
| 20:40 | muhoo | it's irish tome |
| 20:40 | muhoo | to me |
| 20:43 | amalloy | can someone confirm for me that in (extend-type Foo Proto (proto-fn [this] (.blah this))), the `this` object is typehinted so that .blah is fast? |
| 20:49 | tomoj | so I'm thinking of exposing apply in mori (I have an underscore.js mixin for this currently). but it would be nice if it would work on `arguments` too. unfortunately it seems impossible to extend ISeqable to arguments. any workaround ideas? I thought of having `mori.arguments()` return the arguments as an array, but that seems impossible too |
| 20:49 | dnolen | amalloy: it is, otherwise core.logic would be dog slow. |
| 20:53 | _KY_ | I'm using enclojure, built the hello world project, but when run it says <cannot find main class>. what to do? |
| 20:55 | dnolen | if anybody wants to help w/ documenting Mori that would be awesome :) |
| 20:57 | gfredericks | in core.logic, if a goal has several clauses that are quite similar, should it be possible to refactor out the similarities without using macros? |
| 20:57 | tomoj | dnolen: how do you build it for node.js? was getting main-cli-fn problems trying to just change the target to :nodejs |
| 20:57 | gfredericks | nevermind that is a silly and nebulous question. |
| 20:58 | rbxbx | dnolen: it seems pretty well documented to me, what did you have in mind? |
| 20:59 | tomoj | (setting *main-cli-fn* to a noop at the bottom of mori.cljs didn't help) |
| 20:59 | dnolen | tomoj: npm build run |
| 20:59 | dnolen | rbxbx: heh, well documented for fp heads and Clojure users :) |
| 20:59 | tomoj | package.json missing? |
| 20:59 | tomoj | oh I can steal it |
| 21:00 | dnolen | rbxbx: would be nice to get Underscore.js level of documentation. |
| 21:00 | amalloy | dnolen: thanks |
| 21:00 | dnolen | rbxbx: for JS devs. |
| 21:00 | dnolen | tomoj: steal it? it's in the repo |
| 21:01 | tomoj | ah, pulled, thanks, |
| 21:01 | rbxbx | dnolen: marginalia style? |
| 21:02 | rbxbx | dnolen: it might be nice to have a side by side – when you would do x in JS, you could do y if you were using mori... not sure if that belongs in docs though? |
| 21:03 | dnolen | rbxbx: side by side would be nice - but just having the usage like Underscore.js would be enough I think. |
| 21:03 | dnolen | rbxbx: what I would truly love |
| 21:04 | dnolen | rbxbx: fancy intro page a la Handlebar.js + Underscore.js doc page. |
| 21:04 | zanes | Does defrecord give me a test function as well? |
| 21:05 | rbxbx | dnolen: ooo, indeed. Hadn't seen Handlebar.js's homepage before. Very well done. |
| 21:09 | rbxbx | dnolen: I may take a stab at that tomorrow, not sure I have the bandwidth tonight. It would also have the pleasant side-effect of forcing me to understand what everything in Mori does ;) |
| 21:10 | gfredericks | either the core.logic != macro is deeply hard for me to understand or else the README has a typo. |
| 21:10 | dnolen | rbxbx: that would awesome :) |
| 21:11 | dnolen | gfredericks: != is a bit strange - it's a disequality constraint |
| 21:12 | gfredericks | dnolen: I read the docstring and still cannot explain the readme |
| 21:12 | gfredericks | if it weren't for the readme I would assume I understood != |
| 21:13 | dnolen | gfredericks: it just guarantees that two terms can never unify. |
| 21:13 | gfredericks | dnolen: so (!= [x 2] [y 1]) should have no effect, since (not= 2 1), right? |
| 21:13 | dnolen | (!= [x 1] [2 y]) |
| 21:13 | amalloy | anyone remember what {:static true} means on a defn? it looks to me like the current version of the compiler completely ignores it, i just want to make sure that's true |
| 21:13 | gfredericks | ah okay; so typo it is |
| 21:15 | technomancy | amalloy: yeah, it's ignored now. it was an experiment for an opt-in way to turn off ^:dynamic-by-default, but it never worked quite right |
| 21:15 | dnolen | gfredericks: oops, fixed now |
| 21:16 | dnolen | gfredericks: I think someone had mentioned that before but it wasn't clear to me it was I typo |
| 21:16 | gfredericks | dnolen: looks great, thanks |
| 21:17 | technomancy | leiningen 2.0.0-preview4 released |
| 21:18 | technomancy | `lein upgrade` should pull it in if you're on preview3 |
| 21:37 | lynaghk` | technomancy: wooo, thanks. |
| 21:42 | brehaut | dnolen: do you need JDK7 to build mori now that its got reducers? |
| 21:42 | dnolen | brehaut: haha no :) |
| 21:42 | dnolen | brehaut: ain't no fork/join in JS :) |
| 21:43 | brehaut | dnolen: hmm. i get "ERROR - required "clojure.core.reducers" namespace never provided |
| 21:43 | brehaut | goog.require('clojure.core.reducers');" trying to build |
| 21:43 | dnolen | brehaut: yes this has been plaguing everyone all day :) |
| 21:43 | dnolen | brehaut: you need to create the checkouts directory |
| 21:43 | brehaut | aah :) sorry about that |
| 21:43 | dnolen | brehaut: you need to clone ClojureScript repo into there as clojurescript |
| 21:43 | dnolen | brehaut: then you can build. |
| 21:44 | dnolen | brehaut: it's says that in the instructions, but I guess people are excited and skimming :) |
| 21:44 | brehaut | dnolen: i havent reread the instructions since last night |
| 21:44 | dnolen | brehaut: oh yeah, sorry - instructions have changed a bit. |
| 21:45 | brehaut | so i see, sorry to be an arse then |
| 21:45 | brehaut | dnolen: it looks like mori is missing juxt ? |
| 21:45 | brehaut | and i guess its pair which amalloy has called knit in useful |
| 21:46 | dnolen | brehaut: if you add it and send I pull request I will merge it. |
| 21:46 | brehaut | cool :) |
| 21:46 | dnolen | send a pull |
| 21:46 | brehaut | got to write it and build it first ;) |
| 21:46 | brehaut | 'write it' |
| 21:51 | _KY_ | Can I mix java and clojure code in the same project? |
| 21:51 | jasonjckn | _KY_: yes |
| 21:52 | jasonjckn | _KY_: you can mix any JVM language |
| 21:52 | technomancy | well |
| 21:52 | technomancy | currently Leiningen only has plugins for Java, Scala, and Groovy |
| 21:52 | technomancy | though IIRC there's one for JRuby in development |
| 21:53 | _KY_ | I'm using intelliJ now |
| 22:00 | brehaut | crap. need to learn asciidoc |
| 22:00 | brehaut | or soething? |
| 22:00 | brehaut | oh, no i just apparently dont understand markdown |
| 22:01 | brehaut | dnolen: are you wanting to use vectors for tuple shaped stuff in mori, or JS arrays? |
| 22:08 | dnolen | brehaut: ? |
| 22:08 | brehaut | dnolen: i might be missremembering, but last night you were talking about tuples using native JS arrays |
| 22:09 | dnolen | brehaut: hmm, I'm not following, tuples where? |
| 22:09 | brehaut | dnolen: the result of juxt for instance |
| 22:09 | brehaut | in clojure(script) they are vectors but used more like tuples |
| 22:10 | dnolen | brehaut: I think Mori should cater in general to JS usability |
| 22:11 | dnolen | brehaut: in fact where it makes sense to reimplement CLJS functionality for JS usability, it probably makes sense to do so. |
| 22:11 | dnolen | brehaut: if we return an array - then CS or JS destructuring works. |
| 22:11 | brehaut | dnolen: that was my thought too |
| 22:12 | brehaut | and all the cljs functions that take seqs and vectors work sensibly when presented an array? |
| 22:12 | dnolen | brehaut: you can see this thinking in Mori - we don't use CLJS inc, dec, mod, etc. |
| 22:12 | dnolen | brehaut: yes |
| 22:12 | brehaut | right |
| 22:13 | brehaut | so you would also implement identity and constantly from scratch too? |
| 22:13 | dnolen | brehaut: only if they aren't already single arity. |
| 22:13 | dnolen | brehaut: CLJS multiy arity fns are costly. |
| 22:14 | dnolen | brehaut: but code generated for single arity CLJS fns is good. |
| 22:15 | brehaut | ok cool |
| 22:15 | brehaut | dnolen: i'll send a pull request for juxt and knit, but i think we might want to reconsider using arrays instead of vectors |
| 22:16 | dnolen | brehaut: what do you mean reconsider? |
| 22:16 | brehaut | dnolen: well at the moment ive just used vectors for tuple-y values |
| 22:17 | brehaut | dnolen: https://github.com/brehaut/mori/blob/master/src/mori.cljs#L105-107 |
| 22:17 | brehaut | bbs |
| 22:17 | brehaut | got to run an errand |
| 22:23 | austinh | I didn't understand why ":refer :all" wasn't doing anything. Turns out that it's because that feature is in Clojure 1.4, which I thought I was using (but didn't know that was a new feature anyway, since I'm new to Clojure), and Noir was silently forcing me to use 1.3. |
| 22:24 | austinh | I'm happy I was able to figure it out in less than 20 minutes, since there wasn't much immediate info to go on. |
| 23:00 | gfredericks | what are the implications of the "Non-relational." markers in the core.logic docstrings? |
| 23:02 | jasonjckn | gfredericks: basically you can't pass fresh variables to non-relational goals |
| 23:03 | gfredericks | huh. thanks. |
| 23:03 | jasonjckn | gfredericks: does that make sense? |
| 23:03 | gfredericks | I think so |
| 23:04 | jasonjckn | gfredericks: i always thought of run* in terms of how it searched for successful goals |
| 23:04 | gfredericks | will it crash if I do or just silently act unexpectedly? |
| 23:04 | jasonjckn | i forget what happens |
| 23:04 | gfredericks | :) okay |
| 23:04 | jasonjckn | ,(run* [q] (== q 3)) |
| 23:04 | clojurebot | #<CompilerException java.lang.RuntimeException: Unable to resolve symbol: run* in this context, compiling:(NO_SOURCE_PATH:0)> |
| 23:05 | jasonjckn | ,(clojure.core.logic/run* [q] (== q 3)) |
| 23:05 | clojurebot | #<ExecutionException java.util.concurrent.ExecutionException: java.lang.RuntimeException: java.lang.ClassNotFoundException: clojure.core.logic> |
| 23:07 | jasonjckn | non-relational goals can be written in pure clojure (project [x] (== true (even? x)) |
| 23:08 | jasonjckn | if you were to pass fresh variable x, there's no way it could bind x to all the even numbers |
| 23:08 | gfredericks | I wasn't prepared to have to think about whether any of my variables were fresh at arbitrary points |
| 23:08 | jasonjckn | but if x was already bound to some set, it would run this even? test on the entire set |
| 23:08 | gfredericks | but I'm still not certain I need the non-relational goals, or that they could solve my problem |
| 23:09 | jasonjckn | gfredericks: Well I know of 2 ways to think about it |
| 23:09 | jasonjckn | the first way is purely in terms of relations from math |
| 23:09 | gfredericks | that is more ways than I expected |
| 23:09 | jasonjckn | and everythings declarative |
| 23:09 | jasonjckn | that way is fine, so long as you don't have non-relational goals |
| 23:09 | jasonjckn | the second way is in terms of a search algorithm |
| 23:10 | jasonjckn | which is what you need to do for non-relational goals |
| 23:10 | jasonjckn | the search ordering corresponds to your statement ordering |
| 23:10 | jasonjckn | So (run* [q] (== q 3) (project [q] (== true (even? q))) |
| 23:11 | jasonjckn | is fine because the first goal gets executed |
| 23:11 | jasonjckn | and q is bound to set {3} |
| 23:11 | jasonjckn | then the project happens and q is bound to {} |
| 23:11 | jasonjckn | but if you reverse the goals it's not valid anymore |
| 23:11 | gfredericks | yeah; it just requires more care |
| 23:11 | jasonjckn | I made these models up in my head, so use them with caution :) |
| 23:12 | jasonjckn | i haven't actually read the implementation of the search |
| 23:13 | gfredericks | jasonjckn: that was helpful, thanks. |
| 23:30 | Raynes | wtetzner: Dear Sir, thank you for exploding-fish. Evaluation of all of the existing Clojureish URI libraries has lead me to believe that your offering is top notch and for that, I thank you. You are a gentleman and a scholar, and I think we are to be the best of friends. |
| 23:40 | echo-area | Hello |
| 23:41 | echo-area | I've simplified the program that reproduces stack overflow a little bit. I'm still trying to simplify it further, but it now can be shared with you to reproduce it. http://pastebin.com/AUJsEV0z <-- Please take a look at it. Does anyone have a clue? |
| 23:44 | Raynes | Actually, whoa. |
| 23:44 | Raynes | https://github.com/Raynes/exploding-fish/blob/master/src/org/bovinegenius/exploding_fish/query_string.clj#L33 Association lists? O_O |
| 23:44 | amalloy | echo-area: it's exactly what hiredman told you last night. you're building up a big chain of lazy-seqs stacked on top of each other - each call to keep returns a new lazy seq, which has to force the seq below it before it can get anything |
| 23:45 | amalloy | $google clojure stackoverflow dbyrne prime sieve |
| 23:45 | lazybot | [recursion - Recursive function causing a stack overflow - Stack ...] http://stackoverflow.com/questions/2946764/recursive-function-causing-a-stack-overflow |
| 23:46 | echo-area | amalloy: Okay, it maybe my mistake. Currently it happens only at the end of the file, each of the lazy-seq does nothing but trying to get nil. How would I fix it then? |
| 23:47 | amalloy | i don't think you read that entire SO answer in under a minute. i suggest you read the article i linked to, understand the problem, and then decide on a solution that's suitable for your use case. i certainly don't know what's right for you |
| 23:48 | echo-area | amalloy: If I reduce the input file's lines, there will be no stack overflow. How do you explain this behavior? |
| 23:48 | echo-area | Okay, I didn't see that link when I post these messages. |
| 23:48 | echo-area | Let me read it |
| 23:52 | PeregrinePDX | It sounds like something you're doing is holding onto the head of your lazy-seq and you're realizing the entire seq. Multiple times... So you have multiple copies of the 10,000 line file in memory at once. Although I am a clojure newbie so I might be completely wrong and I didn't look at your code. |
| 23:52 | amalloy | PeregrinePDX: no |
| 23:53 | amalloy | that leads to a heap overflow, not a stack overflow |
| 23:55 | PeregrinePDX | Fair enough. Like I said I'm a newbie. |
| 23:55 | echo-area | What's the default max JVM stack size, BTW? |
| 23:55 | amalloy | it varies by your JVM implementation. something around 2k is normal, i think |
| 23:55 | echo-area | Okay |
| 23:55 | amalloy | (2k frames, that is. not sure how many bytes) |
| 23:56 | echo-area | Yes, what I meant was too frame size |
| 23:56 | echo-area | Sorry for the ambiguity |
| 23:59 | _KY_ | Finding a clojure IDE is a game of finding out at which point in time you'd give up on an IDE saying its unusable... 2 down, one more to go =( |