2012-01-31
| 00:03 | jkdufair | anyone have experience with cdt? |
| 00:06 | devn | jeremyheiler: yeah, it seems interesting maybe -- idk |
| 00:07 | jeremyheiler | yeah, im hesitent about things like this. I mean, it took me a while to release Domain Driven Development really only translated into "don't be stupid, and think about design" |
| 00:07 | jeremyheiler | realize* |
| 00:24 | devn | jazzy |
| 00:30 | jbiesnecker | jeremyheiler: These things are like (most) religions, which all tend to boil down to more or less the Golden Rule. Generally they're different ways to slow down, reason about your problem before you start working on it, etc. |
| 00:31 | devn | jbiesnecker: they offer dimension, an angle for consideration |
| 00:31 | devn | jbiesnecker: it's a nice review of possible paths one might consider taking |
| 00:32 | jbiesnecker | devn: not saying they're useless by any means, but rather that they tend to revolve around the same handful of ideas. |
| 00:33 | jbiesnecker | devn: and sometimes it's the revolving that makes the idea make sense. |
| 00:34 | cmajor7 | (starting out with clojure): In imperative world, there are (XA) transactions, AOP, messaging(JMS/AMQP), Security, TCP/IP, etc.. What is the general approach to these things in the clojureland? to just reuse what is there in Java world? [seems that problems can be solved simpler with clojure, but a lot of "enterprise" concerns are still there]. appreciate your thoughts. |
| 00:36 | devn | jbiesnecker: that's a really fantastic way of saying that. |
| 00:37 | devn | jbiesnecker: i agree with you. |
| 00:37 | devn | jbiesnecker: for now ;) |
| 00:37 | jbiesnecker | devn: ;) |
| 00:38 | metajack1 | cmajor7: In some cases there are really nice Clojure abstractions for those (STM, Avout, Lamina, etc) and in some cases you just use the JVM libraries already available. A lot of times you start with the latter and end up creating the former. |
| 00:41 | devn | cmajor7: im playing that chord sequence on my guitar right now. is this a song i should recognize? |
| 00:43 | muhoo | i'm kind of avoiding overtone because i have to focus on stuff that's going to make money |
| 00:43 | cmajor7 | metajack1: thank you. I am just trying to estimate a "what would it take" scenario by looking at the last couple apps I wrote in "Scala / Spring Integration" that talk to sockets and do AOP and XA. I am thinking I'd love to be able to achieve the same (but of course more elegantly and simpler :) ) in clojure. What I am stumbling upon are regular things.. get XA resource.. create an aspect, hook into a monstrous websphere mq, etc.. would i |
| 00:43 | devn | start touring muhoo :) |
| 00:44 | muhoo | devn: been there, done that |
| 00:44 | muhoo | have the poverty to show for it. |
| 00:44 | cmajor7 | muhoo: may songs start with cmajor7. Actually _any_ song that starts with the major chord can start with cmajor7 :) |
| 00:45 | muhoo | i prefer the bill evans chord, 3 7 9 with the 1 in the bass. |
| 00:45 | devn | so specific |
| 00:45 | devn | i cant pick one |
| 00:45 | technomancy | nuclearsandwich: fixed in lein 1.7, but I guess I better fix it in swank too |
| 00:46 | devn | it's like killing a child or something -- chords require context to be themselves |
| 00:46 | metajack | I think messaging is going to be the same. As for sockets, the abstractions in Lamina and Aleph are really nice. I have no experience with AOP in clojure or with distributed transactions, but for the latter you have easy access to ZooKeeper or Avout, or if it's all in process, you can just use Clojure's STM. |
| 00:46 | muhoo | what is AOP? |
| 00:46 | aphyr | muhoo: macros. |
| 00:46 | metajack | muhoo: Aspect oriented programming I assume |
| 00:46 | amalloy | invisible macros |
| 00:46 | muhoo | aop is macros?! |
| 00:46 | aphyr | weak macros, haha |
| 00:46 | cmajor7 | muhoo: http://en.wikipedia.org/wiki/Aspect-oriented_programming |
| 00:47 | devn | i honestly am dumbfounded as to what is happening in here |
| 00:47 | technomancy | aaelony: I'm heading off, but if you could try the 1.x branch of leiningen from git and open an issue if it breaks that would be great |
| 00:47 | muhoo | my god, there's so much buzzword bullshit involved in just working around weaknesses in OOP |
| 00:48 | aphyr | Basically a way to write functionality in different discrete ways and plug them together in functions |
| 00:48 | muhoo | AOP, design patterns, feh. |
| 00:48 | cmajor7 | think about is a weaving the code into any spot of you program later.. ( e.g. compile time, byte code weaving, run time ) |
| 00:48 | aaelony | ok, do you have a link so I'm sure to try the right one? |
| 00:48 | technomancy | git://github.com/technomancy/leiningen.git |
| 00:49 | muhoo | the statement above about all these things just being flaiings at trying to acheive some elusive platonic ideal is quite good, i think. |
| 00:49 | aaelony | cool, thanks |
| 00:50 | muhoo | aphyr: thanks |
| 00:50 | cmajor7 | muhoo: aop is not really a pattern, but what they call a cross cutting concern tool without polluting the codebase. think about security, logging, exception handling, tx management, etc.. that could be "weaved" later on into your code base |
| 00:51 | muhoo | similar to writing algorithms to handle seqs, so you can later plug lots of different types of data into it? :-) |
| 00:51 | aphyr | Maybe. You even seen ruby method alias chaining? |
| 00:51 | aaelony | technomancy: from the leiningen directory I do bin/lein, right? that gives me an exception. |
| 00:51 | aphyr | do_something_before_foo? |
| 00:52 | muhoo | no i haven't gotten that deep into ruby. |
| 00:52 | carllerche | Are people still having issues w/ transient maps on the latest clojure 1.4 alpha? |
| 00:52 | aphyr | muhoo: that's AOP, in a sense. Wrapping up methods in other methods that provide, say, connection safety, thread safety, logging, debugging, etc. |
| 00:52 | muhoo | aphyr: like ring middleware? |
| 00:53 | aphyr | muhoo: Sure, that'd be a nice example/ |
| 00:53 | devn | alias method chains are the same as ring middleware? |
| 00:53 | carllerche | amalloy: I noticed you submitted a transient map issue |
| 00:53 | technomancy | aaelony: if you get an error on the 1.x branch after following the "building" instructions in the readme, please open an issue on github |
| 00:53 | aaelony | ok |
| 00:53 | metajack | ah, i've used this in Emacs without knowing that much about it. There it's called advice. |
| 00:54 | aphyr | devn: in the sense that they're composing orthogonal functionality into single functions, yes. |
| 00:54 | amalloy | carllerche: quite a long time ago, and based on an issue someone posted about on the mailing list. i don't follow the alphas so i dunno |
| 00:55 | nuclearsandwich | technomancy: awesome, thanks. Is 1.7 ready for testers or should I be patient. |
| 00:55 | carllerche | I will submit an issue… for now is there a way to work around transient maps? It seems that converting a java HashMap into a persistent map uses transient maps, so I would guess it would still be buggy |
| 00:55 | technomancy | nuclearsandwich: should be good to go apart from documentation and a couple irreproducible bug reports; hope to release in a few days |
| 00:55 | cmajor7 | metajack: right. an "aspect" could have one or more "advice"s that could be "applied" to a certain "pointcut" (that can be regex specified) in your code |
| 00:56 | metajack | cmajor7: In that case, I think you'll find Clojure quite a bit more powerful for this :) |
| 00:57 | amalloy | well, clojure only has macros, not secret-invisible macros that get applied all through your codebase without any visible signs |
| 00:57 | technomancy | "INVISIBLE MACRO" might make a good lolcat though |
| 00:57 | metajack | amalloy: You could replace vars at runtime with new versions though right? |
| 00:57 | muhoo | or a band name. |
| 00:57 | amalloy | technomancy: feel free to steal that |
| 00:57 | cmajor7 | metajack: right.. while I have a very good imperative understanding of AOP, since I am only starting out with Clojure, I have a hard time placing it in the clojureland |
| 00:57 | amalloy | metajack: but how will you reassign let? i'm sure AOP lets you give advice around "assigning variables" |
| 00:58 | amalloy | (not that i actually want this in clojure) |
| 00:58 | cmajor7 | amalloy: thanks. are you saying that if I need to add an "auth" capability into functions that follow a certain pattern, I can do it with macros? |
| 00:58 | metajack | amalloy: Does AspectJ do this? From the wikipedia page it mostly looked like augmenting function calls. |
| 00:58 | amalloy | metajack: whatever. you can't do that either, across all functions |
| 00:59 | amalloy | "every time i call a function whose name starts with x, please do ____" |
| 00:59 | aphyr | Sure you can |
| 00:59 | aphyr | Wrap your entire program in a macro that recursively rewrites forms |
| 00:59 | amalloy | cmajor7: you could, but usually it's more flexible to just use higher-order functions |
| 00:59 | aphyr | Take every fn that starts with x and rewrite it to do something else |
| 00:59 | amalloy | aphyr: yes, yes, i know macros can do anything |
| 00:59 | aphyr | Why you'd want to is beyond me though, haha :) |
| 01:00 | metajack | cmajor7: I'd go read a Ring or Compojure tutorial to get an idea of how passing around wrapper functions works. It's probably similar enough to give you some good ideas. |
| 01:01 | cmajor7 | amalloy: trying to wrap me head around it :) are you talking passing "some" function f(x) into another f(y) just in case.. to later enrich f(x) with "auth" capability? |
| 01:01 | amalloy | eg, (defn wrap-security [f] (fn [& args] (when *secure-connection* (apply f args)))) - you take a function in, and return a new function that performs the original action only if the connection is secure |
| 01:02 | aphyr | cmajor7: https://github.com/aphyr/ustate/blob/master/reimann/reimann.config |
| 01:02 | cmajor7 | metajack: thanks.. once I am finished with the Mark Volkmann's tutorial :) |
| 01:02 | metajack | cmajor7: If you know python, it's pretty similar to python decorators. Django uses this for transactions for example. |
| 01:02 | aphyr | Each of those is a function that encapsulates the functions below it to contextualize them. |
| 01:02 | muhoo | i was going to ask about decorators |
| 01:03 | muhoo | i did see a similarity between middleware and decorators, but hadn't studied them enough to know for sure. |
| 01:05 | cmajor7 | aphyr, amalloy: but aren't these examples _assume_ that there is "security" ( e.g. auth ) in the first place? I may be missing something.. though [can't inhale clojure that fast just yet] |
| 01:06 | aphyr | cmajor7 really AOP all comes down to writing bits of code to attack separate problems in composable ways. |
| 01:06 | amalloy | yes, my example assumes there's some way to find out if auth has happened; i'm not going to write a whole auth layer in irc. but the point is you can wrap render-webpage with the auth functionality, even though render-webpage knows nothing about auth |
| 01:07 | cmajor7 | amalloy, aphyr, metajack: thank you. I got the "wrapper function" approach. makes sense. |
| 01:09 | aphyr | cmajor7: you can invert that as well: functions make calls to globally scoped hooks that allow them to do interesting things. |
| 01:10 | aphyr | For instance, (defn send [message] (with-network-connection [conn] (send-message conn n))) |
| 01:11 | aphyr | with-network-connection doesn't know what connections are used for, but it creates, locks, and provides them to callers as a service. |
| 01:11 | aphyr | and could itself be extended with logging, debugging, etc. |
| 01:13 | cmajor7 | aphyr: yep, I see.. I guess the whole AOP aspect is there mostly because it is hard to "change" the behavior of something that is already there without inheritance.. where in Clojure ( any functional language ), we can just pass a decorated function... |
| 01:15 | cmajor7 | moving on from AOP (marking it "the clojure way is understood")… how easily do you think I can use clojure with something like Spring Integration ( channel | pipe | filter, etc.. )? ( I understand that you would have reservation from using it with anything like Spring Xyz, but I do believe Spring Integration solves "integration" in a very simple and powerful way ) |
| 01:16 | aphyr | Integration is just queue-backed message passing? |
| 01:18 | aphyr | I'd reach for agents, nonblockingqueue + threadpool, regular old fn composition, or something like Lamina. |
| 01:20 | aphyr | cmajor7: https://github.com/ztellman/lamina may be interesting |
| 01:20 | cmajor7 | aphyr: not just queue.. it implements EIP patterns http://martinfowler.com/books.html#eip where you have things like message stores, protocol adapters ( jms, amqp, jdbc, webservices, etc.. ), aggregators, splitters, etc.. |
| 01:21 | cmajor7 | aphyr: sure. thanks, I'll take a look |
| 01:21 | aphyr | cmajor7: here's a fn-composition implementation of aggregators, splitters, filters, pipes, stateful things, etc. https://github.com/aphyr/ustate/blob/master/reimann/src/reimann/streams.clj |
| 01:21 | y3di | hey guys, i assume clojurescript doesn't mesh well with alot of the newer js frameworks (backbone.js)? |
| 01:25 | cmajor7 | aphyr: looks cool. if I need to connect these channels / pipes to something such a MQ (websphere, rabbit, etc..) where do I start? |
| 01:26 | aphyr | consume-all -> mq client? |
| 01:26 | aphyr | Plus a few lines for connection safety and logging I gues |
| 01:27 | aphyr | Or you could use Spring Integration, if that's what you really want. |
| 01:29 | cmajor7 | but if I do use Spring Integration / Camel, is there a way not to get into OOP trap by using it in Clojure? |
| 01:29 | aphyr | Dunno dude, I try to stay far away from anything that says "enterprise" or "pattern". |
| 01:30 | aphyr | If no wrappers exist you could write one, or you could create objects and do things java-interop style. |
| 01:31 | aphyr | My limited experience with interop (via antlr) has been pretty painless--I just try to get out of java and into clojure as fast as possible. |
| 01:32 | jbiesnecker | Is there an LRU object cache library that supports expiration? I've been googling and not coming up with anything... |
| 01:34 | cmajor7 | aphyr: while I agree with you that enterprise, pattern, process, etc.. are really vague and useless concepts, I actually see strengths in both worlds ( e.g. how mature Camel / Spring Integration is and at the same time how elegant, simple and beautiful Clojure is ). Since I do not yet know Clojure well (still going through tutorials), I do not feel how simple would it be to use both... |
| 01:34 | aphyr | cmajor7: if it helps, writing java in clojure seems easier than writing java in java. |
| 01:38 | cmajor7 | aphyr: I would prefer "clojure in clojure" and "java in java" :), but I get what you're saying |
| 01:39 | cmajor7 | aphyr: thanks for your help.. bouncing off.. |
| 01:58 | muhoo | where is the show function now that there's no more contrib? |
| 01:58 | muhoo | where's repl-utils, in general now? |
| 02:00 | tjgillies | im trying to import classes into clojure from a jar but im getting an error |
| 02:01 | tjgillies | user=> (import '(jm.util Play)) |
| 02:01 | tjgillies | java.lang.ClassNotFoundException: jm.util.Play (NO_SOURCE_FILE:10) |
| 02:02 | tjgillies | jar is in my classpath |
| 02:03 | tjgillies | and jar tf jMusic1.6.3.jar lists class |
| 02:06 | tjgillies | oh |
| 02:06 | tjgillies | jar wasn't in my classpath, fail |
| 02:06 | tjgillies | im new to JVM |
| 02:09 | muhoo | that's weird. i have no clojure.contrib.repl-utils. why? |
| 02:09 | yawNO | hi |
| 02:09 | muhoo | &(require 'clojure.contrib.repl-utils) |
| 02:09 | lazybot | java.io.FileNotFoundException: Could not locate clojure/contrib/repl_utils__init.class or clojure/contrib/repl_utils.clj on classpath: |
| 02:09 | muhoo | huh |
| 02:09 | muhoo | &(require clojure.contrib.repl-utils) |
| 02:09 | lazybot | java.lang.ClassNotFoundException: clojure.contrib.repl-utils |
| 02:10 | muhoo | wtf? |
| 02:16 | devn | &*clojure-version* |
| 02:16 | lazybot | ⇒ {:major 1, :minor 3, :incremental 0, :qualifier nil} |
| 02:16 | devn | &(use 'clojure.repl) |
| 02:16 | lazybot | ⇒ nil |
| 02:17 | devn | &(doc filter) |
| 02:17 | lazybot | ⇒ ------------------------- clojure.core/filter ([pred coll]) Returns a lazy sequence of the items in coll for which (pred item) returns true. pred must be free of side-effects. nil |
| 02:26 | jbiesnecker | I have a java interop question (and I don't really know Java). I'm trying to use Google's ConcurrentLinkedHashMap as an LRU cache ( http://code.google.com/p/concurrentlinkedhashmap/wiki/ExampleUsage ) |
| 02:27 | jbiesnecker | and I can't figure out how to create the object |
| 02:27 | jbiesnecker | It uses a builder object, but I can't seem to import / reference that object |
| 02:27 | jbiesnecker | And I don't really know enough about Java to know what what I'm looking for is even called |
| 02:28 | raek | jbiesnecker: do you have a link to the javadoc for those classes? |
| 02:29 | raek | the examples don't say which packages the classes are in |
| 02:29 | jbiesnecker | raek: http://concurrentlinkedhashmap.googlecode.com/svn/wiki/release-1.2-LRU/index.html |
| 02:29 | raek | ok |
| 02:29 | jbiesnecker | raek: (import '(com.googlecode.concurrentlinkedhashmap ConcurrentLinkedHashMap)) works just fine in the REPL |
| 02:30 | jbiesnecker | raek: but I can't get anywhere from there |
| 02:30 | raek | (ns ...your-ns... (:import com.googlecode.concurrentlinkedhashmap.ConcurrentLinkedHashMap)) |
| 02:31 | raek | (let [cache (doto (ConcurrentLinkedHashMap$Builder.) (.maximumWeightedCapacity 1000) (.build))] ...) |
| 02:31 | raek | java has . in the name of nested classes |
| 02:31 | raek | but it's really a $ in the name on the JVM level |
| 02:31 | raek | which is what clojure sees |
| 02:32 | jbiesnecker | When I do that (in the REPL, does it matter?) I get "CompilerException java.lang.IllegalArgumentException: Unable to resolve classname: ConcurrentLinkedHashMap$Builder, compiling:(NO_SOURCE_PATH:43)" |
| 02:32 | raek | sorry, my example does not work for two reasons |
| 02:33 | raek | 1. the nested class is its own class, so it needs to be imported too |
| 02:33 | raek | (ns ...your-ns... (:import com.googlecode.concurrentlinkedhashmap.ConcurrentLinkedHashMap$Builder)) |
| 02:33 | raek | 2. you want the result of .build, not the the builder to be bound to 'cache' |
| 02:34 | raek | (let [cache (-> (ConcurrentLinkedHashMap$Builder.) (.maximumWeightedCapacity 1000) (.build))] ...) |
| 02:34 | raek | jbiesnecker: you should be able to access ConcurrentLinkedHashMap$Builder in the repl if you have run (import 'com.googlecode.concurrentlinkedhashmap.ConcurrentLinkedHashMap$Builder) |
| 02:35 | jbiesnecker | raek: Huzzah! It works. Thank you so much! |
| 02:35 | jbiesnecker | raek: I think it was importing the Builder class, or rather me not importing it) that was getting me. |
| 02:35 | raek | yeah, afaik this is not explained in the official docs :( |
| 02:36 | raek | the part about the $, that is |
| 02:36 | jbiesnecker | No, I hadn't seen it. |
| 02:36 | jbiesnecker | Thanks again, that was a nice end to far too much frustration :) |
| 03:16 | echo-area | clgv: ping |
| 03:17 | clgv | echo-area: pong |
| 03:17 | echo-area | clgv: http://pastebin.com/qEJrWemb <-- As for yesterday's question, I wrote a test program |
| 03:18 | echo-area | I think both the forms (board-map #(dosync (ref %)) board) and (board-map ref board) are the same effect |
| 03:19 | clgv | echo-area: oh, I dont think you can conclude that from that code snippet. |
| 03:19 | echo-area | Why? |
| 03:19 | clojurebot | #<ClassCastException java.lang.ClassCastException: clojure.lang.Cons cannot be cast to clojure.lang.IPersistentStack> |
| 03:21 | clgv | well you have very likely only one thread accesing the data at a time since the other sleeps meanwhile. |
| 03:22 | clgv | I dont think the question whether (board-map #(dosync (ref %)) board) and (board-map ref board) in absence of other concurrent operations does lead to much insight. The interesting question in my opinion is: "what do you use dosync for?" |
| 03:23 | clgv | +"do the same in absence..." |
| 03:23 | clgv | that second question is pretty well covered in JoC, I think |
| 03:24 | echo-area | IMHO the point here is that both of the two may print inconsistent values for `board'. The right way to go seems to be (dosync (board-map ref board)), as in the link. |
| 03:24 | clgv | yep that would be the right one |
| 03:25 | clgv | wasnt it deref instead of ref? |
| 03:25 | echo-area | Ah right, it was a typo ;-) |
| 03:25 | echo-area | Whoa I typed wrong for all the forms |
| 03:25 | echo-area | :( |
| 03:26 | echo-area | clgv: Anyway, thanks for the help |
| 03:50 | Blkt | good morning everyone |
| 03:51 | llasram | Ah, time zones. Good morning, Blkt :-) |
| 03:52 | clgv | good morning |
| 04:06 | clj_newb | is there a short hand for (with-meta 'Matrix {:rows 20, :cols 12}) ? |
| 04:06 | G0SUB | clj_newb, ^{:rows 20 :cols 12} 'Matrix? |
| 04:07 | clj_newb | G0SUB: jus the syntax I was looking for; thanks |
| 04:07 | G0SUB | clj_newb, mind you, the quote will mess up the metadata attachment. the metadata will get attached to the (quote Matrix) form instead of the symbol Matrix. |
| 04:08 | clj_newb | crap |
| 04:08 | clj_newb | how do I fix this? |
| 04:08 | llasram | What's the bigger picture of what you're trying to do? |
| 04:08 | G0SUB | clj_newb, depends on what you want. |
| 04:08 | clj_newb | i'm using functional zippers for my wysiwyg editor |
| 04:08 | clj_newb | now, I need to attach meta data to nodes, things that aren't sub nodes; but are important |
| 04:09 | clj_newb | like for example, the dimensions of a matrix |
| 04:09 | clj_newb | i.e. '(Matrix 1 2 3 4) is not enough; since I don't know if it's 1x4, 2x2, or 4x1 |
| 04:09 | clj_newb | I need some meta data hanging around -- stuff that are not entries of the matrix, yet are important, i.e. cols/rows |
| 04:09 | llasram | Hmm. That sounds an awful lot like data, not metadata |
| 04:10 | clj_newb | the reason I don't want to store it as '(Matrix rows cols ~@data) .... is that it then forces a change a setup in my data structures |
| 04:10 | clgv | clj_newb: most likely you should make that explicit within your deftype/defrecord |
| 04:10 | clj_newb | llasram: agreed; I didn't think this out before hand |
| 04:10 | clj_newb | this was more of a "build a prototype; hate self later" approach |
| 04:12 | llasram | Less hate, more refactoring! |
| 04:12 | clj_newb | genrally, I find that if I'm not kicking myself; refactoring is premature optimiation |
| 04:14 | clgv | clj_newb: that sounds pretty wrong |
| 04:21 | clj_newb | this is terrible; I think i'm goign to have to define a proper protocol/interfaces for zipper nodes now |
| 04:21 | clj_newb | and interact with them in an intelligent manner |
| 04:21 | clj_newb | instead of just having everything be a bunch of lists |
| 04:24 | G0SUB | clj_newb, :-) |
| 04:27 | Fossi | is there a chance to get http://dev.clojure.org/jira/browse/CLJ-801 backported to 1.2? |
| 04:28 | Fossi | "Protocols Should Handle Hash Collision" |
| 04:28 | Fossi | it makes our appengine webapps crash spontaneously |
| 04:39 | phil___ | because of what clj_newb said, what is the community consensus of maps vs defrecords/types? |
| 04:39 | _phil | on* |
| 04:41 | _phil | i.e. from what i understand, dont try to structure pure data too much (Person, Employee...) but when it comes to architecture then defrecords/types etc are encouraged (i.e. Window, Widget, FileReader) |
| 04:41 | _phil | correct? |
| 04:43 | _phil | :/ |
| 04:44 | llasram | _phil: That's not quite my understanding of the norms / intent behind the structures |
| 04:45 | _phil | llasram: could you elaborate? |
| 04:46 | llasram | Sure :-) Was trying to track down some documentation to back up my statements, but I'll just wing it |
| 04:46 | _phil | :) |
| 04:46 | llasram | I think deftype is usually used for things which are purely software abstractions. So some "architecture" stuff, and things like data structures, etc |
| 04:47 | llasram | But defrecords implement the map interfaces |
| 04:48 | _phil | llasram: and when do we use maps? :) |
| 04:48 | llasram | I haven't used them myself much, but they let you do type-based polymorphic dispatch, without sacrificing (much) of the flexibility of using maps for domain models |
| 04:49 | _phil | llasram: yes, what i do right now is i use maps but "abstract" away the API behind functions so that i can easily convert to defrecords if i should need polymorphism |
| 04:50 | _phil | but im not sure if thats the right approach |
| 04:50 | llasram | That is my understanding of the best practices as well |
| 04:50 | _phil | so youd say defrecords for "data" and deftypes for "architecture"? |
| 04:50 | llasram | That matches my understanding of the intent as well |
| 04:51 | _phil | or rather, defrecords for data *should the need arise* |
| 04:51 | llasram | Right |
| 04:51 | _phil | allrights, this clarifies things, thanks! |
| 04:51 | _phil | *allright :) |
| 04:52 | llasram | Of course, we could both be wrong... Muhaha |
| 04:52 | llasram | I just deployed my first production Clojure project last week |
| 04:53 | _phil | yea, i think clojure is more of an "individualist" language than others right now :) |
| 04:53 | _phil | i.e. "theres no right way to do it" |
| 05:08 | clgv | _phil: there is also this flowchart http://cemerick.com/2011/07/05/flowchart-for-choosing-the-right-clojure-type-definition-form/ |
| 05:21 | _phil | clgv: thx! |
| 05:24 | Raynes | ROSEBUD! |
| 05:25 | samaaron | Raynes: have you been watching Columbo re-runs again? |
| 07:47 | phil | in which interface is (get ...) defined? |
| 07:47 | phil | its not clojure.lang.Associative |
| 07:48 | phil | when i look at the source, it seems that (get ...) invokes the runtime (clojure.lang.RT) |
| 07:49 | phil | so is it even possible to deftype something that overrides get? |
| 07:49 | llasram | phil: ILookup is probably what you want |
| 07:50 | phil | llasram: hm, where is ILookup defined? |
| 07:50 | phil | clojure.lang? |
| 07:50 | llasram | yah |
| 07:50 | phil | llasram: has it been added recently? cant seem to find it :/ |
| 07:52 | llasram | Added on Aug 2, 2009 according to git |
| 07:53 | phil | llasram: sorry for the noob question, but can you point me to the exact location in the source? or is it not in jvm/clojure/lang? |
| 07:54 | llasram | That's where it should be: https://github.com/clojure/clojure/blob/master/src/jvm/clojure/lang/ILookup.java |
| 07:54 | phil | oh god what kind of clojure do i have :/ |
| 07:55 | llasram | An incomplete one, apparently? That is v odd |
| 07:55 | llasram | Where did you get it from, OOC? |
| 07:56 | phil | llasram: google code oh god |
| 07:56 | phil | :D |
| 07:56 | llasram | Oh! Yes, v old |
| 07:56 | phil | hahah i feel a bit stupid now :D |
| 07:57 | phil | llasram: thanks a lot! |
| 07:57 | llasram | Oh, np! |
| 08:46 | solussd_ | what is the opposite of the interpose function? I want to take a list and separate it into two lists- one of even indices and one of odd. :) |
| 08:47 | RickInGA | there is a take-nth function, or something like it, looking up.... |
| 08:47 | TimMc | solussd_: partition |
| 08:48 | TimMc | Hmm, maybe not quite. |
| 08:48 | solussd_ | yeah.. thought that at first too |
| 08:49 | RickInGA | try (doc take-nth) |
| 08:49 | TimMc | solussd_: Right, you need striding here. |
| 08:49 | RickInGA | &(take-nth 2 (range 10)) |
| 08:49 | lazybot | ⇒ (0 2 4 6 8) |
| 08:50 | solussd_ | that can work |
| 08:50 | RickInGA | &(take-nth 2 (rest (range 10)) |
| 08:50 | lazybot | java.lang.RuntimeException: EOF while reading, starting at line 1 |
| 08:50 | TimMc | OK, I bet there's a function that can split into n lists. |
| 08:50 | RickInGA | &(take-nth 2 (rest (range 10))) |
| 08:50 | lazybot | ⇒ (1 3 5 7 9) |
| 08:51 | TimMc | $findfn 3 (range 9) [[0 3 6] [1 4 7] [2 5 8]] |
| 08:51 | lazybot | [] |
| 08:51 | TimMc | oh well |
| 08:52 | solussd_ | &(let [l [1 2 3 4 5 6]] [(take-nth 2 l) (take-nth 2 (rest l))]) |
| 08:52 | lazybot | ⇒ [(1 3 5) (2 4 6)] |
| 08:52 | solussd_ | kind of ugly |
| 08:53 | RickInGA | can you pass a second param no take nth? |
| 08:53 | RickInGA | &(take-nth 2 1 (range 1 10)) |
| 08:53 | lazybot | clojure.lang.ArityException: Wrong number of args (3) passed to: core$take-nth |
| 08:53 | RickInGA | guess not :( |
| 08:53 | solussd_ | &((juxt (partial take-nth 2) (comp (partial take-nth 2) rest)) [1 2 3 4 5 6]) |
| 08:53 | llasram | &(map (partial take-nth 3) (take 3 (iterate rest (range 12)))) |
| 08:53 | lazybot | ⇒ [(1 3 5) (2 4 6)] |
| 08:53 | lazybot | ⇒ ((0 3 6 9) (1 4 7 10) (2 5 8 11)) |
| 08:54 | solussd_ | of course, I want to be able to do it w/ arbitrary lists |
| 08:54 | llasram | &((fn [n s] (map (partial take-nth n) (take n (iterate rest s)))) 3 (range 12)) |
| 08:54 | lazybot | ⇒ ((0 3 6 9) (1 4 7 10) (2 5 8 11)) |
| 08:55 | RickInGA | wow, that's cool |
| 08:55 | solussd_ | &((juxt (partial take-nth 2) (comp (partial take-nth 2) rest)) [1 '+ 2 '* 3 '+ 4 '/ 5 '+ 6]) |
| 08:55 | lazybot | ⇒ [(1 2 3 4 5 6) (+ * + / +)] |
| 08:55 | TimMc | &(apply map vector (partition 2 (range 20))) |
| 08:55 | lazybot | ⇒ ([0 2 4 6 8 10 12 14 16 18] [1 3 5 7 9 11 13 15 17 19]) |
| 08:55 | TimMc | BAM |
| 08:55 | solussd_ | :D |
| 08:55 | TimMc | Not lazy, but it works. |
| 08:55 | TimMc | (Don't use it with an infinite input.) |
| 08:56 | solussd_ | :) thanks |
| 09:24 | TimMc | A proper striding function would be nice, though. |
| 09:25 | RickInGA | timmc: striding function? |
| 09:28 | TimMc | RickInGA: Transpose of partition. |
| 09:29 | TimMc | what solussd_ was asking for |
| 09:35 | RickInGA | gotcha |
| 10:56 | cmajor7 | (def s1 #{:a : b : c :d :e}) ; spaces in 'b' and 'c' to get rid of smiley faces in irc |
| 10:56 | cmajor7 | (def s2 #{: c :d :f :g :h}) |
| 10:56 | cmajor7 | (/ (count (intersection s1 s2)) (count s1)) ; => 2/5 |
| 10:56 | cmajor7 | what would be a more elegant way to find a percentage one set matches/covers the other? |
| 10:56 | cmajor7 | thank you |
| 10:57 | TimMc | cmajor7: If your IRC client turns :b into a smiley and you can't change that, I think you need a new client. o.O |
| 10:58 | TimMc | cmajor7: And that solution looks fine. Sets are counted in constant time: ##(counted? #{1 2 3}) |
| 10:58 | lazybot | ⇒ true |
| 11:00 | cmajor7 | timmc: thank you. you mean they are counted as they get created? |
| 11:01 | TimMc | Yep. So are maps and vectors. |
| 11:01 | TimMc | Oh, and lists. |
| 11:01 | cmajor7 | that's cool :) |
| 11:01 | cmajor7 | (smiley is intentional) |
| 11:01 | jeremyheiler | ahhhhhh unbalacned paren *dies* |
| 11:03 | TimMc | clgv: You could also roll your own intersection counter if you didn't want to incur the cost of building the intersection set: ##(let [a (set (range 0 6)) b (set (range 0 10 2))] (reduce #(if (a %2) (inc %) %) 0 b)) |
| 11:03 | lazybot | ⇒ 3 |
| 11:03 | TimMc | clgv: But that's likely such a small performance hit that there's no sense worrying about it. :-) |
| 11:05 | TimMc | &(let [a (set (range 0 1e5)) b (set (range 0 1e5 3))] (reduce #(if (a %2) (inc %) %) 0 b)) |
| 11:05 | lazybot | ⇒ 33334 |
| 11:05 | clgv | TimMc: did I ask something? not today I think |
| 11:05 | TimMc | bah |
| 11:06 | TimMc | cmajor7: ^ those up there were supposed to be addressed to you |
| 11:06 | clgv | TimMc: lol you got me as default? :P |
| 11:06 | TimMc | yeah |
| 11:06 | clgv | guess I am asking too much ;) |
| 11:06 | TimMc | I don't understand irssi's tab completion algorithm. |
| 11:07 | TimMc | The problem is that it's usually right, so I've been lulled into complacency. |
| 11:07 | clgv | :D |
| 11:07 | cmajor7 | TimMc: thanks, interesting. performance is not a problem. looking for clarity.. |
| 11:07 | TimMc | cmajor7: Then go with intersection, it is visually clear what is being computed. |
| 11:07 | lnostdal | hi guys, is it possible to extend clojure agents to work nicely with not only the built-in transactions (dosync), but also with "other" transactions like e.g. database ones? .. i mean the agents must not only wait until the clojure transactions are done before running, but must also wait until the db transaction is done running |
| 11:08 | TimMc | lnostdal: ORM, eh? |
| 11:08 | TimMc | ~ORM |
| 11:08 | clojurebot | Object-Relational Mappers are the Vietnam of computer science. |
| 11:08 | TimMc | heh |
| 11:08 | lnostdal | i don't know .. it's a mix |
| 11:08 | RickInGA | hehe |
| 11:09 | llasram | lnostdal: Clojure agents don't interact with the STM system, so... no? |
| 11:09 | TimMc | THey sort of do. |
| 11:10 | llasram | How so? They're reference types, but that doesn't mean they use STM. `dosync' means nothing to an agent |
| 11:10 | TimMc | If you're in a transaction, a 'send(-off) will only act once. But the agent doesn't know that. |
| 11:10 | llasram | Ahhh |
| 11:10 | llasram | Ok |
| 11:10 | TimMc | So... sort of. |
| 11:10 | TimMc | lnostdal: You could make the STM transaction fail if the DB transaction fails, right? |
| 11:11 | TimMc | ##(dosync (when false (io!))) |
| 11:11 | lazybot | ⇒ nil |
| 11:11 | TimMc | ##(dosync (when true (io!))) |
| 11:11 | lazybot | java.lang.IllegalStateException: I/O in transaction |
| 11:12 | romain_p | Would anybody suggest alternatives to represent graphs in this code ? The name+gensym solution I came up with seems yucky, but I have no other ideas https://gist.github.com/1711377 |
| 11:12 | RickInGA | http://sqlkorma.com/ claims to be "Tasty SQL for Clojure" and "For the real world" -- I would look there. (I haven't played with it yet myself). |
| 11:12 | lnostdal | anyway .. anyone know? |
| 11:12 | romain_p | (also, generic readability/idioms critique?) |
| 11:12 | lnostdal | TimMc, ah, nice idea with the io! .. thanks |
| 11:12 | TimMc | lnostdal: Test what happens with agents first. |
| 11:13 | llasram | TimMc: OOC, do you know where the agent/transaction behavior is documented? It's pretty clear from the code for clojure.lang.Agent, but I don't think I'd read that before |
| 11:14 | TimMc | Oh, I thought it was controlled by the dosync. Got a link handy? |
| 11:15 | TimMc | lnostdal: Ooh. Actually, just an exception will work fine. |
| 11:15 | llasram | TimMc: https://github.com/clojure/clojure/blob/master/src/jvm/clojure/lang/Agent.java#L248 |
| 11:15 | TimMc | lnostdal: By the way, you'd better be damn sure that agent will succeed, otherwise the DB will be out of sync with it. |
| 11:17 | TimMc | llasram: Huh. Greek to me. |
| 11:18 | maio | can I somehow ignore SSL certificate errors when fetching URL with slurp? |
| 11:25 | TimMc | I doubt there's a var to bind -- you'll probably want to create your own URL input stream with custom settings. |
| 11:25 | muhoo | i'm confused in this example, does %2 mean mod 2 or arg 2 to the lambda? (reduce #(if (a %2) (inc %) %) |
| 11:25 | muhoo | % overload |
| 11:25 | TimMc | arg |
| 11:25 | muhoo | so where's ar %1 ? |
| 11:26 | TimMc | muhoo: % is shorthand for %1 |
| 11:26 | muhoo | or does % mean %1 ? |
| 11:26 | muhoo | ok, thanks |
| 11:26 | TimMc | mod is mod |
| 11:27 | RickInGA | tinMc, mod is mod, or rem? |
| 11:28 | TimMc | &((juxt unchecked-divide-int mod quot rem /) -20 6) |
| 11:28 | lazybot | ⇒ [-3 4 -3 -2 -10/3] |
| 11:29 | muhoo | damn you are fast with those one-liners |
| 11:29 | TimMc | No I;m not. |
| 11:29 | TimMc | grep 'mod.*rem' chatlog/freenode/#clojure.log |
| 11:29 | llasram | ~juxt |
| 11:29 | clojurebot | juxt is a little hard to grok but it's the best thing ever |
| 11:29 | muhoo | %(doc juxt) |
| 11:30 | muhoo | &(doc juxt) |
| 11:30 | lazybot | ⇒ ------------------------- clojure.core/juxt ([f] [f g] [f g h] [f g h & fs]) Takes a set of functions and returns a fn that is the juxtaposition of those fns. The returned fn takes a variable number of args, and returns a vector containing the result of applyi... https://refheap.com/paste/517 |
| 11:30 | TimMc | &((juxt + -) 20 1) |
| 11:30 | lazybot | ⇒ [21 19] |
| 11:31 | muhoo | brain. melt. |
| 11:32 | mintsoup | ~map |
| 11:32 | clojurebot | map and the other sequence functions used to be lazy, but with the advent of chunked sequences, may or may not be lazy, consult your local ouija board |
| 11:33 | muhoo | hehehe |
| 11:33 | muhoo | &(doc map) |
| 11:33 | lazybot | ⇒ ------------------------- clojure.core/map ([f coll] [f c1 c2] [f c1 c2 c3] [f c1 c2 c3 & colls]) Returns a lazy sequence consisting of the result of applying f to the set of first items of each coll, followed by applying f to the set of second items in each co... https://refheap.com/paste/518 |
| 11:35 | muhoo | hmm, juxt does seem a bit to me like map |
| 11:35 | mintsoup | &(map #(% 20 1) [+ -]) |
| 11:35 | lazybot | ⇒ (21 19) |
| 11:35 | muhoo | oh! |
| 11:36 | TimMc | except juxt is decidedly not lazy |
| 11:37 | TimMc | (which has never been a problem for me, or probably anyone) |
| 11:37 | muhoo | so it is reversed. in map you put the args into the lambda, and the functions into the body, and in juxt you put the functions up front and then the args to present to them |
| 11:37 | TimMc | muhoo: Not exactly. |
| 11:37 | TimMc | juxt creates a function, and you can do with that function as you wish. |
| 11:38 | muhoo | a function that maps args to several functions? |
| 11:39 | muhoo | i mean |
| 11:39 | muhoo | &(map #(% -20 6) [unchecked-divide-int mod quot rem /]) |
| 11:39 | lazybot | ⇒ (-3 4 -3 -2 -10/3) |
| 11:39 | muhoo | ((juxt unchecked-divide-int mod quot rem /) -20 6) |
| 11:39 | muhoo | &((juxt unchecked-divide-int mod quot rem /) -20 6) |
| 11:39 | lazybot | ⇒ [-3 4 -3 -2 -10/3] |
| 11:41 | muhoo | i find this stuff irresistably fascinating, though i certainly don't quite understand it yet |
| 11:41 | TimMc | muhoo: ##(let [ops (juxt + - *)] (take 10 (map ops (range) (range 20 10 -2)))) |
| 11:41 | lazybot | ⇒ ([20 -20 0] [19 -17 18] [18 -14 32] [17 -11 42] [16 -8 48]) |
| 11:42 | TimMc | The result of a juxt is just a function that can be passed around. It doesn't have to be used right then and there. |
| 11:42 | muhoo | cool, i see the advantage now over map |
| 11:46 | muhoo | as opposed to ##(let [fns [unchecked-divide-int mod quot rem /]] (map #(% -20 6) fns)) |
| 11:46 | lazybot | ⇒ (-3 4 -3 -2 -10/3) |
| 11:47 | mintsoup | i just wanted to see what clojurebot said about map ;p |
| 11:50 | muhoo | where do the factoids in clojurebot come from? the docs? |
| 11:50 | clgv | muhoo: user definition |
| 11:51 | clgv | clojurebot: muhoo is a questioner of clojurebot factoids |
| 11:51 | clojurebot | Ack. Ack. |
| 11:51 | clgv | ~muhoo |
| 11:51 | clojurebot | muhoo is a questioner of clojurebot factoids |
| 11:52 | ckirkndall | acagle: ping |
| 11:53 | muhoo | clojurebot: muhoo is also not a number |
| 11:53 | clojurebot | Alles klar |
| 11:53 | clgv | ~muhoo |
| 11:53 | clojurebot | muhoo is a questioner of clojurebot factoids |
| 11:54 | lnostdal | ~paste |
| 11:54 | clojurebot | paste is http://gist.github.com/ |
| 11:54 | muhoo | clojurebot: paste is also http://www.refheap.com |
| 11:54 | clgv | lnostdal: lol Raynes should change that I guess ;) |
| 11:54 | lnostdal | clgv, refheap is better? |
| 11:54 | muhoo | clojurebot: paste is http://www.refheap.com |
| 11:54 | clgv | lnostdal: he developed refheap ;) |
| 11:55 | muhoo | lnostdal: "better", i dunno. but it's written in clojure and developed by one of the guys here |
| 11:55 | muhoo | i use it. |
| 11:55 | clojurebot | Ik begrijp |
| 11:55 | lnostdal | ok, cool .. refheap it is then; dogfooding :) |
| 11:56 | clojurebot | Ok. |
| 11:56 | clgv | ~paste |
| 11:56 | clojurebot | paste is http://www.refheap.com |
| 11:56 | lnostdal | font looks fuzzy though :P |
| 11:56 | lnostdal | maybe it's just linux here |
| 11:56 | lnostdal | (xfce) |
| 11:57 | muhoo | iirc he's using html5 fonts |
| 11:57 | lnostdal | ok, the chrome here should support that i think |
| 11:58 | lnostdal | looks waaay better in firefox actually .. weird |
| 11:58 | arkh | ckirkendall: ping |
| 11:58 | muhoo | i'm on ff7 on debian, looks fine to me. |
| 11:58 | seanm | lnostdal: it could depend on what flags chromium was built with |
| 11:59 | TimMc | clojurebot will still say "gist" when you ask for "paste" -- it's factoid-forgetting feature is really broken. |
| 11:59 | seanm | I had a similar problem a ways back |
| 11:59 | seanm | can't remember how I fixed it. Super helpful, right? |
| 12:00 | TimMc | oh god I said "it's" |
| 12:01 | muhoo | clojurebot: seppuku is I AM DISHONORED! AIEEEE! *dies* |
| 12:01 | clojurebot | Ok. |
| 12:02 | muhoo | ~seppku |
| 12:02 | clojurebot | No entiendo |
| 12:02 | muhoo | ~seppuku |
| 12:02 | clojurebot | seppuku is I AM DISHONORED! AIEEEE! *dies* |
| 12:02 | muhoo | ok enough fun, back to work for me |
| 12:02 | ckirkendall | arkh: what's up |
| 12:04 | arkh | ckirkendall: in your fork of Clojurescript One you have "public/javascripts/goog/dojo" included in your config :libs. Is that the same dojo as dojotoolkit.org or is that a name for a google thing? |
| 12:05 | muhoo | i like chris granger's stuff, but orm's give me the shakes. and composite primary keys are the waterloo of most orm's. |
| 12:10 | ckirkendall | its a goog thing |
| 12:11 | ckirkendall | arkh: it is goog.dom.query |
| 12:11 | ckirkendall | arkh: its based on the dojo stuff |
| 12:11 | pandeiro | is it still too early to assume document.querySelector/All are everywhere? |
| 12:13 | arkh | ckirkendall: ah - thank you |
| 12:15 | RickInGA | woo hoo, just the excuse I was looking for... http://euroclojure.com/2012/ |
| 12:17 | TimMc | RickInGA: To travel to Europe? |
| 12:17 | TimMc | OK, does anyone else think it's a little weird to have an Uncle Sam image on the EuroClojure page? |
| 12:19 | jeremyheiler | TimMc: That's funny. I didn't even notice that. |
| 12:19 | mintsoup | Will videos from clojure conj 2011 be posted at some point? |
| 12:19 | RickInGA | tinmc: yeah, to go to Europe. |
| 12:20 | RickInGA | mintsoup: just saw this on twitter http://clojure.com/blog/2012/01/31/first-conj-2011-videos-available.html |
| 12:21 | mintsoup | nice.. hopefully sam aaron's will be posted soon. |
| 12:21 | RickInGA | cemeric: just read your tweet... mostly lazy office hours? Neat idea! |
| 12:22 | RickInGA | (love the podcast btw) |
| 12:23 | gfredericks | ~ping |
| 12:23 | clojurebot | PONG! |
| 12:50 | pcavs | Why can't I seem to call (String/format "%s" "foo") properly? |
| 12:50 | pcavs | ,(String/format "%s" "foo") |
| 12:50 | clojurebot | #<ClassCastException java.lang.ClassCastException: java.lang.String cannot be cast to [Ljava.lang.Object;> |
| 12:51 | raek | pcavs: vararg java methods are a bit special under the hood |
| 12:51 | technomancy | pcavs: why not just clojure.core/format? |
| 12:51 | raek | they actually take an array as their last argument |
| 12:52 | pcavs | technomancy: I would, but I'm using Clojure to test java code, then I translate it into Java ><; |
| 12:52 | pcavs | Was wondering super quick what the behavior of String.format with fewer varargs then format expressions was (but then I started shaving a yak/digging) |
| 12:53 | pcavs | well looks like (source format) has answered my questions, thanks |
| 12:53 | TimMc | pcavs: so did raek |
| 12:54 | pcavs | true, thanks all. |
| 13:12 | perezd | people who are using zeromq in clojure: what is the defacto library to use? |
| 13:29 | fliebel | Whoa! Europe Clojure Conference! |
| 13:33 | amro | is there any way to tell which cljs is causing an error in clojurescript? |
| 13:33 | amro | I'm getting Exception in thread "main" clojure.lang.ArityException: Wrong number of args (5) passed to: compiler$eval889$fn--890$pfn |
| 13:35 | amro | I actually tracked that down, but it would still be nice to know for future reference |
| 13:35 | muhoo | oh fantastic, the (source ) command. no IDE necessary. truly happy. |
| 14:07 | jkdufair | so has anyone seen clojurecraft? http://www.github.com/sjl/clojurecraft |
| 14:07 | sjl | jkdufair: yes :) |
| 14:07 | jkdufair | it's a fun system for interacting with Minecraft using Clojure |
| 14:07 | jkdufair | oh hi! |
| 14:07 | sjl | hah, hey |
| 14:08 | jkdufair | my son is totally into MC and I want him to learn to program |
| 14:08 | jkdufair | this is my shim :-) |
| 14:08 | alexyk | how do I require duck-streams nowdays? |
| 14:08 | jkdufair | did you happen to see my fork? |
| 14:08 | technomancy | alexyk: (require 'clojure.java.io) |
| 14:08 | sjl | I stopped updating Clojurecraft when Notch went crazy changing the protocol every two days a while ago, and haven't gotten back to it yet. |
| 14:08 | alexyk | technomancy: and it has spit and such? |
| 14:08 | jkdufair | i got it behaving fairly nicely with MC 1.1 |
| 14:08 | technomancy | alexyk: some of duck-streams got moved to clojure.core |
| 14:08 | sjl | jkdufair: not yet, but I've been meaning to look at it. Maybe I can do that after work tonight |
| 14:08 | jkdufair | no rush |
| 14:08 | alexyk | super |
| 14:08 | TimMc | ,(resolve 'spit) |
| 14:08 | technomancy | a few things got dropped entirely |
| 14:08 | clojurebot | #'clojure.core/spit |
| 14:09 | technomancy | the rest is in clojure.java.io |
| 14:09 | sjl | jkdufair: nice |
| 14:09 | jkdufair | i found a great resource that documents the current state of the protocol, thankfully |
| 14:09 | TimMc | alexyk: ^ presumably what you are looking for? |
| 14:09 | jkdufair | great piece of kit, sjl |
| 14:09 | sjl | jkdufair: thanks! there are still a bunch of things that need to get done before I see it being generally useful |
| 14:10 | jkdufair | well if you need help, i'm interested in hacking on it |
| 14:10 | sjl | jkdufair: but at least the most horrifying part, the bit-twiddling protocol stuff, is done |
| 14:10 | alexyk | TimMc: yep, awesome |
| 14:10 | sjl | jkdufair: yeah, definitely -- I'll look at the fork tonight and let you know |
| 14:10 | jkdufair | sjl: indeed |
| 14:11 | jkdufair | my goal is for my son and i to sit down and build a sillybot that spits out monty python insults when you whack at it |
| 14:11 | sjl | heh |
| 14:11 | alexyk | now I have a list of strings. I want to output them one per line. Should I just going them and spit or is there a better way for ling lists>? |
| 14:11 | sjl | jkdufair: one of the bad parts about the Minecraft protocol -- there's no way to reliably tell who hits you |
| 14:11 | jkdufair | oh my |
| 14:11 | alexyk | hmm -- write-lines is no longer there |
| 14:11 | sjl | jkdufair: the closest you can do is look at who's nearby when your health goes down |
| 14:12 | TimMc | alexyk: (doseq [l lines] (println l)) might do it |
| 14:13 | alexyk | TimMc: I'm in repl... |
| 14:18 | TimMc | alexyk: with-out-str |
| 14:18 | technomancy | replaca: is it intentional that pprint doesn't honor *flush-on-newline* |
| 14:18 | technomancy | ? |
| 14:20 | alexyk | how do we do set difference? |
| 14:22 | alexyk | and, how do I import string join vs del join? am a bit rusty |
| 14:23 | alexyk | after a year of Scala :) |
| 14:24 | technomancy | clojure.string, clojure.set |
| 14:24 | alexyk | what's the import statement from repl for string join, renaming it to say strain? |
| 14:24 | alexyk | strjoin? |
| 14:25 | TimMc | alexyk: You want to able to say str/join, right? |
| 14:25 | TimMc | (require '[clojure.string :as str]) |
| 14:26 | _phil | TimMc: why is ' necessary when its not a list? |
| 14:26 | alexyk | TimMc: cool |
| 14:27 | _phil | TimMc: nvm, because its trying to resolve clojure.string, got it |
| 14:29 | amalloy | it would also try to resolve str |
| 14:30 | _phil | amalloy: yea, i was confused :) but i like that aspect of clojure - its dynamic but it still catches the most blatant errors by resolving symbols at compile time |
| 14:32 | alexyk | _phil: my early laments about NPE were met with counter-claims of "Null ate my mother and my father" |
| 14:33 | _phil | alexyk: i like how clojure handles nil though |
| 14:34 | _phil | i think it wouldve been better if there was no nil at all but idk if that is even possible in such a dynamic language like lisp |
| 14:34 | _phil | in the 10 seconds iv thought about it right now, i dont see why not |
| 14:35 | _phil | (get ...) would have to return (nothing) or (just) |
| 14:35 | _phil | but without type annotations thatd probably be a nightmare to handle |
| 14:36 | TimMc | nil is already a minor nightmare |
| 14:36 | amalloy | heh |
| 14:36 | amalloy | i also like how haskell handles nil, which seems to be what you're asking for, but it's just not appropriate for clojure |
| 14:37 | _phil | amalloy: yes, thats exactly what id like to see, but yes, without type enforcement that would probably be even worse than having nils all over the place |
| 14:37 | _phil | does (get) return a value or a value wrapped in a maybe? |
| 14:38 | amalloy | we don't have maybes |
| 14:38 | _phil | go figure |
| 14:38 | _phil | i was talking hypotetically :) |
| 14:38 | amalloy | well if maybes existed, obviously you'd return one |
| 14:38 | amalloy | but in real life, you use get's not-found third argument, or you use find instead of get, when you need to tell nil apart from "no entry" |
| 14:39 | amalloy | &(get {:x 1 :y nil} :y :nothing) |
| 14:39 | lazybot | ⇒ nil |
| 14:39 | amalloy | &(get {:x 1 :y nil} :z :nothing) |
| 14:39 | lazybot | ⇒ :nothing |
| 14:39 | _phil | amalloy: yes, im aware of that, just thinking out loud what the implications of a deeply ingrained maybe type would be |
| 14:39 | _phil | i think without pattern matching it would make no sense |
| 14:40 | TimMc | _phil: Luckily, we're using a lisp, so that's no problem. |
| 14:41 | _phil | TimMc: what speaks against maybe & pattern matching in a lisp? |
| 14:42 | _phil | (completely reversing my previous position now :) |
| 14:42 | hugod | mm, how do you set a root binding for a existing unbound var? |
| 14:44 | gtrak | ckirkendall: how's the cincyfp going? |
| 14:49 | pjstadig | hugod: part of the 1.2 => 1.3 paid we've experienced had to do with .setRoot being changed to .setRawRoot or something |
| 14:50 | alexyk | ~((fn [x] (inc x)) 1) |
| 14:50 | clojurebot | Excuse me? |
| 14:50 | alexyk | ~ ((fn [x] (inc x)) 1) |
| 14:50 | clojurebot | No entiendo |
| 14:51 | alexyk | how do I make it compute? |
| 14:51 | alexyk | &((fn [x] (inc x)) 1) |
| 14:51 | lazybot | ⇒ 2 |
| 14:51 | alexyk | &(-> 1 (fn [x] (inc x))) |
| 14:51 | lazybot | java.lang.UnsupportedOperationException: nth not supported on this type: Long |
| 14:51 | alexyk | -- how do we overcome the second case? |
| 14:52 | alexyk | I want lambdas in -> |
| 14:53 | ritre | &(-> 1 ((fn [x] (inc x)))) |
| 14:53 | lazybot | ⇒ 2 |
| 14:53 | hugod | pjstadig: thanks for the warning |
| 14:54 | alexyk | right. more parens |
| 14:57 | alexyk | how do I make a map out of [[1 2] [3 4]] ? |
| 14:59 | Bronsa | &(into {} [[1 2] [3 4]]) |
| 14:59 | lazybot | ⇒ {1 2, 3 4} |
| 15:00 | alexyk | yay |
| 15:04 | alexyk | how do I force a lazyseq? |
| 15:04 | brehaut | doall or dorun |
| 15:05 | Raynes | &(doall (range 10)) |
| 15:05 | lazybot | ⇒ (0 1 2 3 4 5 6 7 8 9) |
| 15:05 | Raynes | &(dorun (range 10)) |
| 15:05 | lazybot | ⇒ nil |
| 15:07 | ckirkendall | gtrak: very good how are your adventures in Baltimore. Did you group get started up. |
| 15:08 | gtrak | ckirkendall: yes, we've had 2 beer nights and doing a talk/hack night tomorrow, it's small but enthusiastic right now |
| 15:09 | ckirkendall | We been running around 15-20 for awhile. I am talking at the cincy JS group about ClojureScript next wed. |
| 15:09 | gtrak | awesome, I saw you guys are still doing one talk per-meeting, how's that working out? |
| 15:11 | ckirkendall | its working well, we have more topics than we have meetings right now. I think we are booked through Apr. |
| 15:12 | ckirkendall | gtrak: In march we have a group coming down from Columbus to do an Overtone concert. |
| 15:12 | gtrak | freaking sweet :-) |
| 15:12 | gtrak | you should record it |
| 15:12 | ckirkendall | gtrak: That's a good idea I will chat with Carin about it. |
| 15:24 | jcromartie | (reset! motivation nil) |
| 15:32 | jondot2 | hey guys |
| 15:33 | jondot2 | im wondering, how should i namespace my ring middleware? |
| 15:33 | jondot2 | if the middleware is called 'ping', is it impolite to drop it in ring.ping namespace? |
| 15:33 | Raynes | my.awesome.ping.middleware. |
| 15:34 | jondot2 | i wouldn't like to use the common __mycompany_.ping.middleware, i think it discourages collaboration |
| 15:34 | Raynes | It's just a name. |
| 15:34 | gtrak | it's impolite to use someone else's namespace in general, what kind of collaboration would that discourage? |
| 15:34 | gtrak | arguing about name collisions? |
| 15:35 | jondot2 | people avoiding contribution thinking this is something that belongs to a company |
| 15:35 | Raynes | You can name it com.pornhub.ping and people will still work with it if they like it. |
| 15:35 | ibdknox_ | lol |
| 15:36 | gtrak | jondot2: then use org. |
| 15:36 | Raynes | If Github started putting out com.github.* namespaced libraries... |
| 15:36 | Raynes | They wont collaborate if your company sucks, I guess. :P |
| 15:37 | jondot2 | i had a bad day guys |
| 15:37 | TimMc | I use org.timmc |
| 15:37 | ibdknox_ | I usually just do ibdknox/.. since my name is unlikely to collide ;) |
| 15:37 | jondot2 | TimMc, ok, that sounds reasonable |
| 15:37 | TimMc | Don't use mine! |
| 15:37 | gtrak | TimMc: you're a well-coordinated bundle of organs |
| 15:37 | jondot2 | TimMc :) |
| 15:38 | Raynes | ibdknox_: I want to namespace things hermione.*, but I figure I'd be infringing on your space. |
| 15:38 | TimMc | gtrak: That's what my momma always said. |
| 15:38 | ibdknox_ | Raynes: yeah man, lay off... that one's mine. |
| 15:39 | jondot2 | so its needles to say that the same deeply nested structure as in Java exist in clojure? no movement to brake off it? (such as naming it org-mycompany-project) |
| 15:39 | jondot2 | as opposed to org.mycompany.project |
| 15:39 | benares_98 | portman.natalie.grits |
| 15:39 | gtrak | jondot2: i don't really see a difference between hyphens and dashes |
| 15:40 | ibdknox_ | gtrak: the number of folders |
| 15:40 | jondot2 | gtrak, the directory structure i'd need to mkdir -p ? |
| 15:40 | gtrak | meh? you make the file once, then emacs can auto-follow to find your file |
| 15:40 | gtrak | M-. |
| 15:41 | jondot2 | well i know there is a solution, i'm just poking around to avoid the solution |
| 15:41 | jondot2 | it may be my opinion, but i dislike Java's deeply nested folders |
| 15:41 | gtrak | jondot2: eclipse helps you find classes too |
| 15:42 | gtrak | i hate projects that create their own structures and don't follow conventions |
| 15:42 | jondot2 | like this one? https://github.com/medSage/clj-http/tree/master/src/clj_http |
| 15:42 | jondot2 | hmm.. i'll just use that kind of structure, was under my nose all this time |
| 15:43 | brehaut | jondot2: i think https://github.com/dakrone/clj-http is the canonical repo now |
| 15:44 | Raynes | It is. |
| 15:44 | dakrone | It is. |
| 15:44 | jondot2 | yep, that was just in my browser history i guess |
| 15:46 | jondot2 | sorry if i made you guys uncomfertable, sometimes i'm just too eager when i have a chance of not doing something i disliked doing for a long time :) |
| 15:46 | Raynes | You make us all very comfortable. |
| 15:47 | jondot2 | in what way? |
| 15:48 | Raynes | The best kinds of ways. |
| 15:48 | ibdknox_ | lol |
| 15:49 | ibdknox_ | this is headed somewhere not good |
| 15:49 | brehaut | too many hormones involved |
| 15:49 | gtrak | Raynes is ready to slip into something more comfortable |
| 15:53 | gtrak | btw, FP baltimore is having the first talks/hack night tomorrow |
| 15:53 | gtrak | BaltimoreFP, rather |
| 15:53 | ibdknox | gtrak: can san franciscans come? |
| 15:54 | gtrak | yes |
| 15:54 | Raynes | technomancy: ibdknox is bouncerfied. |
| 15:54 | ibdknox | it's like I'm a whole new man |
| 15:55 | TimMc | Yessss, now we can bug him any time of day or night. |
| 15:56 | ibdknox | perhaps I should've considered the implications... |
| 15:56 | Raynes | Hah |
| 15:56 | Raynes | ibdknox: But you don't have to see the bugging until you reconnect. ;) |
| 15:56 | ibdknox | I should create a bot version of myself |
| 15:56 | ibdknox | to work in my stead |
| 15:56 | technomancy | ibdknox: oh man, it saves so much time. highly recommended. |
| 15:57 | ibdknox | technomancy: what about it saves time? |
| 15:57 | technomancy | earlier you said it's like you're a whole new man? |
| 15:58 | hiredman | self markov models are the next GTD |
| 15:58 | ibdknox | haha |
| 15:58 | ibdknox | GTD made a lot of money... |
| 15:59 | ibdknox | unrelated, for anyone interested, here's a simple example of some of the CLJS state stuff I've been working on https://refheap.com/paste/522 non-deterministic-finite-state-machine-driven-ui FTW |
| 15:59 | TimMc | ibdknox: Is it because of your childhood that considers the possibility? |
| 16:00 | ibdknox | TimMc: abuh? |
| 16:00 | brehaut | TimMc: lol |
| 16:01 | gtrak | any speculation why apple's sending so many folks to clojure/west? |
| 16:01 | ibdknox | gtrak: source? |
| 16:02 | Raynes | They totally plan to replace objective c with Clojure. |
| 16:02 | Raynes | ibdknox: Alex Miller. |
| 16:02 | Raynes | lrn2twitter |
| 16:02 | ibdknox | lol |
| 16:02 | brehaut | gtrak: i suspect they are apple people going to clojure west, rather than being sent by apple |
| 16:02 | cemerick | There was a guy in here a year ago or so that claimed to be from Apple, who said that Clojure was being used a fair bit. *shrug* |
| 16:03 | gtrak | ibdknox: @ClojureWest: "So far the company with the most developers attending Clojure/West is... Apple. Surprised?" |
| 16:03 | brehaut | cemerick: sounds unlike an apple employee :P |
| 16:03 | cemerick | brehaut: I should have *bolded* "claimed". |
| 16:03 | ibdknox | heh |
| 16:03 | brehaut | cemerick: nope :P |
| 16:03 | ibdknox | well maybe I can teach some of them to build websites ;) |
| 16:03 | gtrak | don't know if that implies they're sponsored to go by apple |
| 16:04 | Raynes | ibdknox: They wont build any websites unless it is STEEL colored and blank. |
| 16:04 | brehaut | i understand that even if they go on their own, they arent supposed to say they work at apple |
| 16:04 | TimMc | ibdknox: Have you ever interacted with the ELIZA chatterbot? |
| 16:04 | ibdknox | TimMc: I have :) |
| 16:05 | ibdknox | Raynes: true, should make the class pretty easy to teach |
| 16:05 | TimMc | ibdknox: I was imagining using ELIZA as your replacement while you weren't logged in. |
| 16:05 | alexyk | how do you prepend an element to a vec? |
| 16:05 | ibdknox | TimMc: it's a pretty good approximation of me |
| 16:05 | Raynes | You probably don't really want to. |
| 16:05 | gtrak | alexyk: you can cons one onto a seq'd vec |
| 16:06 | alexyk | gtrak: will it still be a vec? |
| 16:06 | Raynes | No. |
| 16:06 | gtrak | the vec part will |
| 16:06 | TimMc | alexyk: The output of cons is always a seq. |
| 16:06 | alexyk | Raynes: I'm doing silly data mangling |
| 16:06 | alexyk | so everything goes |
| 16:06 | Raynes | Finger trees! |
| 16:06 | brehaut | ,(class (rest (cons :a [:b]))) |
| 16:06 | clojurebot | clojure.lang.PersistentVector$ChunkedSeq |
| 16:07 | Raynes | I use finger trees for all my softwares. |
| 16:07 | TimMc | Raynes writes all his monads using finger trees. |
| 16:07 | ibdknox | I use bloomfilters for basically everything. |
| 16:08 | gtrak | ,(class (cons :a [:b])) |
| 16:08 | clojurebot | clojure.lang.Cons |
| 16:09 | gtrak | the Cons class is quite simple |
| 16:09 | Raynes | Quite. |
| 16:09 | jondot2 | jondot |
| 16:09 | jondot2 | crap. |
| 16:09 | ibdknox | lol |
| 16:09 | Raynes | Raynesbot. |
| 16:09 | ibdknox | Hi Raynesbot, how are you today? |
| 16:09 | Raynes | Bot, dot, whatever. It's all the same to me. |
| 16:10 | jondot2 | well great now you know the sudo password to one of my VMs |
| 16:10 | lazybot | I'm excellent. Thanks for asking. |
| 16:10 | Raynes | jondot2: Yeah, I've already deleted all of your data. |
| 16:10 | ibdknox | lazybot: you're welcome. |
| 16:11 | gtrak | jondot2: now I'll go and brute-force through my all the vm's in the world database organized by rooted hosts |
| 16:11 | ibdknox | gtrak: should take what? 15mins? |
| 16:11 | lazybot | ibdknox Would you consider a homorobotic romance? |
| 16:11 | gtrak | yea, ec2's really fast |
| 16:12 | ibdknox | haha |
| 16:12 | jondot2 | only that its a virtualbox under a double NAT.. |
| 16:12 | gtrak | jondot2: really fast |
| 16:12 | Raynes | Man, I can almost hear cemerick sigh as he watches the conversation degrade. |
| 16:12 | ibdknox | I assume he hates us all now. |
| 16:13 | ibdknox | Luckily I can claim someone stole my bounced identity and this is all a terrible joke. |
| 16:13 | Raynes | http://euroclojure.com/2012/euroclojure-2012/ Holy crap. |
| 16:13 | ibdknox | yeah, I'll probably submit a couple talks to that one |
| 16:14 | alexyk | is there a mean/average in std lib? |
| 16:14 | gtrak | i don't think i can afford any more clojure conferences |
| 16:14 | yawNO | london |
| 16:14 | yawNO | :; |
| 16:14 | alexyk | Clojure/west I'll visit |
| 16:14 | yawNO | *;_; |
| 16:14 | yawNO | crap |
| 16:14 | cemerick | Raynes: There's very little that makes me sigh. Presume I'm smirking at all times. ;-) |
| 16:14 | cemerick | Anyone know who's running the euroconf? |
| 16:14 | gtrak | but i will be at clojure/west :-D |
| 16:15 | yawNO | cemerick: i might |
| 16:15 | ibdknox | cemerick: whoever this is: http://companycheck.co.uk/company/07908329 |
| 16:15 | yawNO | no wait |
| 16:15 | yawNO | may |
| 16:15 | yawNO | just kidding |
| 16:15 | yawNO | cant |
| 16:16 | gtrak | ~enter |
| 16:16 | clojurebot | Pardon? |
| 16:16 | ibdknox | ~guards |
| 16:16 | clojurebot | SEIZE HIM! |
| 16:16 | ibdknox | ~anyone |
| 16:16 | 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 ..." |
| 16:16 | ibdknox | hah it's still there |
| 16:16 | axle_512_ | just saw a tweet from newsycombinator about the clojure conj videos… really digging Rayn'es clojail talk |
| 16:16 | alexyk | &(reduce '+ [1 2 3]) |
| 16:16 | lazybot | ⇒ 3 |
| 16:17 | gtrak | I'll steal the one from ##java |
| 16:17 | aaelony | noticed that Aaron Bedra is wearing a sweet Grateful Dead / Clojure Lambda T-shirt in the One () to Rule them All video (http://www.infoq.com/presentations/One-Parenthesis-to-Rule-them-All) ... !!! are those on cafepress somewhere ? |
| 16:17 | alexyk | (reduce + [1 2 3]) |
| 16:17 | alexyk | &(reduce + [1 2 3]) |
| 16:17 | lazybot | ⇒ 6 |
| 16:17 | gtrak | ~enter is not punctuation. Please don't press your Enter or Return key until you've finished typing your question, sentence, or idea. It is annoying to see that and hard to follow. |
| 16:17 | clojurebot | Ik begrijp |
| 16:17 | gtrak | ~enter |
| 16:17 | clojurebot | enter is not punctuation. Please don't press your Enter or Return key until you've finished typing your question, sentence, or idea. It is annoying to see that and hard to follow. |
| 16:18 | alexyk | isn't it interesting to see how '+ causes reduce to silently be wrong |
| 16:18 | TimMc | alexyk: Why do you think that was the wrong answer? |
| 16:19 | brehaut | ,((comp (partial apply /) (juxt (partial apply +) count)) [1 2 3]) |
| 16:19 | clojurebot | 2 |
| 16:19 | cemerick | aaelony: Nope, he made it. |
| 16:19 | technomancy | "On two occasions I have been asked [by members of Parliament], 'Pray, Mr. Babbage, if you put into the machine wrong figures, will the right answers come out?' I am not able rightly to apprehend the kind of confusion of ideas that could provoke such a question." |
| 16:19 | ibdknox | ,('+ 3 4) |
| 16:19 | clojurebot | 4 |
| 16:19 | aaelony | cemerick: i think it's pretty awesome |
| 16:20 | technomancy | clojurebot: wrong figures is <reply>"On two occasions I have been asked [by members of Parliament], 'Pray, Mr. Babbage, if you put into the machine wrong figures, will the right answers come out?' I am not able rightly to apprehend the kind of confusion of ideas that could provoke such a question." |
| 16:20 | clojurebot | c'est bon! |
| 16:20 | TimMc | Oh, I see, (quote +) |
| 16:20 | TimMc | I've gotten into the habit of putting ' in front of var names in discussion. |
| 16:20 | alexyk | TimMc: I understand it's not "wrong", but sshy a symbol would return the last arg in a form? |
| 16:20 | alexyk | why |
| 16:21 | TimMc | alexyk: I believe it has to do with lookups. |
| 16:21 | brehaut | its not the last, its the second |
| 16:21 | ibdknox | ,('+ 3 4 5 6) |
| 16:21 | clojurebot | #<ArityException clojure.lang.ArityException: Wrong number of args (4) passed to: Symbol> |
| 16:21 | alexyk | brehaut: awesome mean too |
| 16:21 | brehaut | ('+ {'+ :a} :foo) |
| 16:21 | brehaut | ,('+ {'+ :a} :foo) |
| 16:21 | clojurebot | :a |
| 16:21 | brehaut | ('+ {'- :a} :foo) |
| 16:21 | brehaut | ,('+ {'- :a} :foo) |
| 16:21 | clojurebot | :foo |
| 16:22 | brehaut | its the same thing as keywords as accessors in maps |
| 16:22 | alexyk | brehaut: what's your Twitter nic? |
| 16:22 | brehaut | @brehaut |
| 16:22 | ibdknox | how unoriginal ;) |
| 16:22 | brehaut | (shocking i know) |
| 16:22 | dpritchett | Is there a shorter way to write this? (map #(vector (:title %) (:published %)) my_coll) |
| 16:22 | brehaut | (map (juxt :title :published) my_coll) |
| 16:22 | ibdknox | (map (juxt :title :published) my-coll) |
| 16:22 | ibdknox | damnit |
| 16:22 | TimMc | dpritchett: juxt! |
| 16:22 | dpritchett | thanks! |
| 16:23 | ibdknox | beaten to the punch |
| 16:23 | brehaut | ibdknox: you didnt screw the hyphen though |
| 16:23 | dpritchett | ibdknox if it makes you feel any better i am working in noir |
| 16:23 | ibdknox | sweet |
| 16:23 | TimMc | brehaut: You sniped amalloy on a juxt answer! |
| 16:23 | brehaut | TimMc: i know! |
| 16:23 | brehaut | someone should check if hes ill |
| 16:23 | ibdknox | ~juxt |
| 16:23 | clojurebot | juxt is usually the right answer |
| 16:23 | Raynes | amalloy is nuts for juxt. |
| 16:24 | amalloy | brehaut: i was ill, on my deathbed, but the mere mention of juxt has revitalized me |
| 16:24 | brehaut | lol |
| 16:24 | ibdknox | amalloy: you have a highlight rule for juxt don't you? |
| 16:24 | amalloy | ibdknox: that would be little use, right? nothing left to contribute once it goes off |
| 16:25 | Raynes | ibdknox: He uses pidgin for IRC. He probably doesn't even have a highlight rule for 'amalloy'. Chances are, he pays someone to watch his client just in case someone pings him. |
| 16:25 | brehaut | mechanical turk |
| 16:25 | TimMc | lazybot emails him every time |
| 16:25 | ibdknox | lol |
| 16:25 | dpritchett | I was using Quassel and feeling hardcore about it until I noticed its cache was using up about 1/3 of the disk on my VPS. Now I'm using freenode webchat... |
| 16:26 | Raynes | dpritchett: OS X? |
| 16:26 | ibdknox | what's the best way to monitor memory usage from within your app? |
| 16:26 | dpritchett | win7 here at the office raynes |
| 16:26 | dpritchett | I had quassel running on osx at home and win7 at work |
| 16:26 | dpritchett | the server was ubuntu LTS |
| 16:27 | Raynes | ibdknox: Get inside the app with a video camera pointing to an instance of yourkit. |
| 16:27 | ibdknox | Raynes: I tried that, the camera was too shaky to get a good read. |
| 16:28 | amalloy | $javadoc System |
| 16:28 | lazybot | http://download.oracle.com/javase/6/docs/api/java/lang/System.html |
| 16:28 | TimMc | ibdknox: Probably something to do with JMX |
| 16:29 | TimMc | MBeans and whatnot. |
| 16:29 | amalloy | from within your app? i'd suggest something more like http://docs.oracle.com/javase/6/docs/api/java/lang/Runtime.html#freeMemory() if a crude tool is sufficient |
| 16:29 | ibdknox | crude is ok |
| 16:30 | ibdknox | I'm running out of memory on heroku but I'm not using much locally, so I just need something I can look at to get an idea where things are going haywire |
| 16:36 | Licenser | ibdknox are you still wokring on cljs-watch? |
| 16:36 | ibdknox | Licenser: I still use it everyday, yes |
| 16:37 | Licenser | do you plan on porting it to the newer cljs releases? :) |
| 16:37 | ibdknox | hm? |
| 16:38 | Licenser | I want to use some recent things in cljs like the new -bla syntax for parameters and cljs-watch keeps compiling with the old stuff |
| 16:39 | ibdknox | you just need to pull inside your copy of clojurescript |
| 16:39 | ibdknox | it uses whatever you have locally |
| 16:40 | Licenser | oddly for me it does not work, if i use cljs directly it runs with the new stuff, if I run cljs-watch it uses the old stuff |
| 16:40 | ibdknox | hm is your clojurescript_home potentially pointing at some old dir? |
| 16:41 | Licenser | pretty sure not it's part of my makefile and using the smae cljourescript_hope I use to compile but I will double check |
| 16:45 | Licenser | but thanks for the hint ibdknox I'll investigate on that |
| 16:45 | ibdknox | okidoke, let me know if there's something I need to do. |
| 16:46 | jondot2 | whats the canonical OSS license to use for clojure libs? i see EPL generated by lein, however some others go with MIT |
| 16:46 | jondot2 | hm perhaps 'encouraged' is the word |
| 16:47 | Chousuke | EPL is common |
| 16:48 | gtrak | WTFPL |
| 16:48 | Licenser | ibdknox thanks mate :) I will |
| 16:48 | tjgillies | i use cljr and sometimes it gets "stuck" as in unresponsive, is there a way to get back to user=> ? |
| 16:48 | Chousuke | WTFPL is a bad licence for anything :P |
| 16:48 | gtrak | ha, why? |
| 16:48 | Chousuke | it's too informal |
| 16:49 | brehaut | its a real thing‽ |
| 16:49 | brehaut | huh so it is |
| 16:51 | tjgillies | MIT is my fav |
| 16:51 | tjgillies | because its GPL compatible, without going the way of GPL |
| 16:52 | Raynes | Chousuke: wtfpl is a great license. Get out of my channe. |
| 16:52 | Raynes | channel* |
| 16:52 | pjstadig | CC0 |
| 16:53 | dpritchett | anyone have a favorite standalone repl? |
| 16:53 | pjstadig | or Unlicense |
| 16:53 | gtrak | what's a standalone repl? |
| 16:54 | brehaut | reply cljr ? |
| 16:54 | jedahu | I prefer the ISC license http://en.wikipedia.org/wiki/ISC_license |
| 16:54 | pjstadig | dpritchett: i have a script in my bin that just runs clojure |
| 16:54 | dpritchett | so i'm using lein repl and vim to play around with a little shell of a noir project |
| 16:54 | brehaut | actually, i dont know if reply is stand alone |
| 16:54 | pjstadig | but it doesn't have any like classpath support |
| 16:54 | dpritchett | I'd like it if I had auto-indenting and syntax highlighting and whatnot |
| 16:54 | brehaut | gtrak: a repl that doesnt exist in a project |
| 16:54 | dpritchett | i can live without it at the repl, but i just like to check every so often |
| 16:54 | tjgillies | i like cljr because the swing version lets me click on the screen with my mouse |
| 16:55 | gtrak | brehaut: ah, i just make a project for that |
| 16:55 | brehaut | gtrak: if you dont need dependancies (or 1.3 i think), then lein repl works fine without a project context |
| 16:55 | djh_ | Can anyone explain to me something. I'm trying to look for this function http://clojuredocs.org/clojure_contrib/clojure.contrib.string/substring_q in the "modularised" Clojure Contrib |
| 16:55 | TimMc | dpritchett: You mean, you want a REPL that acts like Emacs? |
| 16:55 | dpritchett | pretty much, tim |
| 16:55 | djh_ | on this page it says http://dev.clojure.org/display/design/Where+Did+Clojure.Contrib+Go that clojure.contrib.string was migrated to clojure.string |
| 16:55 | dpritchett | or pry or irb or bpython or ipython |
| 16:56 | dpritchett | each of which isn't attached to an editor |
| 16:56 | djh_ | but I can't seem to find the function in there |
| 16:56 | pjstadig | djh_: i don't think everything from clojure.contrib.string made the cut |
| 16:56 | dpritchett | Maybe I can just load some repl-oriented stuff into my dev-dependencies and then it'll show up at my repl? irb is pretty boring out of the box but when you load in a few runtime gems it gets downright usable |
| 16:56 | djh_ | pjstadig: Ah I see, OK thanks |
| 16:57 | dpritchett | something like Wirble would be great |
| 16:57 | TimMc | $findfn map (partial % "oo") ["foo" "bar"] [true false] |
| 16:57 | lazybot | [] |
| 16:58 | TimMc | djh_: ##(.contains "foo" "oo") |
| 16:58 | lazybot | ⇒ true |
| 16:58 | TimMc | which is all 'substring? ever was. |
| 16:59 | djh_ | TimMc: ah thanks man, yeah just went to look at the source and noticed that |
| 16:59 | _phil | Licenser: also take a look at https://github.com/davesann/cljs-watch |
| 16:59 | Licenser | ibdknox actually Iu will send a pullrequest towards you :) |
| 16:59 | Licenser | _phil did it crashes w/o saying anything |
| 17:00 | jondot2 | heres an experiment's results: clj 36 LOC, ruby 63 LOC, node.js 71 LOC, C# 153 LOC, same component, same principle frameworks (ring, rack, connect, mvc.net) - nice! |
| 17:00 | _phil | it handles cross compilation between clojure and cljs and handles configuration etc |
| 17:00 | _phil | Licenser: oh |
| 17:00 | _phil | Licenser: never crashed here but im afraid i cant help you :/ |
| 17:01 | Licenser | _phil no worries :) |
| 17:02 | Licenser | actually not the error was somewhere entireu differnet |
| 17:02 | _phil | Licenser: only thing i know is clojure needs to be on the path and $CLOJURESCRIPT_PATH needs to be set |
| 17:03 | Licenser | _phil it starts up, no java errors or anything just quietly dies |
| 17:03 | _phil | Licenser: i mean $CLOJURESCIPT_HOME |
| 17:03 | Licenser | I know ^^ |
| 17:03 | _phil | Licenser: oh... you have to pass it a parameter |
| 17:03 | Licenser | now I git the version from ibdknox working so I am happy |
| 17:03 | _phil | gen-watch f.e. |
| 17:05 | Licenser | f.e.? |
| 17:06 | jedahu | _phil: fwiw, there is also https://github.com/jedahu/lein-clojurescript |
| 17:06 | _phil | for example :) |
| 17:06 | jedahu | sorry, that should have been directed to Licenser |
| 17:06 | _phil | jedahu: np but ive also been meaning to try it out but havent had the time til now |
| 17:07 | Licenser | jedahu yes I know but I don't have a clojure project just cljs for my frontend code |
| 17:07 | _phil | Licenser: i.e. cljs-watch gen-watch |
| 17:07 | Licenser | _phil that is whaty I tried to run :) |
| 17:07 | Licenser | Will watch to gen-src for:user$project_dirs@3a8721bd is all what it said before ending |
| 17:08 | jedahu | _phil: watching checkouts projects is a good idea |
| 17:08 | _phil | Licenser: do you have a cljs-opts.clj file? |
| 17:08 | Licenser | nope |
| 17:08 | jedahu | I'll have to implement it in lein-clojurescript |
| 17:10 | _phil | jedahu: i think lein-cljs is a cleaner solution, cljs-watch generates two additional src folders in your project root |
| 17:10 | _phil | jedahu: its kind of a hack |
| 17:11 | Licenser | cljs-watch does not generate any folders for me |
| 17:12 | _phil | Licenser: strange, it generates src-generated and cljs-staging |
| 17:12 | Licenser | perhaps only the one from davesann? |
| 17:12 | _phil | from your src folder |
| 17:12 | _phil | Licenser: oh yes, im talking about that one :) |
| 17:12 | Licenser | ah okay I use the original |
| 17:13 | _phil | the original cljs-watch doesnt handle cross compilation so it doesnt need to generated additional folders |
| 17:13 | Licenser | now that this is solved I just need someone to write me the CLJS for my gui :P |
| 17:13 | _phil | generate8 |
| 17:14 | _phil | while were talking about cljs-watch, is there a way to keep the repl up-to-date when a file is saved? |
| 17:16 | _phil | i remeber there was some ns-watcher thing, has anyone used it successfully? |
| 17:21 | amro | how can I use apply with a .method in cljs? |
| 17:32 | jedahu | _phil: hadn't come across lein-cljs, looks good :-) |
| 17:33 | _phil | jedahu: oh i meant lein-clojurescript :) didnt know there was lein-cljs either |
| 17:39 | jedahu | _phil: turns out it's based on https://github.com/zkim/cljs which is an old clojure->javascript compiler, so not that relevant after all |
| 17:43 | pjstadig | technomancy: bump https://github.com/technomancy/swank-clojure/issues/103 |
| 17:44 | jedahu | amro: (. obj -method (apply obj (. [arg1 arg2] -array))) |
| 17:45 | jedahu | _phil: there is also https://github.com/jedahu/lein-repljs |
| 17:46 | _phil | jedahu: thx, ill have a look :) |
| 17:49 | dpritchett | Hey ibdknox, "lein uberjar && java -jar <jarname>" should work on Noir out of the box, right? |
| 17:50 | dpritchett | That is, for a project generated by lein noir new |
| 17:50 | ibdknox | dpritchett: I think you'll need to use load-views-ns instead of load-views |
| 17:52 | dpritchett | Thanks. Excuse me while I go stare the API docs and try to figure out why there are two separate load-views functions. |
| 17:52 | ibdknox | dpritchett: history |
| 17:52 | dpritchett | So I guess my version of the lein noir plugin uses the deprecated function? |
| 17:52 | ibdknox | load-views-ns is a little more robust and will be used in the templates moving forward |
| 17:53 | ibdknox | yep |
| 17:58 | dpritchett | So I figured out the proper syntax for load-views-ns and I was able to get the app back up and running with "lein run" but my attempts to run the uberjar are still stalling out at "could not find the main class: myappname.server" |
| 17:59 | dpritchett | Here's the code fwiw https://gist.github.com/1713638 |
| 18:00 | ibdknox | you need (:gen-class) in your server ns decl |
| 18:01 | amro | jedahu: what's -array in that? |
| 18:03 | dpritchett | Thanks for the hand holding, ibdknox. I'm back in business. |
| 18:03 | ibdknox | good deal :) |
| 18:05 | aphyr | tw |
| 18:05 | jedahu | amro: the field of a cljs vector that holds the underlying js array |
| 18:06 | amro | I'm confused how that maps back to a regular apply call, (apply fn arg1 arg2 seq) |
| 18:07 | amro | I basically have (. obj method x y z), where x y z are in a vector |
| 18:09 | ibdknox | (apply (.-method obj) x y z) |
| 18:09 | ibdknox | (.-method obj) will give you the property (which is a function) |
| 18:09 | ibdknox | however |
| 18:10 | ibdknox | "this" will be bound incorrectly in that case |
| 18:10 | ibdknox | if that method uses it |
| 18:10 | jedahu | amro: like ibdknox said, it doesn't map to regular apply |
| 18:13 | jedahu | amro: (defn wrap-method [& args] (.apply (. obj -method) obj (. args -array))) |
| 18:14 | jedahu | amro: sorry, that should be: (defn wrap-method [prop & args] (.apply prop obj (. args -array))) |
| 18:15 | jedahu | amro: then (apply (wrap-method (. obj -method)) arg1 arg2 seq) |
| 18:15 | mabes | did class loading change any in 1.3? I'm upgrading a project from 1.2 and it is claiming that it can't file a AOTC class file even though I've verified it exists.. |
| 18:16 | mabes | just looking for related changes that might explain the break... |
| 18:19 | amro | jedahu: thanks, I got it to work |
| 18:20 | technomancy | pjstadig: just use ^:regression =P |
| 18:25 | amro | is there a standard way to automatically bootstrap repls with a few forms at the start? |
| 18:30 | jedahu | amro: good :-) |
| 18:38 | amro | I sometimes get this error when running lein clojurescript: Exception in thread "main" clojure.lang.ArityException: Wrong number of args (5) passed to: compiler$eval889$fn--890$pfn |
| 18:38 | amro | it's not consistent at all- I can recompile without any source changes and it doesn't happen |
| 18:39 | amro | try a few times and it will happen again, still no source changes |
| 18:39 | amro | any ideas why? |
| 18:41 | jedahu | amro: does cleaning the 'out' directory change anything? (lein clojurescript fresh) |
| 18:46 | pcavs | Not a pure clojure question, but does anyone else run into the problem when using clojure-jack-in in emacs, when the repl prints out anything beyond five to ten lines, the repl gets off and puts the cursor in the wrong spot after commands? |
| 18:46 | amro | jedahu: I just ran it 20 times in a row and no more error, I'm gonna chalk that down as a success |
| 18:48 | amro | Uncaught TypeError: Cannot call method 'call' of undefined - I've marked the function with ^:export and this still happens. am I missing something? |
| 18:55 | jedahu | amro: does it happen for optimizations lower than :advanced? |
| 19:09 | amro | jedahu: I don't have any optimizations |
| 19:10 | jedahu | amro: iirc ^:export only comes in to play for :advanced optimization |
| 19:11 | jedahu | amro: so chances are there is something else going on |
| 19:12 | jedahu | amro: have you checked out the js source of the error in your browser? |
| 19:14 | amro | yeah, it's what I pasted |
| 19:14 | amro | I checked in the inspector, the object doesn't exist as it should |
| 19:15 | amro | engine.main.setup.call(...) is generated, but engine.main doesn'tt have a setup |
| 19:18 | sjl | I give up. The "Where did Clojure contrib Go" page lists the new names of contrib stuff, but doesn't tell you how to GET them. |
| 19:18 | sjl | Where can I find the magic names/numbers that need to go into project.clj to actually use these things? |
| 19:18 | brehaut | http://search.maven.org/ |
| 19:19 | brehaut | eg http://search.maven.org/#search%7Cga%7C1%7Cclojure.algo.monads |
| 19:19 | technomancy | or lein search |
| 19:19 | technomancy | if you feel like downloading huge maven repo indices from overloaded mirror servers |
| 19:19 | sjl | technomancy: lein search has been hanging downloading an index for a few minutes now. I ctrl+c'ed it |
| 19:20 | technomancy | yeah, the mirrors are ridiculous |
| 19:20 | technomancy | it's 80MB of lucene files, but still |
| 19:20 | brehaut | thats why its never completed for me |
| 19:20 | sjl | brehaut: hmm, I assume I should just use the latest version listed here and hope it works with 1.3? |
| 19:20 | technomancy | IIRC all contribs have to work on 1.2 and 1.3 to have a release |
| 19:21 | brehaut | some of them have a newer release in the sonatype snapshot repo |
| 19:22 | technomancy | I wonder if lein search should take a "I don't have all day; just try clojars" flag =( |
| 19:22 | brehaut | haha |
| 19:23 | brehaut | it'd be helpful for people trapped on craptacular (international?) connections |
| 19:24 | technomancy | oh, actually that's trivial to implement using profiles in lein2 |
| 19:25 | Raynes | clojurebot: profiles support in line2 is the answer to life, the universe, everything. |
| 19:25 | clojurebot | 'Sea, mhuise. |
| 19:25 | brehaut | wait, isnt that juxt? |
| 19:25 | technomancy | {:clojars {:omit-default-repos true :repositories {"clojars" "http://clojars.org/repo/"}}} ; <- put that in ~/.lein/profiles.clj, then do "lein with-profile clojars search cheshire" |
| 19:25 | brehaut | lein2 isnt out yet though right? |
| 19:25 | technomancy | wellllllll |
| 19:26 | technomancy | what does "out" mean? |
| 19:26 | brehaut | i dont know |
| 19:26 | xeqi | a non-snapshot version? |
| 19:26 | brehaut | normal plebs like me who forget to upgrade lein? |
| 19:26 | technomancy | try it and see! |
| 19:26 | technomancy | if it breaks, you get to keep both pieces |
| 19:26 | brehaut | fantastic :P |
| 19:27 | technomancy | seriously though, I'll have a preview release by clojurewest |
| 19:27 | technomancy | all that's missing for the preview is the enhanced repl and native deps |
| 19:27 | technomancy | both of which I have delegated to other hackers =) |
| 19:28 | cemerick | nag, nag, nag ;-) |
| 19:28 | brehaut | is the enhanced repl an nrepl thing or reply? |
| 19:28 | brehaut | or something else? |
| 19:28 | technomancy | brehaut: it's ... both! |
| 19:28 | Raynes | Gotta earn my damn sticker. |
| 19:28 | cemerick | technomancy: bencode has landed, so it won't be long: https://bitbucket.org/kotarak/nrepl |
| 19:29 | xeqi | cemerick: I've also got a pull request on pomegranate that would be nice to get into the preview |
| 19:30 | brehaut | how long till one of the technomancys replaces slime / swank with an nrepl equivalent |
| 19:30 | cemerick | xeqi: I missed that somehow. Shocking, given github's awesome notifications. :-P |
| 19:30 | cemerick | I'll get it merged in tomorrow-ish |
| 19:30 | xeqi | np |
| 19:30 | xeqi | figured it might have been missed |
| 19:31 | cemerick | brehaut: nrepl is a swank equivalent (though I think it's better, of course) |
| 19:31 | cemerick | it's the SLIME part that's tough |
| 19:31 | technomancy | it's better |
| 19:31 | technomancy | as a server |
| 19:31 | brehaut | cemerick: right. i presume theres lots of stuff intermunged in slime land? |
| 19:31 | technomancy | considering it wasn't a line-by-line port of an ancient CL program =) |
| 19:32 | brehaut | lol |
| 19:32 | technomancy | or rather a defun-by-defun port |
| 19:32 | cemerick | brehaut: yeah, there's *really* tight coupling between SLIME and swank, and emacs in general and swank |
| 19:33 | cemerick | If bitbucket implements asciidoc well, then… :-P |
| 19:33 | Raynes | cemerick: I don't think they even implement markdown well. |
| 19:33 | Raynes | :\ |
| 19:33 | brehaut | cemerick: lol. what is the appeal of asciidoc other than its not markdown? |
| 19:33 | cemerick | If they had fixed their pricing 2 years ago, then they might have been where github is now. |
| 19:34 | Raynes | cemerick: I use bitbucket just for private repos. |
| 19:34 | cemerick | brehaut: asciidoc doesn't suck |
| 19:34 | hiredman | still thinks |
| 19:34 | technomancy | lol bzr |
| 19:34 | Raynes | technomancy: If you and I started using hg, I bet we'd convince the entire community to… |
| 19:34 | brehaut | technomancy: yeah. |
| 19:34 | cemerick | markdown doesn't suck as bad as textile, but that's not saying much. |
| 19:34 | brehaut | technomancy: but at least its UI didnt suck |
| 19:35 | technomancy | yeah, it has the best docs |
| 19:35 | technomancy | also the best icon |
| 19:35 | brehaut | it has an icon?! |
| 19:35 | Raynes | technomancy: Let's do it. leiningen on hg on bitbucket. Go. |
| 19:35 | technomancy | http://wiki.bazaar.canonical.com/LogoOptions?action=AttachFile&do=get&target=bzr+icon+64.png |
| 19:35 | dgrnbrg | Can syntax quotes be nested? |
| 19:35 | cemerick | hiredman: There's a Transport protocol, so if anyone has a better idea that suits all parties… |
| 19:35 | brehaut | huh so it does |
| 19:35 | technomancy | Raynes: I'm locked into git for work |
| 19:35 | _phil | Raynes, technomancy: yes please, hg! |
| 19:35 | dgrnbrg | to make a macro-generating-macro? |
| 19:35 | Raynes | Quit your job. |
| 19:35 | hiredman | (/ 10000 365) |
| 19:35 | clojurebot | *suffusion of yellow* |
| 19:35 | technomancy | also, magit is too good for words |
| 19:35 | Raynes | _phil: Never. |
| 19:36 | cemerick | sexprs don't cut it |
| 19:36 | hiredman | ,(/ 10000 365) |
| 19:36 | clojurebot | 2000/73 |
| 19:36 | amalloy | dgrnbrg: it sounds like this question would be easier to answer by trying it yourself than by asking here |
| 19:36 | Raynes | technomancy: fugitive.vim is surprisingly sufficient. I've enjoyed using it. |
| 19:36 | hiredman | ,(double (/ 10000 365)) |
| 19:36 | clojurebot | 27.3972602739726 |
| 19:36 | dgrnbrg | amalloy, I have tried it, and it doesn't seem to work, so I'm hoping my question will result in an alternative |
| 19:36 | technomancy | ,(double :your-refreshment) |
| 19:36 | clojurebot | #<ClassCastException java.lang.ClassCastException: clojure.lang.Keyword cannot be cast to java.lang.Number> |
| 19:36 | adam_w_ | ,(double (/ 22 7)) |
| 19:36 | clojurebot | 3.142857142857143 |
| 19:36 | ibdknox | technomancy: lol |
| 19:36 | technomancy | supposedly you can use hg as a client for git repos now though? |
| 19:36 | amalloy | k. well, it's totally possible, but is generally a really hard thing to do right so it's not surprising you had trouble |
| 19:37 | amalloy | it's also something you need to do a lot less rarely than you think, so consider a different approach entirely |
| 19:37 | dgrnbrg | I need to have some functions evaluate their arguments as thunks inside another function to catch exceptions and do something to them |
| 19:37 | brehaut | amalloy: a lot _less_ rarely? |
| 19:38 | amalloy | er |
| 19:38 | ibdknox | more |
| 19:38 | Raynes | Hahaha. |
| 19:38 | amalloy | less often |
| 19:38 | Raynes | $logout |
| 19:38 | brehaut | phew! |
| 19:38 | lazybot | You've been logged out. |
| 19:38 | Raynes | $shell |
| 19:38 | lazybot | Raynes: It is not the case that you don't not unhave insufficient privileges to do this. |
| 19:38 | amalloy | dgrnbrg: so far, sounds like you want a function for creating functions, not a macro for creating macros |
| 19:39 | dgrnbrg | I need the arguments to not be eagerly evaluated |
| 19:39 | dgrnbrg | since I need to wrap them in (try) |
| 19:39 | dgrnbrg | I'm pretty sure I need a macro to do that |
| 19:39 | amalloy | *shrug* make them functions |
| 19:39 | adam_w_ | have you thought about using futures? |
| 19:39 | dgrnbrg | The end syntax is important |
| 19:39 | ibdknox | I write macros that write macros that write functions that spit out programs to write macros that write... |
| 19:40 | dgrnbrg | it has to look like (defn-exceptions my-funk [args] body) |
| 19:40 | amalloy | &(let [thunk #(throw (Exception. "OMG")), wrap-try (fn [f] (try (f) (catch Exception e "Caught it!")))], (wrap-try thunk))) |
| 19:40 | lazybot | java.lang.SecurityException: You tripped the alarm! catch is bad! |
| 19:40 | dgrnbrg | and each arg must get wrapped in a try to catch any exceptions it might cause |
| 19:41 | dgrnbrg | I've written that part as functions |
| 19:41 | ibdknox | hm |
| 19:41 | dgrnbrg | but I need to automagically wrap the arguments into thunks |
| 19:41 | dgrnbrg | what are the rules for unsplicing in nested syntax-quotes? |
| 19:41 | amalloy | okay. so that's a macro. you don't need two macros |
| 19:41 | dgrnbrg | but I need to make lots of functions like that |
| 19:42 | dgrnbrg | so I need a macro to write the argument-wrapping macros |
| 19:42 | ibdknox | this is seeming very odd |
| 19:42 | ibdknox | why do they need to be caught individually? |
| 19:43 | dgrnbrg | since I they're each independent computations, and I want to report as many exceptions as possible |
| 19:43 | ibdknox | if they're computations, why wouldn't they be their own functions? |
| 19:43 | amalloy | i kinda feel like nested syntax-quotes is a journey you need to go on alone |
| 19:44 | ibdknox | that would catch their own exceptions |
| 19:44 | dgrnbrg | ibdknox, since I want to allow the user to give me expressions |
| 19:44 | dgrnbrg | the API is complex, and I want to hide the complex |
| 19:44 | dgrnbrg | -ity |
| 19:46 | Raynes | ibdknox: https://refheap.com/paste/524 best thing ever. |
| 19:47 | Raynes | ibdknox: That will fix your problem with horrid indentation in (defpage ..) and (defproject ..). |
| 19:47 | Raynes | And anything else starting with def or with. |
| 19:47 | technomancy | Raynes: what, no vimscript highlighting yet? |
| 19:47 | ibdknox | yeah I found that a bit ago |
| 19:47 | Raynes | Huh, that shouldn't have pasted the whole page. |
| 19:48 | Raynes | Just the end is relevant. |
| 19:48 | Raynes | technomancy: It has VimL highlighting, but my vimrc has no extension and thus my vim plugin doesn't know what to set highlighting to. |
| 19:48 | Raynes | edit'd |
| 19:48 | dgrnbrg | I've almost solved it--I just want to quote an unquote-splicing operator |
| 19:49 | dgrnbrg | but if I write (unquote-splicing) instead of ~@, it generates different code |
| 19:49 | _phil | is there a vim plugin to paste directly to refheap or gist or whatever? |
| 19:49 | Raynes | _phil: http://github.com/Raynes/refheap.vim |
| 19:50 | Raynes | Okay, bug. |
| 19:51 | Raynes | It doesn't know the difference between a single highlighted line and the whole file. I thought I fixed that. Guess not. |
| 19:51 | Raynes | Will tackle it later. |
| 19:51 | _phil | Raynes: thx, trying it out |
| 19:52 | Raynes | _phil: You need a vim compiled with Ruby support enabled. |
| 19:52 | Raynes | Also, Vim's Ruby support is the devil, so if it doesn't work… Rawr. |
| 19:52 | _phil | Raynes: macvim has it by default right? |
| 19:52 | ibdknox | _phil: yes |
| 19:52 | Raynes | Yep. |
| 19:52 | _phil | cmt + t works at least |
| 19:52 | Raynes | Macvim should work fine. |
| 19:53 | _phil | good |
| 19:53 | Raynes | If command-t works, it should work. |
| 19:53 | Raynes | ibdknox: Also, how do you feel about ctrlp vs command-t? The former is the default in janus distributions, but when I open clj files with it they aren't highlighted and the author can't reproduce :( |
| 19:54 | ibdknox | I use command t |
| 19:54 | ibdknox | though rarely |
| 19:54 | amalloy | Raynes: maybe he should use a sexier text editor, if he's having trouble reproducing |
| 19:54 | Raynes | NERDtree is for nerds. |
| 19:54 | ibdknox | lol |
| 19:54 | brehaut | rimshot |
| 19:54 | Raynes | ~rimshot |
| 19:54 | clojurebot | Badum, *tish* |
| 19:54 | brehaut | thanks |
| 19:54 | ibdknox | someone changed it from ching? |
| 19:54 | Raynes | https://github.com/kien/ctrlp.vim |
| 19:55 | technomancy | doesn't rimshot imply that at least it was close? |
| 19:55 | ibdknox | Raynes: I used buffer explorer for the most part |
| 19:55 | amalloy | ibdknox: i stole it verbatim from fsbot |
| 19:55 | amalloy | technomancy: if we were talking about basketball rather than drums, yes |
| 19:55 | brehaut | f sharp bot? |
| 19:55 | technomancy | aha |
| 19:55 | Raynes | brehaut: God no. |
| 19:56 | amalloy | brehaut: #emacs bot |
| 19:56 | brehaut | oh :S |
| 19:57 | amalloy | and really, the sound *is* more of a tish. ching is what is often said aloud, but the cymbals just don't sound like that at all |
| 19:57 | _phil | Raynes: LoadError: /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require': no such file to l |
| 19:57 | _phil | oad -- rubyheap |
| 19:57 | tjgillies | technomancy: wow, all your libaries are awsome, thanks |
| 19:57 | ibdknox | amalloy: I agree, it's more of a chuh |
| 19:57 | tjgillies | libraries* |
| 19:58 | brehaut | http://www.youtube.com/watch?v=kpoanOlb3-w |
| 19:58 | brehaut | ^ cymbol at 1000fps |
| 19:58 | brehaut | s/ol/al/ |
| 19:59 | brehaut | i dont think a symbol at 1000fps would be as interesting |
| 19:59 | technomancy | not true |
| 19:59 | amalloy | he should stop leaving that thing out in the sun. looks like he borrowed it from salvador dali |
| 19:59 | _phil | do i need any additional deps for refheap.vim? |
| 20:00 | technomancy | some of them are lame |
| 20:00 | technomancy | this, on the other hand, is awesome: http://27.media.tumblr.com/tumblr_lxkqilGXuz1qzfsnio1_250.jpg |
| 20:00 | brehaut | amalloy: hes lucky it didnt aquired weirdo dolphins or strange giraffe/elephants |
| 20:02 | amalloy | brehaut: sorry man, bendy clocks are the limit of my cultural knowledge |
| 20:03 | brehaut | one of the bendy clocks is on a dolphine thing |
| 20:05 | brehaut | amalloy: i have to have something to show for trying to get into art school years ago |
| 20:06 | dgrnbrg | I figured out the macro: |
| 20:07 | dgrnbrg | here's my macro-writing macro |
| 20:07 | dgrnbrg | https://gist.github.com/1714329 |
| 20:11 | dgrnbrg | I'm quite pleased with ~@'~body |
| 20:15 | cemerick | seancorfield: really? Still looks stale here. |
| 20:15 | Raynes | "Anthony quite possibly is the youngest member of Clojure community, he is 17. Avid cat lower and Stuart Sierra’s groupie with occasion inspired green hair." |
| 20:15 | Raynes | Did anybody else think my hair was green? |
| 20:16 | Raynes | Because it was supposed to be blue. Albeit I went with a really really light blue that could probably be interpreted as green. |
| 20:16 | brehaut | Raynes: you are a cat lower? |
| 20:16 | ibdknox | it was blue |
| 20:16 | Raynes | brehaut: Apparently so. |
| 20:16 | Raynes | http://vitalyper.wordpress.com/2011/11/17/clojure-conj-2011-recap/ |
| 20:17 | Raynes | The first time I died my hair, it was *exactly* like stuartsierra's hair. |
| 20:17 | Raynes | dyed* |
| 20:17 | Raynes | Not even purposely. I think he just uses the same dye as me. |
| 20:20 | TimMc | Damn you, technomancy, now I'm watching *all* the slow motion videos on YouTube! |
| 20:21 | brehaut | TimMc: while technomancy is normally the provider of apropos links, i think this time its my fault? |
| 20:21 | ibdknox | TimMc: brehaut sent that I think :p |
| 20:21 | TimMc | Oh, so it is! |
| 20:21 | ibdknox | man, I'm just off my game today |
| 20:21 | ibdknox | brehaut has beaten me multiple times :p |
| 20:21 | TimMc | I opened both links, you see. |
| 20:21 | TimMc | and forgot which was which |
| 20:22 | brehaut | TimMc: http://www.youtube.com/watch?v=TKF6nFzpHBU |
| 20:22 | brehaut | iphone 4 inside an acoustic guitar: you can see the wave forms on the strings. very cool |
| 20:23 | TimMc | NOT CLICKING |
| 20:24 | TimMc | You've done enough damage today! |
| 20:29 | ibdknox | technomancy: any thoughts why my process on heroku would eat ridiculous amounts of memory, but not do so locally? |
| 20:30 | technomancy | you didn't switch it to using utf-32, did you? |
| 20:30 | ibdknox | no lol |
| 20:30 | technomancy | yeah... not sure. are you using lein trampoline? that might help address the symptoms |
| 20:30 | ibdknox | just using lein run |
| 20:31 | ibdknox | I'll give trampoline a shot |
| 20:31 | technomancy | lein trampoline run will save some memory |
| 20:31 | ibdknox | we're talking 600mb here, though |
| 20:31 | ibdknox | lol |
| 20:32 | technomancy | just a handful of threads? |
| 20:32 | ibdknox | 3 |
| 20:32 | technomancy | surely not 3 total threads? |
| 20:33 | technomancy | is it even possible to have only 3 threads when using jetty? |
| 20:33 | ibdknox | yeah, it creates them as it needs them |
| 20:33 | ibdknox | and I just restarted it |
| 20:34 | technomancy | so is it 600 MB before responding to any requests? or after a few? |
| 20:34 | ibdknox | it jumps to 787 from about 120 after 2 concurrent requests |
| 20:34 | technomancy | O_O |
| 20:34 | ibdknox | yeah |
| 20:34 | ibdknox | it doesn't even go up 1mb locally |
| 20:35 | ibdknox | lol |
| 20:35 | ibdknox | I'm very confused |
| 20:35 | technomancy | can I privmsg? |
| 20:53 | tjgillies | anyone know how to stop http-server for aleph? |
| 20:53 | aphyr | (server) |
| 20:53 | tjgillies | repl driven development is new to me heh |
| 20:54 | tjgillies | slime is the best |
| 20:57 | tjgillies | aphyr: Unable to resolve symbol: server in this context |
| 20:59 | aphyr | tjgillies: presuming you bound the server you created to a variable called server. |
| 20:59 | tjgillies | aphyr: oh, well i didn't bind to anything heh |
| 20:59 | tjgillies | i guess im out of luck |
| 20:59 | aphyr | You can get it from the REPL history |
| 20:59 | aphyr | *1, *2, etc |
| 21:00 | tjgillies | oh nice |
| 21:00 | aphyr | I think |
| 21:01 | tjgillies | i'll just restart slime and bind next time |
| 21:01 | tjgillies | heh |
| 21:06 | jedahu | hmm, found a bug in clojurescript: (defn next [a] (inc a)) |
| 21:07 | ibdknox | ? |
| 21:07 | jedahu | hangs the repl while ram is chewed up and assigns the function to cljs.core.next when compiled |
| 21:07 | ibdknox | :refer-clojure :exclude [next] |
| 21:08 | ibdknox | as a workaround |
| 21:08 | jedahu | should compile to: my.ns.next = function(a) ... |
| 21:09 | jedahu | ibdknox: yes, that fixes it |
| 21:14 | dnolen | jedahu: ibdknox: ticket created http://dev.clojure.org/jira/browse/CLJS-140 |
| 21:14 | jedahu | dnolen: I was just writing one up :-) |
| 21:27 | axle_512_ | How does one println to a stream that is not stdout? |
| 21:27 | axle_512_ | suppose I have an seq of streams, and I want to send a string to each of them? |
| 21:28 | axle_512_ | s/streams/outputstreams/ |
| 21:30 | brehaut | ,(doc with-out) |
| 21:30 | clojurebot | Excuse me? |
| 21:30 | dgrnbrg | with-out-str |
| 21:30 | dgrnbrg | ,(doc with-out-srt) |
| 21:30 | clojurebot | Pardon? |
| 21:30 | dgrnbrg | ,(doc with-out-str) |
| 21:30 | clojurebot | "([& body]); Evaluates exprs in a context in which *out* is bound to a fresh StringWriter. Returns the string created by any nested printing calls." |
| 21:31 | axle_512_ | dgrnbrg: thanks |
| 21:32 | TimMc | axle_512_: (binding [*out* ___] ...), actually |
| 21:32 | dgrnbrg | (let [str (with-out-str body)] (map #(.print % str) seqs)) |
| 21:33 | axle_512_ | TimMc: thanks. So for each item in my seq, just re-bind *out* to that stream |
| 21:33 | dgrnbrg | with binding, you could interleave the IO differently |
| 21:33 | TimMc | dgrnbrg: That's an awfully roundabout way of doing it... |
| 21:33 | dgrnbrg | TimMc, you need to write the string to a temp buffer and then copy it around |
| 21:33 | axle_512_ | In my case, I am thinking these would be socket connections. Thinking chat-client… I want to iterate over all the connected clients, and send the message to each of them |
| 21:34 | axle_512_ | er chat-server |
| 21:34 | dgrnbrg | you'll want to use binding, almost certainly |
| 21:34 | TimMc | dgrnbrg: with-out-str doesn't allow streaming. |
| 21:34 | dgrnbrg | for ^^^ reasno |
| 21:34 | TimMc | with-out-str is halla handy, though |
| 21:34 | TimMc | *hella |
| 21:34 | axle_512_ | ok, got it. thanks guys. much appreciated. |
| 21:35 | jeremyheiler | Do you really need to rebind *out* here? If you have writers/streams, could just call println or write directly on them in a doseq. |
| 21:35 | dgrnbrg | today I wrote a macro that writes a macro that writes a function...I'm pretty pleased that it works |
| 21:35 | dgrnbrg | with nested syntax-quotes |
| 21:36 | axle_512_ | jeremyheiler: how do you call println directly on the stream? |
| 21:36 | jeremyheiler | (.println stream-obj) |
| 21:36 | jeremyheiler | well |
| 21:36 | jeremyheiler | (.println stream-obj "sting to write") |
| 21:36 | brehaut | (.write stream "abc") |
| 21:37 | axle_512_ | ok, so revert to java-interop for that… got it. |
| 21:37 | TimMc | Hmm, true -- if you have the data and the streams *right there*... |
| 21:37 | jeremyheiler | axle_512_: the methods on the stream are available to you. |
| 21:37 | jeremyheiler | yea |
| 21:37 | axle_512_ | Thanks! |
| 21:37 | brehaut | actually, outputstream only has write byte[], no string |
| 21:37 | amalloy | TimMc: "halla". your attempt to impress the kids with your hip lingo has just made you look like you enjoy jewish egg-bread |
| 21:38 | axle_512_ | brehaut: true… so I think I can convert my streams to writers |
| 21:39 | TimMc | amalloy: Challah. Fuckin' delish. |
| 21:39 | amalloy | it is, i can't argue with that |
| 21:39 | TimMc | Especially with bacon, I bet. |
| 21:39 | TimMc | although it certainly doesn't need it |
| 21:39 | amalloy | a twist on the traditional bacon-and-eggs breakfast? |
| 21:40 | TimMc | sure |
| 21:40 | TimMc | and lunch, and dinner |
| 21:40 | amalloy | note also the wicked pun on "twist" with the twisty challah |
| 21:40 | brehaut | its a pitty javas io lib is so class inheritance heavy :/ |
| 21:41 | TimMc | amalloy: BAM |
| 21:41 | TimMc | brehaut: Luckily, amalloy has a solution for you. |
| 21:41 | brehaut | TimMc: ah yeah, i think ive seen that |
| 21:41 | brehaut | a nice lib |
| 21:42 | brehaut | alexyk, jeremyheiler: fyi if you want print… methods you want to wrap your writer in a java.io.PrintWriter |
| 21:42 | jeremyheiler | brehaut: I know. i figured that was given (or at least implied) |
| 21:43 | brehaut | s/writer/writer,file,or outputstream/ |
| 21:43 | axle_512_ | understood. thanks |
| 21:43 | TimMc | There's always 'spit, yeah? |
| 21:43 | TimMc | That'll take just about anything. |
| 21:44 | jeremyheiler | spit cleans up when it's done. |
| 21:44 | jeremyheiler | probalby want to keep the socket open.. maybe.. lol |
| 21:45 | brehaut | jeremyheiler: anyone who has come to clojure from non-jvm languages may well not know the ins and outs of javas IO libs |
| 21:46 | brehaut | jeremyheiler: so its worth stating things |
| 21:46 | TimMc | jeremyheiler: Ooh, didn't know that. |
| 21:46 | TimMc | I guess that makes sense. |
| 21:46 | jeremyheiler | brehaut: true |
| 21:48 | tjgillies | is it just me or is lein uberjar taking forever |
| 21:48 | jeremyheiler | axle_512_: check out clojure.java.io/writer for easy wrapping of a outputstream in a bufferedwriter. you could go one step further and wrap that in a PrintWriter so you can call println |
| 21:48 | ibdknox | tjgillies: you're probably running code at the top level |
| 21:48 | tjgillies | ibdknox: eh? |
| 21:48 | ibdknox | tjgillies: and as such are running it when you jar |
| 21:48 | tjgillies | oh |
| 21:49 | tjgillies | ibdknox: gotcha |
| 21:49 | jeremyheiler | axle_512_: I mean println the method on the printwriter, not the fucntion. |
| 21:49 | axle_512_ | jeremyheiler: ok, i think I'll do exactly that |
| 21:49 | tjgillies | ibdknox: thnx |
| 21:49 | ibdknox | np |
| 21:52 | axle_512_ | one other question about my chat-server learning example... |
| 21:54 | axle_512_ | I am thinking of storing the streams (or PrintWriters actually) of all connected users in a set in an atom. When a new user joins or drops out, I adjust the set by swap!-ing in the new set. Sound like the right way to handle the concurrency and shared set? |
| 21:54 | brehaut | axle_512_: yes that seems sensible |
| 21:54 | axle_512_ | behaut: thanks, I think I'm starting to get it. I'm enjoying this :-) |
| 21:55 | TimMc | axle_512_: Could any of your writes block? |
| 21:56 | brehaut | axle_512_: if by swapping in the new set you mean (swap! my-atom assoc …) |
| 21:56 | brehaut | err |
| 21:56 | brehaut | not assoc, conj |
| 21:56 | axle_512_ | brehaut: yes, that's what I mean |
| 21:56 | brehaut | cool :) |
| 21:56 | axle_512_ | TimMc: Hmm, I don't expect the writes to block… but I suppose it is possible |
| 21:57 | axle_512_ | TimMc: The writes would be performed on the output streams bound to sockets for each remote client |
| 22:02 | ibdknox | you know, I think I might implement a rule with my projects that to submit a bug, you have to submit a pull request with a test that fails |
| 22:02 | brehaut | ibdknox: thats a pretty cool idea |
| 22:03 | ibdknox | people have been really good about giving me small repros, so I'm definitely not complaining, but it seems like a really clean way to do it |
| 22:08 | TimMc | ibdknox: For some types of projects, that sounds reasonable. |
| 22:08 | brehaut | ibdknox: might be a little tricky with korma? needing sql to be submitted as well? |
| 22:09 | ibdknox | brehaut: hm? almost all bugs with korma can be proven with strings |
| 22:09 | brehaut | i guess thats true |
| 22:09 | ibdknox | TimMc: yeah, only provable ones |
| 22:09 | ibdknox | lol |
| 22:09 | ibdknox | Korma is like the poster child for it |
| 22:09 | TimMc | I mean, there are some things I despair of writing regression test for. |
| 22:10 | alexbaranosky | ibdknox, if they don't submit a failing test, then just tell them you probably won't fix it |
| 22:11 | ibdknox | pinot would be almost impossible to do that way |
| 22:33 | jweiss | when i see a 10-line block of code like this, where every line is nearly identical https://github.com/clojure/clojure/blob/master/src/clj/clojure/core_print.clj#L263 , I wonder why it's not written as a list and a macro? less readable? slower? seems like it would be easier to maintain at least. |
| 22:34 | ibdknox | it would be far less obvious |
| 22:36 | jweiss | to who? someone who doesn't know what macros do? |
| 22:36 | jweiss | to me, that block is "do a defmethod for these 10 things) |
| 22:37 | jweiss | how many such lines before it *would* be better as a macro? |
| 22:37 | jweiss | (i know there's no real answer here, just looking for opinions of people who have more experience w clojure than me) |
| 22:38 | ibdknox | in that particular case I'm not sure the answer is ever |
| 22:38 | ibdknox | if even one of those needs to vary |
| 22:38 | ibdknox | at some point in the future |
| 22:38 | jweiss | ibdknox: what do you mean? |
| 22:38 | ibdknox | you've lost whatever you were gaining by the uniformity the macro would provide |
| 22:38 | brehaut | i wonder how much effort it would take to convert the cljs reader into the much discussed format preserving reader |
| 22:39 | jweiss | oh i see, you mean if one of the items had to break the pattern |
| 22:39 | ibdknox | jweiss: yeah, which doesn't seem unreasonable in that case |
| 22:39 | ibdknox | likewise, there's already a lot of magic going on there with the multi-methodness of it, I'm not sure it would actually make it clearer.. just add another layer of indirection |
| 22:40 | jweiss | ok. i tend to look at my own code that looks like this and say "i'm repeating myself". i suppose my code gets less clear, but i feel compelled to make it smaller :) |
| 22:43 | oakwise | does clojurescript warn about the new property access form on every method call with 0 args now? |
| 22:43 | oakwise | or am I doing something weird? |
| 22:43 | ibdknox | it does |
| 22:44 | oakwise | no way to say "I get it already!"? :) |
| 22:45 | jedahu | oakwise: on the next release those warnings will be gone |
| 22:45 | oakwise | jedahu: ah great thanks |
| 22:46 | aphyr | Is there a clojure strftime? |
| 22:48 | oakwise | I found the tiniest of bugs in the Host Interop section of the cljs wiki: `(.sb toString)` should be `(.toString sb)` |
| 22:48 | ibdknox | oakwise: edit it :) |
| 22:48 | oakwise | ibdknox: I haven't signed the contrib agreement yet :\ |
| 22:49 | TimMc | It's a wiki, just do it. :-) |
| 22:49 | ibdknox | you don't need to to edit the wiki |
| 22:52 | oakwise | TinMc: ibdknox: oh cool thanks. Done! |
| 22:52 | amalloy | i thought wiki was hawaiian for "slow and unwieldy, like jira" |
| 22:52 | jweiss | hehe i'm laughing because i once had to administer jira |
| 22:52 | brehaut | amalloy: sure fast, messy and inaccurate? |
| 22:53 | brehaut | s/sure/surely/ |
| 22:54 | oakwise | was jira chosen b/c github wasn't around/up-to-snuff, or was it a conscious decision over other options? |
| 22:54 | brehaut | its to minimise contributions from 3rd parties |
| 22:54 | jweiss | hehe |
| 22:54 | brehaut | </jest> |
| 22:55 | jweiss | i know jira is a lot more configurable, not sure if that had anything to do with it |
| 22:55 | brehaut | it was chosen before githubs issues got decent |
| 22:55 | brehaut | not sure if that was a factor |
| 22:55 | metajack | It's news to me that GitHub's issues is decent ;) |
| 22:55 | brehaut | metajack: it was worse :P |
| 22:56 | brehaut | and at least its not bugzilla |
| 22:56 | oakwise | hah |
| 22:56 | metajack | i liked bugzilla if you fixed the default form to have less info and customized the queries. |
| 22:56 | TimMc | GitHub's issues feature is for completeness. It allows them to attract a much larger user base. |
| 22:56 | jweiss | i can't decide which i hate more ,jira or bugzilla . i worked on both jboss and red hat projects, so had to use both |
| 22:56 | metajack | but out of the box experience was quite poor |
| 22:57 | brehaut | 'quite' |
| 22:59 | oakwise | TimMc: they claim it's feature limited by design |
| 22:59 | oakwise | http://zachholman.com/talk/how-github-uses-github-to-build-github |
| 23:41 | devn | Saddle up. This is a wonderful talk. |
| 23:41 | devn | http://www.infoq.com/presentations/The-DCI-Architecture |
| 23:54 | devn | https://github.com/w01fe/Clojure-traits/blob/master/src/example.clj |
| 23:55 | devn | Interesting. |