2012-11-26
| 00:29 | devn | Madison Square Clabango |
| 00:30 | dnolen | wow can finally round trip js html 5 source map to CLJ data structure and back to js html 5 source map |
| 00:30 | devn | ! |
| 00:30 | devn | that's great |
| 00:31 | dnolen | yes so damn close now |
| 00:31 | dnolen | just need to merge CLJS compiler map w/ closure map ... |
| 00:31 | devn | dnolen: recently i started working on a client project and found they're using google closure |
| 00:31 | devn | i just about jumped out of my seat |
| 00:31 | devn | my first experience with gclosure outside of clojurescript |
| 00:32 | dnolen | most obnoxious 80 lines of Clojure I've ever written ... grumble |
| 00:32 | devn | :) |
| 00:32 | devn | dnolen: any ideas on cutting it down to size? |
| 00:32 | devn | or is it necessarily large? |
| 00:33 | dnolen | cutting what down to size? |
| 00:34 | devn | the 80 lines |
| 00:34 | dnolen | maybe but I don't want to work on it anymore, I've already spent a few days on it - it works |
| 00:35 | devn | dnolen: is this (https://github.com/devn/codeq-playground) wortwhile at all, do you think? |
| 00:36 | dnolen | devn: yeah that looks pretty awesome - hope to find some time to actually try it out. |
| 00:36 | devn | i was thinking about having an open project which is just a bunch of codeq queries |
| 00:36 | dnolen | I think that's super useful - seeing as hardly anyone knows how to use codeq :) |
| 00:36 | devn | haha, well partly this came about as i was trying to write some docs for the codeq wiki |
| 00:37 | devn | i think the hardest part of the whole thing is just the packaging of datomic |
| 00:37 | devn | i wish we had `apt-get install datomic` and `brew install datomic` |
| 00:37 | devn | i wrote a formula, but the hombrew guys said "ewww" |
| 00:37 | devn | and rightly so |
| 00:37 | devn | homebrew* |
| 00:37 | devn | bin/* contains a lot of stuff |
| 00:38 | devn | i still need to figure out how to fill out the codeq wiki, but im thinking we need a sort of clojurescript-esque approach until packaging is taken care of |
| 00:38 | devn | ./script/get-datomic, etc. |
| 01:00 | bbloom | dnolen: w00t on source maps |
| 01:00 | bbloom | dnolen: are they playing nice with the web kit sources tab yet? |
| 01:11 | dnolen | bbloom: not quite there yet, putting in the finishing touches now |
| 01:12 | dnolen | bbloom: hardest thing was just making sure we could encode and decode and get the same thing |
| 01:13 | nightfly_ | aw hell, are there times where you have to manually macroexpand when making a macro that will have other macros nested inside of it when invoked? |
| 01:14 | bbloom | dnolen: cool. i'm starting to write more and more cljs code outside of the compiler itself |
| 01:14 | bbloom | dnolen: would really enjoy the source mappings :-) |
| 01:15 | dnolen | bbloom: yes, yes, I know :) |
| 01:16 | bbloom | dnolen: I'm really liking the way my little dom manipulation library is shaping up. it's taking longer than i expected but the result is more and more enjoyable |
| 01:17 | bbloom | dnolen: I actually have a working prototype where i have some code of pure functions which returns a (what i'm calling) DomScript program |
| 01:17 | bbloom | dnolen: then there is an interpreter that executes that program on a stack machine DSL. that same program can be printed, sent to the server, and send back down to another browser :-) |
| 01:17 | bbloom | so i can mirror browser manipulations on other browsers :-) |
| 01:18 | bbloom | it's pretty damn neat |
| 01:19 | bbloom | dnolen: slightly more awkward to use than domina or jquery for small cases, but far nicer to work with for larger dom transformations |
| 01:21 | dnolen | sounds interesting - looking forward to a write up |
| 01:23 | bbloom | dnolen: i'm probably gonna write it up and release it in pieces, starting with the stack language |
| 01:23 | bbloom | dnolen: it's heavily inspired by www.factorcode.org |
| 01:29 | tomoj | nightfly_: I've done that sometimes |
| 01:37 | jyu | does anybody share why you use datomic? |
| 01:44 | wingy | jyu: its db done correct |
| 01:48 | jyu | the free version cannot integrated with infinispan and so on, I might not be able to use in the real world if the company does not want to buy the commercial one. |
| 01:49 | wingy | jyu: its ridiculous that they don't wanna pay for good techs |
| 01:49 | wingy | it's like wanting to use heroku but not wanting to pay for it |
| 01:51 | bbloom | wingy: I agree that people should want to pay for good tech, but i don't think it is wise to build a business on top of somebody's closed source software |
| 01:52 | wingy | bbloom: i agree on that one .. they should definitely open source it |
| 01:52 | bbloom | wingy: I wouldn't build my business on a closed source database, simply because I've seen several older businesses become hilariously dependent on insane implementation details of Oracle |
| 01:52 | p_l | well... is it their core money bringer? |
| 01:52 | bbloom | wingy: meanwhile, oracle just keeps jacking their licensing fees |
| 01:52 | p_l | bbloom: that's Oracle-specific problem, actually |
| 01:53 | bbloom | p_l: no it isn't |
| 01:53 | bbloom | p_l: I used to work for microsoft |
| 01:53 | bbloom | p_l: I've seen it plenty of times |
| 01:53 | bbloom | p_l: you should not build your business on closed source software |
| 01:53 | bbloom | period. |
| 01:53 | bbloom | p_l: or, let me clarify |
| 01:54 | bbloom | p_l: it can be "closed" source, as long as i get a copy of the source when i buy it |
| 01:54 | bbloom | p_l: and if you go out of business, i can carry on with the code base |
| 01:54 | bbloom | and you can't just keep jacking the licensing costs annually |
| 01:55 | wingy | when i add (file/wrap-file "public") as a middleware Light Table says it cannot find folder "public" .. this is a path related issue .. how can I fix this so public can be found? |
| 01:55 | p_l | bbloom: well, I know less about MS, but afaik Oracle and MS SQL got the craziest licensing all-around, with SQL Server usually getting ahead by "being cheaper than Oracle" |
| 01:55 | bbloom | p_l: which isn't cheap :-P |
| 01:55 | p_l | as for Oracle... Ellison makes money sharks look like generous fuzzy kittens |
| 01:55 | bbloom | heh. |
| 01:56 | bbloom | the point is: datomic is super mega awesome cool |
| 01:56 | wingy | I don't like that dude .. he thinks he owns the world |
| 01:56 | bbloom | and i'd happily pay rich hickey and company money for datomic and all the other cool stuff they've done |
| 01:56 | bbloom | but i won't build a business on datomic unless i can be sure that it's not undue business risk |
| 01:56 | p_l | but they need to make a source license as well? |
| 01:56 | wingy | bbloom: me too .. tell them to open source it! |
| 01:57 | p_l | wingy: you should not open source the core money bringer without very careful planning |
| 01:57 | bbloom | p_l: I dunno, consider Havok Physics engine |
| 01:57 | bbloom | it's a pretty popular middleware system |
| 01:57 | bbloom | used by LOTS of AAA games |
| 01:57 | wingy | look at mongodb .. its pretty awesome business model |
| 01:57 | p_l | OTOH, if you open source it with AGPL, I'm flat out calling you for being money grubbing license terrorist |
| 01:57 | bbloom | each license comes with the source code |
| 01:57 | bbloom | i like the havok model |
| 01:58 | bbloom | but games are a little easier |
| 01:58 | p_l | bbloom: gamedev stuff usually comes with source code, outside of big complete engines with "lite" licenses for just binaries |
| 01:58 | bbloom | because your license covers "titles" |
| 01:58 | bbloom | titles generally have a discreet ship date |
| 01:58 | bbloom | so your business isn't locked in for the next title |
| 01:58 | bbloom | services are generally a little different |
| 01:58 | bbloom | because you don't have a gold master print it to DVD version of a web service |
| 01:58 | p_l | bbloom: not only that, it's just that in gamedev, you often *need* the source to get the project to build, let alone fly :) |
| 01:58 | wingy | should i use wrap-resource instead of wrap-file for Light Table to be able to find the folder? |
| 01:59 | wingy | bbloom: when a company goes down they won't outsource the code? |
| 02:00 | wingy | i mean open source it |
| 02:00 | bbloom | wingy: no, generally not |
| 02:00 | p_l | wingy: depends on how they go down |
| 02:00 | wingy | so all clients are just fucked? hmm |
| 02:00 | bbloom | wingy: I sold my company to salesforce |
| 02:00 | bbloom | wingy: salesforce owns the software |
| 02:00 | p_l | Symbolics for example... No one fucking knows who got copyright to what |
| 02:00 | bbloom | wingy: lots of people have asked me to open source it, but that's just not my call |
| 02:01 | wingy | i guess it depends on what the buying company is indenting to do with the software .. kill it .. or taking over it |
| 02:01 | wingy | bbloom: what was your company? |
| 02:01 | bbloom | wingy: http://www.crunchbase.com/company/thinkfuse |
| 02:02 | wingy | gj |
| 02:02 | bbloom | thx |
| 02:02 | bbloom | but that's why you can't depend on closed source software |
| 02:03 | bbloom | because even if you trust the current stewards, they might not be the stewards forever |
| 02:04 | bbloom | that said: datomic is super fucking cool |
| 02:04 | bbloom | and i'd love to be able to use it for a real project :-) i'm even willing to pay, heh |
| 02:05 | wingy | rich and the team behind seem to be reasonable .. perhaps they have plans of open sourcing it |
| 02:05 | brainproxy | dnolen: now that fressian is open source, is it something you'll be looking to leverage w/in core.logic? |
| 02:06 | bbloom | brainproxy: what's fressian? |
| 02:06 | brainproxy | bbloom: https://github.com/Datomic/fressian |
| 02:07 | brainproxy | it's the binary data library used interally by datomic |
| 02:07 | bbloom | brainproxy: interesting |
| 02:08 | bbloom | brainproxy: am i right in assuming BISON : JSON :: Fressian : EDN ? |
| 02:08 | brainproxy | i think that's the basic idea |
| 02:09 | bbloom | interesting |
| 02:09 | p_l | bbloom: personally, for "breadwinner" code, I wouldn't "open source" it, but give exclusive licenses to source code for my customers |
| 02:10 | bbloom | p_l: yeah, that's what i'm saying |
| 02:12 | p_l | OTOH, I once had a very, very evil idea on how to "open" some source code |
| 02:12 | p_l | provide the code, but not the compiler or language spec :> |
| 02:15 | bbloom | brainproxy: how does it relate to core.logic tho? |
| 02:23 | jyu | what make the datomic special |
| 02:25 | bbloom | jyu: there are a bunch of videos on the datomic site |
| 02:25 | bbloom | jyu: watch them :-) |
| 02:26 | bbloom | jyu: and http://www.infoq.com/author/Rich-Hickey too |
| 02:26 | jyu | bbloom: thanks |
| 02:26 | brainproxy | bbloom: I remember dnolen saying something about how fressian gave datomic's datalog performance characteristics that would not be easy to match w/o something similar |
| 02:27 | bbloom | brainproxy: hmm |
| 02:28 | brainproxy | bbloom: i may have misunderstood that comment/observation |
| 02:28 | Nocab | but some of the things Id like to try in clojure depends on local mutable state inside functions |
| 02:28 | bbloom | Nocab: you can create atoms and use swap! or reset! |
| 02:28 | Nocab | is there are conventional or idiomatic way to do that in clojure? |
| 02:28 | brainproxy | Nocab: setup an atom w/in a let |
| 02:28 | bbloom | (doc atom) |
| 02:28 | clojurebot | "([x] [x & options]); Creates and returns an Atom with an initial value of x and zero or more options (in any order): :meta metadata-map :validator validate-fn If metadata-map is supplied, it will be come the metadata on the atom. validate-fn must be nil or a side-effect-free fn of one argument, which will be passed the intended new state on any state change. If the new state is unacceptable, the validate-fn should return fa |
| 02:28 | bbloom | er: |
| 02:28 | bbloom | yeah, ok apparently that works without , or & |
| 02:29 | bbloom | haha |
| 02:30 | brainproxy | Nocab: leiningen is your friend in that regard, if you don't have it setup already |
| 02:31 | brainproxy | simple as `lein repl` |
| 02:31 | Nocab | brainproxy: can the atom be anything? am I reading this correct, if I assume the atom here is a mutable map? |
| 02:31 | Nocab | http://clojure.org/atoms |
| 02:31 | Nocab | brainproxy: no worry |
| 02:31 | brainproxy | Nocab: you can stick what you want inside the atom |
| 02:31 | Nocab | I do have lein and sublime-text setup reasonably well :) |
| 02:31 | brainproxy | then use reset! or swap! |
| 02:32 | Nocab | http://clojuredocs.org/clojure_core/clojure.core/reset! |
| 02:32 | Nocab | this page seems to have all my needs covered |
| 02:32 | Nocab | thanks :) |
| 02:32 | brainproxy | if you use swap!, then w/in the fn you pass as an argument, you'll likely use "regular" immutable semantics for operating on, say, a map you have stored in the atom |
| 02:32 | Nocab | mmm |
| 02:32 | brainproxy | and yeah, clojuredocs is nice |
| 02:33 | brainproxy | http://clojuredocs.org/clojure_core/clojure.core/swap! |
| 02:33 | Nocab | so |
| 02:33 | brainproxy | if you're planning on sticking a hash-map inside your atom, then swap! is probably the way to go |
| 02:33 | Nocab | mmhm |
| 02:34 | Nocab | as for something completely different |
| 02:34 | Nocab | anyone here use sublime-text for their clojure needs? |
| 02:34 | brainproxy | emacs24 ftw! :) |
| 02:34 | Nocab | I have pretty much -everything- setup as I like, but I cannot get the sublimerepl plugin to work properly |
| 02:34 | Nocab | brainproxy: I tried that setup, its OK. but I sublime-text has won me over quickly ;) |
| 02:34 | bbloom | mostly emacs and vim guys around here :-) |
| 02:35 | bbloom | sublime is pretty tho, that's for sure |
| 02:35 | Nocab | it just feels more lightweight and nimble than emacs |
| 02:35 | Nocab | and its available for all the platforms I care about, so Im giving it a spin ;) |
| 02:36 | brainproxy | i reach for BBEdit when I'm feeling lazy and don't want to take time to figure out how to do something w/ my emacs |
| 02:36 | Nocab | heh |
| 02:41 | tomoj | bbloom: what do you think of having a special kind of future-promises (I'm calling them "tasks") that bind themselves into their dynamic scope so that tasks created inside that scope will be failed when the parent task fails? |
| 02:42 | bbloom | tomoj: I'm too tired to deeply consider this problem now :-P |
| 02:42 | bbloom | tomoj: ask me again tomorrow :-) |
| 02:42 | tomoj | no prob |
| 02:42 | bbloom | i do find this stuff interesting tho |
| 02:42 | tomoj | hopefully I'll have a fork of cljque with that working tomorrow |
| 02:48 | Nocab | tomoj: sounds like C#'s TPL ;) |
| 02:50 | bbloom | Nocab: it's exactly like C#'s TPL |
| 02:50 | bbloom | Nocab: the C# guys deserve a lot of credit for their work on parallel and reactive libraries |
| 02:51 | bbloom | in general, the C# team has done a stellar job of neatly packaging brilliant ideas from cutting edge and sadly forgotten better-is-better tech of yore |
| 02:51 | Nocab | heh |
| 02:51 | Nocab | I like C# |
| 02:51 | bbloom | i do to, i much prefer it to java |
| 02:51 | Nocab | the thing I like -least- about C# is the lacking type-inference in the compiler |
| 02:51 | Nocab | it cant infer return types |
| 02:51 | bbloom | i blame C# 3 and Linq for getting me into functional programming :-) |
| 02:52 | Nocab | making you have to declare a billion generic type-signatures if you want to do any sort of cool funcitonal programming |
| 02:52 | Nocab | and then all those type-signatures removes all the gain the functional programming would have gotten you code wise |
| 02:52 | Nocab | that sort of stuff annoys me |
| 02:52 | bbloom | *shrug* it's not for you :-) |
| 02:52 | Nocab | but I may be using C# in other ways than Anders Heljberg anticipated :P |
| 02:53 | bbloom | the goal of C# is to drag cube moneys half way around kicking and screaming to lisp |
| 02:53 | Nocab | hah |
| 02:53 | bbloom | it accomplishes that mission quite well |
| 02:53 | Nocab | anyway. care to tell me what Im doing wrong here? |
| 02:53 | bbloom | moneys -> monkeys |
| 02:53 | Nocab | http://pastebin.com/nQTp8rKP |
| 02:54 | bbloom | 1) use refheap :-) |
| 02:54 | tomoj | 2) whitespace :P |
| 02:54 | bbloom | reset! isn't being called |
| 02:54 | bbloom | you need () around that |
| 02:55 | Nocab | indeed |
| 02:55 | Nocab | my bad |
| 02:55 | Nocab | it was initially written as a #() lambda |
| 02:55 | Nocab | so I guess I forgot to re-wrap it when rewriting it :) |
| 02:55 | Nocab | thanks |
| 02:55 | bbloom | entertainingly |
| 02:55 | bbloom | this thing you're making |
| 02:55 | bbloom | with get and set |
| 02:55 | bbloom | it's basically the same as the underlying atom it's wrapping :-P |
| 02:56 | Nocab | this is just a simplest-possible function-local mutable structure POC for me, myself |
| 02:56 | bbloom | yup, it's totally reasonable for learning |
| 02:56 | Nocab | now that I see it's working, I can expand it to be useful ;) |
| 02:56 | tagrudev | hello, I've cloned this repo -> https://github.com/stuarthalloway/programming-clojure and now I am trying to require the examples in src/examples, how can I do this ? |
| 02:57 | tagrudev | in repl |
| 02:57 | bbloom | tagrudev: are you using `lein repl`? |
| 02:57 | tagrudev | yes |
| 02:57 | bbloom | tagrudev: or rather, ./script/repl here? |
| 02:57 | tagrudev | lein repl |
| 02:57 | bbloom | k |
| 02:58 | bbloom | use: |
| 02:58 | bbloom | (doc require) |
| 02:58 | clojurebot | "([& args]); Loads libs, skipping any that are already loaded. Each argument is either a libspec that identifies a lib, a prefix list that identifies multiple libs whose names share a common prefix, or a flag that modifies how all the identified libs are loaded. Use :require in the ns macro in preference to calling this directly. Libs A 'lib' is a named set of resources in classpath whose contents define a library of Clojure |
| 02:58 | bbloom | examples on clojure docs |
| 02:58 | bbloom | http://clojuredocs.org/clojure_core/clojure.core/require |
| 02:59 | Bergle_1 | noob question. [this is extracted from something else]. Why doesnt this work -- (doseq [[y] (range 10)] (println y)) |
| 02:59 | Bergle_1 | get error - nth not supported on this type |
| 02:59 | bbloom | Bergle_1: the [y] binding is trying to unpack a vector |
| 03:00 | bbloom | doseq inherently unpacks a sequence |
| 03:00 | Bergle_1 | oh duh. |
| 03:00 | bbloom | you want (doseq [y (range 10)] (println y)) |
| 03:00 | Bergle_1 | i chased my tali for 30 min now on that |
| 03:00 | Bergle_1 | thankyou |
| 03:00 | Bergle_1 | i knew it had to be soemthing dumb. |
| 04:15 | cgrand | morning @cemerick |
| 04:16 | cemerick | cgrand: good morning! :-) |
| 04:16 | clojurebot | Cool story bro. |
| 04:17 | HolyJak | which reminds me, cemerick, I've recently seen your Intro to Clojure screencast with url shortener, great job! I'm recommending it to all participants of our recent clojure intro workshop :-) |
| 04:17 | cemerick | cgrand: I see you've been tinkering with map perf and such. What's prompted that? |
| 04:17 | cemerick | HolyJak: Glad you liked it :-) |
| 04:19 | cgrand | cemerick: profiling/optimizing on a client project |
| 04:20 | cemerick | That's great. I had no idea you had snagged work that involved Clojure. |
| 04:24 | cgrand | cemerick: well my legacy (and local) clients are non-clojure as you know but for years now I have had Clojure gigs |
| 04:25 | cemerick | Huh. I suppose I forgot, if I knew that already. |
| 04:28 | xumingmingv | ,(type (int 10)) |
| 04:28 | clojurebot | java.lang.Integer |
| 04:28 | xumingmingv | found an interesting thing |
| 04:29 | xumingmingv | if you execute this form: "(type (int 10)) " in a `lein repl` , the result will be "java.lang.Long" |
| 04:30 | xumingmingv | while if you execute the same form in the regular REPL, the result is "java.lang.Integer" |
| 04:30 | xumingmingv | anyone knows why? |
| 04:33 | cemerick | xumingmingv: your lein REPL is running 1.3.0, the "regular" REPL is running probably 1.4.0. |
| 04:36 | xumingmingv | yeah, that's indeed my situation.. |
| 06:13 | Anderkent | Is there a way to tell clojure.pprint to print out meta? *print-meta* doesn't seem to work |
| 07:36 | Anderkent | Anyone know why defmulti checks whether the name is already def'ed? It messes up my code coverage tool attempts :P |
| 07:36 | Anderkent | ,(source defmulti) |
| 07:36 | clojurebot | Source not found |
| 07:37 | Anderkent | geh. |
| 08:55 | hotwoofy | does anyone know if there's a convenient Slingshot selector syntax to match the data part of exceptions generated with ex-info? if i throw (ex-info "Error message" {:some :data}), then I can't seem to catch it with (catch [:some :data]). I can use throw+ to just throw just the map, I was just wondering if I was missing something about ex-info. |
| 09:01 | konr_trab | Is it possible to set an environment variable inside a lein plugin and then call another task? |
| 09:16 | mccraig | is there a stdlib function (i.e. not the (var…) special-form) which will return me a Var given a Symbol ? |
| 09:16 | cemerick | konr_trab: env vars cannot be set within the JVM |
| 09:16 | cemerick | mccraig: resolve |
| 09:17 | mccraig | thx cemerick |
| 09:52 | solussd | i know this must exist… how can I add pre/post conditions to an existing function? |
| 09:53 | solussd | or rather, take an existing function and create the same function with pre/post conditions |
| 09:55 | cemerick | solussd: See https://github.com/clojure/core.contracts and https://github.com/fogus/trammel |
| 09:55 | solussd | cemerick: thanks |
| 10:17 | devinus | amalloy: weren't you writing a titandb lib? |
| 10:20 | googya | (let [ {:keys [join-date email]} mm ] (println email)) how this work? |
| 10:22 | googya | Binding values to their keys’ names? |
| 10:22 | ucb | googya: mm is destructured as a map and the values for the keys are bound to the key-names |
| 10:24 | clojure-newb | hey guys, I'm using ring-json-resonse to jsonify a single result item in the response… what do I use for a collection ? |
| 10:25 | weavejester | clojure-newb: If you return a vector, ring-json-response will turn it into a JSON array |
| 10:25 | weavejester | clojure-newb: Are you using the ring/ring-json library for this? |
| 10:26 | clojure-newb | weavejester: yes I am |
| 10:26 | clojure-newb | 0.1.2 |
| 10:26 | weavejester | clojure-newb: So I usually use something like: (response (vec list-of-results)) |
| 10:27 | clojure-newb | I see, 'vdc' is key here |
| 10:27 | weavejester | clojure-newb: The reason it has to be a vector is because seqs are used for streaming in Ring. |
| 10:27 | clojure-newb | *vec |
| 10:27 | clojure-newb | sorry |
| 10:27 | clojure-newb | thx for the help |
| 10:29 | clojure-newb | weavejester: that explains why I was seeing the Transfer-Encoding: chunked header val |
| 10:47 | jweiss | i see there are no issues remaining for the leiningen 2.0.0 milestone https://github.com/technomancy/leiningen/issues?milestone=3&state=open - does that mean the current preview release is 'pretty darn close' to a release candidate or actually a release candidate? |
| 10:49 | bhenry | can anyone give me insight as to why the first run of this batch script gives a class not found error, but the second runs as expected? https://gist.github.com/59d8b537fcc5365341dc |
| 10:50 | bhenry | s/batch/bash |
| 10:50 | antares_ | jweiss: it has been "pretty darn close" for a while. The remaining bits of work are now on the clojars side. |
| 10:51 | jweiss | antares_: that's what i'm trying to figure out, if i upgrade will that missing stuff bother me? |
| 10:52 | antares_ | jweiss: every open source project I know or use is already on lein2 |
| 10:52 | antares_ | clojars changes are relevant mostly for library developers |
| 10:52 | jweiss | antares_: yeah, my project consists of several projects, some of which are libraries for others |
| 10:54 | jweiss | i quite often push snapshots to clojars. just wondering if there's some problem i might hit in lein2 |
| 10:55 | uvtc | jweiss: my understanding is that lein 1 is now legacy. |
| 10:55 | antares_ | jweiss: I haven't seen any issues with snapshot publishing via scp |
| 10:55 | antares_ | however, I do not consider myself to be completely on top of the clojars changes |
| 10:55 | antares_ | so we will see |
| 10:55 | Anderkent | Is there something like clojure.lang.LineNumberingPushbackReader, but one that assigns ^{:line} to each token, not just lists? |
| 10:55 | jweiss | uvtc: i don't understand how the 'stable' release is actually legacy but the 'current' release is still called preview? |
| 10:55 | antares_ | but so far as a long time lein2 user and maintainer of over 20+ libraries, I haven't seen any issues |
| 10:56 | jweiss | ok, good enough for me to try it out :) |
| 10:56 | antares_ | jweiss: it has been called "preview" for almost a year, at preview10 for over 1 month |
| 10:57 | jweiss | antares_: i know, but that's not really as relevant as the fact that the stable release hasn't been re-pointed at it |
| 10:57 | jweiss | there must be some reason. |
| 10:57 | uvtc | jweiss: I think what happened was, lein 2 was meant to be released a while ago, but some issues regarding the new clojars have kept that from happening. |
| 10:57 | jweiss | right, i'm trying to figure out what's blocking it and whether it'll affect me. |
| 10:57 | uvtc | jweiss: you might be able to get more specific details on #leiningen. |
| 10:57 | jweiss | ah didn't know it had its own channel |
| 10:58 | antares_ | jweiss: clojars changes have to be finished first |
| 10:58 | Anderkent | bhenry: AFAIK it's a lein bug - it will output info about dependencies being fetched to stdout instead of stderr |
| 10:58 | antares_ | because leiningen has a list of default repositories |
| 10:59 | antares_ | and if you ship it, those repositories better work and not change |
| 10:59 | Anderkent | bhenry: so the first time you run, it prints out that it's fetching *some xml file*, and you put that in -cp, which breaks java |
| 10:59 | Anderkent | bhenry: the second time it's not fetching anything so the output is right |
| 11:00 | bhenry | Anderkent: so what's the cutoff for that to run. I figured it was soemthing like that, but then nothing changes and the next time the bash script runs i have to do it twice |
| 11:02 | bhenry | Anderkent: is it per session maybe? |
| 11:22 | marcellu` | anyone know what might be causing me to have to run lein clean again everytime I change my program? Sometimes it seems like I have to run it multiple times just to get it to work. Otherwise I get a "java.lang.NoSuchMethodError: clojure.lang.RT.keyword" error |
| 11:25 | antares_ | marcellu`: this means something drags Clojure 1.2 on the classpath |
| 11:26 | marcellu` | antares_: OH ok, should be able to track it down, thanks! |
| 11:28 | antares_ | marcellu`: are you using lein2? |
| 11:28 | antares_ | if so, lein deps :tree may help you |
| 11:28 | marcellu` | antares_: yup. Thanks again! |
| 11:28 | antares_ | marcellu`: and here is how to exclude dependencies of other dependencies, e.g. clojure: https://github.com/michaelklishin/monger/blob/master/project.clj#L35 |
| 11:28 | jweiss | anyone know the equivalent to slime's ,sayoonara in nrepl.el? |
| 11:32 | marcellu` | antares_: hmm Clojure 1.2 isn't in the tree at all. Would clojure-contrib 1.2 do it? |
| 11:33 | S11001001 | jweiss: I would also like to know how to quit nrepl :) |
| 11:36 | antares_ | marcellu`: monolithic Clojure Contrib is no longer developed |
| 11:36 | antares_ | marcellu`: and won't work with 1.3 or 1.4. See http://dev.clojure.org/display/design/Where+Did+Clojure.Contrib+Go |
| 11:38 | S11001001 | ~contrib |
| 11:38 | clojurebot | Monolithic clojure.contrib has been split up in favor of smaller, actually-maintained libs. Transition notes here: http://dev.clojure.org/display/design/Where+Did+Clojure.Contrib+Go |
| 12:20 | jweiss | S11001001: nrepl-quit. not bound by default |
| 12:21 | S11001001 | jweiss: neato |
| 12:21 | S11001001 | :r |
| 12:22 | TimMc | < amalloy> (def exit (lazy-seq (System/exit 0))) |
| 12:22 | TimMc | => exit ;; done! |
| 12:22 | S11001001 | ha ha |
| 12:57 | muhoo | wait, what? |
| 12:57 | mdeboard | I'm having a scope issue with the following code: https://gist.github.com/839618e9690db68fc89d The code "stamps" a PDF with a watermark (in this case, a "Copyright protected material" statement). I want to iterate through each page in the PDF, and have tried both `doseq` and `for` for this, but each time it's only stamping the final page. This smells like a scoping issue but I'm not quite sure how to resolve it. I'd |
| 12:57 | mdeboard | appreciate any guidance on this |
| 13:01 | S11001001 | mdeboard: exchange the position of your with-open and doseq |
| 13:01 | TimMc | M-x paredit-convolute-sexp |
| 13:01 | S11001001 | mdeboard: probably the my-pdf too needs to go outside the doseq |
| 13:01 | S11001001 | mdeboard: everything inside the doseq happens *every time* |
| 13:03 | mdeboard | S11001001: If I swap lines 68 and 69, I get an "IOException Stream Closed"; closing the PdfStream object in `(fingerprint)` closes the stream apparently. |
| 13:04 | S11001001 | mdeboard: then don't do that |
| 13:05 | mdeboard | S11001001: lol, yeah. I tried before; I'm pretty sure I do need to open up a new stream each time. At least, based on the C# code from which I'm porting this piece of ... software. |
| 13:05 | S11001001 | mdeboard: then fix your loop so you open the previous output instead of the original input each time |
| 13:06 | S11001001 | mdeboard: go through the logic of stamp-pdf carefully, tracing the loops with paper if you have to |
| 13:06 | mdeboard | S11001001: How so? |
| 13:07 | S11001001 | mdeboard: see how you *always* open /home/matt/courseload/stillwaiting.pdf? |
| 13:07 | mdeboard | Yeah |
| 13:07 | S11001001 | don't do that |
| 13:07 | mdeboard | I see, that admittedly was a hack to get around another issue |
| 13:08 | mdeboard | And that issue was "com.itextpdf.text.DocumentException: The original document was reused. Read it again from file." (this is thrown if I remove that local binding of `my-pdf` on line 70) |
| 13:09 | S11001001 | mdeboard: that's a binding completely eliminated by the compiler; it does nothing to have it in a let instead of inline as an arg to stamper |
| 13:09 | mdeboard | I see |
| 13:10 | S11001001 | mdeboard: you probably saw that earlier error because you had the order of operations wrong due to the loop. What's there now isn't a fix, just a different problem. |
| 13:11 | mdeboard | S11001001: Well, even passing it as an arg... I wonder if I should just use agents... send them off, then after they've each run their course close them |
| 13:11 | S11001001 | mdeboard: No. |
| 13:12 | mdeboard | That is, I modified the signature of `(stamp-pdf)` to accept the PdfReader object as an arg; I still get that DocumentException |
| 13:13 | S11001001 | mdeboard: The global my-pdf doesn't get reexecuted each time you reference it |
| 13:14 | mdeboard | S11001001: I gotcha; that is what I assumed to be the case. The symptom of the problem reminded me of e.g. [lambda: x + 1 for x in range(5)] in python or any number of scope issues in JS |
| 13:14 | mdeboard | S11001001: I changed the `(stamp-pdf)` function in line with your advice to https://gist.github.com/11b0e9efa44a67db8a0d and it works well, thanks much |
| 13:15 | S11001001 | np |
| 13:15 | mdeboard | It didn't make sense to me either that I'd need to open a new stream and create a new pdfreader instance on every iteration |
| 13:16 | mdeboard | I just couldn't close the loop so to speak |
| 13:30 | borkdude | is there a function like (split-p [p coll] [(filter p coll) (filter (comp not p) coll)]) ? |
| 13:30 | antares_ | borkdude: partition? |
| 13:30 | borkdude | replace split-p by fn |
| 13:31 | TimMc | ~separate |
| 13:31 | clojurebot | separate is in clojure.contrib.seq-utils, but just use (juxt filter remove) instead |
| 13:31 | borkdude | antares_ partition(-by) makes partitions depending on when the value of the predicate changes |
| 13:31 | borkdude | timmc ok, not in core then I guess |
| 13:32 | TimMc | &((juxt filter remove) odd? (range 10)) |
| 13:32 | lazybot | ⇒ [(1 3 5 7 9) (0 2 4 6 8)] |
| 13:33 | borkdude | timmc ok yes |
| 13:33 | borkdude | timmc tnx |
| 13:46 | borkdude | can this predicate be any shorter? #(= :keyword %) ? |
| 13:47 | tomoj | #{:keyword} is not quite the same but usually close enough |
| 13:48 | borkdude | lol, yes tnx |
| 13:54 | borkdude | does juxt have an equivalent in Haskell? |
| 13:55 | josteink | how do you generate an error in clojure? |
| 13:55 | josteink | as in (error X) in scheme? |
| 13:55 | S11001001 | borkdude: liftA2 (,) |
| 13:55 | nDuff | josteink: I strongly suggest slingshot |
| 13:56 | josteink | sounds frameworkey |
| 13:56 | nDuff | josteink: ...the built-in thing is http://clojuredocs.org/clojure_core/clojure.core/throw |
| 13:56 | borkdude | S11001001 thank you, will look into that |
| 13:56 | josteink | I just need a one-off failer :) |
| 13:56 | S11001001 | josteink: it isn't. |
| 13:56 | nDuff | joegallo: ...but slingshot gives you calls that feel more clojure-y |
| 13:56 | josteink | nDuff: thanks. that''ll do |
| 13:56 | nDuff | joegallo: (and no, it doesn't place other demands on your design) |
| 13:56 | technomancy | ex-info is a huge improvement over regular Exceptions though |
| 13:57 | Raynes | nDuff: He isn't joegallo. |
| 13:58 | S11001001 | borkdude: if you're looking for a variadic version, that's called distribute. |
| 13:58 | josteink | hehe |
| 13:58 | tomoj | S11001001: what's *** for applicatives? |
| 13:58 | borkdude | since when does it matter what person you are? |
| 13:59 | S11001001 | tomoj: you'd need a newtype for that |
| 13:59 | Raynes | tomoj: (foo *** bar) (x,y) = (foo x, bar y) |
| 14:00 | S11001001 | tomoj: see Data.Functor.Product |
| 14:01 | Raynes | Oh, for applicatives. I didn't realize it was a specific question. |
| 14:01 | S11001001 | tomoj: I assume of course you're looking for Applicative f, Applicative g => Applicative (forall a. (f a, g a)) |
| 14:02 | KolmeChousukea | Raynes, I am three Chousukes |
| 14:03 | KolmeChousukea | New and improved |
| 14:03 | S11001001 | borkdude: anyway, distribute can specialize to [a -> b] -> a -> [b], among many other things |
| 14:03 | KolmeChousukea | the functionality of 3 in 1. |
| 14:04 | S11001001 | tomoj: and I forgot about ***, thanks |
| 14:06 | saolsen | can extend-type be used to extend a java class with a java interface? |
| 14:06 | dnolen | saolsen: no |
| 14:08 | oskarth | anyone got the link to clojure conj 2012 text slides? |
| 14:08 | saolsen | I need to add a comparitor to byte-array, is there a good way to do that other than making a new class that implements Comparable? |
| 14:08 | saolsen | i guess a new type in this case, not a new class |
| 14:08 | S11001001 | saolsen: most sorty functions also take a Comparator. |
| 14:09 | S11001001 | ,(supers (class (fn [] 42))) |
| 14:09 | clojurebot | #{java.lang.Runnable clojure.lang.Fn java.util.concurrent.Callable clojure.lang.IObj java.io.Serializable ...} |
| 14:09 | saolsen | < and > dont :( |
| 14:10 | S11001001 | ,(supers clojure.lang.IFn) |
| 14:10 | clojurebot | #{java.lang.Runnable java.util.concurrent.Callable} |
| 14:10 | S11001001 | ,(supers clojure.lang.AFn) |
| 14:10 | clojurebot | #{java.lang.Runnable java.util.concurrent.Callable clojure.lang.IFn java.lang.Object} |
| 14:10 | S11001001 | I will find this thing |
| 14:10 | S11001001 | ,(supers clojure.lang.AFunction) |
| 14:10 | clojurebot | #{java.lang.Runnable clojure.lang.Fn java.util.concurrent.Callable clojure.lang.IObj java.io.Serializable ...} |
| 14:10 | S11001001 | ,(drop 5 (supers clojure.lang.AFunction)) |
| 14:10 | clojurebot | (clojure.lang.IMeta clojure.lang.IFn clojure.lang.AFn java.util.Comparator java.lang.Object) |
| 14:35 | sandover | is there an approved way for someone outside the clojurescript project to log an issue? |
| 14:36 | cemerick | sandover: anyone should be able to open a ticket |
| 14:36 | sandover | on jira? |
| 14:36 | cemerick | yeah |
| 14:36 | cemerick | Probably best to raise the issue on the ML first. |
| 14:37 | josteink | how do I import a full namespace in a clojure file? |
| 14:38 | josteink | just... import as is without a need for prefixing |
| 14:38 | nDuff | josteink: use does that. |
| 14:38 | squidz | What would be the best way in clojure to search xml for attributes, then replace nodes containing said attribute with a new node? |
| 14:38 | nDuff | josteink: can you show how you're trying to use it? |
| 14:39 | nDuff | josteink: (though that tends to be frowned on, from the perspective of creating code where it's hard for the reader to tell where a given symbol came from) |
| 14:39 | sandover | mine might be too small an issue to immortalize on goog group — what i'm seeing is that running clojurescript compiler from command line hangs for 1 minute after the compile is done. |
| 14:40 | josteink | nDuff: heh. |
| 14:40 | sandover | as in, "java -cp (classpath) clojure.main "cljsc.clj" hello-world.cljs" takes 1:30, but outputs code after only 0:30! |
| 14:40 | josteink | let me try again one last time :) |
| 14:41 | josteink | (use '[constraints.elements :exclude [loop]]) |
| 14:41 | dnolen | sandover: what version of cljs? |
| 14:41 | josteink | victory is mine :) |
| 14:41 | sandover | master cloned today |
| 14:41 | nDuff | josteink: any reason you aren't putting it in your ns declaration? |
| 14:42 | josteink | I couldnt get the syntax right ;) |
| 14:42 | dnolen | sandover: I think I've observed this as well - open a ticket |
| 14:43 | nDuff | josteink: (ns my-ns (:use [constraints.elements :exclude [loop]])) |
| 14:43 | nDuff | josteink: ...that's assuming :exclude to be correct; my own code uses :use only in conjunction with :only |
| 14:43 | josteink | compiler says it's ok :) |
| 14:43 | josteink | thanks |
| 14:43 | josteink | in clojure |
| 14:44 | josteink | I feel there is some idiomatic mismatch, but job #1 is getting it running |
| 14:44 | josteink | I can improve upon it from there |
| 14:47 | dnolen | sandover: probably something silly I did - need to do a git bisect to figure it out ... |
| 14:49 | seangrove | Is this the best example of how to do automated tests for cljs code? https://github.com/dustingetz/cljs-bootstrap |
| 14:50 | seangrove | Even just testing with phantomjs is fine, but want to get a handle on testing things to make sure there aren't memory/reference leaks in my cljs code |
| 14:51 | dnolen | seangrove: maybe not related but I'm surprised no one's ported clojure.test yet |
| 14:51 | sandover | made a new issue for clojurescript compiler hang behavior; http://dev.clojure.org/jira/browse/CLJS-430 . (sorry, accidentally marked it 'major'!) |
| 14:52 | dnolen | sandover: so did you try building via the REPL and observed the same behavior there? |
| 14:53 | sandover | i did not have a chance to run (build ) at the REPL, no |
| 15:03 | sandover | CLJS (build ) done with the REPL runs normally |
| 15:10 | mccraig_ | anyone got a bunch of dsl creation experience and a few minutes to chat ? |
| 15:13 | Raynes | ~anyone |
| 15:13 | clojurebot | Just a heads up, you're more likely to get some help if you ask the question you really want the answer to, instead of "does anyone ..." |
| 15:14 | technomancy | clojurebot: metaprogramming? |
| 15:14 | clojurebot | Titim gan éirí ort. |
| 15:14 | Raynes | This is the #clojure IRC channel. Everyone has DSL experience. ;) |
| 15:14 | technomancy | clojurebot: metaprogramming in lisp? |
| 15:14 | clojurebot | Metaprogramming in Lisp is like Chinese food in China; they just call it food there. |
| 15:14 | technomancy | ^^ |
| 15:15 | pjstadig | clojurebot: metaprogramming is <reply>Metaprogramming in Lisp is like Chinese food in China; they |
| 15:15 | pjstadig | just call it food there. |
| 15:15 | clojurebot | Ok. |
| 15:15 | pjstadig | hmm those line breaks! |
| 15:15 | scriptor | ERC? |
| 15:15 | clojurebot | Counterclockwise aka ccw at http://code.google.com/p/counterclockwise/ |
| 15:15 | Raynes | You broke everything now. |
| 15:16 | Raynes | clojurebot: What does ERC have to do with CCW? |
| 15:16 | clojurebot | ccw is http://github.com/laurentpetit/ccw |
| 15:16 | Raynes | I KNOW THAT |
| 15:16 | Raynes | grrr |
| 15:16 | Raynes | I need to add factoids to lazybot so that I can control the infuriating little bugger. |
| 15:19 | pjstadig | k i think i fixed it |
| 15:19 | pjstadig | ~metaprogramming |
| 15:19 | clojurebot | Metaprogramming in Lisp is like Chinese food in China; they just call it food there. |
| 15:20 | pjstadig | i only teach clojurebot something once every six months and I always screw it up somehow |
| 15:21 | mccraig_ | Raynes: ha, well in that case, i've been working on a dsl using a state-monad approach, and its fine, but it's not as neat as a simple simple instance_eval approach would be in ruby… can't easily loop over the monadic functions… so i'm considering using a stateful approach. was wondering if i'm missing something |
| 15:23 | squidz | What would be the best way in clojure to search xml for attributes, then replace nodes containing said attribute with a new node? |
| 15:32 | brainproxy | squidz: the 'enlive' library might be suitable, just depends on the xml you would be processing |
| 15:32 | brainproxy | as enlive is designed to work with html, but I've used it to transform xml in the past |
| 15:37 | squidz | brainproxy: its very simple xml. i normally use hiccup which is great for creating html, but im not sure how it would to do read it then modify it |
| 15:43 | crease | squidz: have you tried clojure.zip/xml-zip? |
| 15:51 | brainproxy | squidz: if it's "very simple" xml as you say, then you will probably have luck transforming it w/ enlive |
| 15:52 | brainproxy | brian marick's tutorial is the best way I've found to get up to speed on how to use enlive: https://github.com/cgrand/enlive/wiki/Table-and-Layout-Tutorial,-Part-1:-The-Goal |
| 15:53 | crease | yah, that's probably the sensible way to do it |
| 15:54 | crease | but if it's *really* simple: |
| 15:54 | crease | (defn lightly-munge-xml [f, yer-xml] |
| 15:54 | crease | (->> yer-xml |
| 15:54 | crease | clojure.zip/xml-zip |
| 15:54 | crease | (iterate #(-> % (clojure.zip/edit f) clojure.zip/next)) |
| 15:54 | crease | (take-while (complement clojure.zip/end?)) |
| 15:54 | crease | last |
| 15:54 | crease | clojure.zip/root)) |
| 15:54 | crease | oops, multiline, apologies |
| 15:54 | brainproxy | crease: that's what refheap and gist are for :D |
| 15:55 | crease | yah, sorry, enthusiastic c/p |
| 15:56 | fmw | anybody in here using the Domina library for ClojureScript? domina.css and domina.xpath aren't working for me, for some reason (i.e. (domina/destroy! (sel "#header")) doesn't work, while (domina/destroy! (domina/by-id "header")) does). |
| 15:59 | Frozenlock | fmw: https://github.com/levand/domina#important-note-on-browser-xpath-compatibility-ie-and-android |
| 16:00 | fmw | Frozenlock: I have only tested on Firefox and Chrome on GNU/Linux. |
| 16:00 | Frozenlock | I'm using domina and (css/sel "#some-id") works for me. :( |
| 16:00 | fmw | Frozenlock: I've checked out the project, compiled the tests and there it works for me too |
| 16:00 | fmw | just not in my own project for some odd reason |
| 16:01 | Frozenlock | Is it just with ids? |
| 16:01 | Frozenlock | does (css/sel ".some-class") work? |
| 16:04 | dnolen | seangrove: hmm, not that big I don't think. |
| 16:05 | fmw | Frozenlock: no, that doesn't work either |
| 16:06 | fmw | e.g. I add something from the Firebug console through domina.append_BANG_(domina.by_id("wrapper"), "<h1 class=foo>foo</h1>"); - but domina.destroy_BANG_(domina.css.sel(".foo")) returns null and doesn't do anything. |
| 16:09 | tomoj | how is domina a "functional" interface to the dom? |
| 16:09 | tomoj | the interface has clojure functions, so it's functional? |
| 16:09 | fmw | tomoj: the dom is not immutable if that is what you mean with functional, but it is "as idiomatic as possible" from a clojure perspective |
| 16:10 | Frozenlock | fmw: You might want to get your REPL running, it really is handy. Other than that, I don't see how I could help you, other than saying it works for me :P |
| 16:10 | tomoj | I'll admit it seems somewhat idiomatic |
| 16:10 | nDuff | tomoj: the interface is defined in terms of composable functions, rather than objects or other abstractions. |
| 16:11 | tomoj | ah, right |
| 16:11 | fmw | Frozenlock: I'm normally using an in-browser REPL, but try to keep it clean with debugging |
| 16:11 | fmw | Frozenlock: thanks for your input, though |
| 16:11 | fmw | seangrove: do you have any input on this issue? I just applied your patch to fix the exception when using domina.css, which solved that |
| 16:11 | fmw | domina.css and domina.xpath still don't work for me, though |
| 16:13 | Frozenlock | Anyone have an easy way to let users automatically update clojure apps? (.jar) I've read somewhere about webstart, but I would like to have a clojurian opinion. |
| 16:14 | Frozenlock | clojurer? |
| 16:15 | mdeboard | Clojurisprudence |
| 16:15 | tomoj | maybe if you had a lein plugin that accepted a coordinate, downloaded the dep if necessary, and ran the remaining commands inside that project: `lein with-project your.app :latest run` |
| 16:16 | tomoj | vs `lein with-project your.app 1.0.0 run` for no auto-update |
| 16:16 | tomoj | which would also be sweet for repl |
| 16:18 | Frozenlock | I like the idea. I would like it even more if it existed already, but I like it :P |
| 16:23 | Frozenlock | tomoj: Is lein included in a uberjar? |
| 16:23 | bbloom | nDuff: persona is actually really cool |
| 16:23 | tomoj | no, if you're uberjar'ing my suggestion is worthless I think |
| 16:23 | Frozenlock | Aww :( |
| 16:23 | bbloom | nDuff: it's mozilla's attempt at openid done right |
| 16:24 | nDuff | bbloom: Bah. I already have an OpenID RP with a physical token backing it up. Last thing I want is another password. |
| 16:24 | tomoj | persona makes me unable to login to refheap in my browser |
| 16:24 | bbloom | nDuff: except you're a weirdo among the universe of people who don't have openid accounts or have no idea how to use them …. including people like me :-) |
| 16:24 | bbloom | i just assumed openid was DOA because it's too complex for a normal user |
| 16:25 | bbloom | so i never bothered |
| 16:25 | llasram | tomoj: Conkeror? |
| 16:25 | tomoj | yeah |
| 16:25 | nDuff | bbloom: Anyone with a Google account can use OpenID. |
| 16:25 | tomoj | good think for refheap.el.. |
| 16:25 | nDuff | bbloom: ...the complexity only comes in when you try to do interesting things with it. |
| 16:25 | bbloom | nDuff: except that your email address isn't an open id token |
| 16:26 | nDuff | bbloom: ...and I'm at a loss for why it needs to be. |
| 16:26 | nDuff | bbloom: the user experience doesn't require entering that token. |
| 16:26 | bbloom | nDuff: only because people hard code it to google's endpoints |
| 16:26 | nDuff | bbloom: True enough. My personal domain, on the other hand, _is_ an OpenID token. |
| 16:26 | nDuff | (granted, I'm an exception). |
| 16:26 | bbloom | nDuff: exactly: you're a wiiiide outlier |
| 16:27 | bbloom | nDuff: good discussion here http://news.ycombinator.com/item?id=4580986 |
| 16:28 | nDuff | bbloom: Does anyone offer physical-token-based auth for Persona? |
| 16:28 | nDuff | If it's dual-auth capable, I _might_ be a possible sell. |
| 16:28 | TimMc | nDuff: I gave up BrowserId^WPersona as well. |
| 16:28 | bbloom | nDuff: i don't think so, it's too new. firefox is apparently integrating it into the browser tho |
| 16:28 | TimMc | I still can't believe Mozilla made a login screen that doesn't work with Firefox's password manager. |
| 16:30 | nDuff | ...well -- the original intent there was to sign into refheap. That's not happening, so let's get the code I was going to ask about over to gist... |
| 16:30 | clojurebot | to be fair I dunno that I've ever had code out right rejected, it just sits in jira or assembla or where ever, or if I ask if there is any interest (before writing any code) I get told to go write alioth benchmarks |
| 16:30 | bbloom | nDuff: several random sources from quick googling says that mozilla is developing two factor into the protocol |
| 16:31 | nDuff | I feel like I'm doing something unidiomatic / unnecessarily ugly when trying to split keyword arg pairs out of an argument list here. Comments? https://gist.github.com/4150725 |
| 16:31 | bbloom | nDuff: you can apply hash-map |
| 16:32 | nDuff | bbloom: Not everything is a pair -- in fact, most things won't be. |
| 16:32 | bbloom | nDuff: do keyword pairs come first or second? |
| 16:32 | brehaut | nDuff: are you wantting to turn :a 1 2 3 :b 3 into {:a 1 :b 3} [2 3] |
| 16:32 | nDuff | brehaut: Exactly. |
| 16:32 | bbloom | ah ok what brehau said |
| 16:33 | bbloom | nDuff: that seems odd tho… why not mandate that keyword pairs come before or after positional arguments? |
| 16:33 | TimMc | something something finite state transducer |
| 16:33 | bbloom | nDuff: clarity? :-P |
| 16:33 | nDuff | ...if mandating that pairs came at the end made cleaner code in the parser, I'd do so happily. |
| 16:34 | nDuff | If someone abuses the flexibility to write dirty code, though, that's their problem. |
| 16:34 | brehaut | TimMc: wow, the wikipedia page for that gets confusing fast |
| 16:35 | tomoj | it's unidiomatic to have keyword args mixed in before positional args. anyway, you are sure someone won't want to pass a keyword as a positional arg? |
| 16:35 | TimMc | &(split-with (complement keyword?) [1 2 3 :a 4 :b 5]) |
| 16:35 | lazybot | ⇒ [(1 2 3) (:a 4 :b 5)] |
| 16:35 | bbloom | &(let [[positional kwargs] (split-with (complement keyword?) [1 2 3 :foo 4 :bar 5]), arg-map (apply hash-map kwargs)] [positional arg-map]) |
| 16:35 | lazybot | ⇒ [(1 2 3) {:foo 4, :bar 5}] |
| 16:35 | TimMc | brehaut: It's also not exactly appropriate here, I think. |
| 16:35 | seangrove | fmw: Hmm, I'm using clojure 1.5.0, latest cljs, the explicit goog-closure-library-third-party dep in project.clj, and chrome |
| 16:36 | seangrove | (domina/single-node (domina.css/sel "#main)) seems to work for me |
| 16:36 | fmw | Frozenlock, seangrove just fixed it, there was an old version of domina required through lein-git... |
| 16:37 | brehaut | TimMc: nevertheless, its been ten years since i looked at FSA properly |
| 16:37 | fmw | seangrove: thanks for checking, though |
| 16:37 | brehaut | TimMc: apparently i am super rusty |
| 16:37 | fmw | it was due to the old version being broken and failing silently |
| 16:37 | seangrove | Glad to hear! Domina is a good library, but a bit sad it hasn't had much activity recently. |
| 16:37 | TimMc | brehaut: That article is also super unhelpful. |
| 16:38 | fmw | seangrove: yes, it seems like a very decent way to deal with the DOM |
| 16:38 | fmw | I'm going to try to build composable UI "widgets" on top of it |
| 16:38 | brehaut | TimMc: looks like a job for a monad stack anyway |
| 16:39 | Frozenlock | fmw: you might already know it, but there's 'enfocus' that uses Domina and offer higher level functions. |
| 16:39 | tomoj | all the !'s don't cause composability problems? |
| 16:40 | TimMc | brehaut: Basically it's just an FSM that emits output on edge traversals. |
| 16:40 | bbloom | tomoj: you mean in domina? |
| 16:40 | tomoj | yeah |
| 16:40 | brehaut | TimMc: and what it emits doesnt necessarily correspond to the input? |
| 16:40 | bbloom | tomoj: the bigger issue for me is the ugliness with nesting |
| 16:40 | TimMc | Yeah. |
| 16:41 | Frozenlock | technomancy: are you aware of any 'auto-update' feature for a uberjared project? (By any chance..) |
| 16:41 | bbloom | tomoj: jquery abuses the javascript 'this keyword, which is actually surprisingly useful for working with deeply nested transformations and such |
| 16:41 | bbloom | tomoj: hence the DOM library i'm working on utilizes a stack machine :-) |
| 16:41 | fmw | Frozenlock: yes, I had a look at Enfocus. seems like a good library |
| 16:41 | brehaut | TimMc: this is really cool, thanks :) |
| 16:41 | Hodapp | why do people bitch about JavaScript so much? |
| 16:41 | tomoj | yeah, excited to see it |
| 16:41 | TimMc | nDuff: I really dislike embedded kwargs, by the way -- better to have them in an optional map arg. |
| 16:41 | Hodapp | the only part of it I've found that is worth complaining about is the weak typing. |
| 16:42 | nDuff | TimMc: That's fair -- I'm supporting them here only for compatibility with another call. |
| 16:42 | bbloom | tomoj: i've got it working reasonably well, but i want it to be much more complete before releasing it |
| 16:42 | tomoj | I guess maybe you can apply composed actions to orphan nodes and clone when necessary to keep the side-effects from screwing things up? |
| 16:42 | bbloom | tomoj: there is a lot of surface area to the dom api |
| 16:42 | tomoj | yeah :'( |
| 16:42 | TimMc | Hodapp: "0" == 0 == "", "0" != "" -- you have to know about a ton of "features" to not use most of the time. |
| 16:43 | seangrove | bbloom: That souns pretty intense, any samples of what the interface looks like? |
| 16:43 | bbloom | sure |
| 16:43 | bbloom | seangrove: https://www.refheap.com/paste/7004 |
| 16:43 | seangrove | whitespace sensitive? |
| 16:44 | bbloom | no, it's postfix notation |
| 16:44 | seangrove | Ah |
| 16:44 | bbloom | that grabs an element with the idea "root", pushes it on the stack, then it creates a div and pushes that on the stack, sets the class property, assigns it a background color |
| 16:44 | bbloom | then the ~label injects a value from clojure land, so in this case a string |
| 16:44 | bbloom | text! sets the text content, and then '(append) keep' is a higher order postfix operation |
| 16:45 | bbloom | append attaches the child to the parent and removes the child from the stack, but (append) keep will preserve the child on the stack |
| 16:45 | bbloom | so that you can then clone it and ALSO prepend it :-) |
| 16:45 | bbloom | just as an example |
| 16:45 | seangrove | Wow, looks interesting |
| 16:45 | seangrove | Will definitely check it out when you release it |
| 16:45 | bbloom | seangrove: deeper explanations here http://docs.factorcode.org/content/article-dataflow-combinators.html |
| 16:46 | seangrove | I wonder how libraries around the DOM can go... I have a hard time writing functional code around it |
| 16:46 | bbloom | this way dom manipulations are programs as data! you can stream dom control commands across the network :-) |
| 16:46 | bbloom | heavily inspired by PostScript. treating the DOM as a printer :-) |
| 16:47 | tomoj | hmm: "keep ( ..a x quot: ( ..a x -- ..b ) -- ..b x )" |
| 16:47 | bbloom | tomoj: yeaaaah, that bit is a tad confusing |
| 16:47 | tomoj | what is the type of your keep function, roughly? |
| 16:47 | bbloom | it's "row polymorphism" |
| 16:47 | bbloom | the idea is that you have "quotations" which are just lists of instructions |
| 16:48 | bbloom | the ..a just means some sequence of items on teh stack |
| 16:48 | bbloom | you can think of every function as having type stack -> stack |
| 16:48 | bbloom | in this case, it's telling you facts about the stack |
| 16:49 | bbloom | in this case that you get a stack, a value, and a quotation (like a lambda) and return a new stack plus the top item from the original stack |
| 16:49 | bbloom | hence the "keep" |
| 16:49 | bbloom | you're keeping the top item of the stack |
| 16:49 | bbloom | even after applying the quotation |
| 16:50 | bbloom | functions are called "words" and have signatures defined as "stack effects" of the form (x -- y) where x and y are the before and after states of the stack |
| 16:50 | bbloom | for example the dup word has stack effect (x -- x x) … that is, it takes an x off the stack and puts it back on twice |
| 16:50 | bbloom | DUPlicates it :-) |
| 16:51 | muhoo | bbloom: is your dom library up on github somewhere? |
| 16:51 | bbloom | muhoo: not yet, going to publish the stack language library first |
| 16:52 | muhoo | cool, thanks. |
| 16:52 | tomoj | guess I should find a factor tutorial |
| 16:53 | bbloom | tomoj: if you like videos, the google tech talk is good: http://www.youtube.com/watch?v=f_0QlhYlS8g |
| 16:53 | tomoj | I do, thanks :) |
| 16:53 | bbloom | the benefit of stack/concatenative languages is that side effects are left to right |
| 16:53 | bbloom | so it's much easier to reason about mutation |
| 16:54 | bbloom | since the dom is inherently mutable, any attempt to project a functional interface onto it is kinda doomed from the start |
| 16:54 | bbloom | so i said "fuck it" and i'm going to use functions to return programs that trivially compose via concatenation, and then execute those programs |
| 16:54 | bbloom | and since there is no wrapping of dom elements to pass around, it should perform reasonably well |
| 16:55 | bbloom | raw dom nodes get stored on the stack |
| 16:55 | bbloom | no complex monad allocations like jquery and whatnot |
| 16:55 | tomoj | so your refheap is a function that takes <div id="root"></div> to <div id="root"><div class="button" style="...">label</div><div class="button" style="...">label</div></div>, where the first inner div is the clone of the second? |
| 16:55 | bbloom | although right now my interpreter is hilariously inefficient, allocating cons cells left and right |
| 16:55 | bbloom | tomoj: not quite. |
| 16:56 | bbloom | line 1 grabs the #root element and pushes it on the stack |
| 16:56 | clojurebot | trampoline is http://groups.google.com/group/clojure/browse_thread/thread/6257cbc4454bcb85/3addf875319c5c10?#3addf875319c5c10 |
| 16:56 | tomoj | oh, the whole thing is a (stack -> stack) still.. |
| 16:56 | bbloom | lines 2 through 5 create <div class="button" style="…">text here</div> and pushes that on the stack |
| 16:56 | bbloom | (append) keep will put the button div into the root element |
| 16:57 | bbloom | but leave both the button and the root element on the stack |
| 16:57 | bbloom | clone will replace the element with a clone of itself |
| 16:57 | bbloom | and then prepend that |
| 16:57 | technomancy | huh, weird; that factor video won't play, but it also doesn't show a "please install flash" message |
| 16:57 | bbloom | technomancy: odd. |
| 16:57 | bbloom | technomancy: plays for me |
| 16:59 | bbloom | also good: http://evincarofautumn.blogspot.com/2012/02/why-concatenative-programming-matters.html |
| 17:00 | jamii | dnolen: proposed bloom^L query syntax - https://gist.github.com/4150891 |
| 17:00 | jamii | dnolen: seems reasonable? |
| 17:02 | bbloom | my notation is different than factor's by necessity of clojure's reader syntax… so i also need to document it well before releasing :-) |
| 17:03 | bbloom | i've been translating and testing little chunks of jquery code and the result is almost always dramatically nicer than jquery syntax |
| 17:06 | ChongLi | I think my friend took down 4clojure by trying to do a search |
| 17:06 | ChongLi | is that crazy? |
| 17:06 | tomoj | interesting, I've been working on a pointless library as well, but struggle when I need points |
| 17:06 | tomoj | now I have to go learn factor, so thanks and no thanks :/ |
| 17:07 | ChongLi | 502 bad gateway |
| 17:07 | ChongLi | :( |
| 17:07 | bbloom | tomoj: lexical variables can be implemented reasonably easily: http://docs.factorcode.org/content/vocab-locals.html |
| 17:07 | bbloom | but having things like dip and keep make the need pretty rare |
| 17:14 | dnolen | jamii: looks neat though I can't provide much more specific feedback since I haven't had time to really dig into bloom yet. |
| 17:14 | jamii | dnolen: ah, ok :) |
| 17:15 | dnolen | definitely on my list of things to do very soon - but been super heads down w/ CLJS source mapping in my free time. |
| 17:27 | jamii | dnolen: I've been meaning to dig into the cljs compiler fairly soon. My compilers in strucjure and droplet are gross - need to come up with something cleaner. |
| 17:28 | dnolen | jamii: don't worry, cljs compiler is a mix of clean and gross ;) fortunately it's not much code. |
| 17:29 | jballanc | ChongLi: it's working for me...maybe clear cookies? |
| 17:35 | ChongLi | jballanc: it's fine now |
| 17:35 | ChongLi | it was down for about 3 minutes |
| 17:39 | dnolen | jamii: I wonder if your CLJ bloom stuff could work in CLJS via http://www.webrtc.org ? |
| 17:39 | jamii | dnolen: clojurescript / applets was one of the reasons I originally targeted clojure |
| 17:40 | jamii | dnolen: I want to work on in-browser p2p networks |
| 17:40 | jamii | dnolen: I'm not sure how useful webrtc is for that. I haven't read much but I've heard that its heavily focused towards audio/video rather than general purpose communication |
| 17:41 | dnolen | jamii: http://stackoverflow.com/questions/10904636/webrtc-p2p-update ? |
| 17:43 | dyreshark | ls |
| 17:43 | lazybot | bin boot home lost+found media mnt srv swap var |
| 17:43 | jamii | dnolen: I wonder if its possible to do PEX-style hole punching or if you have to rely on a stun server |
| 17:58 | derrida | Hey guys, I'm trying to use nrepl with nrepl.el in emacs. When I C-u M-x nrepl-jack-in and specify my project folder, sure enough, a repl pops right up. Strangely, when I open code from the project (or switch to a buffer), I cannot C-x C-e on forms, it tells me that there is no inferior lisp started. Even stranger, when I hit C-c C-z, emacs boots up another repl- this time the repl has a different "header" |
| 17:58 | derrida | that shows a different version number and seems to have a title of "REPL-y". I tried completely deleting my ~/.emacs.d and got the same results after installing nrepl and clojure-mode. Is anyone familiar that could offer some advice? |
| 17:59 | derrida | also, once the "REPL-y" repl is booted, I can then compile forms and they are sent to that repl |
| 18:00 | derrida | I apologize that this might be more emacs related than clojure-language related, just figured this is probably the most likely place to find help. |
| 18:01 | technomancy | derrida: for some reason nrepl-interaction-mode isn't getting enabled upon connect |
| 18:01 | derrida | fwiw, this happens to me in osx, my friend that is using linux and installed alongside me did not experience the same result. |
| 18:02 | derrida | technomancy: should I need to add that to my init files manually if I installed via melpa? |
| 18:03 | derrida | adding the hook is no issue, I just got worried because my experience was not consistent with my friends. |
| 18:03 | technomancy | derrida: no, it just means there's a bug in the connect hook |
| 18:03 | technomancy | no idea what causes it, but a few people have asked in here about it |
| 18:03 | derrida | that makes me feel better anyway |
| 18:04 | technomancy | you're not using aquamacs, are you? |
| 18:04 | tomoj | bblöom: so how do you differentiate between pushing a function to the stack and calling a function |
| 18:12 | derrida | technomancy: nah |
| 18:12 | wink | "I don't always C-u M-x, but when I do, I'm nrepl-jack-in." |
| 18:12 | derrida | technomancy: I compiled emacs from homebrew for X11, I tested with emacsforOSX pre-compiled though and it was the same thing |
| 18:31 | bbloom | tomoj: http://docs.factorcode.org/content/article-quotations.html thse use [ brackets ] for quotations and { arrays }, but I was using [ vectors ] and ( quotations ) to better mesh with clojure semantics |
| 18:32 | tomoj | ah, now I understand (append) keep |
| 18:33 | bbloom | yeah, that example is just me testing our various features |
| 18:33 | bbloom | keep is relatively complex, so it's a good test |
| 18:33 | bbloom | it's defined as: over (call) dip |
| 18:34 | bbloom | and dip itself is a primitive which also invokes 'call |
| 18:34 | bbloom | so it's a double layer of quotations and such, exercises the stack pretty well |
| 19:26 | firesofmay | Hi, I want to try out this project : https://github.com/kovasb/session But I am not sure how to run this thing. Any pointers? |
| 19:35 | devn | heh firesofmay |
| 19:35 | devn | that's sort of the supreme irony is that it doesn't have examples |
| 19:45 | mdeboard | I really wish Python had type hinting. Would save so much unnecessary commenting. |
| 19:45 | mdeboard | s/python/every language |
| 19:47 | KolmeChousukea | mdeboard, you mean Haskell style type annotations? |
| 19:47 | mdeboard | No, Clojure style type-hinting in function signature |
| 19:47 | KolmeChousukea | I do love how in Haskell type signatures are basically sufficient as comments most of the time |
| 19:47 | KolmeChousukea | mdeboard, example? |
| 19:48 | mdeboard | (defn some-fn [^Integer i ^String s] (+ i (read-string s))) |
| 19:48 | ben_m | Also helps with performance! |
| 19:48 | mdeboard | http://clojure.org/java_interop#Java%20Interop-Type%20Hints |
| 19:48 | KolmeChousukea | Ah yes |
| 19:49 | wingy | what is the difference between (file/wrap-file "public") and (resource/wrap-resource "public")? |
| 19:51 | xeqi | wingy: file/wrap-file looks on the filesystem, resource/wrap-resource looks on the classpath |
| 19:52 | xeqi | so resource/wrap-resource can find resources inside jar files |
| 19:52 | wingy | xeqi: which one do i wanna use to serve static files? |
| 19:53 | xeqi | from the file system or classpath? I usually use resources |
| 19:53 | wingy | can i use (file-info/wrap-file-info) with the latter? |
| 19:54 | wingy | also, my public folder is in the project root .. if i use the latter, where do i have to put that folder, in resources/public? |
| 19:55 | xeqi | wingy: I believe those work together, just make sure wrap-file-info is the outside middleware |
| 19:55 | xeqi | resources/public would work |
| 19:55 | wingy | ok thx |
| 19:55 | xeqi | * for a lein2 project w/ default :resource-paths |
| 19:56 | wingy | but on the other hand perhaps i can control it more with using the former one |
| 19:57 | wingy | eg. if i only plan for specific files in the public folder to be served, if they aren't in the public folder then the responses return not found then it seems better to serve with file/wrap-file |
| 20:18 | firesofmay | Hi, Can anyone help me with how to run this project? https://github.com/kovasb/session It has no docs saying how to try it out. Any ideas? |
| 20:19 | firesofmay | Anyone? |
| 20:19 | clojurebot | Just a heads up, you're more likely to get some help if you ask the question you really want the answer to, instead of "does anyone ..." |
| 20:23 | moogatronic | firesofmay: what did you try? |
| 20:24 | moogatronic | firesofmay: looks like you just need to do 'lein run' |
| 20:24 | firesofmay | moogatronic, I tried doing lein swank but it fails. I think i have to do make a jar which I did, and after that I did |
| 20:24 | firesofmay | moogatronic, java -jar target/session-0.1.2-SNAPSHOT-standalone.jar |
| 20:24 | firesofmay | moogatronic, but I got Exception in thread "main" java.lang.NoClassDefFoundError: session/server |
| 20:24 | tanzoniteblack | firesofmay: you might try 'lein repl' |
| 20:24 | firesofmay | moogatronic, okay. |
| 20:24 | moogatronic | right, try lein run |
| 20:25 | moogatronic | that will run the :main |
| 20:25 | firesofmay | moogatronic, okay let me try |
| 20:25 | moogatronic | firesofmay: tip - Check the project.clj. You can usually figure out what's going on from there. Any aliases, mains, etc. that are defined will be good starting points. |
| 20:25 | firesofmay | moogatronic, Getting Exception in thread "main" java.lang.NumberFormatException: null |
| 20:26 | firesofmay | moogatronic, Inside project.clj it says : :main ^{:skip-aot true} session.server |
| 20:28 | moogatronic | firesofmay: check out https://github.com/kovasb/session/blob/master/src/clj/session/server.clj |
| 20:29 | moogatronic | the -main shows what args and setup the server is expecting. |
| 20:29 | firesofmay | moogatronic, Yeah I was checking that. I did lein run and switched to session.server ns. |
| 20:29 | firesofmay | moogatronic, What to pass to -main? I am not clear on that. |
| 20:29 | moogatronic | the cmd line args are passed there. |
| 20:29 | moogatronic | i'm not sure either, i've never looked at this prj. =) |
| 20:29 | moogatronic | looks like datomic is set up with the last param |
| 20:30 | moogatronic | the listening port is set with the first param |
| 20:30 | hughfdjackson | are there interoperable client and server libraries? |
| 20:30 | firesofmay | moogatronic, okay |
| 20:30 | hughfdjackson | i'm basically writing a little proxy for fun |
| 20:30 | hughfdjackson | first stage is to get pass-through :D |
| 20:31 | moogatronic | firesofmay: looks like someone created an issue asking for "getting started" |
| 20:31 | moogatronic | =) |
| 20:31 | firesofmay | moogatronic, oh :) |
| 20:32 | moogatronic | i'm sure Kovas will provide some quick docs as soon as he's able. |
| 20:32 | firesofmay | moogatronic, heh. I was the one who came an hour back and asked about it ;) |
| 20:32 | firesofmay | moogatronic, thanks a lot :) |
| 20:32 | moogatronic | firesofmay: well, it makes sense. this was presented at the conj, so others will likely be poking around as well. |
| 20:32 | firesofmay | moogatronic, you saw this project? |
| 20:33 | firesofmay | moogatronic, at conj i.e. |
| 20:34 | moogatronic | firesofmay: yeah, well I saw the preso. I have a ton of my to-play-with-queue just from the conj among other things. =) |
| 20:34 | moogatronic | i've not really checked it out much though. |
| 20:34 | wingy | when i run a form i get back a clojure.lang.ExceptionInfo https://www.refheap.com/paste/7008 how do I interact with it, eg. returning the clj-http response body |
| 20:35 | firesofmay | moogatronic, I wanted your opinion on something then. Basically I have been toying around with the idea of creating a logo environment using clj/cljs |
| 20:35 | firesofmay | moogatronic, and lately it mutated into teaching lisp/clojure via logo using some kind of codeschool kind of thing with canavas |
| 20:35 | firesofmay | canvas* |
| 20:36 | firesofmay | moogatronic, one of my mentors, BG, said that check out this project session, hence I was. But what do you think about the overall idea? |
| 20:37 | moogatronic | well, i don't know much about logo, aside from turtle graphics.. =) But it seems like a good fit generally. |
| 20:38 | moogatronic | firesofmay: the session project would probably contain some good stuff to use directly in an edu/style setup. canvas/cljs/web-repl/graphics… not much to dislike there. =) |
| 20:38 | firesofmay | moogatronic, okay. |
| 20:38 | firesofmay | moogatronic, I like the whole idea of learning lisp/clojure but with strong visual feedback on how powerful it is. |
| 20:39 | moogatronic | firesofmay: you can probably msg Kovas directly on github, since you have a vision/path of exploration/ etc. |
| 20:39 | firesofmay | moogatronic, 4clojure is great, but there is no learning, I cant tell a person go learn liso there. |
| 20:39 | firesofmay | lisp* |
| 20:39 | moogatronic | firesofmay: I agree wrt visual&learning. I learned clojure via Overtone. |
| 20:39 | moogatronic | audio … but similar concept. |
| 20:39 | firesofmay | moogatronic, Hmm. Sounds like a good idea. Though I have no clue of how cljs yet. and a bit of cljojure not much. |
| 20:39 | Hodapp | Overtone looks rather interesting. |
| 20:40 | Hodapp | I wish I had some musical inclination to actually use it |
| 20:40 | moogatronic | firesofmay: check out Quill as well. It's a clojure wrapper around Processing |
| 20:40 | firesofmay | moogatronic, oh Thats interesting. So you have background in music? |
| 20:40 | Hodapp | Quil* |
| 20:40 | moogatronic | Hodapp: you don't need any. You trade in programming skill! |
| 20:40 | moogatronic | Hodapp: thanks. =) |
| 20:40 | moogatronic | firesofmay: well, I had a background in Java… and a love of music.. I do have some background in music, but not professional. |
| 20:40 | firesofmay | moogatronic, yeah I started with that but I got a feedback that it would be better if you make this as a webproject as then anyone can start with it. |
| 20:41 | Hodapp | moogatronic: Apparently I have not enough skill in programming to trade in for enough musical inclination to accomplish much. |
| 20:41 | firesofmay | moogatronic, hence toying with clojurescript. |
| 20:41 | firesofmay | Hodapp, heh :) |
| 20:41 | Bergle_2 | its 'quil' one l. fun :) |
| 20:41 | Hodapp | moogatronic: Perhaps weed is a better things to trade it for in the meantime... |
| 20:41 | moogatronic | firesofmay: Yeah, go with what you think will get you the best return. I had a course project that required the use of genetic/evolutionary algos, and i wanted to make it arty. =) |
| 20:42 | firesofmay | moogatronic, nice. I tried overtone to run on my ubuntu machine, had so much pain. I gave up too soon. Should try again. |
| 20:42 | firesofmay | moogatronic, Is it possible to have a web repl for overtone? |
| 20:42 | moogatronic | Hodapp: Lawlz. Well, i'm not sure how to convert programming skill to weed. =) |
| 20:42 | Hodapp | moogatronic: Easy. Use the former to get money, and then buy it. |
| 20:42 | moogatronic | firesofmay: Locally only. Overtone requires supercollider. |
| 20:43 | firesofmay | moogatronic, Hmm okay. |
| 20:43 | SegFaultAX | I know this is offtopic, but I'm looking for some guidance on (what should be) a relatively simple github markdown issue... |
| 20:43 | moogatronic | firesofmay: http://www.chris-granger.com/2012/02/20/overtone-and-clojurescript/ |
| 20:43 | SegFaultAX | https://gist.github.com/4151846 You'll notice that there is a huge space between the outer ordered list and the inner bullet list, but no space between the bullet and the next ordered list item. |
| 20:43 | SegFaultAX | How can I fix this? |
| 20:44 | firesofmay | moogatronic, thanks checking it out. |
| 20:44 | Hodapp | moogatronic: this looks like a neat article, thanks |
| 20:49 | moogatronic | SegFaultAX: Do you need the space between the numbered lists? Maybe remove that and the rendering will fix. |
| 20:51 | tmciver | SegFaultAX: Not sure if this is the problem, but when I view the raw text the second bulleted list is indented by 3 (not 4) spaces. |
| 20:52 | tmciver | SegFaultAX: Also when I paste it into pandoc (http://johnmacfarlane.net/pandoc/try), it looks OK (with no spaces). |
| 20:53 | SegFaultAX | tmciver: Yea, it's just the shitty GH markdown stylesheet I think. |
| 20:53 | SegFaultAX | They don't have a bottom margin of nested lists. :( |
| 20:55 | tmciver | SegFaultAX: just wonky github markdown implementation, I guess. |
| 20:55 | SegFaultAX | Just a stylsheet issue. |
| 21:06 | Urthwhyte | SegFaultAX: GH uses Sundown I thought? |
| 21:12 | dnolen | neat IGS GoPanda2 client is written in Clojure & CLJS |
| 21:17 | ohpauleez | dnolen: Whoa! Totally awesome. Any link on their experience or a blog post? |
| 21:19 | dnolen | ohpauleez: don't think so |
| 21:20 | SegFaultAX | Urthwhyte: It does. What does that have to do with the GH stylesheet though? |
| 21:20 | Urthwhyte | I didn't even realise they supported nested lists |
| 21:20 | Urthwhyte | I thought that was a Pandoc extension |
| 21:20 | Urthwhyte | My mistake |
| 21:20 | SegFaultAX | Urthwhyte: http://daringfireball.net/projects/markdown/ |
| 21:22 | Sgeo__ | dnolen, awesome |
| 21:22 | Sgeo__ | Wait, why is a client using both? |
| 21:30 | tomoj | bbloom: hmm.. https://www.refheap.com/paste/8d71b9b2a197b4c51d7032d67 |
| 21:30 | tomoj | not sure whether I'm sold yet, but I think I'm doing it wrong |
| 21:30 | tomoj | "call call call" looks suspicious |
| 21:42 | tomoj | I bet semantic editor combinators shouldn't be directly translated to concatenative |
| 21:49 | seangrove | Christ, it's easy to write leaky code with Closure |
| 21:50 | tomoj | leaky as in memory? |
| 21:55 | seangrove | tomoj: Yeah |
| 21:57 | tomoj | clojurescript leaks in places clojure wouldn't, because of closure? :( |
| 21:59 | brehaut | http://blog.ezyang.com/2011/05/space-leak-zoo/ |
| 22:00 | brehaut | haskellers use the term 'space leak' as a superset of the bugs that can cause a program to consume all your ram, with memory leak being the particular problem that notoriously effects C programs |
| 22:04 | tomoj | what's a space leak that can't cause a program to consume all your ram? |
| 22:06 | tomoj | I guess since there's a stack limit, stack overflow |
| 22:07 | brehaut | sorry, i was unclear |
| 22:07 | brehaut | its a superset of memory leaks, and includes all the ways you can consume all your ram |
| 22:08 | mthvedt | is there a leak that covers bloated programming |
| 22:08 | brehaut | java |
| 22:08 | mthvedt | haha |
| 22:10 | seangrove | tomoj: Nah, just the documentation of Closure is so-so, great at a small level, not so great at a high-level, so it's easy to destroy components that leave tons of event listeners that have references to DOM elements that would otherwise get GC'd |
| 22:11 | tomoj | I see, good. I've been worried about optimization-induced space leaks ##(inc brehaut) |
| 22:11 | lazybot | java.lang.RuntimeException: Unable to resolve symbol: brehaut in this context |
| 22:12 | brehaut | haha, the karma thing is a special syntax, not an evaluated piece of clojure |
| 22:12 | seangrove | I'm just trying to get a test going just to asserts that the number of listeners/undisposedObjects is 0 at the beginning/end, but it's still pretty rough it seems |
| 22:13 | brehaut | seangrove: incidentally, its common in javascript to build really leaky event handling code. ibdknox had some horrific experience trying to use jquery and contain the memory growth |
| 22:14 | tomoj | lol "stack underflow" |
| 22:14 | seangrove | brehaut: Yeah, we build a gmail plugin, so we have to ensure we don't leak memory because pages are left open for days at a time |
| 22:14 | seangrove | It's an interesting challenge |
| 22:15 | seangrove | Maybe we could be sneaky and find a reference to how much memory is being used, and just refresh the page, heh |
| 22:15 | tomoj | or just refresh after idle for X min? |
| 22:15 | seangrove | I imagine the gmail users might be slightly upset about it, but maybe that's not a bad idea |
| 22:16 | seangrove | Anyway, we have space leaks with our current version, but the cljs version we're making sure that it's sound from the beginning |
| 22:16 | seangrove | I expect it'll be a reasonable job now that we're aware of it |
| 22:17 | seangrove | ibdknox: Any tips on how you're handling testing? |
| 22:24 | dyreshark | hi! i've been using clojure for a few weeks now, and i was wondering if someone could refer me to some code i could read so i can improve my coding skills in clojure? i come from a background of primarily c++/c/python, so at the moment i'm likely not writing good code. :p |
| 22:25 | brehaut | ring, compojure, leiningen, |
| 22:25 | brehaut | they are all well maintained projects with lots of eyes on them |
| 22:26 | dyreshark | cool, i'll look into them. thanks :) |
| 22:26 | Frozenlock | The clojure source itself can be interesting. |
| 22:27 | moogatronic | dyreshark: maybe just keep building things in a questionable way? I find that discovering idioms happens sort of organically.. |
| 22:27 | moogatronic | reading code is definitely a part of that though… |
| 22:29 | dyreshark | moogatronic: yeah, i've done a few personal projects in clojure. i just feel like reading some code would at the very least introduce me to things i don't know about yet |
| 22:29 | dyreshark | like if-let. i learned that a full ten minutes ago :P |
| 22:29 | moogatronic | Frozenlock: yeah, I have a lot of stuff like that in my code. Hopefully less now than a year ago… but you never know. =) |
| 22:30 | dyreshark | Frozenlock: i feel like i have a lot of things like that. :P |
| 22:30 | dyreshark | oh well! thanks again for the insight, all |
| 22:30 | seangrove | I can't tell how to track down this stack trace https://gist.github.com/413f31323d5142993207 |
| 22:31 | seangrove | Hmm, it's probably a syntax error on my part somewhere, let go through once more... |
| 22:31 | tomoj | looks like you have a bad ns decl? |
| 22:32 | brehaut | thats my first gues too |
| 22:33 | seangrove | How do you guys see that? |
| 22:34 | seangrove | How/where in the trace? |
| 22:34 | tomoj | first, we know you have foo where it should be [foo] or (foo) |
| 22:35 | Hodapp | what's a typical Clojure-ish method of implementing an abstraction layer that could target multiple backends? |
| 22:35 | tomoj | which is a common error in ns decls I think |
| 22:35 | tomoj | then there's a parse-ns in the stacktrace |
| 22:35 | brehaut | seangrove: mysterious looking 'nth not supported on this type: Symbol' coming from the compiler is a good clue |
| 22:35 | brehaut | Hodapp: that would be protocols |
| 22:35 | tomoj | and analyzer.clj:639-ish is the parse 'ns multimethod |
| 22:36 | brehaut | Hodapp: and more rarely multimethods |
| 22:36 | seangrove | tomoj: You just know that from experience? |
| 22:36 | tomoj | I looked at analyzer.clj |
| 22:37 | seangrove | Well, I guess I should be less afraid of diving into the source of Clojure then |
| 22:37 | tomoj | you can pretty much ignore RT.java, core.clj, protocols.clj, etc |
| 22:37 | brehaut | the source command at your repl helps for that too |
| 22:38 | tomoj | since it's a cljs compile error compiler.clj and analyzer.clj frames will likely be helpful to look at |
| 22:39 | seangrove | Ah, I feel bad now, didn't realize that was the normal way of going about things |
| 22:39 | seangrove | Ok, I'll go after it from here, thank you! |
| 22:39 | tomoj | my editor throws more exceptions every time I try to get it to jump to a frame :( |
| 22:40 | brehaut | seangrove: no need to feel bad. |
| 22:41 | brehaut | seangrove: you asked a sensible question |
| 22:41 | seangrove | brehaut: It feels a bit lazy in hindsight is all ;) |
| 22:42 | seangrove | But M-. on cljs.compiler/parse-ns and it's starting to make more sense |
| 22:42 | brehaut | i dunno; its not normal for programmers to look under the hood on their compiler in most languages |
| 22:42 | brehaut | so its not really lazy, its just a lack of awareness |
| 22:43 | seangrove | Appreciate that, I'd agree with the lack of awareness |
| 22:43 | seangrove | I've heard good things about the cljs source anyway, so shouldn't be afraid of digging through it |
| 22:46 | tomoj | wonder how long before compiler errors show line/col |
| 22:48 | brehaut | seems like it mustnt be far off if there is source mapping in cljs |
| 22:53 | mattmoss | What is the better for (map #(some-fn %) coll) ? I'm feeling stupid atm. |
| 22:55 | Frozenlock | (map some-fn coll) :P |
| 22:55 | brehaut | (map some-fn coll( |
| 22:55 | seangrove | With a pluggable analyzer like fogus talked about, I really hope we can get some super-helpful error messages. Instead of "Wrong number of args (5) passed to: analyzer$eval223$fn--224$pfn", it'd be "You passed 5 arguments to a def - did you mean to use a defn?" |
| 22:56 | atom_ | performance question: is there any reason performance wise to use clojure instead of java? |
| 22:56 | seangrove | So many interesting projects to work on in clojure-land, heh |
| 22:56 | mattmoss | Frozenlock: Oh, duh. I see what you mean. |
| 22:57 | brehaut | atom_: java is (unsurprisingly) a very close fit to the optimal performance decisions for the JVM. i dont think your question makes sense. |
| 22:58 | Frozenlock | Does this seem applicable to clojure? http://www.hascode.com/2012/05/creating-updatable-java-applications-using-getdown-and-the-getdown-maven-plugin/ |
| 22:59 | atom_ | brehaut: I understand that java is (unsurprisingly) close to the optimal performance for the JVM. I was asking in terms of performance gain, if there was ever a time I would use clojure in place of java. |
| 23:00 | brehaut | i doubt it |
| 23:00 | seangrove | atom_: Haven't done any Java development, so can't comment one way or the either |
| 23:01 | brehaut | atom_: inplace munging of data without functioncall overhead is how you write screaming code. thats not ideal in clojure. |
| 23:01 | ChongLi | optimal performance is kind of a nebulous concept |
| 23:01 | atom_ | It was a general question. If everyone were only concerned about speed we would all be writing in ASM or C. |
| 23:02 | ChongLi | if clojure allows you to express some abstraction that makes it easier to write a parallel program than java, does that make it super-optimal? |
| 23:02 | seangrove | ChongLi: That's what I was thinking, yes |
| 23:02 | brehaut | atom_: or haskell or java… |
| 23:02 | brehaut | C doesnt have some secret advantage of being fast |
| 23:03 | brehaut | the JVM is capable of some really impresive optimisation |
| 23:08 | brehaut | atom_: my point re:java is that its close to what the JVM does. JVM is the optimising compiler; javac is not. clojure isnt an optimizing compiler either. therefore, its going to be easiest to write performance optmized code in the language closest to the model the optimizing compiler expects |
| 23:08 | brehaut | atom_: clojure code could be written that equals java code |
| 23:08 | brehaut | atom_: but it doesnt make sense to expect it to be fast |
| 23:08 | brehaut | er |
| 23:09 | atom_ | brehaut: I understand what you're saying. I was just asking out of curiosity, also trying to find a reason to work it into our applications. |
| 23:10 | brehaut | atom_: choose clojure for aiding correctness and expression |
| 23:10 | atom_ | brehaut: I personally love writing in clojure, just looking for where I could leverage it and to what end. |
| 23:10 | ChongLi | yes |
| 23:10 | ChongLi | the real question you should ask when evaluating any programming language |
| 23:10 | muhoo | ah, tradeoffs, the bread and butter of engineering :-) |
| 23:11 | ChongLi | is if it helps you express a solution to your problem in a more concise, easily read and easily maintained manner |
| 23:11 | ChongLi | from SICP: the 3 key features of any programming language |
| 23:11 | ChongLi | primitve operations, means of combination and means of abstraction |
| 23:12 | muhoo | often you're really trading cpu time for programmer time. |
| 23:12 | ChongLi | since clojure is implemented in java, anything you can write in clojure could be written in java |
| 23:12 | ChongLi | but what would that actually look like? :) |
| 23:13 | brehaut | ChongLi: it would look like biting tinfoil tastes |
| 23:13 | ChongLi | or fingernails on a chalkboard |
| 23:13 | ChongLi | haha |
| 23:14 | atom_ | ChongLi: Many of the concepts you just spoke about are foreign to me. My degree is in physics and I took only 1 programming class. I was hired by the company owner because he liked talking to me about solid state dynamics. I kind of fell into programming so the jargon is a little difficult for me to handle sometimes. |
| 23:14 | ChongLi | atom_: that's fine |
| 23:15 | ChongLi | if you have time, you might want to look at SICP |
| 23:15 | ChongLi | it'll explain it way better than I can |
| 23:15 | atom_ | ChongLi: I've been reading/watching the MIT OCW on that recently. |
| 23:15 | ChongLi | that's good |
| 23:15 | atom_ | ChongLi: I think I like clojure because it makes more sense than OOP to me. |
| 23:16 | ChongLi | of course |
| 23:16 | ChongLi | functional programming is much closer to mathematics |
| 23:16 | ChongLi | you can use the substitution model |
| 23:16 | ChongLi | something you're very familiar with in algebra |
| 23:17 | ChongLi | once you introduce assignment (mutation) you lose the algebraic properties |
| 23:18 | ChongLi | variables no longer refer to values but instead to places in memory |
| 23:18 | ChongLi | substitution breaks down because you're no longer talking about values |
| 23:20 | seangrove | Struggling with running cljs test - Here's my project.clj https://gist.github.com/1dfa6eae91dae6cf37c9 |
| 23:20 | atom_ | Well, after learning Java enough to work within our applications (the largest one is small, probably only 250k - 300k lines) I've found that mistakes are made because of mutation. Exceptions, bad data, etc. I found clojure and thought it might help solve some of the problems. |
| 23:21 | seangrove | On line 50 I define the :test cljs build, which compiles the :source-path into "unit-test.js" |
| 23:21 | seangrove | The unit-test.html includes unit-test.js as a script tag, so it seems like it's meant to be a bootstrap of sorts |
| 23:21 | ChongLi | atom_: it will, and more |
| 23:22 | ChongLi | clojure is also way more expressive than java |
| 23:22 | ChongLi | it'll allow you to accomplish more with less code |
| 23:22 | ChongLi | what I don't get is why people out there try to argue against that? |
| 23:23 | ChongLi | why do so many people insist on using languages that require them to follow rote mechanical repetition? |
| 23:23 | ChongLi | "design patterns" as they're called |
| 23:23 | seangrove | But two problems: One, how should I get the actual application cljs code included, and Two, if I'm setting on-page-load events in my application code, I suppose they'll be called when they're included as a script tag, so I'll need to find a way to prevent them from being called |
| 23:24 | atom_ | ChongLi: Because that's what's familiar to them? |
| 23:24 | tomoj | they were taught or learned a way. it probably involves an IDE that does a lot of useful things |
| 23:24 | brehaut | ChongLi: design patterns werent originally supposed to be followed rote; they represent small case studies in common problems, enumerating a common best trade off, and the problems of benefits involved |
| 23:25 | ChongLi | if the problem is common enough, why not have a library to take care of it? |
| 23:25 | ChongLi | unless your language lacks the expressive power to create such a library |
| 23:26 | brehaut | ChongLi: well partly, but also because the particular solutions involve trade offs. a concrete solution hard codes that trade off. |
| 23:26 | tomoj | hmm |
| 23:27 | brehaut | frinstance, GOF, Decorator (first pattern that the book opened to) lists under Consequences "…two key benefits and two liabilities…" |
| 23:27 | brehaut | (thats pg 178 of GoF) |
| 23:28 | ChongLi | haha |
| 23:28 | brehaut | seangrove: the book is on my shelf, within arms reach :P |
| 23:29 | brehaut | i dislike the wanton application as much as the next sensible programmer |
| 23:29 | brehaut | but i also dislike patterns getting set up with a straw man |
| 23:29 | seangrove | Meant as a compliment ;) |
| 23:29 | brehaut | ah :) |
| 23:29 | tomoj | brehaut: but isn't that exactly the expressiveness problem I think dnölen talked about? |
| 23:29 | seangrove | And it's a well-balanced view anyway |
| 23:29 | ChongLi | what about stuff like "dependency injection"? |
| 23:30 | tomoj | being able to write libraries which don't make those choices? |
| 23:30 | seangrove | I *still* don't get DI - what the hell is it supposed to do? |
| 23:30 | brehaut | tomoj: for the GoF patterns, absolutely yes |
| 23:30 | ChongLi | it makes me laugh that imperative programmers complain about monads |
| 23:31 | ChongLi | and then talk about dependency injection and abstract factory patterns |
| 23:31 | brehaut | tomoj: but every level of abstraction in an engineering solution has trade offs. just because our language lets us avoid low level trade offs with ease doesnt mean that there arent higher level trade offs it cant address |
| 23:31 | ChongLi | everybody's guilty of these overwrought names, if you ask me |
| 23:32 | brehaut | its one of the two hard problems in computer science (naming, cache invalidation, and off by one errors) |
| 23:32 | ChongLi | hahaha |
| 23:33 | tomoj | is a sign error an off by one error in Z_2? |
| 23:34 | ChongLi | I guess monad isn't all that overwrought |
| 23:34 | ChongLi | it's just an alien term |
| 23:34 | brehaut | its perhaps underwrought |
| 23:34 | ChongLi | it also happens to be a very abstract concept |
| 23:35 | brehaut | yes |
| 23:35 | ChongLi | which always seems hard to name |
| 23:35 | ChongLi | I tried explaining monads to somebody in #archlinux the other day |
| 23:35 | ChongLi | and it was very hard |
| 23:36 | ChongLi | tried going from functions like a -> a |
| 23:36 | ChongLi | but even that was a stretch for this person |
| 23:36 | tomoj | hmm.. if a language could well address all trade offs, there wouldn't be any reason to use a different language. so that's om |
| 23:36 | ChongLi | I guess most people aren't used to the idea of type variables |
| 23:37 | brehaut | tomoj: om ? |
| 23:37 | ChongLi | ? |
| 23:37 | tomoj | just a name for the perfect language |
| 23:37 | ChongLi | how do you address all tradeoffs? |
| 23:37 | tomoj | you don't |
| 23:37 | brehaut | tomoj: ah, coBlub |
| 23:38 | ChongLi | coblub would be a great name for a language actually |
| 23:38 | brehaut | tomoj: just incidentally, i don't think its an accident that GoF is full of ways to do straight forward smalltalk in C++ |
| 23:39 | tomoj | I think the question was something like whether statements of the form "language X is closer to coBlub than language Y" can have truth values |
| 23:40 | tomoj | not, of course, whether clojure is coBlub |
| 23:40 | brehaut | right |
| 23:41 | brehaut | agda will (eventually at least) be blub to someone |
| 23:41 | brehaut | anyway, its the end of the day here. later |
| 23:42 | ChongLi | later |
| 23:52 | clj_newb_2345 | i'm writing some graphics intense (svg manipulating) code in clojurescript |
| 23:52 | clj_newb_2345 | my code is slow |
| 23:52 | clj_newb_2345 | how do I profile this? |
| 23:52 | clj_newb_2345 | my background is clojure, not javascript |
| 23:53 | bbloom | clj_newb_2345: you can look at allocations and cpu time in chrome |
| 23:53 | clj_newb_2345 | i am using chrome |
| 23:53 | bbloom | clj_newb_2345: and use the 'time macro |
| 23:53 | bbloom | (doc time) |
| 23:53 | clojurebot | "([expr]); Evaluates expr and prints the time it took. Returns the value of expr." |
| 23:53 | ChongLi | I don't know a lot about clojurescript |
| 23:53 | clj_newb_2345 | bbloom: do I need some plugin to use the chrome profilng tools |
| 23:53 | ChongLi | but I do know that it doesn't have the same kind of complexity guarantees in its immutable data structures |
| 23:53 | bbloom | ChongLi: that is no longer true |
| 23:53 | ChongLi | oh really? |
| 23:54 | ChongLi | shows how much I know :) |
| 23:54 | bbloom | ChongLi: cljs has had persistent data structures for quite a while |
| 23:54 | ChongLi | that's really good to hear |
| 23:54 | bbloom | clj_newb_2345: you can use the regular profiler |
| 23:54 | clj_newb_2345 | bbloom this is very useful |
| 23:54 | clj_newb_2345 | so 11% is my program |
| 23:54 | clj_newb_2345 | 8% is the GC |
| 23:55 | clj_newb_2345 | hmm, 31% is some json function |
| 23:55 | clj_newb_2345 | and 40% is ... _seq ? |
| 23:55 | bbloom | clj_newb_2345: if you're using advanced mode, name mangling can make your life difficult :-/ |
| 23:56 | clj_newb_2345 | this is amazing |
| 23:56 | clj_newb_2345 | I would have otherwise never guesed the time splitting |
| 23:56 | clj_newb_2345 | thanks! |
| 23:57 | bbloom | clj_newb_2345: no problem :-) |
| 23:57 | bbloom | clj_newb_2345: are you using advanced optimizations? |
| 23:57 | clj_newb_2345 | no |
| 23:57 | clj_newb_2345 | how do I turn them on? |
| 23:57 | bbloom | clj_newb_2345: you should try those first :-) |
| 23:57 | bbloom | are you using lein-cljsbuild ? |
| 23:57 | bbloom | {:optimizations :advanced} |
| 23:57 | bbloom | it's in the docs |
| 23:57 | clj_newb_2345 | you mean have the computer do more work rather than me do more work? |
| 23:57 | bbloom | clj_newb_2345: bingo. haha |
| 23:58 | bbloom | clj_newb_2345: advanced optimizations will elimiate dead code, aggressively inline small functions, specialize call sites on type, ec |
| 23:58 | clj_newb_2345 | recompiled |
| 23:59 | bbloom | clj_newb_2345: take a peek at the compiled output to make sure it's rewritten everything to completely unreadable single character names :-) dnolen is working on source maps to make it easier to debug |
| 23:59 | clj_newb_2345 | hmm, my program is now taking 40% of the time |