#clojure logs

2014-11-04

00:01sm0kenestastubbs: it is a very interesting idea though
00:02sm0kei think you need a parser which parses each key lazily
00:02nestastubbsyou ever seen Ragel?
00:02sm0kenope
00:03sm0kebut regex are also kind of state machines right?
00:03nestastubbshttp://en.wikipedia.org/wiki/Ragel
00:04sm0kei dont see how it will help except from may be a very fast lexer
00:06nestastubbsit's overkill for this task
00:06sm0kehow about is cheshire return you a lazy map, and each key is parsed only upon first access
00:07nestastubbsnope
00:07sm0ke:)
00:07nestastubbstoo complicated
00:08sm0keyep too complicate for {"a": 1}
00:08sm0kebut for a json in gigbytes?
00:09sm0kelike the one you have
00:09sm0ke:P
00:09nestastubbsnot gigabytes
00:09nestastubbsmegabytes tho
00:09nestastubbsok, I gota go to bed
00:09nestastubbslatah!
00:09sm0keok sleep on it
00:09nestastubbsthanks for noodling
00:33ddellacostaanyone in here used riemann? I'm having trouble getting it to pick up events. Using the 2.6 server and the clojure client
00:33ddellacostajust running it on 127.0.0.1
01:03vIkSiThello all
01:03vIkSiTI forked a github project, and i want to use it with some changes using lein.
01:03vIkSiTso far, i use the [lib-v.0.0] in my project.clj
01:04vIkSiThow do I build this and use it using lein so that my user project points to the local version and not the one on clojars?
01:05dgellowtoday I learned: after having modified a defrecord, always run `lein clean` !
01:05luxbockvIkSiT: you can do `lein install' in the forked project directory and then use it normally through Leiningen
01:06vIkSiTluxbock, but lets say my project.clj contains [mylib-1.0.0-snapshot]
01:06vIkSiTif i do a lein install
01:07vIkSiThow does it know to pick up my version rather than the one in clojars?
01:07luxbockthe dependencies are stored locally in ~/.m2
01:08luxbockso once you have it there then it leiningen won't need to find it from Clojars anymore
01:12vIkSiTahh
01:12vIkSiTgot it
01:12vIkSiTthanks luxbock
01:54ddellacostaargh, setting up riemann's dashboard is making me want to cry
01:54ddellacostathe docs are non-existent and/or wrong
01:55kenrestivowell, there's palet, puppet, jclouds...
01:56bjeanesIs there a way to do do a sort of "blocking pop" on a PersistentQueue? I'm can only see looping on a deref to wait for it to be non-empty but without doing that in a transaction it could still try to pop an empty queue. Either way, it kills the CPU. Should I just be using a java.util.concurrent.BlockingQueue instead?
01:56amalloyddellacosta: try asking aphyr? he's not in here, but i think he's pretty responsive on twitter
01:56bjeanesI feel like... yes but want to make sure it's not just that I don't know how to think in PersistentQueues (as I've not used them properly)
01:56ddellacostaamalloy: yeah, I'll try that, thanks
01:57amalloybjeanes: if you want a concurrent blocking mutable queue, j.u.c is pretty good for that. you can implement it in clojure as an atom around a queue in a much better way than you're suggesting, but there's no real need to
01:57ddellacostakenrestivo: as far as I know riemann is doing different stuff than those
01:57bjeanesamalloy: cool, I'll go with the j.u.c but for my own curiosity/learning what should I read about or think about to do it with persistent queues?
01:59ddellacostaaha, breakthrough, apparently a "view" is the thing the instructions are written on
01:59amalloybjeanes: well, you can avoid popping an empty queue by following the one rule of thread safety: make all important decisions inside of a swap! or a dosync. like, never ever write (if (seq @a) (pop @a)), because those aren't connected
02:00amalloyinstead, swap! it with a function that checks if it's empty, and then if not pops it
02:00amalloyadditionally, to avoid the spinlock, you can use watchers, such as with https://github.com/amalloy/useful/blob/develop/src/flatland/useful/state.clj#L54
02:02amalloythat wait-until doesn't enable you to modify it when a condition is met, but does let you block until that condition is met, at which point you can open a transaction (or a swap!) and double-check that it's still set, following the same suggestion about doing all the work inside a transaction
02:02bjeanesamalloy: thanks that helps. I am doing the pop inside the dosync but not the while loop. I forgot that transactions will all be attempted more or less simultaneously and was in my DB mind of "don't hold the transaction open".
02:02amalloybjeanes: transactions are "free"
02:02bjeanesamalloy: ah perfect. I'll look at that a bit. I knew I was missing an ingredient (first time back in clojure for more than a year
02:03bjeanesamalloy: indeed. I recognized my mistaken thinking after my initial question
02:03bjeanesI haven't used watchers before so I think that was the missing piece in my approach
02:03bjeanesthanks!
02:06bjeanesamalloy: ah looked at your wait-until. The watch + promise delivery paints a complete picture now. Thank you
02:06amalloybjeanes: you're welcome
02:32ddellacostais there a better way to perform an action on a regular basis than to simply start a thread, and loop with Thread/sleep for the duration of time I want to wait?
02:34Kneivaddellacosta: there is a scheduling library: https://github.com/clojurewerkz/quartzite.docs but that might be a bit heavy handed if your use case is that simple
02:35ddellacostaKneiva: ah, yeah, I'm talking more about some simple monitoring activities. Actually we are already using quartzite for task scheduling (but stuff more like backups/regular data imports/etc.)
03:01fairuzAny Titan db users? I need some advice connecting to a remote titan db instance.
03:28visofhi guys
03:29visofwhat is the fastest way to get the last word from URL like http://hello-world.com/welcome/foo , i need to get foo?
03:29visofsplit and get last are going to be fast?
03:30rweirusing an actual urlparser sounds like a better idea
03:32visofrweir: is there any suggestions for urlparser ?
03:40amalloy$google java.net.url
03:40lazybot[URL - Oracle Software Downloads] http://download.oracle.com/javase/6/docs/api/java/net/URL.html
03:41amalloyactually, didn't i write a $javadoc command? i no longer remember how to use it
03:41Glenjamin$help javadoc
03:41lazybotGlenjamin: Lookup Oracle's javadocs for a class. Input can be a fully qualified class name, a class name and a method/field, or a non-qualified class name.
03:41amalloy$javadoc java.net.URL
03:41lazybothttp://docs.oracle.com/javase/6/docs/api/java/net/URL.html
04:01Glenjaminanyone else find they always try and put the docstring after the arglist?
04:09SagiCZ1Glenjamin: i totally always do, and then get super confused
04:09SagiCZ1Glenjamin: it also feels weird i cant have separate docs for overloaded functions
04:10cflemingGlenjamin: Yeah, Eastwood has a warning about that, I'm going to add one to Cursive too.
04:10cflemingGlenjamin: I think it's pretty common.
04:10SagiCZ1cfleming: sweet!
04:11SagiCZ1btw cursive managed to kill my aero today, something that might be worth looking into
04:11cflemingYour aero?
04:11SagiCZ1cfleming: i will pm you
04:37chatterboxr
04:38chatterboxOh! Sorry, for the mistaken "return" key in this window :)
04:39sm0kei am looking for a simple embeddable java interop language where you can define a simple method, compile/interpret it, pass arguments and execute, get some meta like no. of arguments and return type. Any suggestions?
04:47zotwhere can i publicly lament that (imho) string/split arguments are incorrectly ordered? :)
04:47mavbozozot: what should the order be?
04:48zotthe pattern feels like it is an action function, a la f in map, filter :) and semantically, then you can do things like (partial string/split #"\n") to get a line splitter
04:49zot(instead of having to use an anon func or something else)
04:49zoti just want a ballot box to say it out loud, with full awareness that it's been this way for 5 years, and won't be changing any time soon :)
04:54clgvzot: well obviously the devs do not thing a string is a sequence or collection - that's very likely the reason for the order
04:55clgvzot: since this is a breaking change with almost no benefit your chances to get it changed approach zero
04:55clgv*think
04:56zotclgv: fair point, re seq - although (count) works against it. and i know it won't change, as said above.
04:56clgvzot: count works since string can be considered as seqable similar to maps
04:58zotis there an important semantic difference between seqable and sequence? this sounds different than what you mentioned above…
04:59clgvzot: yeah, seqable means that you can use `seq` to convert the thing into a sequence
04:59clgvbut it is not a clojure sequence in the first place
05:00clgv,(seq "Hello")
05:00clojurebot(\H \e \l \l \o)
05:00clgv,(seq? "Hello")
05:00clojurebotfalse
05:00hyPiRion,(sequential? "foo")
05:00clojurebotfalse
05:00hyPiRionoh gurr.
05:01zotclgv: cool, thanks. learned my new thing for the day :)
05:01hyPiRionYou want seqable?, which isn't in core afaik
05:01clgvhyPiRion: we do not need to query it? he just wanted to know the difference
05:01clgv-?
05:13phillordhmmm
05:13phillord(.isAssignableFrom java.util.Set clojure.lang.PersistentHashSet)
05:13phillord,(.isAssignableFrom java.util.Set clojure.lang.PersistentHashSet)
05:13clojurebottrue
05:13phillord,(.isAssignableFrom java.util.Set clojure.lang.IPersistentSet)
05:13clojurebotfalse
05:14phillordwhich is strange -- the implementation class implements the interface
05:14phillordbut the two interfaces do not extend each other
05:14phillordis this not strange?
05:15phillordor is it just me?
05:15martinklepschwhat do people think of boot? I was sceptic the first time I saw it but I begin to see a use for it when it comes to application development
05:26ssiderismartinklepsch: what is boot?
05:26martinklepschssideris: ah sorry — boot: Build tooling for Clojure. — https://github.com/boot-clj/boot
05:31clgvmartinklepsch: good question. its announcement suggested that the leiningen way for CLJS is problematic - is that really the case?
05:31ssiderismartinklepsch: looks interesting, thanks
05:33perplexahmm use people vim-slime or vim-fireplace? ;x
05:35perplexaalso, nikuse is a spambot :P
05:59zarkonehello all! I want to try the clojure language (just curious and to compare with cl). ButI havesome doubts.. It works on top of JVM and i'm afraid I have to understand what's inside of it. Is it true, and give
05:59zarkone
05:59zarkoneme someadvicesabout how tobegin
05:59zarkonethanks
06:00zarkone*to begin with JVM, i mean. May be some books or articles..
06:01cbryanjoyofclojure.com/ is a very good book
06:05zarkonecbryan: thank you!
06:16donbonifaciotalking about books, I've read the programming clojure. Any suggestions on more advanced books?
06:17clgvdonbonifacio: joy of clojure
06:18donbonifacionice :) thanks clgv
06:18mmeixshort question: the use case for "delay" is for a (expensive) computation, which I'm not sure I'll need - correct?
06:20mmeix(only computed if needed by derefing)
06:20clgvmmeix: or deferred calculation, you have multiple threads potentially needing the result of a particular calculation but it shall be calculated only once and you do not care who calculates it
06:21clgvmmeix: it is used in core.cache afair
06:21mmeixah! didn't consider multiple threads - thanks!
06:21mmeixso it really makes sense only for longer calculations
06:22mmeixI guess
06:22mmeixin the case of single thread
06:22mmeixgot it
06:23clgvmmeix: not necessarily, in case of core.cache aka advanced memoize some computations might be quick as well
06:24mmeixok
06:24mmeixthanks!
06:25clgvmmeix: resource loading into a map of resources might be a use case as well, you want to load that resource only once
07:24visofhi
07:24visofi'm running my app using lein ring server, but it's running forever at specific ns, how can i deal with this?
07:24visofand what is best fastest way to debug this?
07:25weavejesterYou mean the ns isn’t loading?
07:27visofweavejester: i got compiling foo.clj
07:27visofbut don't terminated
07:27visofand when i try to load in repl i got repl timeout
07:28visofweavejester: what do you think ?
07:28weavejestervisof: It sounds like you have an infinite loop in your namespace, or something else that’s blocking
07:29weavejestervisof: The easiest way to debug it is to remove everything from the ns, then add things back in until you hit the error again
07:29weavejestervisof: Or look for anything that isn’t a “def” or “defn”
07:29weavejesterOr anything potentially side-effectful
07:39clgvweavejester: visof: "(def ...)" is problematic as well
07:41weavejesterclgv: Yeah, if it’s connected to something that could block.
07:50kungiI have the symbol of a namespace in a variable. Can I somehow call a function in this namespace through the variable?
07:54clgvkungi: yeah require the namespace with the symbol, build a symbol of the function, resolve the function symbol, get the function via var-get and call it
07:55clgv,clojure.string/join
07:55clojurebot#<string$join clojure.string$join@1a7d91c>
07:56clgvdamn it is required.
07:56clgv,clojure.java.io/file
07:56clojurebot#<io$file clojure.java.io$file@1daf1cd>
07:56clgv:(
07:56clgvok no demonstration here ,)
07:56clgv,(-> 'clojure.java.io resolve var-get)
07:56clojurebot#<ClassNotFoundException java.lang.ClassNotFoundException: clojure.java.io>
07:56clgv,(-> 'clojure.java.io/file resolve var-get)
07:56clojurebot#<io$file clojure.java.io$file@1daf1cd>
07:57clgvkungi: ^^
07:57neena((eval (symbol (.getNamespace the-symbol) "myfunction")) arguments)
07:57clgvneena: no please dont. thats absolutely not necessary
07:58kungiclgv: like this: (defn fn-in-ns [ns function]
07:58kungi (var-get (resolve (symbol (str ns "/" function)))))
07:58clgv,((-> 'clojure.java.io/file resolve var-get) "foo.txt)
07:58clojurebot#<RuntimeException java.lang.RuntimeException: EOF while reading string>
07:58clgv,((-> 'clojure.java.io/file resolve var-get) "foo.txt")
07:58clojurebot#<File foo.txt>
07:58clgv,(symbol "clojure.java.io" "file")
07:58clojurebotclojure.java.io/file
07:59clgvkungi: ^^
08:00neenaclgv: i guess you can replace eval with (comp var-get resolve)
08:01clgvneena: you definitel should
08:09visofhow can i replace all "\"\'" in a string with nothing?
08:09visof,(clojure.string/replace "\"\'" "\"" "")
08:09clojurebot#<RuntimeException java.lang.RuntimeException: Unsupported escape character: \'>
08:09visof,(clojure.string/replace "\"\'" #"\"" "")
08:09clojurebot#<RuntimeException java.lang.RuntimeException: Unsupported escape character: \'>
08:09visof,(clojure.string/replace "\"\" #"\"" "")
08:09clojurebot#<RuntimeException java.lang.RuntimeException: EOF while reading string>
08:09visof,(clojure.string/replace "\"\" "\"" "")
08:09clojurebot#<RuntimeException java.lang.RuntimeException: EOF while reading string>
08:09visof,(clojure.string/replace "\"\'" "\"" "")
08:09clojurebot#<RuntimeException java.lang.RuntimeException: Unsupported escape character: \'>
08:10visof,(clojure.string/replace "\"'" "\"" "")
08:10clojurebot"'"
08:12clgvvisof: don't you own a private repl? :P
08:12visofclgv: sorry
08:13clgv,(re-pattern "\\\"")
08:13clojurebot#"\""
08:13clgvvisof: that's the reason ^^
08:14clgvclojure's reg exps have a shortcut for less escaping then you'd need with strings
08:17mavbozowhy when dealing with java, i encounter lots of byte, byte array, byte stream? seems too low level for a language such as java
08:20clgvmavbozo: that strongly depends what kind of projects you are looking at
08:22visofwhat is the best way to deal with text data which has unsupported chars in clojure?
08:22visofif i do somethign like (str "\xea") i got RuntimeException Unsupported character:
08:23clgvvisof: no you get an error because that escape "\e" is unknown
08:24clgv,(str (char 0xEA))
08:24visofclgv: yeah but suppose i'm reading a strange content of webpage and want to escape all the \ to convert it to a string to can deal with in clojure
08:24clojurebot"ê"
08:24clgvvisof: ^^
08:24visofclgv: i mean the data from the webpage already has unknown things like \xaea \cvf \adfdf so how can i escape them?
08:24clgvyou could replace all "\eXX" with result of the function above ;)
08:25clgvah not repair them?
08:25visofclgv: i don't even know what are the chars should i escape ?
08:25clgvvisof: if you them as text why do you need to escape them?
08:25visofclgv: i don't repair just escape them to handle them after that
08:26visofclgv: because it's not a valid string
08:26visofi need to read them as valid string
08:26dysfunhi all. is there any good library for building indexes into data? i've got some data that fits in memory, so it makes sense to keep it there
08:26clgvif I read in "\xea" from some external source I get "\\xea"
08:26clgvinternally
08:27clgvyou are something that causes the need to escape those
08:27clgv+doing
08:28clgvdysfun: for one attribute?
08:28dysfunideally supporting more complex operations
08:29dysfuni would like to build computed indices that may operate over multiple attributes
08:30clgvok. well no idea
08:30dysfunheh
08:30clgvdysfun: might be you end up with a databased solution anyway...
08:30clgvdoes sqlite offer sophisticated indices?
08:31dysfunsince it all fits in memory and i don't have budget for datomic, it seems daft to use a database
08:31clgvI would never recommend datomic to you ;)
08:31dysfunheh. it's nice, but i will never have budget for datomic :)
08:31clgvsqlite is a in-memory db, so if you dont find anything else it might be the easiest way
08:32dysfun*nod*
08:32dysfunthanks
08:52dysfunis there a datatype that looks like a promise, but might cover something that goes away and attempting to use it will trigger eg. a socket connection? i think promises can only be delivered once?
08:52dysfunan atom and a promise would do it, but it seems like a simple thing
08:53dysfunwell, maybe not the autoconnecting when accessing, happy for that to be done elsewhere
08:53hyPiRionYou can implement a record which implements IDeref for stuff like that
08:54dysfunhrm, interesting idea
08:55hyPiRion,'(@hello)
08:55clojurebot((clojure.core/deref hello))
08:55hyPiRion@ is just sugar for deref
08:55dysfunyeah, i use it
09:07clgv+1 for IDeref
09:56clgv,(read-string "@hello")
09:56clojurebot(clojure.core/deref hello)
09:56clgvhyPiRion: to demonstrate the reader macro expansion ^^
09:56hyPiRionyeah
10:04gfredericks,'@hello
10:04clojurebot(clojure.core/deref hello)
10:05gfredericks,'@@@@@@@@@hello
10:05clojurebot(clojure.core/deref (clojure.core/deref (clojure.core/deref (clojure.core/deref (clojure.core/deref (clojure.core/deref (clojure.core/deref (clojure.core/deref (clojure.core/deref hello)))))))))
10:06hyPiRion,````hi
10:06clojurebot(clojure.core/seq (clojure.core/concat (clojure.core/list (quote clojure.core/seq)) (clojure.core/list (clojure.core/seq (clojure.core/concat (clojure.core/list (quote clojure.core/concat)) (clojure.core/list (clojure.core/seq (clojure.core/concat (clojure.core/list (quote clojure.core/list)) (clojure.core/list (clojure.core/seq #))))) (clojure.core/list (clojure.core/seq (clojure.core/concat (clo...
10:08csd_what level of of proficiency would someone need to demonstrate to get a junior dev job in clojure (assuming you can find a company using clojure ;) )
10:12dysfunthat very much depends on the company
10:17craigglennieAnyone have a problem with Cursive not letting you put parens where you want to?
10:17craigglennieI’m trying to close a function and it either just won’t insert the paren, or it jumps into a comment block
10:18justin_smithcraigglennie: is cursive's version of paredit turned on?
10:19clgvcraigglennie: try hitting ESC and then the paren to insert it out of scrope of paredit?
10:19clgvor maybe that is bound to a different key
10:19karlshey guys, a slightly hand-wavy question. i'm trying to write a sort of helper library that covers plumbing and some common patterns for our worker system at work. i'm finding it hard to not fall into the inheritance-style OO thinking. are there any rules of thumb for how to structure such a library?
10:19jackjamescraigglennie: it's in the lower right corner, where it says "Stuctural: On". you can click that to toggle it off
10:20craigglenniejackjames: That did it, thanks
10:20karlsi'm experimenting with component atm, but just want to see if there are alternative approaches before i dive too deeply into one it
10:20clgvkarls: hand-wavy answer: think in data and functions manipulating the data
10:20justin_smithkarls: instead of inheriting, define a protocol or multimethod and have things implement that
10:20craigglennieStructural == paredit in Cursive?
10:21clgvkarls: humm do you really need "component" if that is a library for some task? afaik "component" is built to organize systems and the dependencies between their components
10:21clgvcraigglennie: probably yes
10:21karlsclgv: justin_smith, that's what i'm trying to do, just finding it difficult. the particular use case is to have rabbitmq and postgres connections set up, logging, and other such "plumbing".
10:22karlsclgv: yeah, that was my original thinking. the readme does have a section on this as well
10:22justin_smithkarls: in my experience that isn't something complex in clojure
10:22justin_smithunless you are doing something weird
10:22clgvkarls: well your last description sounds as if you could use components for rabbitmq and postgres each
10:23karlsi'm a bit confused as to whether or not setting everything up "behind the scenes" is the clojure way.
10:23karlsindeed, and i have an example component for rabbitmq, and that seems to work fine
10:23clgvkarls: no you set up things in clojure explicitely, not behind the scenes
10:24justin_smithkarls: with immutibility you don't really need data hiding
10:24karlsthe essential reason for this is that i ideally wouldn't like to keep track of config opts, "instantiation" of connections etc for every single worker individually..
10:25karlshence trying to think about how to make it a bit more straightforward to write workers that connect to rabbitmq and postgres/redis/whathaveyou
10:25karls(avoiding copy-pasting)
10:26clgvhuh? where should the config opts come from?
10:27karlsfor dev - project.clj atm, for prod - env variables or a config file? i'm not too sure yet
10:27karlsbut just writing it down it already feels like an overkill...
10:27justin_smithkarls: a nice approach is to have a different config.edn file to load for each environment (guided by a system property telling you which one to load)
10:27clgvIn one of my projects I use config files but they are generated from GUI input.
10:29clgvfor example for a distributed communication I have (create-client config-url) which returns a "client" deftype which can be passed around where communication is needed
10:29karlsjustin_smith, clgv okay
10:30karlsclgv: and it sits in a var at the top level?
10:30karlsjustin_smith, clgv, thanks for your input. i think i was waayy overthinking this.
10:30justin_smithkarls: in practice all vars are top level, def can only make globals
10:30clgvkarls: no, it is called in the "-main" function and then passed to the functions that need it
10:31mmeix_just found Gorilla REPL, which could serve as a music notebook with clojure, if I manage to write a custom renderer for music snippets for it - doesn't seem to hard on first sight ... someone here tried Gorilla REPL? http://gorilla-repl.org/index.html
10:31karlsclgv: got it.
10:32karlsjustin_smith, clgv, cheers!
10:32justin_smithmmeix_: gorilla can use LaTeX right?
10:32mmeix_yes
10:32justin_smithmmeix_: if so, lilypond is amazing
10:32justin_smithand it has scheme bindings to all its internals
10:33mmeix_yes, I know lilypond quite well
10:33justin_smithcool :)
10:33mmeix_went trough a couple of music typesetting systems
10:33mmeix_lilypond is one of the best
10:34mmeix_problem is: it's not possible to run on a server
10:34mmeix_which is the usage I'm looking after
10:34mmeix_looking for
10:34mmeix_(sorry for non-native English)
10:35mmeix_I'm planning a web service in the long run
10:35justin_smithwhy not install lilypond on the server? most servers run linux
10:35mmeix_for our Music University
10:35justin_smithoh, they have a specific setup
10:35mmeix_I need user interactivity
10:35mmeix_and that is not something easily to get in lilypond
10:35justin_smithmmeix_: I was imagining lilypond as a rendering backend
10:36mmeix_people tried that
10:36justin_smithso interact with gorilla repl, call some scheme code or generate lilypond input...
10:36mmeix_but obviously this didn't work out well
10:36justin_smithmaybe that's too complex
10:36mmeix_yes, I think so
10:37mmeix_I tried some simple things myself with SVG, which is easy to manage with hiccup or so
10:37mmeix_I would inly have to write my own notation engine
10:37mmeix_:-)
10:37justin_smithanalemma is nice for generating svg
10:38mmeix_(googling analemma)
10:38justin_smithmmeix_: that doesn't sound simpler than using lilypond to me, but it's your call
10:38mmeix_I don't see a way to get lilypond interactive easily: it's heavily text based
10:39mmeix_so one would need to write a whole handling library
10:39justin_smithmy point is that your code can generate data that is fed to lilypond
10:39mmeix_I see
10:39justin_smithit has a lisp in the background, you can use data structures to generate its input
10:40justin_smithfor example I know rosegarden does this (linux composition program)
10:40mmeix_I need an interface, where the user can drag a note directly, and I'm not sure how this would work with e server backend
10:40justin_smithahh yeah - that's another thing entirely, you are right
10:40mmeix_I had tha idea to use Noteflight for this
10:41justin_smithmaybe once everything in place make a pretty lilypond version - but for user interaction something uglier but more drag and drop friendly
10:41justin_smiththere is vexflow http://www.vexflow.com/
10:41mmeix_ja, know that: in my opinion it's too naive in some aspects, musically
10:42justin_smithOK
10:42mmeix_I have very long and extensive experience with music setting applications
10:43mmeix_it's not an easy task, yes
10:44mmeix_but I guess, for my Eartraining app it doesn't need to be of the highest sophistication (only 1-2 lines of music, reduced polyphony)
10:44mmeix_so maybe I can SVG something myself
10:45mmeix_and just found, that Gorilla REPL allows integration of DIY renderers
10:45mmeix_so I'll try that
10:46mmeix_could be a nice workflow: building music structures in clojure with a growing renderer function
10:47mmeix_highly optimistic, of course ;-)
10:47mmeix_but Clojure lends itself to music (like its creator...)
10:48mmeix_(looking at Analemma...)
10:50mmeix_ah, that's great: they divided it into three layers, xml, svg, charting
10:50mmeix_something to learn from
10:51mmeix_thanks for the hint!
10:52lazylambdafolks, is there a way to treat the comma as a symbol instead of whitespace?
10:52hiredmannope
10:53mmeix_what for?
10:55lazylambdait's not a big deal. I was working on django project for work and I wanted to sort some imported constants to shut up flake8. I sorted them in the clojure repl, and after that I wanted to interleave the sorted list with (repeat ',) so I could just copy and paste the output into my python code without having to manually insert commas
10:55lazylambdathat's why I was wondering if it's possible to quote comma
10:56mmeix_wouldn't interpose work for that?
10:56mmeix_(if a string output would work)
10:57clgvlazylambda: why not print what you want to export? e.g. (println "[" (str/join ", " coll) "]")
10:57cbryan,(symbol ",")
10:57clojurebot,
10:58cbryan,(take 10 (repeat (symbol ",")))
10:58clojurebot(, , , , , ...)
10:58cbryanyeah?
10:58mmeix_,(interpose "," (range 9))
10:58clojurebot(0 "," 1 "," 2 ...)
10:58clgv,(require '[clojure.string :as str])
10:58clojurebotnil
10:59lazylambdacbryan: YES.. that's it.
10:59clgv,(println "[" (str/join ", " (range 10) "]")
10:59clojurebot#<RuntimeException java.lang.RuntimeException: EOF while reading>
10:59cbryan,(interpose (symbol ",") (range 9))
10:59clojurebot(0 , 1 , 2 ...)
10:59cbryan;)
10:59lazylambdaclgv: printing would have been a good option as well
10:59mmeix_,(apply str (interpose "," (range 9)))
10:59clojurebot"0,1,2,3,4,5,6,7,8"
10:59clgv,(println "[" (str/join ", " (range 10)) "]")
10:59clojurebot[ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 ]\n
11:00mmeix_(mmeix just learned to use the clojurebot :)
11:00clgvmmeix_: thats exactly str/join :P
11:00clgvbut less efficient ;)
11:00mmeix_ah, ok
11:00cbryanpsh. clever code above clear code!
11:00mmeix_(back to learner's seat ;)
11:00justin_smith$source clojure.string/join
11:00lazybotclojure.string/join is http://is.gd/aOFm5m
11:01justin_smithcbryan: well as that link from lazybot will show, in clojure core it is fast code above clear code :)
11:01clgvjustin_smith: not always ;)
11:02justin_smithfair enough - but it's a definite pattern
11:02lazylambda,"test the bot"
11:02clojurebot"test the bot"
11:03lazylambda,(+ 1 2 3)
11:03clojurebot6
11:03justin_smithdon't forget to ##(str "test the other bot")
11:03lazybot⇒ "test the other bot"
11:03clgvjustin_smith: uh he is around.
11:03lazylambdalol, who's the other bot?
11:03kenrestivois there a way to force transitive aot, like, all of clojure.core ?
11:04cbryan,(print (str "hmmm" '##(str "test the other bot")))
11:04lazybot⇒ "test the other bot"
11:04clojurebot#<RuntimeException java.lang.RuntimeException: Reader tag must be a symbol>
11:04cbryanoops
11:04clgvkenrestivo: isnt that AOTed already?
11:04cbryandoes lazybot respond to clojurebot? >:)
11:04cbryanand vice versa?
11:04justin_smithcbryan: there was, in times of legend, a bot-quine
11:04clgvkenrestivo: otherwise just specify #"clojure\.core.*" in your project.clj
11:04kenrestivoclgv: nope
11:04cbryanoh, but the arrow would stop that
11:04cbryanjustin_smith: haha
11:05justin_smithcbryan: this forced some changes, as you could imagine
11:05kenrestivohmm, doesn't :aot :all do that?
11:05clgvcbryan: not blacklisting. they did in the past ;)
11:05kenrestivobecause, it isn't. i guess i could try :aot #"*.*" ?
11:05clgvs/not/no./
11:06clgvkenrestivo: see above ;)
11:06clgvkenrestivo: this a not a valid pattern ###"*.*
11:06clgvkenrestivo: this a not a valid pattern ##(identity #"*.*)
11:06clgv,#"*.*"
11:06clojurebot#<NoClassDefFoundError java.lang.NoClassDefFoundError: Could not initialize class java.util.regex.PatternSyntaxException>
11:06cbryan,#"*\.*"
11:06clojurebot#<NoClassDefFoundError java.lang.NoClassDefFoundError: Could not initialize class java.util.regex.PatternSyntaxException>
11:06kenrestivo,(re-find #"*\.*" "foo.bar")
11:06clojurebot#<NoClassDefFoundError java.lang.NoClassDefFoundError: Could not initialize class java.util.regex.PatternSyntaxException>
11:07clgvno. the star in the beginning is wrong ;)
11:07cbryanoh, oops
11:07kenrestivo,(re-find #"\.*" "foo")
11:07clojurebot""
11:07clgv,(re-find #"clojure\.core.*" "clojure.core.reducers")
11:07clojurebot"clojure.core.reducers"
11:08clgv,(loaded-libs)
11:08clojurebot#{clojure.core.protocols clojure.instant clojure.java.io clojure.repl clojure.string ...}
11:08mmeix_BTW, I need to translate a XML-file into a csv - only once - somebody has a quick tip for that?
11:08clgv,(->> (loaded-libs) (map name) (filter #(re-find #"clojure\.core.*" %)))
11:08clojurebot("clojure.core.protocols")
11:08kenrestivo,(re-find #"\." "any.damn.namespace")
11:08clojurebot"."
11:09cbryan,(re-find #".*\..*" "any.damn.namespace")
11:09clojurebot"any.damn.namespace"
11:09clgvmmeix_: XSLT?
11:09justin_smithmmeix_: clojure.data.xml and clojure.data.csv both exist
11:09mmeix_justin_smith thanks
11:10mmeix_(inc clgv)
11:10lazybot⇒ 34
11:10mmeix_(inc justin_smith)
11:10lazybot⇒ 115
11:10mmeix_for continued help :)
11:13dysfundoes anyone know how clojure performance is on android?
11:13tbaldridgeclojurebot: clojure performance android?
11:13clojurebotHuh?
11:13tbaldridgeexactly....
11:13dysfunremarkably helpful...
11:14tbaldridgedysfun: from what I understand, it works, and isn't bad once it's loaded, but it does take some time to load
11:14dysfunhrm, that could be acceptable
11:15nathanici would think that the extra GC pressure from clojure's (otherwise wonderful) persistent data structures would be pretty noticable on android
11:15csd_does riddley walk from inside out or from outside in?
11:16nathanicbut i've so far been scared off by reports of many-second loading times
11:16tbaldridgedysfun: http://nicholaskariniemi.github.io/2014/03/12/clojure-android-startup-benchmarks.html
11:16clgvdysfun: you could go the clojurescript way for android though. there are js containers to write apps with js
11:16ToxicFrogI've been kicking around the idea of using Chrome Apps on Android and cljs to deploy that way, but haven't actually tested it yet.
11:16dysfunumm, why is ART startup so long? I thought it AOT-compiled everything?
11:17tbaldridgedysfun: yeah, I've done that several times and CLJS works really well...
11:17dysfunactually this way to get around having to do something that works on javascript
11:17tbaldridgedysfun: it does, but you still have to init clojure/lang/rt.java and that takes time
11:17dysfunyeah, but it takes *more* time :)
11:18clgvthe nexus 7 is slower than the 5?
11:18kenrestivoi found performance of clojure on android to be not much different than performance of android on android
11:18tbaldridgedysfun: there's been some work done around startup time that was slated for 1.7, not sure if it's going to get into 1.7 though due to transducers.
11:18clgvinteresting product strategy ;)
11:19kenrestivothen again i'm not doing anything terribly tight-loopy, it's all just gui stuff and calling android services
11:20kenrestivoand... it is *worlds* more fun than trying to deal with the android toolkit in native java. also too, repl.
11:20dysfuni don't mind waiting for cool stuff :)
11:21cbryan"i'm not doing anything terribly tight-loopy" famous last words
11:21cbryan;)
11:21dysfunalso "my dataset is quite small"
11:21eric_normandgood morning folks!
11:21kenrestivohah, well not on that platform. i will soon be doing tight-loopy stuff on a different embeedded arm platform, and i'm ready to offloa it to c if needed
11:22cbryan(inc dysfun)
11:22lazybot⇒ 1
11:22eric_normandanybody get tikkba to work on heroku?
11:22eric_normandI think it's an openjdk issue
11:22dysfuni'm intrigued by the idea of a repl running on my device as part of the app during dev though
11:23eric_normandsays that this class is not found: com.sun.image.codec.jpeg.TruncatedFileException
11:24kenrestivodysfun: http://github.com/kenrestivo/spazradioapp first and only (so far) clojure android thing i've done, it was fun
11:24justin_smitheric_normand: I have used tikka with openjdk
11:24eric_normandjustin_smith: with no problem?
11:24dysfunkenrestivo: sweet, thanks :)
11:24justin_smitheric_normand: but the jvm is silly and thinks that headless = nothing that uses images
11:25justin_smitheric_normand: so if they have the "headless" jdk and that can be a problem
11:25justin_smitheric_normand: the idea that the ability to composite an image and the ability to show one in a GUI are tied is absurd, but it is the case :(
11:25eric_normandjustin_smith: so what to do?
11:25engblomOn Linux, what is the best way for reading a mouse device? Assume you have several mice and each one of them will control things (and not the cursor on screen). /dev/input/MouseN is producing a C-struct.
11:26eric_normandjustin_smith: google is not giving me a good solution
11:26justin_smitheric_normand: make sure you are not using a headless jvm - I don't know how this is done on heroku
11:26justin_smitheric_normand: technomancy may have some inner heroku insight though
11:26cbryanengblom: you mean read it in clojure? or just in general?
11:27justin_smithengblom: use the .h file to make a parser, it is a simple and stable data
11:27justin_smithengblom: it sucks to do it by hand, but it isn't a large thing (I have done it before) and you only need to do it once
11:27engblomcbryan: Reading it in Clojure... This is a clojure channel after all :)
11:28justin_smithengblom: we have great tools for parsing binary data packets by the way - like that one from ztellman
11:28justin_smithhttps://github.com/ztellman/gloss
11:29csd_Is there an equivalent of `lein clean` for cider-nrepl?
11:29csd_Its getting borkedup by an old package it seems
11:29engblomjustin_smith: Sounds interresting
11:30justin_smithengblom: there is also the possibility of using java.awt of course
11:30justin_smithbut in my experience the linux mouse device is very easy to access and use
11:31justin_smithand bonus, when you use the device and not awt, you don't need a window open, and you get all events (well for me this was a bonus...)
11:37technomancyeric_normand: I don't know the solution for this, but we just hired someone specifically to own JVM issues; if you open a support ticket he could probably point you in the right direction
11:38eric_normandtechnomancy: thanks
11:39mnngfltgCan I somehow refer to the name of a `let` binding from inside the same `let`? This won't work: https://www.refheap.com/92702 (Unable to resolve symbol: power-set* in this context)
11:39tbaldridgemnngfltg: name the function
11:39tbaldridgemnngfltg: (fn power-set* [xs] ...)
11:39csd_not within the same binding. only a different binding, below the first
11:39justin_smithmnngfltg: or letfn
11:39mnngfltgtbaldridge, then the function calls are not cached
11:39Bronsatbaldridge: that would not pass through the memoize
11:40Bronsamnngfltg: as letfn should work
11:40tbaldridgeah right, missed the memoize. yeah, use letfn
11:40Bronsa*as justin_smith said
11:41phillordIs there a good way to see what Clojure things the type is of a particular entity
11:41justin_smithtype
11:41justin_smith,(type nil)
11:41clojurebotnil
11:41justin_smith,(type {:a 0})
11:41clojurebotclojure.lang.PersistentArrayMap
11:41phillordsorry, meant at compile time
11:41mnngfltgI thought of letfn, but it doesn't take a function as a value (as `let`) but a function definition
11:42phillordI am getting a reflection warning from a call which looks like (.method (set properties))
11:42justin_smith,(type (with-meta {:a 0} {:type "foo"}))
11:42clojurebot"foo"
11:42phillordand it complains that it doesn't know the type of the call
11:42justin_smithphillord: (.method ^the.Class (set properties))
11:42kenrestivofor the record, :uberjar {:aot [#"\."] :omit-source true}} did what i wanted
11:43Bronsamnngfltg: ah right, uhm there might be someting in useful for this, let me check
11:43justin_smithmnngfltg: ahh, right
11:43phillordthe method signature is .method(java.util.Set)
11:43phillordit should just work
11:43mnngfltgby the way, I can't use `def` because 4clojure won't let me :)
11:44justin_smith(fn memoized [args] ((fn inner [x] ... (memoized y)) args))
11:44Bronsamnngfltg: well the hacky way is to use a promise
11:44justin_smith(fn memoized [args] ((memoize (fn inner [x] ... (memoized y))) args))
11:44justin_smiththat is
11:45justin_smithor wait, that creates a new memo on each call doesn't it? no good
11:45mnngfltgjustin_smith, but that will create a new cache every time, which defeates the purpose
11:45justin_smithright
11:45tbaldridgeforget this stupid immutability, it only causes problems...I'm going back to Python
11:46noonianlol
11:46mnngfltgtbaldridge, heh
11:46Bronsamnngfltg: (let [f (promise) your-f (memoize (fn [] .. (@f ..))) _ (deliver f your-f)] ..) not pretty but should work
11:46tbaldridge(inc Bronsa)
11:46lazybot⇒ 67
11:48mnngfltgBronsa, very nice :)
11:48justin_smith(inc Bronsa)
11:48lazybot⇒ 68
11:48justin_smithI find myself solving more and more things with promises
11:49justin_smith,(deliver (promise) ()) ; an empty promise
11:49clojurebot#<core$promise$reify__6499@1766b1e: ()>
11:49cbryanba-dum-tsh :p
11:51mnngfltgI'll sleep on it.
11:52mnngfltgThere's gotta be a better algorithm for calculating the powerset which doesn't require memoization :)
11:52justin_smithyeah, memoizing a powerset is going to use a lot of heap
11:58Bronsaphillord: I just replied to your thread on the ML, the answer to your question is that clojure.core/set is not type hinted
11:59csd_I'm trying my hand at writing my first macro and am running into trouble.. I just want a macro that expands into Compojure's destructuring syntax. So the macro is just (defmacro foo {{x :x} :y}); and I'm trying to insert it into {{existing :binding} :baz} ~@foo}. I'm running into errors though so I'm curious if I'm doing something that's not possible since I know that the syntax I'm working with is itself nonstandard
11:59gfredericksmacros need an arg list
11:59csd_ah
11:59gfredericksso (defmacro foo {{x :x} :y}) doesn't make any more sense than (defn foo {{x :x} :y})
11:59technomancymaybe *your* macros do gee fredericks
12:00cbryanwrite a macro that defines a macro without an arglist
12:00cbryanduh
12:00weavejestermacros are just functions which have their return values evaled instead of their arguments.
12:00Bronsaweavejester: that's a nice way to explain it
12:01cbryantechnomancy: eric_normand had a heroku question (he might have solved it)
12:01cbryanwell, clojure question relevant to heroku ;)
12:01technomancycbryan: yeah, I handed him off to our jvm guy
12:02cbryancool cool
12:02phillord@Bronsa okay
12:02phillordthat's confusing
12:04csd_gfredericks: It looks like hash-map checks for even number of forms before macro expansion occurs
12:05Bronsacsd_: that happens at read-time
12:05dc_how do i configure clojure to use more cores? it's only like using 12% of my processor
12:05phillord@Bronsa I will reply on the mailing list -- I still don't think this makes sense
12:05Bronsacsd_: the hacky way to make it work is to put a ~@()
12:06rweirin what sense do you want clojure to use more cores
12:07dc_i've got some parallelized functions using r/fold and r/mapcat and reduce
12:07justin_smithdc_: you probably need to rewrite code so it can execute in more threads
12:07justin_smithoh
12:07dc_but the java process doesn't seem to be utilizing the cores
12:08justin_smithit will use all the cores it can, unless you force it not to
12:09dc_justin_smith: does that include processes spawned inside a repl?
12:09dc_or from inside intellij's repl?
12:09justin_smithyes
12:10justin_smithunless you went out of the way to place some limit on the CPUs it could use
12:10dc_i'm looking at activity monitor and the java process says 100%, but my CPU load is like 12%
12:11cbryantry a profiler?
12:11dc_might be osx
12:11clgv8 logical cores?
12:11justin_smithdc_: it could be that the CPU intensive part of what you are doing is all in one thread
12:12clgvmaybe different relation ;)
12:12clgv100/800 vs 12.5/100 ...
12:12dc_if i'm using persistent/transient is this going to force certain ops to use one thread?
12:13justin_smithtransients need to stay in one thread
12:13clgvdc_ currently (<= 1.6) you can't use trnaisent in other threads than the owner thread
12:14gfrederickswhat was the motivation for changing it?
12:14Bronsagfredericks: supporting core.async
12:14dc_so a reduce using a transient structure wouldn't be parallelized?
12:14clgvdc_: also there is no implicit spawning of threads for clojure collections without using something that explicitely uses a different thread
12:14Bronsatechnomancy: ban nikuse please
12:14Bronsatechnomancy: it's a spammer
12:14Glenjamindc_: reduce is never parallelized
12:14justin_smithdc_: the jdk comes with jvisualvm, and you can see a nice graph of all your threads and how hard each is working in a graph there
12:14Glenjamincore.reducers/fold can be though
12:14dc_Glenjamin: i thought reduce now uses r/reduce
12:15justin_smithdc_: you can just start jvisualvm, and choose your process and click around
12:15clgvbut if you have many large enough collections the GC will spin up some threads ;)
12:15Bronsadc_: reduce and r/reduce are different things
12:15Glenjaminnot sure, but r/reduce is still single threaded
12:15Bronsatechnomancy: thanks
12:15technomancyBronsa: I got 'im earlier but forgot to use * as the hostmask
12:16dc_can i force reduce to use threads?
12:16Glenjaminonly with r/fold
12:16Bronsadc_: you can't. currently only r/fold can
12:17dc_ok cool, thanks guys
12:42razum2um1is there any way to inspect objects safely? (say for infinite seq print only <LazySeq@dfsdf>
12:43justin_smith,(str (range))
12:43clojurebot#<OutOfMemoryError java.lang.OutOfMemoryError: Java heap space>
12:43justin_smith,(print (range))
12:43clojurebot(0 1 2 3 4 ...)
12:44razum2um1justin_smith: strange, but in repl it prints infinite (probably it's smart bot)
12:46cbryan,(print (range 10))
12:46clojurebot(0 1 2 3 4 ...)
12:46cbryanit just sets a threshold
12:47gfredericks,(doc *print-length*)
12:47clojurebot"; *print-length* controls how many items of each collection the printer will print. If it is bound to logical false, there is no limit. Otherwise, it must be bound to an integer indicating the maximum number of items of each collection to print. If a collection contains more items, the printer will print items up to the limit followed by '...' to represent the remaining items. The root binding is...
12:48clgvthe bot that could decide the halting problem ;)
12:50clgv,(binding [*print-length* 500] (str (range)))
12:50clojurebot#<OutOfMemoryError java.lang.OutOfMemoryError: Java heap space>
12:51clgvlet's guess its memory ^^
12:52razum2um1,(binding [*print-length* 2] (str (range)))
12:52clojurebot#<OutOfMemoryError java.lang.OutOfMemoryError: Java heap space>
12:52cbryan,(.maxMemory (Runtime/getRuntime))
12:52clojurebot#<CompilerException java.lang.SecurityException: Reference To Runtime is not allowed, compiling:(NO_SOURCE_PATH:0:0)>
12:52cbryandarn :p
12:53clgvah lol have to use print ;)
12:53clgv,(binding [*print-length* 500] (print (range)))
12:53clojurebot(0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 1...
12:53razum2um1clgv: thanks!
13:13successAnyone know a simple explanation of STM?
13:13successgetting rid of locks seems great but what is the downside?
13:13CookedGryphonsuccess: you might do some work twice
13:13rweircomplicated, poor performance with lots of collisions, operations need to be idempotent
13:14clgvrweir: you sounds pretty convinced of the benefits of STM :P
13:15clgvsuccess: you can read up on pessimist vs optimistic transaction handling
13:15rweirno, ti's handy
13:15rweirbut it's not a silver bullet
13:15clgvsuccess: in worst case scenarios your calculation within the transaction might run a lot of times instead of once
13:16clgvrweir: usually I don't hunt werewolves while coding ;)
13:17alexherbo2Hi
13:17alexherbo2How start a repl headless?
13:18alexherbo2How send code to a repl?
13:18justin_smithalexherbo2: you can start a headless repl with lein repl :headless
13:19justin_smiththen you would need to run lein repl :connect, or connect to it with some other client
13:19alexherbo2hum
13:19alexherbo2i actually need head
13:20alexherbo2how list repl ?
13:21alexherbo2in my editor i want send code to repl connected in current dir.
13:21clgvwhich editor do you use?
13:21alexherbo2kakoune
13:21clgvnever heard of it. is there any clojure support for that one?
13:22alexherbo2a write syntax highlighting
13:22alexherbo2s/a/i/
13:22clgvyeah well, if that is all, you wont be able to send code from editor to repl
13:23clgvyou probably need to switch to an editor with clojure support
13:24cbryanhttps://github.com/mawww/kakoune seems you can use :eval or something
13:24alexherbo2in a term i start kakoune from ~/foo/bar and edit baz.clj
13:24alexherbo2in another term i start lein repl from ~/foo/bar
13:24alexherbo2i want list connected repl
13:24clgvI want dinner!
13:25clgvscnr
13:25alexherbo2and connect from the editor to first repl
13:25alexherbo2in current dir
13:25cbryanalexherbo2: either use a different editor or write a plugin for kakaoune
13:25alexherbo2i will write a plugin
13:26clgvthat is not the easiest task if you are new to clojure and leiningen
13:26alexherbo2it should not be hard.
13:27technomancyalexherbo2: you should be able to look for a .nrepl-port file in the project root
13:27technomancytheoretically that file gets deleted when the repl process exits, so if it's present it should be an indicator that there's a running repl
13:27alexherbo2what i need is find a repl and connect to it. send send selection to the repl.
13:28technomancyare you aware that the nrepl protocol is a bit more complicated than stdin/stdout?
13:29alexherbo2no
13:30technomancyhttps://github.com/clojure/tools.nrepl#design
13:30technomancythe simplest thing to do is to start a `lein repl` subprocess
13:30technomancyconnecting to a running repl server means implementing the nrepl protocol
13:30successclgv: ok, indefineately many?
13:31noonianalexherbo2: if you are just starting with clojure i would recommend just using lein repl and reloading your code when you change it in your editor
13:31clgvsuccess: you probably can construct such a scenario
13:32technomancyalexherbo2: I've done a standalone nrepl client, and it was ~500 lines of ocaml
13:32successcompared to haskell, clojure feels pretty far behind, is this language really worth getting into?
13:32technomancy150 was the bencode implementation, you might be able to get that for free from a library, and ~50 was lein-specific stuff you would leave out
13:32successit seems mostly a webapp lang...?
13:32tbaldridgesuccess: how are comparing?
13:32cbryanhaskell was created in 1990
13:32clgvsuccess: how do you judge both of these statements?
13:32technomancysuccess: it's over a decade behind, sure
13:32cbryanclojure in 2007
13:33clgvsuccess: no you can write optimization algorithms with JVM performance in Clojure as well
13:33technomancytbaldridge: number of years, I would guess =)
13:33dbaschsuccess: we’re successfully using clojure at companies that do infrastructure, to process large amounts of data
13:33successi didnt mean when the projects were started, i meant where they are. haskell feels incredibly fresh and solid, so much more rigorous than anything I ever tried befoe
13:34tbaldridgesuccess: feelings are never a good way to do tech evaluations ;-)
13:34clgvsuccess: I wouldnt describe that syntax as "fresh" :P
13:34technomancyhmm, what unit of measurement is used for fresh/solid?
13:34clgvtechnomancy: in terms of fish smell ;)
13:34technomancymillimentos?
13:34dbaschsuccess: the comparison only makes sense within a context. Otherwise you might as well be asking: should I ride a bike or fly a helicopter?
13:34clgvat least the fresh part ^^
13:35successactors use locks underneath right? or am i wrong? you push and pop from its mailbox so that access must be synchronized.
13:35noonianclojure *feels* pretty solid to me at least
13:35tbaldridgesuccess: Clojure really doesn't have actors...
13:35cbryani've never felt clojure :( i'
13:36tbaldridgesuccess: you mean agents?
13:36cbryandammit, hit enter before i finished my awesome joke
13:36tbaldridgesuccess: but if you want a list of people who use clojure, this is a good starting point: https://news.ycombinator.com/item?id=8549823
13:36successagents != actors?
13:36tbaldridgesuccess: yep, you send msgs to actors, you send functions to agents
13:36tbaldridgesuccess: actors require a message to deref, agents have instant deref
13:38successeither way, you send something, it has to go via something, access to that something must be synchronized
13:39tbaldridgesuccess: yes, agents are backed by a thread pool, but they can't deadlock since sending is async
13:39dbaschalso agents are in-process
13:40successbut how can sending be async? you cant push to the mailbox/Q/whatever without checking if someone is reading
13:40laliluna@success Of course you can
13:40tbaldridgethere's many ways to do that, one of them is via a queue and a CAS.
13:41lalilunaYou can use compensation to validate if data reached its target
13:41dbaschsuccess: that’s like saying that you cannot send an email if there’s nobody to read it
13:42lalilunaIf you sent money from US to Europe, this does not happen in one hop. Basically, the system validate at the end of the day, if all accounts are as expected.
13:42cbryandbasch: MAILER-DAEMON begs to differ ;)
13:43dbaschcbryan: I can send an email to my father even though he’s been dead for 2 1/2 years. The account still exists.
13:44successno im saying if reading means deleting as well, then you cannot be sure that someone isnt deleting while you write. im thinking of data structures underneath, you could be manipulating the same pointers if you write and delete at the same time
13:44tbaldridgesuccess: btw, sorry for all the snark. It's just a bit funny to go to a forum and say "your stuff seems to be less mature than this other stuff guys...". Say that and you're going to get some snark ;-)
13:44tbaldridgesuccess: that's what CAS is for...
13:44technomancyheh, this is not exactly uncharted territory
13:45cbryandbasch: true, true. depends on if "no one there" means "non existant" or "not available". but i was being pedantic!
13:45lalilunaUnrelated question: do you avoid to use function names used by clojure in library APIs?
13:45tbaldridgesuccess: if you have immutable data structures, and CAS that's about 3 lines of code
13:46technomancyI guess if you were unaware that CAS existed, clojure reference types would feel super shaky and untrustworthy =)
13:46cbryanlaliluna: like create a function named map or something? i would avoid it if you can
13:47lalilunacomment, sort-by, find are other candidates. It is not easy to find other names every time.
13:47dbaschlaliluna: http://clojure.org/cheatsheet
13:47dbaschwhen in doubt
13:48cbryandbasch: laliluna is wondering if its okay to name a function with the same name as one in clojure.core
13:49dbaschlaliluna: it depends on the context. It’s fine to have a function with the same name if it does the same conceptual thing in a different context
13:49cbryantbaldridge: what does CAS stand for here?
13:49Bronsacbryan: compare and swap
13:49cbryanah
13:50tbaldridgeit's like STM for a single integer/pointer
13:51martinklepschI asked that question before but since there's a bit more activity right now:
13:51martinklepschwhat do people think of boot? I was sceptic the first time I saw it but I begin to see a use for it when it comes to application development
13:51cbryanmartinklepsch: it looks cool but i haven't used it
13:51martinklepschboot provides build tooling for Clojure. — https://github.com/boot-clj/boot
13:52tbaldridgemartinklepsch: diversity is good, lein hasn't ticked me off enough to want to switch, but many of my co-workers already use other stuff besides lein.
13:52tbaldridgeSo the more options the better.
13:52martinklepschtbaldridge: what else is there what your coworkers use?
13:52cbryanseems kind of like lein : boot :: maven : gradle
13:52cbryani mean maven is hell on earth and i love lein, but in the sense of config vs code
13:53tbaldridgemartinklepsch: some use custom bash scripts, others have built make based tools, or simply use maven in one way or another.
13:53successCAS=Content-addressable storage ?
13:53cbryancompare-and-swap, as Bronsa said
13:53tbaldridgesuccess: compare and set.
13:54mmeixvery newbish question again (sorry 'bout that): when using (clojure.data.csv/write-csv writer data & options) - which would be the correct writer to write to a file on disk? (And where do I educate myself about writers?)
13:54martinklepschcbryan: not familiar with gradle/maven but that sound like a good analogy
13:54mmeix(and readers)
13:54tbaldridgesuccess: http://en.wikipedia.org/wiki/Compare-and-swap
13:54ToBeReplacedmmeix: look at clojure.java.io/writer
13:54lalilunaThe JavaScript has a very good separation of task runners and tasks: grunt, gulp, brunch are solutions there. I am not sure, if this is the direction of boot
13:54cbryan(writer "my-file")
13:54justin_smithmmeix: I think (java.io.File. "your-file-name") works in that context
13:54tbaldridgesuccess: almost all locks/mutexes are built off of CAS, but CAS itself is non-blocking.
13:54mmeixthanks
13:55danneummeix: check out clojure.java.io's fns/helpers at least as a place to start
13:55cbryanyeah, lein : boot :: grunt : gulp also works
13:55lalilunalein is nice for packaging and a hell, if you want to hook into one step. There it becomes as elegant as maven plugins
13:56ToBeReplacedhuh... boot-clj is interesting
13:56justin_smithso make : autotools :: lein : ??
13:56lazybotjustin_smith: What are you, crazy? Of course not!
13:56honzaI have yet to see how Emacs + cider is any more interactive than vim + fireplace for Clojure development. Any mad enough to convince me? :)
13:56justin_smith$botsmack
13:56alexherbo2technomancy: http://leiningen.org/grench.html ? :)
13:56danneuhonza: no vimscript
13:57ToBeReplacedif nothing else, i'm glad someone(s) are trying another approach
13:57successAndroid is multithreaded, you cant get away from it, would be interesting to have clojure working really good on android
13:57justin_smithhonza: I don't think it's more interactive. But emacs has elisp and org mode, so use emacs if you want that sort of thing.
13:57honzadanneu: meaning? easier to customize?
13:57technomancyalexherbo2: that's the one
13:58justin_smithhonza: elisp is a mediocre programming language, but it's an actual language you can write things in
13:58technomancyjustin_smith: make : autotools :: lein : cljsbuild maybe
13:58danneuhonza: ever try evil-mode in emacs?
13:58justin_smithfor vi's many benefits I don't think you could say writing an app in vimscript is reasonable
13:59technomancyhonza: you can invoke commands implemented in clojure using nrepl-discover and have them auto-generated as first-class M-x commands in emacs, bound to keystrokes, etc
13:59technomancycross-runtime metaprogramming
13:59honzajustin_smith: how does that affect clojure development? vim-fireplace gives you tons of interactive code eval mappings that are supposedly only possible in emacs
13:59alexherbo2technomancy: not tested yet but works like this ?, grench eval "(+ 2 3)" and it sends code to running repl in current dir. i should see result in grench repl.
14:00honzadanneu: yes - why?
14:00technomancyalexherbo2: result would be in stdout, not in a separate repl session
14:00successwhere would you recommend launching your clojure webapp?
14:00successheroku?
14:00danneusuccess: yeah
14:00honzatechnomancy: welp, that's a good one
14:00alexherbo2technomancy: i want see result in the repl
14:00technomancyalexherbo2: well, you can't use grench for that then
14:00alexherbo2i just want use editor to send selected code, and have a repl where i see result
14:01alexherbo2not see result inside the editor
14:01clgvalexherbo2: there are a lot of editor+plugin combination that are capable to do that
14:01technomancyalexherbo2: it sounds like you'd end up reimplementing grench in whatever language your editor uses for extensions
14:02justin_smithhonza: I hae never seen that "only available in emacs" claim
14:02danneusuccess: have you seen https://devcenter.heroku.com/articles/getting-started-with-clojure#introduction
14:03danneusuccess: there are a couple gotchas with deploying to heroku. like you should specify :min-lein-version (or whatever) in projet.clj or else heroku uses an old 1.x version of lein that usually fails to deploy
14:03technomancydanneu: you get that for free with `lein new heroku myapp` fwiw
14:03technomancybut yes, good point
14:04successso it is a pain
14:04successmaybe I should just run my own server!
14:04danneuif you've been programming clojure you should be used to idiosyncrasies
14:04successis it easy to deploy on my comp?
14:05danneutechnomancy: is there a list of templates?
14:05justin_smithsuccess: it's not a pain if you use lein new heroku, like technomancy said
14:05technomancydanneu: I think searching clojars for lein-template works?
14:05danneucool
14:05justin_smithsuccess: also, deploying to a vanilla unix env consists of "lein uberjar"; scp that to the server; run java -jar my.jar on the server
14:06justin_smithsuccess: you can get fancier but often don't need to, that's how I do it for some production sites
14:06danneusuccess: doing the couple things you need to do for heroku is less painful than doing your own deploys
14:06danneugit push heroku vs ?
14:06danneursync?
14:06justin_smithdanneu: scp / ssh -c restart (where restart is a five line script)
14:07justin_smithwell lein uberjar first, of course
14:07justin_smithdanneu: the only thing I install on the server is nginx and a jvm
14:07danneui unfortunately still ssh into my linode, attach to my tmux session, and reboot the app
14:07danneu"one day i'll streamline/automate this"
14:08danneuit's been 1 year
14:08technomancywhat's the app?
14:08justin_smithdanneu: I find nohup more reliable (and scriptable) than running inside tmux
14:08danneuit's a forum
14:09danneujustin_smith: yeah, i'm a sysadmin noob. if a process isn't in the foreground, it doesnt exist to me
14:10justin_smithdanneu: yeah, I think I am ignoring a big background of linux usage that makes things seem "simple" that actually took me a while to learn
14:10justin_smithbut hey, once you know it it's like riding a bike!
14:10justin_smithand heroku definitely eliminates a bunch of that (in trade for some monetary cost and more limited options, of course)
14:13danneuheroku also forces you to get your act together. can't be as lazy
14:13danneui somehow let my linode app get so nasty that it doesnt even work once it's an uberjar
14:15successtechnomancy, ty! working now
14:16technomancycool
14:19justin_smithdanneu: here are three scripts I have used in deployment, I intend to make them a bit more modular and make a real package out of them some day https://www.refheap.com/92704
14:19successwhat about running on a raspberry? clojure has a pretty big footprint compared to python right?
14:20justin_smithsuccess: it does, but I have heard tell of it running OK on a pi (as long as you aren't doing something realtime like audio)
14:20mmeix(or a Beaglebone or on the new Intel Edison, interested in that too)
14:22danneujustin_smith: you use grunt? you didn't yakshave your own asset pipeline like the rest of us?
14:22justin_smithdanneu: I have frontend guys on the team, they don't want to use clojure and I don't make them use it
14:22justin_smith(well, the boss doesn't make them use it, it isn't even up to me)
14:24danneuplant the seed, man. start slow. grow your hair out like hickey's
14:24justin_smithdanneu: getting too old for that (or too balding to be precise)
14:24mgaarethis is ugly... better way to do this? (some-> nil-or-fn (#(%)))
14:25successmeh, this language just doesnt bring anything to the table.
14:25justin_smithI'm sorry to hear you feel that way. It's worked great for me.
14:25nooniansuccess: haha
14:25mgaareok I guess (when nil-or-fn (nil-or-fn)) is nicer
14:26nooniani think you just need to spend more time with it
14:26justin_smithmgaare: (and (ifn? nil-or-fn) (nil-or-fn))
14:26justin_smithit makes it more explicit what you are checking
14:26justin_smithwhat if someone accidentally passed "true" in
14:27nooniansuccess: what piqued your interest in clojure in the first place if you don't mind me asking?
14:28mgaareto give a little more context, it's actually this: (some-> (get-in functions-map [:maybe :fn]) (#(%))))
14:28mgaareI just re-wrote as a when-let and I feel better about myself
14:30successnoonian, the possibility of using it instead of java (on android) but it is not practical at all there
14:30danneunoonian: embedded programming
14:31nooniansuccess: ah, yeah i think clojure has some problems on android
14:31mgaaresometimes the embarassment of showing something crappy to the channel is enough motivation to come up with something better. so, thanks all :D
14:31danneusuccess: youre talking about barely charted territory http://clojure-android.info/
14:32mgaarefor even more fun, you can go clojurescript -> phonegap -> android
14:32danneuoh man
14:33danneuit took me long enough to even get the bundled-for-android eclipse package to run the example program without error.
14:34razum2um1is there any way to include some jar into one build by lein jar? how can I depend on some arbitrary jar file?
14:35mgaarerazum2um1: it's not very fun to do that. The easiest way is to get the jar you want into a maven repository. The other way is to use a lein plugin
14:35mgaareno, "easiest" was not the word I wanted there. "most recommended"
14:36razum2um1mgaare: where is no pom.xml file, but jar has no deps, is there an easy way like lein deploy maven?
14:37mgaarerazum2um1: you can just make a skeleton pom file in that case.
14:38razum2um1mgaare: ok, thx ;)
14:38justin_smithmgaare: isn't there a lein command that does that?
14:38mgaarejustin_smith: there certainly might be
14:39justin_smithlein-localrepo
14:39justin_smithit does various stuff with the local maven cache
14:39technomancyyou can just use the second arity of lein deploy
14:39justin_smithoh, that too
14:40successsorry if I was rude, no offense meant!
14:41mgaareyou can't offend clojure people. we have abstracted away our emotional response mechanisms
14:41successjust trying to figure out if this was for me and the conclusion is it is not. it does not offer me anything at all.
14:41dbaschif I were doing android development, I’d probably stick with Java.
14:42dbaschmostly because of the tooling
14:42technomancyI read that as "because of the trolling" at first and thought "it certainly would provide many rich opportunities"
14:43danneuis it rare for a given JS library to be closure-compatible?
14:43danneui.e. get to move it into the build process instead of :libs + externs?
14:43nooniandanneu: definitely, its mostly only googles libraries afaik
14:44dbaschtrolling in java is easier too, but the clojure support for trolling keeps getting better
14:44technomancyhttp://technomancy.us/165
14:45amalloydbasch: the downside is it takes so many words to build up to a proper troll in java that your audience leaves in the middle
14:45dbaschI was listening to the stack exchange podcast, apparently one of the indicators of poor quality of a question in SO is having “java” as its only tag
14:46mgaareI'd imagine a non-trivial percentage of java SO questions are related to CS101 homework assignments
14:47dbaschmgaare: they speculated quite a bit about the reasons, one possibility is that a vast majority of the java questions are trivially googleable
14:49danneuwhich of course leads to a nice succinct SO answer
14:49danneuSO is about playing the answer arbitrage market
14:52csd_Has anyone experienced a problem where *cider-error*'s stacktrace's colors are wrong. It's giving me dark on dark and its nearly impossible to read.
14:52justin_smithcsd_: put your cursor on the text, and M-x describe-face
14:53csd_I did, it's telling me default, and it's incorrect
14:53justin_smithyou will end up with a hyperlink you can go to to set the new color for future usage
14:53justin_smithare you really on the colorized text? if so that is really weird
14:53csd_It's not reporting the correct face for some reason
14:53csd_Yes. I am on the stacktrace portion of the buffer
14:53justin_smithcsd_: it could be a face that "bled", you may need to go up to where the color setting started
14:54csd_you mean a problem with another package?
14:54justin_smithcsd_: also, it could be an overlay instead of a face (m-x describe-text-properties iirc)
14:54justin_smithno, not another package
14:54justin_smithfor any given text, emacs knows why it has the color it has
14:55justin_smithit usually comes down to font-lock, overlays, or bugs
14:55csd_that last command seems like it is the right one
14:55csd_looks like the face is cider-stacktrack-face, and every property of it is undefined
14:56justin_smithcsd_: you can follow that as a link and set the colors
14:56alexherbo2technomancy: the editor i use, kakoune, is langage agnostic.
14:56justin_smithit is probably inheriting a bad default
14:56csd_inherits default so that explains that
14:56csd_thx
14:56justin_smithnp, sorry it took me a few to remember the real solution there :)
14:56technomancyalexherbo2: if it doesn't let you write extensions in-process then that just means it supports all languages equally badly =\
14:57justin_smithtechnomancy: ed is language agnostic
14:57alexherbo2technomancy: yes
15:00csd_is it worthwhile reading let over lambda for someone who isn't doing CL?
15:00amalloycsd_: it won't actively harm you, so "worthwhile" depends how much you value your time. there's some value there
15:01amalloythere are some interesting ideas and techniques, which mostly don't apply to clojure but might get you thinking
15:01csd_i read that the macro portion of it is supposed to be pretty good
15:01clojurebotIk begrijp
15:02justin_smith~i read that the macro portion of it
15:02clojureboti read that the macro portion of it is supposed to be pretty good
15:11SegFaultAXjustin_smith: Obligatory https://www.gnu.org/fun/jokes/ed-msg.html
15:13justin_smithSegFaultAX: I should make a line editor for clojure
15:13justin_smithall the old lisps had one
15:13justin_smithdo all your work in the repl!
15:16SegFaultAXHah, do it! :)
15:32justin_smithand then I can have a setup where you can define editor plugins in clojure - and someone can integrate it with curses or awt - and then we have clomacs!
15:33amalloybbloom: my recollection of your stance on monads is that you think specific monad instances are useful (eg mapcat for List), but that there's no real value in having the generic notion of a Monad. (a) is this about right, and (b) i was curious how you feel about monoids
15:33bbloomamalloy: that's close to how i feel
15:33bbloomamalloy: there obviously is value to the generic notion of a monad when you have something that operates on it, like do syntax in haskell
15:34bbloombut if you don't have return type polymorphism (as you can't really in a latent typed language) then you have to specify the monad specifically, so you might as well specify that via the syntax you choose
15:35bbloomie when you use clojure.core/for, you're specifying that you want the list monad and it's syntactic form
15:35bbloomlist comprehension is the monadic interface, but it's a richer interface than just bind/return
15:35bbloomso it gets special syntax, like :let, :when, etc
15:36bbloomamalloy: that make sense?
15:36amalloywellll, :let is just more sugar over bind/return. :when is a bit richer, though
15:37bbloomamalloy: no let is sugar over lets expressions in between binds
15:37amalloysure
15:37amalloyi guess i meant, it's sugar over things that don't need any more "power" than bind/return
15:37bbloomyes, true
15:37bbloombut worth nothing that haskell's AST explicitly supports late statements in do notation
15:38amalloys/late/let, right?
15:38bbloomyeah
15:38bbloom(doc for)
15:38clojurebot"([seq-exprs body-expr]); List comprehension. Takes a vector of one or more binding-form/collection-expr pairs, each followed by zero or more modifiers, and yields a lazy sequence of evaluations of expr. Collections are iterated in a nested fashion, rightmost fastest, and nested coll-exprs can refer to bindings created in prior binding-forms. Supported modifiers are: :let [binding-form expr ...], :while test, :when te
15:38bbloomoh yeah, while too
15:39bbloomhaskell has list comprehensions for when/while
15:39amalloyand i definitely see what you mean in a loosely-typed language like clojure: there's not a ton of value in generic monad functions, because even though you can write them they're not really as easy to use than specialized versions
15:39amalloybbloom: well, when is just a function; you can include that in do notation too
15:39amalloythough i think `guard` is the function more like clojure's :when
15:39bbloomhttp://en.wikibooks.org/wiki/Haskell/Syntactic_sugar
15:40bbloomyeah, guard is a monadic operation
15:40bbloomthe list monad's interface is larger than the generic monad's interface
15:40bbloomthat's the point
15:40bbloomif you want special monadic syntax, you lose that for things outside the generic interface
15:40bbloommodulo let
15:40bbloomas far as i can tell
15:41bbloomalthough the "-- or equivalently" block looks relatively nice
15:43bbloomamalloy: do you know how to do :while in haskell?
15:43amalloybbloom: i was just about to say that :while is the interesting one and i don't know what's like it in haskell
15:43amalloyi have a SO comment somewhere, where i asked a haskell guy with some clojure experience and his response was similar
15:44bbloom*shrug* either which way, for syntax, haskell people generally use list comrhensions instead of do notation
15:44bbloomi wonder what other extra-monadic operations are interesting on which underlying monads
15:45bbloomsurely there are many, but which benefit from syntax support?
15:46bbloomscala's for comprehensions include yoda-style trailing `if`
15:46amalloyspeaking of using do-notation for list comprehensions, i saw this beginner haskell question recently, and an answer which was completely incomprehensible, even to someone like me who already knows the answer: http://stackoverflow.com/q/26659648/625403 (this is unusual for haskell SO, despite the stereotype that haskellers just answer everything with graduate-level mathematics)
15:47bbloomheh
15:47bbloomhttp://docs.scala-lang.org/tutorials/FAQ/yield.html
15:47bbloom.withFilter
15:49amalloythat's basically the same as :when, right? (for [x xs :when cond] (f x)) => for (x <- xs; if cond) {yield f x}
15:49amalloyours is just as trailing/yoda
15:49bbloomyes
15:50bbloomhttps://www.haskell.org/haskellwiki/MonadPlus
15:50amalloyright, that's where guard lives
15:50bbloomyeah
15:50amalloyneeds mzero, iirc
15:51bbloomhilarious that it's called "MonadPlus"
15:51bbloomis that a technical term or "shit, this is useful, let's put it in"
15:51amalloybbloom: plus as in addition, i think
15:51amalloyzero and plus
15:51bbloomyeah, i know, but surely there is a word from abstract algebra
15:52bbloomanyway
15:52bbloomi'm not saying do notation is useless
15:52bbloomor that having a monad-abstraction is useless
15:52bbloomi'm just saying it's not that useful :-P
15:55aztakgood morning!
15:56nathan7bbloom: AdditiveMonad?
15:57bbloomnathan7: https://en.wikipedia.org/wiki/Group_(mathematics) maybe? i suck at abstract algebra
15:57nathan7bbloom: No
15:57nathan7bbloom: or, hmm, yes
15:58nathan7bbloom: mzero is the identity element
15:58nathan7bbloom: and mplus is the group operation
15:58nathan7bbloom: ah, no
15:58nathan7bbloom: a group is a monoid
15:59nathan7bbloom: monoids have associativity and an identity element
15:59bbloomwe need to lock the abstract algebra and category theory people in a room and convince them to chop the vocabulary in half
15:59nathan7bbloom: "The precise set of rules that MonadPlus should obey is not agreed upon."
15:59nathan7on the plus side, I now know what a monoid is
16:00bbloomif the rules are hard to decide, that means you don't understand it :-P
16:00dbaschbbloom: if you chop the vocabulary in half, then talking about all those things becomes really verbose
16:00bbloomwhich is also why i don't concern myself too much w/ the precise mathematical structure and instead worry about making shit that works and *feels* right
16:01bbloomdbasch: i was mostly kidding
16:01dbaschbbloom: let’s do away with decimal, I don’t want to remember all those symbols when 0 and 1 suffice :P
16:05nathan7bbloom: you should learn J or K
16:06nathan7bbloom: it has like maybe 40 functions? many of them with the same symbol but different arities
16:06nathan7bbloom: +/%# being an averaging function, for example (+/ is kinda like map, % is division, # is count)
16:07dbaschand then you can find out if non-abelian supercalifragilistic groups are supersolvable
16:11lodinbbloom: Can you elaborate on why do notation is not that useful (in Clojure?)? I've heard this statement before, but never got the rationale.
16:11bbloomlodin: amalloy and i discussed it above
16:15lodinbbloom: Ah, the lack of return type inference. Indeed.
16:18amalloylodin: which is the same thing that makes functions like (Monad m) => (...) not very useful: it's super-hard to say which specialization you want
16:19amalloyi noticed it because yesterday i was writing (sequence :: (Monad m) => [m a] -> m [a]), since i wanted it for test.check generators, and i realized/remembered: oh yeah, if you apply this to the list monad instead of the generator monad, it's cartesian-product
16:19amalloyand like...too bad: i kinda just have to write it twice, with different binds and returns
16:22lodinYeah. I've faced the same issue. Specifically, you can't put return in a protocol, which you would do for fmap in a Functor protocol and bind in a Monad protocol.
16:24amalloyright. the various attempts at generic clojure monad libraries have tried to address this in various ways; none are super-impressive
16:26amalloyjimduey's protocol-monads does an interesting thing which makes do-notation work surprisingly well but doesn't seem to address the question of functions like sequence
16:26dbaschhere’s an example of a bad “java” question on SO: http://stackoverflow.com/questions/26745316/how-to-interpolate-point-in-time-in-java
16:27lodinamalloy: Ultimately I guess you end up writing your sequence function with two arguments: the monad description, and the [m a] value.
16:28amalloyright. you have to do all the type-witness passing by hand and at runtime, where it's "ordinarily" done at compile time by ghc
16:28amalloywell, actually, i guess sometimes it does leak up to runtime in ghc too. either way doing it by hand sucks
16:31arrdemis there a good "infinite integer" value hack that people use or is it just Double/POSITIVE_INFINITY?
16:35lodinamalloy: Is https://github.com/bwo/monads/blob/master/src/monads/util.clj#L68 satisfactory?
16:41amalloylodin: i can't tell how the knowledge about the current monad gets from place to place, there. it looks vaguely like he's using something like the Free monad to determine the structure of the computation without running it, and then at the top level running that Free instance through the monad you want?
16:41amalloya neat approach if he actually made it work
16:44EvanRmonads in clojure?
16:44EvanRdoes that imply types in clojure?
16:45taliosclojure has types - what do you think list, set, map are? is there a difference between data structure and type?
16:45EvanRi mean, non dynamic types of the simple java flavor
16:46taliosyou can type hint. and protocols/records compile to static java classes so..
16:46dbascharrdem: every number should be < Infinity in the jvm
16:47EvanRmy question was whether monad libs come with the expectation of parametric types, or are they just freeform
16:47justin_smitharrdem: Integer specifically?
16:47EvanRcuz freeform would be interesting
16:47arrdemnevermind I'm being silly about how I'm approaching this
16:47amalloydbasch: except NaN
16:47justin_smith,Integer/MAX_VALUE
16:47clojurebot2147483647
16:47justin_smith,Long/MAX_VALUE
16:47clojurebot9223372036854775807
16:48arrdem\forall X x \lteq \Ifty is good enough
16:48dbaschamalloy: but NaN is not a number :)
16:48amalloy,(number? Double/NaN)
16:48clojurebottrue
16:48arrdemNaN can go cry in the corner with NaR neither of whom belong in real data :P
16:48EvanR,(< Double/Infinity Double/Infinity)
16:48clojurebot#<CompilerException java.lang.RuntimeException: Unable to find static field: Infinity in class java.lang.Double, compiling:(NO_SOURCE_PATH:0:0)>
16:48amalloyNaR?
16:48dbaschI didn’t say any #(number? %) :P
16:48arrdemamalloy: Not a Result. used in some speculative hardware.
16:49dbaschbtw, wat
16:49arrdemlol EvanR
16:50EvanRtheres two kinds of NaNs
16:50dbaschit is true that not a number is a number… therefore everything in clojure is true
16:50justin_smithdbasch: with two notable exceptions, yes
16:51EvanR,(if nil 1 0)
16:51clojurebot0
16:51EvanR,(if NaN 1 0)
16:51clojurebot#<CompilerException java.lang.RuntimeException: Unable to resolve symbol: NaN in this context, compiling:(NO_SOURCE_PATH:0:0)>
16:51EvanR,(if Double/NaN 1 0)
16:51clojurebot1
16:51arrdemEvanR: it's ##Double/POSITIVE_NAN
16:51amalloy(inc justin_smith)
16:51lazybot⇒ 116
16:52justin_smitharrdem: it's ##(Double/NaN)
16:52lazybot⇒ NaN
16:52EvanRpositive nan o_O
16:52arrdemor does NaN not have a sign bit.. I thought it did..
16:52EvanRnooo
16:52amalloyarrdem: were you positive?
16:52arrdemamalloy: gtfo
16:52technomancysome architectures give zero a sign bit
16:52dbasch(doc number?)
16:52clojurebot"([x]); Returns true if x is a Number"
16:53EvanR,(= Double/NaN Double/NaN)
16:53clojurebotfalse
16:53amalloy/topic Clojure, and puns thereon.
16:53justin_smith,-0.0 ; technomancy like the jvm, sometimes
16:53clojurebot-0.0
16:53amalloyjustin_smith: well, for floats that's required
16:53dbasch,(instance? Number Double/NaN)
16:53clojurebottrue
16:53ambrosebs,(= Double/NaN)
16:53clojurebottrue
16:53justin_smitha classic
16:53EvanRwtf
16:53arrdemEvanR: HAH yes you can have +/- NaN, but it's ignored on most architectures
16:54arrdemNaN is 0bX1111111axxxxxxxxxxxxxxxxxxxxxx
16:54arrdemwhere a
16:54justin_smith,(.longValue Double/NaN)
16:54clojurebot0
16:54arrdemis the signaling bit
16:55technomancy(negative? -0.0)
16:55technomancy,(negative? -0.0)
16:56clojurebot#<CompilerException java.lang.RuntimeException: Unable to resolve symbol: negative? in this context, compiling:(NO_SOURCE_PATH:0:0)>
16:56lodinamalloy: Don't know about the free monad, but yeah. That's basically it I think. I ended up with such a solution and then found that library.
16:56technomancy,(neg? -0.0)
16:56clojurebotfalse
16:56technomancyjustin_smith: that doesn't count
16:56EvanR,(negative? Double/NaN)
16:56clojurebot#<CompilerException java.lang.RuntimeException: Unable to resolve symbol: negative? in this context, compiling:(NO_SOURCE_PATH:0:0)>
16:56EvanR,(neg? Double/NaN)
16:56clojurebotfalse
16:56EvanR,(pos? Double/NaN)
16:56clojurebotfalse
16:56justin_smithtechnomancy: the only number that prints with a leading - that isn't negative, I guess
16:56justin_smith(zero? Double/NaN)
16:56justin_smith,(zero? Double/NaN)
16:56clojurebotfalse
16:57EvanRi hate NaN
16:57amalloy,((juxt neg? pr-str) (- Double/NaN))
16:57clojurebot[false "NaN"]
16:57amalloywell, so much for that being a counterexample
16:57amalloyEvanR: how do you feel about naan?
16:58EvanRits ok
16:58pmonksEvanR: my nan is the best. She makes me stewed apple.
16:58technomancyamalloy: are you asking for a naan disclosure agreement?
16:58amalloytechnomancy: only clojure-related puns, sorry
16:58nathan7o.o
16:58amalloythis is more of an engineering wordplay
16:58nathan7(naan highlights me for hysterical raisins)
16:59dbaschI only like naan that lends itself to currying
16:59nathan7shoo, off to Haskell you go q=
17:01lodinamalloy: in monads.core you find (defn run-monad [m computation] ...) and (defn return [x] (Return. x)), and I believe (Return. x) is a computation.
17:03gfredericksamalloy: something something naan disclojure agreement
17:04{blake}Why would "lein test" show a FAIL and then end with "Ran 2 tests containing 2 assertions. 0 failures, 0 errors."?
17:04dbaschgfredericks: you have to sign one before they let you eat here http://www.yelp.com/biz/naan-n-curry-san-francisco-4
17:09justin_smith{blake}: that's weird, how many tests do you actually have defined?
17:10sdegutisIs rsync a reasonable way to deploy a Clojure web app in uberjar form along with its resources dir?
17:10technomancy(deftest ohai (println "FAIL") (is true) (is true))
17:10amalloysdegutis: why would you deploy its resources directory separately? it should be included in the uberjar
17:10sdegutisamalloy: I meant resources/public, for Nginx.
17:11{blake}justin_smith, Two. I'm just starting to write tests. Two were in the auto-generated test file, but I removed one. Then I added one.
17:11dbaschsdegutis: why does nginx need the resources/public dir?
17:12{blake}If I run it from the REPL in Cursive, it doesn't even show the error. (Making running testing from the REPL useless.)
17:12amalloydbasch: i presume sdegutis wants to let nginx serve his public resources instead of doing it with ring
17:13dbaschamalloy: yes, but why?
17:13tickingQuick poll :), what is the most idiomatic way to split a sequence of booleans on a true false flank?
17:13amalloyticking: flank??????
17:13amalloyit's not an incoherent choice. nginx surely does a better job of it. better caching, performance, whatever
17:14dbaschamalloy: sure, if you’re google, or heroku, or whatever
17:14dbaschotherwise it’s a very premature optimization
17:14tickingamalloy: edge, sorry it's late here
17:14justin_smith{blake}: using clojure.test, right?
17:15{blake}justin_smith, Yep.
17:15amalloyticking: do you have a sample input with expected output? it's a pretty vague question
17:15justin_smith{blake}: if you load the namespaces that define the tests, (clojure.test/run-all-tests) will run the tests and give a summary
17:15arrdemticking: amalloy: [true true false true] -> [[true true] [false] [true]] if I understand...
17:16tickingamalloy arrdem: [true true true false true true false true] => [[true true true false] [true true false] [true]]
17:16amalloyso whenever a is false and b is true, put a split between a and b
17:16amalloy(in that order)
17:16tickingyeah
17:17sdegutisdbasch: For when the site is restarting.
17:17amalloyif you don't mind pulling in flatland/useful (https://github.com/flatland/useful/blob/develop/src/flatland/useful/seq.clj#L224), you could: (defn splits [xs] (partition-between (fn [[a b]] (and b (not a))) xs))
17:17sdegutisamalloy: Most of my resources are on CloudFront. I just want to serve some while the Clojure web app is restarting.
17:18tickingamalloy: yeah, but this has to be doable in clojure.core :D
17:18amalloyticking: huh? you're hoping to include this function in clojure.core?
17:18dbaschsdegutis: sure, you can rsync. I’d rather deal with the few seconds of downtime
17:18gfredericks&(pr-str (map #(doto % println) '(1 2 3)))
17:18lazybot⇒ "(1\n2\n1 3\n2 3)"
17:18sdegutisThan what?
17:19dbaschsdegutis: than with the error-prone nature of deploying a jar and a directory of resources separately
17:19sdegutisWhy is that error-prone?
17:19dbaschunless I had to optimize for uptime because I have tons of users and I lost money when they couldn’t see the site
17:19tickingamalloy: it's driving me nuts, splitting seqs between values is such a basic operation, and in comparison partition-by is super useless, especially considering that partition-by is a special case of partition-between
17:19dbaschsdegutis: because you have to write a custom script to deploy both at once, and you could forget to run it
17:20{blake}justin_smith, Yeah. There it shows 1 test containing 1 assertion. :-/
17:20sdegutisdbasch: It's the only way to deploy though.
17:20amalloyticking: i mean, i agree; that's why i wrote partition-between. what does this have to do with not wanting to use useful?
17:20justin_smith{blake}: is there some other namespace that has test definitions in it that did not get loaded?
17:20arrdem&(bit-shift-left 5 2)
17:20lazybot⇒ 20
17:20tickingamalloy: I'll happily use it, but it should be in core ;)
17:21arrdem&(bit-shift-left 5 5)
17:21lazybot⇒ 160
17:21amalloyoh, by "has to", you mean "there should be a way to do it with just functions in clojure.core"?
17:21tickingamalloy: yeah
17:22amalloyobviously there is one; reimplement all the functions in useful, which depend on stuff not in clojure.core, and use the reimplemented versions as helpers
17:22tickingin less than 5 lines ;)
17:22amalloyit's not super-hard to write this boolean-splitting function by hand
17:22{blake}justin_smith, When I do a run-all-tests in the REPL, it doesn't load my "main" tester. When I "lein auto test" (using the "auto" plugin), it loads both files.
17:22amalloybut it's so specific i can't imagine why you would; instead, implement partition-between
17:23m1dnight_If I want to make a quick program (solve a puzzle, belphegor numbers, for who cares), how do I import a namespace?
17:23tickingyeah I wrote one that is faster than partition-by when supplied with not=
17:23technomancym1dnight_: "use" is fine for throwaway code
17:24m1dnight_but then i get classnotfound exception
17:24m1dnight_It's not in a leiningen project, to be clear
17:24m1dnight_just a buffer in cider
17:24sdegutisI like the idea of deploying via Git, though.
17:24sdegutisThat way I can push a tag to remote.
17:24technomancywell ... the namespace has to be present
17:25amalloyi don't think you can write it *well* with clojure.core in less than five lines
17:26dbaschamalloy: you could do it easily with a greedy loop and an accumulator
17:26amalloydbasch: so far that doesn't sound like a counterargument
17:26amalloylazy seqs for life
17:27arrdemtransducer style partial lazyness :P
17:29amalloyticking: if i had to write it from scratch and wasn't allowed to build any reusable helpers, https://www.refheap.com/caf4ede90f5fd21a2fa1d47e8 is what i would do
17:33arrdemhttp://macbeth.cs.ucdavis.edu/lang_study.pdf
17:34dbasch“a very large data set from GitHub (729 projects)” … ok
17:35arrdemby the standards of software defect papers that's actually not bad :P
17:35arrdemmost of the software engineering literature I've seen is grateful for 2 or 3 projects as samples
17:36dbasch“Some languages induce fewer defects than other languages.” ok, let’s make everyone code in Scala and see how that remains true
17:37m1dnight_hmm, I've been using exp function in clojure by accident (meant to write expT) and it yields false results, is that possible?
17:39Bronsam1dnight_: there's no exp function in clojure
17:39m1dnight_huh
17:39m1dnight_what on earth have I been using then..
17:39Bronsa,exp
17:39clojurebot#<CompilerException java.lang.RuntimeException: Unable to resolve symbol: exp in this context, compiling:(NO_SOURCE_PATH:0:0)>
17:39noonianthere is java's Math/exp
17:39m1dnight_I have no use, import nothing
17:40noonian,(Math/exp 2 4)
17:40clojurebot#<CompilerException java.lang.IllegalArgumentException: No matching method: exp, compiling:(NO_SOURCE_PATH:0:0)>
17:40m1dnight_and yet, (exp x y) worked :p
17:40m1dnight_oddly enough
17:40m1dnight_user> (exp 2 3)
17:40m1dnight_8
17:40m1dnight_.. :p
17:40Bronsam1dnight_: how are you running clojure?
17:40m1dnight_Cider
17:40m1dnight_hmm, user defined function according to repl
17:40m1dnight_i must have done.. euhm.. nvm :p
17:42{blake}Wow...inspired by Eiffel!
17:44dbascharrdem: “the defect proneness of languages in general is not associated with software domains.” <- they cannot assert that if their universe of domains is restricted to a few open-source projects on github
17:46arrdemdbasch: gimme a minute hand-assembling some code..
17:47cfleming{blake}: Are you having problems testing in Cursive?
17:47{blake}cfleming, I'm having specific issues testing in Cursive, but I'm having problems NOT in Cursive as well. =)
17:48cfleming{blake}: Hehe, well I can at least help with the Cursive bit
17:48cfleming{blake}: Have you seen this? https://cursiveclojure.com/userguide/testing.html
17:48{blake}cfleming, I have, but not in a while. Let me revisit...
17:48cfleming{blake}: It's slightly out of date (the tooltips are now on the error message in the editor itself) but it'll give you the idea.
17:49cfleming{blake}: If you're still having problems let me know
17:49m1dnight_Hmm, so I can't use namespaces like math.numeric-tower in a not-leining project?
17:49m1dnight_I have the clojure jar in the same foler, but I have no idea if I have to load it by hand or so?
17:50dbaschm1dnight_: you need the jar in the classpath
17:50m1dnight_I'm guessing that is in the classpath of CIDER?
17:51{blake}cfleming, Well, it runs the tests, so there's that. The counts are wrong, just as they at the CLI.
17:51amalloym1dnight_: doing anything *not* in a leiningen project is quite a handicap. everything is easier with lein
17:51cfleming{blake}: So your counts are wrong using lein test, or whatever you're using to run your tests?
17:52m1dnight_but I just want to solve a simple puzzle, I dont want to create a leining project for that
17:52{blake}cfleming, Yeah, it seems to count each namespace as 1, regardless of the number of tests and assertions.
17:52m1dnight_not being able to quickly mash up some code for a 10 line puzzle is a handicap imo
17:52dbaschm1dnight_: but it takes like 1 second to create a leiningen project, and you can keep it for future puzzles
17:53m1dnight_point well made
17:53m1dnight_argh ;p ill do it that way then
17:53{blake}dbasch, m1dnight_ That's what I do.
17:56arrdembah bugs
17:57ToBeReplacedm1dnight_: "lein one-off" might be of interest
17:57arrdemdbasch: you're right. yay research criticism
17:57xonev1m1dnight_: I use the lein-exec plugin for simple scripts: https://github.com/kumarshantanu/lein-exec
17:57m1dnight_aaah, that might be something that might aleviate :)
17:57m1dnight_thank you guys
17:59dbascharrdem: yeah, I’m sure the approach is ok for github, but for example C is used in tons of industrial domains with long development cycles (e.g. embedded devices). They need to take that into account when they make broad statements like that one.
17:59arrdemdbasch: for sure, but measuring defect rates and classes for closed source stuff like that is le hard :/
18:00dbascharrdem: that’s the kind of data that the SEI has, mostly with defense contractors
18:01arrdemdbasch: which SEI? :P
18:02dbascharrdem: software engineering institute http://en.wikipedia.org/wiki/Capability_Maturity_Model
18:02cfleming{blake}: Hmm, that's strange. Cursive will probably report the same as clojure.test does there, it just delegates to clojure.test for all that info.
18:04andyfBronsa: Ok, Clojure and taj trivia question. Clojure seems to allow foo/bar as args to methods in reify, but taj throws exception. That looks reasonable to me on taj side, but wanted to verify
18:05amalloy,(reify Object (toString [user/this] "x"))
18:05clojurebot#<sandbox$eval25$reify__26 x>
18:05amalloyhuh, i didn't expect that
18:05Bronsaandyf: ugh.
18:05Bronsaandyf: yeah I'll have to support that
18:05technomancyI vaguely recall opening a bug about reify accepting nonsense args
18:06Bronsa,(reify Obejct (foo/toString [foo/this] "foo"))
18:06clojurebot#<CompilerException java.lang.RuntimeException: Unable to resolve symbol: Obejct in this context, compiling:(NO_SOURCE_PATH:0:0)>
18:06Bronsa,(reify Object (foo/toString [foo/this] "foo"))
18:06clojurebot#<sandbox$eval75$reify__76 foo>
18:06andyfBronsa: Why would you have to support it? Isn't it an accident that Clojure accepts it?
18:06amalloyBronsa clearly doesn't trust my tests
18:07amalloyandyf: lacking a spec that's independent from the existing implementation, it doesn't really matter what's an accident: anything that works in clojure is as close to defined behavior as we get
18:07Bronsaandyf: some code might rely on this, clojure.core relies on (foo/toString ..) to work
18:07Bronsa,(deftype x [] Object (toString [foo/bar] ""))
18:07clojurebotsandbox.x
18:07Bronsagah
18:07andyfEven when I say Clojure accepts it, I just mean it doesn't give error. You can't refer to those args in the body (at least I don't know how)
18:07Bronsaandyf: ah really?
18:08Bronsa,(defprotocol p (f [_ _]))
18:08clojurebotp
18:08Bronsa,(f (reify p (f [_ foo/bar] bar)))
18:08clojurebot#<CompilerException java.lang.IllegalArgumentException: No single method: f of interface: sandbox.p found for function: f of protocol: p, compiling:(NO_SOURCE_PATH:0:0)>
18:08justin_smith{blake}: coming back after a nap: clojure.test does not do anything to look for namespaces with tests in them, all it does is run the tests in namespaces that have been loaded
18:09justin_smith{blake}: lein test has some rules for looking for namepsaces that have tests in them
18:09technomancyI wish that were part of clojure.test
18:09technomancyreally lame to have to put them in the task
18:09Bronsa,(f (reify p (f [_ foo/bar] bar)) 1)
18:09clojurebot1
18:10Bronsaandyf: ^ looks like it work
18:10Bronsaworks*
18:10andyfLook at gist.github.com/jafingerhut/9323268424eca54293f5
18:10technomancyBronsa: it's not the same identifier though
18:10technomancyI mean ... FSVO "works"
18:12Bronsaandyf: how did you find out about this?
18:12andyfGot exception when trying to lint aleph lib, got that taj exception, and started experimenting.
18:12andyfLet me find aleph code.
18:13Bronsaah so there *is* real code that depends on this :(
18:13technomancyandyf: fixing this in a way that throws at compile time would be a lot better than some behaviour changes that just affect codebases silently though
18:14andyfI think it just happens to work with Clojure because aleph has this issue for args named _, so never used in method
18:14technomancyanyone who sees an exception would immediately say "oh wow, we were doing what??" and feel embarrassed.
18:14technomancylike how Clojure used to discard nonsense type hints and then started throwing compile errors
18:14andyftechnomancy: Agreed that the error is preferable if this can't be used in reasonable way
18:15Bronsatechnomancy: people write `(deftype x [] Interface (method [..] ..) all the time never realizing that's going to expand to (ns/method [..] ..)
18:15technomancythere is nothing reasonable about namespaced locals
18:15technomancylocals by definition need no namespace
18:15technomancyBronsa: is this about the method name or the arglist?
18:15Bronsatechnomancy: method name
18:15ztellmanandyf: thanks for the heads up on that
18:15ztellmancrazy that it's such an invisible bug
18:16Bronsatechnomancy: clojure still silently ignores wrong type-hints btw
18:16technomancyBronsa: I meant for classes that simply don't exist
18:16Bronsatechnomancy: .. yeah
18:17Bronsatechnomancy: it's highly inconsistent, it might throw or just ignore it depending on where you put the type hint
18:17cflemingandyf Bronsa: I noticed while working on my macroexpander that macroexpansions of deftype/reify/etc forms have clojure.core-qualified method names.
18:17technomancyBronsa: it changed somewhere in 1.1 -> 1.3 to be more strict
18:17andyfGithub.com/ztellman/aleph/blob/0.4.0/src/aleph/netty.clj#L277
18:18Bronsatechnomancy: well I can't imagine how bad it was earlier then, lol
18:18dbaschBronsa: and when it throws it’s not always the same exception
18:18technomancyanyway, I wrote code that accidentally relied on the old behaviour and was glad for the new behaviour even though it was a breaking change, because it was compile-time
18:18Bronsaandyf: I've felt your pain typing that url
18:20andyfI guess I should have said before that at least in this case, an error from taj seems preferable to Clojure's accepting it
18:20Bronsacfleming: yeah defrecord has all its method impls qualified
18:20andyfIt is quick copy and paste when not on my iPhobe (left that typo in for fun :-)
18:21cflemingtechnomancy: The one case where locals are reasonably ns-qualified is in the new :keys destructuring
18:22cflemingtechnomancy: Otherwise, right, no argument there.
18:22amalloycfleming: well, that's because you're using `: macroexpansion isn't qualifying those names, you are
18:22amalloy,`(reify Object (toString [this] "s"))
18:22clojurebot(clojure.core/reify java.lang.Object (sandbox/toString [sandbox/this] "s"))
18:23Bronsa,(macroexpand-1 '(defrecord x []))
18:23clojurebot(clojure.core/let [] (clojure.core/declare ->x) (clojure.core/declare map->x) (deftype* x sandbox.x [__meta __extmap] :implements ...) ...)
18:23Bronsawell.
18:23amalloy&(macroexpand-1 '(defrecord x []))
18:23lazybot⇒ (clojure.core/let [] (clojure.core/declare ->x) (clojure.core/declare map->x) (deftype* x sandbox12103.x [__meta __extmap] :implements [clojure.lang.IRecord clojure.lang.IObj clojure.lang.ILookup clojure.lang.IKeywordLookup clojure.lang.IPersistentMap java.util.Map j... https://www.refheap.com/92715
18:23amalloyokay, i guess that's true. if you expand past defrecord to the deftype* phase, there are more clojure.core-qualified names
18:24Bronsacfleming: in cljs it's even worse btw protocols too get cljs.core qualified and ctors too in some cases
18:24cflemingRight, as a user I can't avoid that happening AFAICT - not that I probably care as long as Clojure accepts it
18:25cflemingJust thought it was curious
18:25andyfAnyone have example if new namespace qualified key destructuring for me to test with?
18:25Bronsa,(let [{:keys [foo/bar]} {:foo/bar 1}] bar)
18:25clojurebot1
18:25cflemingandyf: I think the JIRA had examples, but I don't have it to hand.
18:25cflemingOr Bronsa has your back :-)
18:26amalloyactually, i take it back. defrecord expands into (deftype* Object (clojure.core/toString [this__auto] "whatever")), which is not an instance of this undesirable qualified names
18:26andyfYes. Yes he does
18:26cflemingBronsa andyf: The new Eastwood looks great BTW - I need to get those type-hint warnings into Cursive too.
18:27Bronsaamalloy: cfleming was talking about qualified method names not locals
18:27amalloyBronsa: yes, i missed that
18:27cflemingRight, the clojure.core/toString in your example
18:27andyfcfleming: The new version is easier to call from a repl or other app, if you want to go that route
18:27amalloywhich is sorta "old news". weird that the compiler accepts it, but once you think about it it's much preferable to the alternative
18:28Bronsaamalloy: agreed
18:28cflemingandyf: I'll have to rewrite them to work within Cursive, unfortunately - the infrastructure works in quite a different way.
18:28amalloyaccepting qualified method arguments is the wild thing andyf noticed
18:28cflemingandyf: BTW this would be good to warn about too, if you can: http://dev.clojure.org/jira/browse/CLJ-865
18:29cflemingandyf: This bit me the other day.
18:29amalloyoh hey, that would be a good thing to put in a linter, i suppose
18:29cflemingNo doubt, I'll be warning about that in Cursive when I get some time
18:30Bronsacfleming: if you need hints on what to look for when warning about type hints feel free to email me
18:30andyfMeaning if a macro invocation has a type hint, warn that compiler will/might remove it depending on macro defn?
18:31cflemingBronsa: Thanks, I will do when I get to it, definitely.
18:31{blake}justin_smith, It's running the tests. I can make them fail and they'll all show up. It just doesn't count them.
18:31Bronsabtw I've run into a super weird issue with tools.reader the other day
18:31cflemingandyf: Right. I think "will almost certainly remove it" is a more accurate characterisation
18:31Bronsachanging ` to emit c.c/sequence instead of c.c/seq caused some metadata to be lost
18:32BronsaI tracked it down to sequence possibly returning a LazySeq rather than an ASeq but couldn't figure out why lazyseq were problematic
18:32{blake}justin_smith, So, I'll get five fail messages, but then "2 tests containing 2 assertions, 0 failures, 0 errors."
18:34andyfSo sounds like it may be best to keep exception in t.a.j for method arguments with namespace qualifiers?
18:35justin_smith{blake}: weird, I've never seen anything like that
18:35cfleming{blake}: That does sound like the ns is not being correctly loaded somehow.
18:35cfleming{blake}: There are no exceptions while loading?
18:36Bronsaandyf: I just unstaged the changes to relax the check, amalloy and technomancy have convinced me it's not worth it
18:37andyfCool. One more kind of likely-a-bug thing it can catch, then
18:43{blake}cfleming, While loading what? From the command lein it's just "lein auto test". No exceptions there.
18:43cfleming{blake}: While loading the namespace - to me it looks like your test vars are not being created correctly for some reason. If you manually require your test ns, do you get any exceptions?
18:44{blake}From a new REPL in cursive, I just do "(clojure.test/run-all-tests)".
18:44{blake}Let me try that.
18:44cfleming{blake}: You could also look for your test vars to make sure they're there as you expect, and that they have the clojure.test metadata attached to them.
18:45cfleming{blake}: i.e. (meta my-ns/my-test-var) should have some test-related entries, although I'm travelling right now and can't remember what it looks like
18:45{blake}cfleming, Requiring the namespace causes the tests to be run, and the errors to be shown, but no count.
18:45cfleming{blake}: Then that is very weird.
18:45{blake}cfleming, So far I've got no test vars, just running functions.
18:46cfleming{blake}: So you're not using deftest?
18:47{blake}cfleming, That could be it. I started with deftest then switched to testing.
18:47amalloy{blake}: if your test assertions aren't inside of a deftest form (ie, are just at the top level of your namespace), then of course lein test won't know they failed
18:47justin_smithyeah, that's not what testing is for
18:48{blake}Well, mystery solved, then.
18:48amalloyall tests should be inside of a deftest; testing is for finer shades of meaning within that
18:49justin_smith{blake}: testing is for getting more meaningful failure messages, and for grouping assertions within a test
18:50{blake}justin_smith, Sure. I see the admonition to use deftest on the api page, but I'm used to using RSpec (which I see this is Not Like).
18:50{blake}Anyway, thanks all.
18:51{blake}cfleming, And nice job on underlining the failed test in Cursive!
18:54cfleming{blake}: Thanks! Glad the mystery is solved.
18:54cfleming{blake}: I'd recommend checking out the clojure.test source sometime to see how it works, it's a single longish ns, and relatively easy to understand.
18:55justin_smithcfleming: {blake}: I am a big fan of how clojure.test leverages standard clojure features instead of trying to be a mini language for testing
18:56{blake}cfleming, Thanks, I'll do that. That seems to be a very effective tactic in Clojure.
18:56cflemingjustin_smith: Agreed. I like expectations for that, too.
19:00bbloomhelp me convince don syme that value recursion is a bad idea :-)
19:00bbloomhttps://twitter.com/BrandonBloom/status/529700895765049344
19:12{blake}justin_smith, Oh, no argument from me. I'm coming from a language where EVERYTHING is done as a mini-language. And there are six constantly changing mini-languages for any domain. And you can't learn one of the mini-languages without learning 3 or 4 others the mini-language creator was currently enamored of at the time.
19:12justin_smithheh
19:13noonian{blake}: which language is that?
19:14postpunkjustinracket?
19:16tuftjust wrote the best equivalent to the threading macro possible =)
19:17amalloynoonian: ruby, presumably, since he said rspec
19:17{blake}noonian, Ruby. Which I like a lot, don't get me wrong. But the premiere Ruby on Rails book has (IIRC) over ten technologies you have to tackle before you get to a "Hello, World."
19:17noonianah
19:18{blake}Ooh, I outed myself. I'm actually a Smalltalk guy. And Delphi. Heh.
19:25{blake}(Or used to be, anyway.)
19:33rweirtuft, hah, mine too
19:49{blake}Deploying with JBOSS? Rad? Or gnarly?
19:51jcrossley3-away{blake}: define "JBOSS"
19:53{blake}jcrossley3-away, JBOSS can be whatever you want it to be! (Our devops guy said "Let's use JBOSS to deploy it". Whatever it is, it'll be a brand new box just hosting this one app.)
19:53justin_smiththere is immutant
19:54justin_smithfor a clojury jboss exerience
19:55{blake}justin_smith, I'm trying to talk him into it.
19:55tuftclustering in immutant seems interesting
19:55tuftotherwise i'd rather roll my own with libs
19:56jcrossley3-away{blake}: it all depends on why he wants jboss. if it's because he wants you to hand your app to him in the form of a war file, then the onus is on him to deal with jboss
19:56{blake}tuft, Your own deployment platform?
19:56jcrossley3-awayimmutant can make your dev experience a little nicer until you have to hand him a war file
19:56{blake}jcrossley3-away, Yeah, that was my argument.
19:57tuft{blake}: oh, i wasn't thinking about it from a deployment perspective i guess. yeah if you're stuck having to spit out a war then i guess you need the j2ee app server stuff
19:57jcrossley3-away{blake}: fwiw, immutant's clustering requires wildfly, so that rules out older jboss versions.
19:58{blake}What's the most common approach for deploying Clojure?
19:58tuft{blake}: i was thinking more about immutant's capabilities as an application server vs just booting up some library components and managing your own "main"
19:58{blake}I can probably sell whatever.
19:58tuftwith nginx in front =)
19:59technomancythe most common approach is jetty uberjar
19:59{blake}technomancy, So...standalone?
20:00technomancyyeah
20:00jcrossley3-awaytuft: {blake}: immutant 2 can do either standalone/runnable/uberjar or app server (wildfly)
20:01tuftjcrossley3-away: cool yeah, i saw it's more componentized
20:01jcrossley3-awayand immutant.web's embedded undertow should be a skosh faster than jetty
20:01{blake}jcrossley3-away, So maybe I use jetty uberjar while I figure out Immutant?
20:01tuftimmutant 2 isn't released yet i don't think
20:02{blake}OK, thanks, all. Off to experiment.
20:02jcrossley3-awaytuft: correct, hopefully in a month or so
20:03jcrossley3-awayand 2.0.0-alpha2 is out, certainly experiment-worthy
20:05sdegutisThe main benefit of Clojure over Ruby so far appears to be the complete lack of worrying about method name collisions.
20:05tuftheh
20:14amalloythe main downside? a complete lack of worrying about artifact-id collisions
20:15sdegutiswat
20:17dbaschI’d say the main benefit of Clojure over Ruby is that you can look at a few lines of code and know that no horrendous monkeypatching mutation will be sending you into a random circle of debugging hell
20:17csd_amalloy: have you ever thought about extending 4clojure to have questions that require macros to solve?
20:19amalloycsd_: i have. it was a hard problem, both technically (missing features in the sandbox) and pedagogically (how do you define such a problem anyway?)
20:19amalloythat was years and years ago; these days i don't really do much with 4clojure besides keep it running
20:20dbaschamalloy: the arrow macros would be interesting pedagogically
20:21amalloydbasch: we have a problem or two showing how the arrow macros are used, but none about how to write them
20:22dbaschI wouldn’t want to deal with getting the sandbox to allow macros securely though
20:23amalloyreiddraper: is (apply gen/tuple gens) functionally the same as (sequence gens)? i spent some time yesterday looking for sequence, and then stopped when i found it as a private helper function, but i now see that tuple looks like the user-facing version of that
20:25gfredericksamalloy: sequence is a 3-arg function, so I'm having trouble parsing your meaning
20:26amalloygfredericks: i mean sequence like the haskell function whose type is given in the docstring. it's what gen/sequence would be, except it takes bind and return as args too
20:26sdegutisdbasch: Not true at all.
20:26dbaschsdegutis: which part?
20:27gfredericksamalloy: ah okay; it looks to me that sequence *could* be a bit more raw and not handle shrinking, perhaps?
20:29amalloygfredericks: mabye. i don't actually plan to use gen/sequence; the fact that it's private is warning enough. but after writing my own (sequence :: [m a] -> m [a]) i realized maybe i just want tuple
20:29amalloyi don't know anything about how the shrinking is implemented
20:30gfredericksyeah I think that's what tuple is for; I've used tuple on long runtime seqs of generators with no obvious downside
20:31gfredericksin fact that's how vector is implemented
20:31gfredericks(apply tuple (repeat num-elements generator))
20:33mdeboardWhat's the purpose of the "I" convention for protocols
20:34csd_i'm sure this question has no good answer, but what do you guys think of rails vs node
20:34mdeboardcsd_: They're not equivalent
20:34mdeboardYou can't compare them. You'd need to compare like Angular or Ember to Rails
20:36csd_mdeboard: do you see node as sticking around?
20:37justin_smith$examples juxt
20:37lazybothttp://clojuredocs.org/v/2058
20:38justin_smitharrdem: any interest in adding grimoir to the examples plugin while I am working on lazybot? almost done over here
20:40sritchiehas anyone here tried to render React / Om code on the server side?
20:40sritchieI’m trying to use Kioo,
20:41sritchieand it’s failing because Nashorn has no DOMParser implementation
20:42mindbender1Is there a standard algorithm for inserting things anywhere in a sequential?
20:43amalloymindbender1: that's a corollary to a question asked in here yesterday: go back in time to when you decided what data structure to use, and use something that supports the operations you want to perform
20:44guest59sritchie: I've render on the server side using nashorn
20:45sritchieguest59: do you have any code that tries to parse HTML?
20:46guest59Let me try to find the code ...
20:48mindbender1amalloy: that's tricky because i have had this issue on my mind for a long time and ever since playing with sequentials? I have never come across such a function in clojure unless of course I have bad re-collective memory and would rather indulge your assistance here.
20:49amalloymindbender1: i mean, it doesn't exist. you can write it yourself, but if your algorithm involves inserting in the middle of an arbitrary seq that almost always means it is a bad algorithm
20:49dbaschmindbender1: there can’t be a standard algorithm because you don’t know the structure, but you can code a simple, generic O(n) solution
20:49dbaschwhich is probably not what you want unless you need to modify someone else’s code in a pinch
20:51mindbender1amalloy: exactly. I was thinking if it's not that standard then it probably means I'm not thinking right about the problem and it's solution.
20:52dbaschmindbender1: think about it, inserting things anywhere in a sequential structure means either shifting things, changing pointers or having empty space to begin with
20:52amalloymindbender1: right. so instead of "how do i insert into the middle of a seq", the question to ask is "here's why i think i need to insert into the middle of a seq; what am i wrong about?"
20:53arrdemjustin_smith: sure, but I think that example selection & formatting will prove problematic
20:53arrdemjustin_smith: if anything I would want a way to say $grim <symbol> and get a link
20:54arrdemjustin_smith: that would be kickass
20:54amalloy$grim fandango
20:55guest59sritchie: Looks like I was just testing it out. Here's the code I used - https://www.refheap.com/92723
20:55mindbender1But in this case I'm not sure I'll be dealing with that much elements to really affect performance. It's really vectors that I want to use and hold a number of non-rendered dom elements when something needs to change position I do that off the dom and re-render. I really don't know how to make this happen without pushing and pulling.
20:55justin_smitharrdem: yeah, that is what I had in mind, if you can give me the code that does that for a given symbol, I can throw it into a lazybot plugin no prob
20:55mindbender1I wrote an insert-at as far back as last year
20:56mindbender1but I'm really concerned if I'm doing it wrong
20:56dbaschmindbender1: the obvious O(n) way would be (concat (take n xs) [x] (drop n xs))
20:57mindbender1dbasch: that's exactly what i did
20:57arrdemjustin_smith: so the munging is easy that's all in lib-grimoire
20:57arrdemjustin_smith: you can just require that stuff
20:57dbaschwhich would not be bad if you have a small number of elements that you’re going to render (say < 100)
20:58arrdemjustin_smith: the real issue is that for anything not in clojure.core it gets way more complex
20:58justin_smitharrdem: if only you had a query api
20:58mindbender1dbasch: yes. That much would be just about it. You think the algorithm you put up above serves well?
20:58arrdemjustin_smith: there's a listing API in 0.4.0, but that's not done yet
20:58justin_smithoh, cool
20:58arrdemjustin_smith: throw me a ticket and I'll think about a real search API
20:59justin_smithmay make more sense to just wait and make something that uses that
20:59mdeboardI've seen a few decision trees/matrices about when to use types, records, protocols, etc. Anyone know where those can be found
20:59amalloy$google cemerick types flowchart
20:59lazybot[Flowchart for choosing the right Clojure type definition form | cemerick] http://cemerick.com/2011/07/05/flowchart-for-choosing-the-right-clojure-type-definition-form/
20:59justin_smitharrdem: a fallback would be to ask for a full name / url index one time, and then just look things up in that
20:59mdeboardaha
20:59mdeboardthanks
20:59amalloymindbender1: i mean, why do these things need to be in a particular order? is there some way you can make it a tree with a reasonable sort, instead of a list?
21:00justin_smithyeah, a sorted-set-by for example
21:00arrdemjustin_smith: have you seen my var-link stuff?
21:00amalloypresumably there is some property of the data items themselves that makes you say "this one has to go after that one"
21:00amalloyencode that in the data structure, instead of in your application's list-manipulation code
21:01mindbender1amalloy: I think I get it. Or we can say why does it even have to be re-ordered in the first instance?
21:01justin_smith,(sorted-set-by #(compare (:a %) (:a %2)) {:a 0 :b 1} {:a 1 :b 3} {:a -1 :b 2})
21:01clojurebot#{{:b 2, :a -1} {:b 1, :a 0} {:b 3, :a 1}}
21:01justin_smitharrdem: no I have not
21:01amalloysure, if order doesn't matter at all the question is even easier
21:02amalloyjustin_smith: super-dangerous there, to use a compare function that doesn't agree with equals
21:03justin_smithamalloy: oh, good point
21:03justin_smith,(sorted-set-by #(compare [(:a %) %] [(:a %2) %2]) {:a 0 :b 1} {:a 1 :b 3} {:a -1 :b 2})
21:03clojurebot#{{:b 2, :a -1} {:b 1, :a 0} {:b 3, :a 1}}
21:03amalloyusually such things are better as a multimap than as a set
21:03amalloyor that
21:04gfredericksclojurebot: using a compare function that doesn't agree with equals is super-dangerous
21:04clojurebot'Sea, mhuise.
21:05amalloyclojurebot: justin_smith |lives| side by side with danger
21:05clojurebotIk begrijp
21:05justin_smith~using a compare function that doesn't agree with equals
21:05clojurebotusing a compare function that doesn't agree with equals is super-dangerous
21:06justin_smith~super-dangerous
21:06gfredericks,(into (sorted-set-by #(compare (rem %1 2) (rem %2 2))) (range 6))
21:06clojurebotexcusez-moi
21:06clojurebot#{0 1}
21:06gfredericksHUH.
21:06gfredericksI did not expect that
21:06justin_smithyeah, that was a goof for sure
21:06amalloygfredericks: you expected #{5 6}?
21:06gfredericksamalloy: no, logically it's possible for it to keep everything
21:06gfredericksisn't it?
21:07amalloygfredericks: not if it uses the compare function you gave it
21:07gfredericksit could also check =
21:07amalloygfredericks: it's required not to do that
21:07gfrederickswho required that?
21:07amalloythe Set interface
21:07dbaschmindbender1: all you need is for your component to know how to render your elements in order
21:07amalloyalso Comparator, which says it must impose a total ordering
21:07dbaschthey don’t need to be in an ordered structure necessarily
21:08dbaschof course it’s more efficient if it’s ordered
21:08amalloythere's no way for a total ordering to say "i don't care": it has to say less, greater, or equal
21:08amalloyand if they're equal, then duplicates must be rejected from the set
21:08gfredericks,(parents (class (sorted-set)))
21:08clojurebot#{clojure.lang.APersistentSet clojure.lang.Sorted clojure.lang.IObj clojure.lang.Reversible}
21:08amalloy,(supers (class (sorted-set)))
21:08clojurebot#{clojure.lang.APersistentSet java.lang.Runnable clojure.lang.IPersistentCollection clojure.lang.Sorted clojure.lang.IObj ...}
21:08amalloy&(supers (class (sorted-set)))
21:08lazybot⇒ #{java.util.concurrent.Callable java.util.Collection clojure.lang.IHashEq clojure.lang.IPersistentCollection java.lang.Runnable java.io.Serializable clojure.lang.Reversible clojure.lang.AFn clojure.lang.Seqable clojure.lang.IPersistentSet clojure.lang.IObj clojure.la... https://www.refheap.com/92724
21:09gfredericks,(reduce list (supers (class (sorted-set))))
21:09clojurebot((((((((((# java.util.Set) java.util.Collection) clojure.lang.Counted) clojure.lang.AFn) java.lang.Object) clojure.lang.IMeta) clojure.lang.Seqable) clojure.lang.Reversible) java.util.concurrent.Callable) java.lang.Iterable)
21:09gfredericksoh poop
21:09gfredericksalmost tricked it
21:09gfredericks,(some #{java.util.SortedSet} (supers (class (sorted-set))))
21:09clojurebotnil
21:10gfredericksdoes the Set interface say anything about orders or comparators?
21:10amalloygfredericks: i think i was wrong about that
21:10amalloy$javadoc Comparator
21:10lazybotJavadoc not found. Try http://docs.oracle.com/javase/6/docs/api/
21:10amalloy$javadoc java.lang.Comparator
21:10amalloyc'mon, man
21:11gfredericksokay I guess Comparator contract is a good enough reason
21:11dbaschgfredericks: no, Set is about no two things being equal
21:11dbaschthey don’t need to be comparable
21:11mindbender1dbasch: yeah. The insert use case was if a user wanted to drag a component from it's position to another position in it's container or another container entirely. but like amalloy pointed out one has to think critically where the real sense in that lies.
21:12gfredericks'It is generally the case, but not strictly required that (compare(x, y)==0) == (x.equals(y)). Generally speaking, any comparator that violates this condition should clearly indicate this fact. The recommended language is "Note: this comparator imposes orderings that are inconsistent with equals."'
21:12gfredericksamalloy: ^
21:12amalloyright, but 'If the ordering imposed by c on S is inconsistent with equals, the sorted set (or sorted map) will behave "strangely." In particular the sorted set (or sorted map) will violate the general contract for set (or map), which is defined in terms of equals.'
21:12amalloyso it's not an illegal comparator, but using it causes you to get an illegal set
21:13amalloyor at least one that will surprise you
21:13dbaschof course you could also have an illegal set by mutating things after inserting them
21:13gfredericksthat's strange for the Comparator docs to make claims about what sets do
21:14dbaschbut a set of mutable things is a really bad idea
21:14gfredericksit also claimed a set couldn't contain itself so now I have to try
21:14gfredericks,(let [s (java.util.HashSet.)] (.add s s) s)
21:14clojurebot#{#{#{#{#{#{#{#{#{#{#}}}}}}}}}}
21:14amalloyhah, did it really?
21:14gfredericks"A special case of this prohibition is that it is not permissible for a set to contain itself as an element. "
21:15TEttinger##(let [s (java.util.HashSet.)] (.add s s) s)
21:15lazybot⇒ #<HashSet [(this Collection)]>
21:15gfrederickshaha
21:15kenrestivoeverything is permissible
21:15nathan7gfredericks: damnit
21:15gfredericks&(let [s1 (java.util.HashSet.) s2 (java.util.HashSet.)] (.add s1 s2) (.add s2 s1) s1)
21:15lazybotjava.lang.StackOverflowError
21:16gfredericks,(let [s1 (java.util.HashSet.) s2 (java.util.HashSet.)] (.add s1 s2) (.add s2 s1) s1)
21:16clojurebot#{#{#{#{#{#{#{#{#{#{#}}}}}}}}}}
21:16gfredericks,(let [s1 (java.util.HashSet.) s2 (java.util.HashSet.)] (doto s1 (.add s2) (.add :foo)) (doto s2 (.add s1) (.add :bar)) s1)
21:16clojurebot#{#{:bar #{#{:bar #{#{:bar #{#{:bar #{#{:bar #} :foo}} :foo}} :foo}} :foo}} :foo}
21:17dbaschby “not permissible” they mean “please dont’ do it"
21:17dbaschdon't
21:18gfredericksoh no...what happens if they find out?
21:18dbaschOracle might sue you
21:20gfredericks,(into (sorted-set-by (fn [_ _] (- 100 (rand-int 200)))) (range 10))
21:20clojurebot#{3 8 9 6 7 ...}
21:20kenrestivoi would like oracle to go sue themselves.
21:21amalloyit will probably happen accidentally eventually, kenrestivo, if it hasn't already
21:22kenrestivo,(let [oracle-lawsuit (java.util.HashSet.)] (.add oracle-lawsuit oracle-lawsuit) oracle-lawsuit)
21:22clojurebot#{#{#{#{#{#{#{#{#{#{#}}}}}}}}}}
21:23dbaschin clojure we obey the laws of thermodynamics
21:24arrdemoh dear
21:25gfredericksI also looked suspiciously at it
21:25gfredericksI'm betting it's a weird HashSet feature
21:26arrdem"feature"
21:27amalloywell, having a .toString representation that takes up all available RAM is pretty crap for debuggers and so on
21:28amalloyparticularly in a language where there's no better way to look at things than .toString
21:28amalloyso it's nice that HashSet puts in a little effort to avoid that problem
21:28gfredericks(inc HashSet) ;; for effort
21:28lazybot⇒ 1
21:32gfredericksoh man cljs
21:32gfredericksI typo'd "%" as % and all I got was a warning
21:33nonubyis there something like -> that bails the first non truthy value it encounters like (or (-> (first args) (Integer/parseInt)) 8080)
21:33gfredericksI know that's consistent with everything else it does I just feel unusually let down
21:33gfredericksnonuby some->
21:33arrdemhttp://grimoire.arrdem.com/1.6.0/clojure.core/some-%3E
21:33gfredericksthough that's non-nil I think
21:33nonubysweet! thanks
21:40arrdem&(re-matches #"clojure\.((core)|(data)|(edn)|(inspector)|(java)|(main)|(pprint)|(repl)|(set)|(stacktrace)|(template)|(test)|(uuid)|(walk)|(xml)|(zip)).*" "clojure.core/concat")
21:40lazybot⇒ ["clojure.core/concat" "core" "core" nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil]
21:42arrdemjustin_smith: oneoff https://www.refheap.com/92725
21:42arrdemnot my best regex but it'll do
21:45lazylambda_folks, is it possible to print a bigint without having that N tagged at the end?. Anyway that doesn't require changing the value to a string first?
21:46TEttinger,(.toString 10N)
21:46justin_smitharrdem: cool
21:46clojurebot"10"
21:46TEttinger,(.toString 1000000000000000000000000000000N)
21:46clojurebot"1000000000000000000000000000000"
21:46arrdemjustin_smith: better version incomming..
21:46TEttingerhow's that, lazylambda_?
21:47arrdemjustin_smith: https://www.refheap.com/92727
21:48lazylambda_Tettinger: good enough, thanks
21:48lazylambda_,(str "1000000000000000000000000000000000000N")
21:48clojurebot"1000000000000000000000000000000000000N"
21:48lazylambda_hmm, I thought str calls toString
21:48arrdemjustin_smith: note that you need to add [org.clojure-gimoire/lib-grimoire "0.2.0"] to your deps for that
21:48Raynes$last
21:48lazybotRaynes is listening to: Kanye West - Stronger (Explicit) []
21:48Raynesjustin_smith: You're a special person.
21:48arrdemRaynes: 10/10 GUD SONG
21:48RaynesYou've spent days
21:48RaynesDAYS
21:48RaynesWorking on this bot.
21:49lazylambda_Raynes: go to bed, Grimey
21:49RaynesFor no good reason other than the goodness of your heart.
21:49RaynesMostafa!
21:49TEttingerlol
21:49lazylambda_:D
21:49RaynesWe meet again.
21:49TEttingerI have done the same, but for other reasons
21:49TEttingermostly people nagging me
21:49lazylambda_yes
21:50arrdemjustin_smith: can you throw that up in here or in -offtopic? I want to kick it for a minute
21:50TEttingerlazylambda_, it's not even 7:00 PM here in Raynes' and my timezone
21:50TEttinger-social was it?
21:51TEttingerarrdem: I've kicked it plenty in ##anyone
21:51arrdemTEttinger: there's -social which I no longer lurk, and there's -offtopic which is me, Bronsa, justin and ambrose
21:51justin_smithRaynes: aww, shucks
21:51arrdemfor the most part
21:52justin_smithRaynes: it was fun, and we all benefit
21:52lazylambda_TEttinger: I know, I was just being retarded
22:07arrdem@grim clojure.core/some->
22:12technomancywow. beanshell.org uses comic sans *with* a drop shadow.
22:14TEttingertechnomancy, that's incredible.
22:15technomancyTEttinger: it gets better http://beanshell.org/beany.html
22:16TEttingerheavily compressed gifs? http://beanshell.org/images/bshsplash3.gif the background repeats if your monitor is too wide? wow.
22:26justin_smiththat site has the most awesome design
23:12j0nii`I'm trying to figure out the correct way to call protocol
23:12j0nii`functions which are defined inline in defrecord forms
23:12justin_smithj0nii`: how are you calling them now?
23:13j0nii`It seems like (.func record) works but is wrong since it's an
23:13j0nii`implementation detail
23:13j0nii`well I was doing it like that, then just recently switched to
23:13j0nii`using the namespace qualified version
23:13j0nii`(ns/func record)
23:13justin_smith(proto-ns/proto-method record) should work, where proto-ns is the namespace where the protocol is defined
23:14j0nii`ah, that sounds good, because it preserves the polymorphic propertes
23:14j0nii`ies
23:14j0nii`I guess I've only been thinking of using the record namespace
23:14justin_smithright, that way, any implementation of the protocol is called identically
23:14j0nii`since the protocol and records are sharing a namespace right now
23:14justin_smithgot it
23:14j0nii`so I shoud fix that :)
23:15justin_smiththey can be in the same ns, that's fine
23:15justin_smithbut eventually some instances may not be
23:16j0nii`right - so is the defrecord implementation of the proto-fn not exported?
23:16j0nii`to clarify, if my record is in a separate ns, will
23:16j0nii`record-ns/proto-fn work?
23:16justin_smiththe proto-fn belongs to the proto
23:16justin_smiththe record gets a method
23:17j0nii`right
23:17j0nii`the method isn't exposed as a fn in the record namespace?
23:17justin_smiththe (.method record) form
23:17justin_smithnot as I recall, it shouldn't be
23:17j0nii`ok, that makes things a lot clearer, thanks
23:17justin_smithI'd have to make a few namespaces and check that I guess
23:18j0nii`well I can do that myself, and will - I don't mean to task you :)
23:19j0nithanks justin_smith for your help!
23:20justin_smithnp
23:21nonubyslightly OT, when search google for clojure docs on some-> and some->> it seems google strip the -> part, even when quoted, is there a way of googling these things?
23:21justin_smith$examples some->
23:21justin_smithhmm, oh, yeah, lazybot is too old for that function
23:22justin_smithhttp://grimoire.arrdem.com/ is kept up to date
23:22justin_smithhttp://grimoire.arrdem.com/1.6.0/clojure.core/some-%3E/
23:22nonubyjustin_smith thanks
23:23justin_smitharrdem did all the work :)
23:23arrdemjustin_smith: doing more work now :P
23:24nonubyarrdem, thanks, btw the offline version link is dead, are you aware?
23:24arrdemhttps://github.com/clojure-grimoire/grimoire/issues/131
23:24arrdemfeel free to comment if it's something you'd like
23:24arrdemGrimoire 0.3.9 can be cloned and run locally
23:25arrdemall versions of Grimoire can be run locally
23:25arrdem0.4.0 will go one better, but that's not done yet :P
23:25arrdemthe "static HTML snapshot" thing was slow to build and seldom used accoring to my logs so it's been dropped
23:25arrdemfeel free to comment on that issue if you want it tho
23:26nonubythanks, ill try running it locally first
23:30jcsimsany idea why environ might be failing to pick up either of the recommended var forms in an uberjar?
23:31jcsimsi.e either an env variable or a java system property
23:47bbloomhyPiRion: you should put dates on your blog posts :-)
23:52sm0keneed a little with a macro i am trying to write which given a integer returns a function with same arity
23:52sm0kei have come up with the following but it doesn not work for no constants
23:52sm0kehttps://www.refheap.com/92734
23:52sm0kelittle help*
23:55arrdemdear clojure.parallel go away nobody likes you
23:55arrdemjustin_smith: got it for real this time :D
23:56arrdemjustin_smith: lein grim can now document arbitrary artifacts off of the classpath
23:56justin_smithnice
23:57justin_smithsm0ke: I am not sure, I think this has to do with some interaction between the let macro and your own definition
23:58sm0kejustin_smith: actually if you expand it you will get num cannot be cast from symbol
23:58sm0kewhich makes sense
23:59sm0kebut i am not sure how to resolve it
23:59justin_smithsm0ke: that is because a is a symbol
23:59arrdemthehell...
23:59justin_smithand that happens because of the let macro, I think
23:59arrdemwhy is clojure.parallel not listed here
23:59arrdemhttp://clojure.github.io/clojure/
23:59arrdemtotally part of "stock" clojure