#clojure logs

2014-01-05

00:03john2xhello, how do I fix "Could not find artifact org.clojure:clojure.core.cache:jar:0.6.3 in central"? my network is fine and I'm not behind a proxy..
00:03john2xwhen doing lein deps
00:09john2xah it's a typo. my bad.
00:14TEttingerbvvd, heh thanks
00:31devn.toString vs str
00:31devnthe epic battle
00:31devn...for perf
00:34devngfredericks: hi
00:50devncolor me confused. why does https://github.com/dgrnbrg/spyscope show (take 20 (repeat (+ 1 2 3))) as blowing up in the examples?
00:50devn,(take 20 (repeat (+ 1 2 3)))
00:50clojurebot(6 6 6 6 6 ...)
01:00bellkevIs there an easy way to figure out how some stale artifact is on my class path?
01:01bellkevLike, a way to check where the class/src file is that some function/ns came from?
01:04technomancybellkev: check the metadata of a var; it'll have :file/:line entries
01:04anildigitalGuys feel free to contribute http://clojurebyexample.com/
01:05anildigitalI think great opportunity here..
01:05Kleptocracytechnomancy, you're back
01:05anildigitalhttps://github.com/anildigital/clojurebyexample
01:06anildigitaltechnomancy: Hi Sir.. if possible can you give me suggestions for this.. thanks :)
01:06bellkevtechnomancy: sweet, thanks
01:06TEttingerdevn, for spyp, the one that just prettyprints something, no checks for blowing up?
01:11technomancyanildigital: you've got ... a marginalia page or something? not sure what you're asking.
01:11anildigitaltechnomancy: I mean.. I am trying to setup something very similar to https://gobyexample.com/
01:11anildigitalI used marginalia for generating docs..
01:11anildigitalhope to fill up all types of examples soon
01:12anildigitalmarginalia is docs so .. it will look different .. like docs
01:12technomancyoh, ok; cool
01:12anildigitaltechnomancy: do contribute if you think you have something in mind.. I am open to it
01:13technomancysounds like a lot of work but could be a good resource
01:13anildigitalbasically I am clojure noob.. so won't be that good at examples first.. but will try my best to add good examples there
01:22anildigitalif someone here helps me to list down top name spaces that must be present in http://clojurebyexample.com/ .. that would be so good.. thanks already
01:32ddellacostaanildigital: a non-exhaustive list of places to review before starting out on a new documentation project: http://clojure.org/cheatsheet, http://clojuredocs.org, http://clojure-doc.org, http://www.clojureatlas.com, http://www.clojureatlas.com. I would urge you to see if you can contribute to one of those (clojure-doc.org seems like the best candidate) before starting a new documentation project. However, I don't want to dissuade yo
01:32ddellacostafrom trying something new--your project could be really great.
01:33anildigitalddellacosta: it's definitely not documentation... but example snippets .. where a new developer can refer to write the code
01:33anildigitalIt can have more specific examples
01:34ddellacostaanildigital: ...call it what you will, examples abound of the same exact sort of thing in some of the resources I linked to above.
01:34TEttingeranildigital, get everything you can off rosetta code's clojure section for just pure snippets.
01:34TEttingerclojure-docs has example snippets for most functions
01:36ddellacostaanildigital: all I'm saying is, if you are a Clojure newbie, and you want to provide something useful to the community, it's important to review what is already present and see how what you are providing could fit within that. What would be worse is creating yet another half-baked Clojure docs site that is infrequently updated and/or inconsistent. We have enough of those.
01:37anildigitalddellacosta: the thing is that... it's opensource and on github.. hope to get some other contributors and keep it up to date
01:37ddellacostaanildigital: my point stands.
01:37anildigitalddellacosta: I am writing this for my own use
01:37anildigitalddellacosta: if it is helping me.. it should help others..
01:37ddellacostaanildigital: great, then there you go--I've given you some examples to use. Good luck!
01:37anildigitalddellacosta: definiltely goal is not to be the best there.. but useful
01:47nopromptdnolen: *finally* got the chance to play with om. it is beyond legit. :-)
01:48dnolennoprompt: cool, you're jumping in at the right time :) quite a few issues ironed out - frankly surprised at how many people are using it and reporting bugs
01:49dnolennoprompt: been putting together a non-trivial generic sortable example and I'm kinda blown away how solid the React conceptual model is.
01:49dnolennoprompt: basically FP/OO the good parts
01:50nopromptdnolen: well, it's *really* nice. right now i'm rewriting an app i originally did with angularjs/coffeescript and i'm shocked. it's significantly shorter and much easier to refactor.
01:50dnolennoprompt: awesome! :)
01:52nopromptdnolen: it's not terribly complex but it might serve as an example.
01:53dnolennoprompt: you should post about it
01:53xnilnoprompt: that tends to be the case coming from any toolkit
01:53xnils/toolkit/alternative workflow/
01:53dnolennoprompt: I was worried for a while that people were discussing something so in flux, but I think I've settled on some ideas I don't think are going to change much in the near future.
01:56nopromptdnolen: that's one of the reasons i kinda avoided jumping in when you first started on it. but i'm still keeping an eye on it.
01:56xnilis clojure usable on android? i need performance, scalability, and stability
01:57dnolennoprompt: wise :) but the undo / app-state history stuff and this sortable thing is starting to convince me that Om approach can really work and really work well
01:57nopromptdnolen: the cursor work you've done is absolutely wonderful.
01:58TEttingerxnil: try a clojure repl for android, there's some in the google play store for free
01:58dnolennoprompt: heh yeah I was kinda skeptical about it
01:58dnolennoprompt: but I really don't see how the app state approach can work w/o it efficiently
01:58nopromptdnolen: everything is so clean. normally that's plumbing you end up having to do yourself.
01:59xnilTEttinger: i'm talking about for application development; i'd like to know if any significant apps have been developed for android using at least almost exclusively clojure
01:59dnolennoprompt: yeah early on the path stuff was explicit and I didn't like it
01:59dnolennoprompt: I kinda dig the specify stuff a bit too, so you can have cursors on primitive values
01:59dnolenkind of a corner case, but cool that it can be handled
02:00TEttingerxnil, I haven't tried, but the repls are very slow to eval clojure code... not sure if it's the runtime eval that's slow or clojure in general on android
02:00xnilalright
02:00nopromptdnolen: sablono is nice too. r0man has done a nice job with that.
02:00xnili'll do some benchmarking
02:01dnolennoprompt: yeah I like it! I hope Om inspires people to really run w/ a truly CLJS-centric approach to client side development
02:04nopromptdnolen: i finally started using source maps too. it's funny, i got so used to debuging the compiled javascript it's weird seeing cljs in the chrome dev tools.
02:05dnolennoprompt: oh man, I do not miss staring at the generated JS at all
02:05nopromptdnolen: i do miss the laser fast compile times though.
02:05dnolennoprompt: yeah source maps are a bit more expensive, but so far not lame
02:06ddellacostadnolen: related to OM, I have a simple question about the etymology of the term "cursor--" is that referencing the meaning of cursor as in DB cursor (http://en.wikipedia.org/wiki/Cursor_(databases))?
02:07dnolenddellacosta: yes, it's also kind of like a zipper too
02:07ddellacostadnolen: okay, gotcha, that's helpful.
02:07dnolenddellacosta: I honestly didn't have a good name, and I just needing something to point out that it's a bit special
02:07nopromptdefinitely feels like a zipper
02:09dnolennoprompt: as I've said several times already, I think the really cool stuff will happen when people start making instrumentation components for development
02:10dnolennoprompt: like hover over the UI and see the EDN data backs it up
02:10anildigitalTEttinger: thanks for rosetta code site
02:10dnolennoprompt: but the real gold will be VCR, so you can refresh much less, just revert app state re-evaluate via Austin or whatever, and keep going
02:14nopromptdnolen: yes, yes, yes. the record/playback stuff is one of the really neat features from pedestal i liked.
02:15dnolennoprompt: but note it's not really like pedestal at all, pedestal was delta oriented which is limiting.
02:15dnolennoprompt: in Om you can do real queries over the entire app history, compute delta, patch timeline, branch etc.
02:17nopromptdnolen: is that baked in or soon to come?
02:17dnolennoprompt: it's just implicit in the model
02:17dnolennoprompt: I'm planning on building an example library separate from Om that shows how it can be done
02:18nopromptdnolen: that's if you're saving the snapshots right?
02:18dnolennoprompt: yep
02:18dnolennoprompt: once people can see how to do it, they'll just do it, no need for a library at all
02:25arrdemso I know we have *ns* for getting a namespace from a macro, is there a way to get the outermost bound fn?
02:25arrdemor am I just hosed here.
02:26nopromptdnolen: the part about this whole style of development that i find interesting is that it seems to mock several "best practices". ie. single location for app state, full re-renders (although not really), on* attributes, etc.
02:26dnolennoprompt: yep
02:27dnolennoprompt: and less model controller boilerplate, data -> view -> done
02:27nopromptdnolen: it's very dwim (do what i mean).
02:28alewanyone use emacs helm?
02:28dnolennoprompt: I was somewhat concerned about component composition, but passing functions and core.async ... it works
02:29dnolennoprompt: also mad props to the React guys, the life cycle methods really make it easy to figure out where to put stuff
02:32nopromptdnolen: i still don't know 100% of the life cycle api but overall i really feel like they nailed it. the whole vdom concept; brilliant.
02:33nopromptdnolen: are any of them experimenting with om?
02:33dnolennoprompt: not that I know of, most of their users are JS users and we use React in a unorthodox way
02:34dnolennoprompt: the React devs are down with immutable data structures so I'm sure they'll push those since that gives them a lot more leverage / freedom
02:35dnolennoprompt: but I think Om can blaze a trail and show what's possible if you have efficient access to app state history
02:36dnolennoprompt: I think once people grok that, they won't want to go back to whatever they were doing before
02:36dnolennoprompt: it only takes a cursory look at existing Undo solution in JS to realize it's a joke
02:36dnolengranted it's a joke every where else too
02:39nopromptdnolen: completely cloning application state?
02:41dnolennoprompt: well no one does that. but the command pattern and recording inverses and all the madness.
02:41dnolennoprompt: but we can just clone the app state because it's not expensive for us.
02:42nopromptdnolen: oh yuck. heh, i completely forgot about that.
03:34wafflepilotis sandbar pretty commonly used to abstract sessions?
03:35wafflepilotit seems that it isn't a very active project
04:26alewhrm, did the behavior of indention change in clojure-mode? example: https://www.refheap.com/22489
04:40Clome_I have a record which has many propreties (defrecord Fo [a1...a10]). Is there an easy way to instantiate it with fewer arguments? Now if I want to instantiate it with 2 args I would have to do something like this (Fo 1 2 nil...nil) with 8 nils.
05:06t3soroIs it possible for a (dosync (future ...) (alter some-ref)) to have the future execute twice during a transaction intersection, or does the lang guard against that
05:09shock_oneEverything in dosync can be executed multiple times, that's why you mustn't put there anything with side-effects. But since future caches its results, its body will run only once.
05:12xificurCcan anybody help me why is this happening? https://www.refheap.com/22491
05:17shock_onexificurC: should be (osci [f v] ...
05:17shock_oneSorry '(f v)
05:18shock_oneNo, I misunderstood what it does.
05:19xificurCshock_one: its a 4clojure problem, its like iterate but should apply the provided functions in a cycle
05:19ryanfI think it's because in your recursive call you're doing (osci (f v) [array of fns]) instead of (osci (f v) fn1 fn2 etc)
05:19ryanfso you need to apply it or something
05:19ryanfor else make osci take a seq of functions to begin with
05:20xificurCryanf: I see it now, thanks!
05:28shock_oneI want to execute a couple of functions concurrently with delay. Right now the code looks roughly like this https://gist.github.com/anonymous/aaed7ff0b206c5fddcb7 . When I execute it from the REPL, it finishes right away (because I don't dereference futures), but when I run it inside the main- function of my project, all the futures execute, and the process continues running forever? Can somebody explain me what's going on?
05:31shock_oneHa, I just had to call (shutdown-agents). RTFM, stupid!
05:34shock_oneBut still, what's so special about -main that it changes behaviour?
05:38amalloyshock_one: nothing. -main returns immediately; it's just that the jvm doesn't shut down until all non-daemon threads are finished
05:38amalloythe fact that the jvm doesn't shut down surprises you when you run -main, but it doesn't surprise you at all from the repl
05:42shock_oneThank you. I tried to run this script with lein exec plugin, and it did shut down execution. Maybe it's just because lein-exec does some weird things.
05:47logic_progtbaldridge: you should do more youtube videos
05:47logic_progtbaldridge: it increases average IQ of clojure programmers
06:11anildigitallogic_prog: link pls
06:22logic_proganildigital: ?
06:22anildigitallogic_prog: I mean the videos you were talking
06:23logic_prog$9.99 please
06:23logic_proghttp://www.youtube.com/watch?v=R3PZMIwXN_g
06:23logic_progI will take bitcoin + litecoin + dogecoin
06:23logic_progmuch knowledge, so clojure
06:23logic_prog:-)
06:24logic_progis there a goog dutotirla on how nrepl middleware works?
06:24logic_progI need to understand how cljx middleware + nrepl middleware work together
06:27pepijndevosDo sorted maps allow getting the first/last item?
06:30pepijndevos(they are red-black trees, no?)
06:31eredpepijndevos: it should, sorted-map is just a subclass of map
06:31ered,(first (sorted-map :z 1, :b 2, :a 3))
06:31clojurebot[:a 3]
06:31ered,(last (sorted-map :z 1, :b 2, :a 3))
06:31clojurebot[:z 1]
06:31ered,(sorted-map :z 1, :b 2, :a 3)
06:31clojurebot{:a 3, :b 2, :z 1}
06:31amalloyered: last is very expensive, though
06:32amalloyyou want (first (rseq some-sorted-map))
06:32pepijndevosered, ok, let me restate that, can it e *efficiently* do that. first and last cast to a seq
06:32pepijndevosamalloy, ah, smart
06:32amalloypepijndevos: first is fast, of course
06:32pepijndevosyea, and rseq ins O(n) right
06:32pepijndevoserm 1
06:33pepijndevosso that'd be O(2) :P
06:34pepijndevosis rseq lazy? Must be...
06:35pepijndevoscool. exactly what I want
06:37amalloyit's as lazy as seq: it just allocates an ISeq object with a different iteration order (unless the map is empty, of course, in which case it returns nil)
06:38alewdoes rseq only work for vector and sorted-map?
06:38Glenjaminwhy isn't last implemented as (comp first rseq) for seqs in that case?
06:40amalloyit works for anything that implements Reversible
06:41amalloyin the clojure language core, the only such things i know of are vector, sorted map, sorted set
06:41amalloybut of course you can implement Reversible yourself, so it can't "only" work for any list of things
06:51mischanixIs there a fn form of and?
06:52pepijndevos#(and %1 %2)?
06:52mischanix,(apply and '(true false true))
06:52clojurebot#<CompilerException java.lang.RuntimeException: Can't take value of a macro: #'clojure.core/and, compiling:(NO_SOURCE_PATH:0:0)>
06:53amalloy&(doc every?)
06:53lazybot⇒ "([pred coll]); Returns true if (pred x) is logical true for every x in coll, else false."
06:53pepijndevos&(reduce #(and %1 %2) '(true false true))
06:53lazybot⇒ false
06:54pepijndevos$findfn {:a 1 :b 2} :a [:a 1]
06:54amalloy:(((( pepijndevos
06:54lazybot[clojure.core/find]
06:54amalloyreduce and is really bad. that's what every? is for
06:54mischanixYeah, every? works nice. Thanks
06:54pepijndevosTrue
06:55pepijndevosI keep forgeting about every? and some and what they do.
06:55mischanixHeaps of idioms to remember, yeah
06:59Glenjaminwould you do (every? true? x) or (every? identity x) ?
07:00mischanixI was mapping to to get the booleans, so I managed to just do (every? #(% c) ...
07:00pepijndevosGlenjamin, depends if the seq is pure booleans or other stuff.
07:01pepijndevosamalloy, other thn that it looks a lot nicer, what makes reducing with and slower?
07:01pepijndevosohwait, you said bad, not slow
07:02amalloy&(reduce #(and %1 %2) (repeat false))
07:02lazybotExecution Timed Out!
07:02amalloy&(every? identity (repeat false))
07:02lazybot⇒ false
07:02pyrtsareduce is greedy unless you use reduced to return the short-circuited result.
07:02amalloyit's much slower too, in cases like that, har har
07:02mischanixslight difference between much and infinitely
07:03pyrtsa(def all? (partial every? identity)) is a good idea IMO.
07:03pyrtsa(In case it's needed often.)
07:04pyrtsa(def any (partial some identity)) likewise.
07:05mischanixI feel like I'm going to end up rewriting everything multiple times as I learn nicer ways to do stuff
07:08Glenjaminthe biggest annoyance i have left from when i learnt clojure while writing this app
07:08Glenjaminis that my namespaces are holding state
07:08Glenjaminnot much state, but enough to be annoying
07:08pyrtsaI agree.
07:09Glenjaminhttps://github.com/stuartsierra/component/ seems like a good approach to having a module-like construct that sits alongside namespaces
07:10Glenjaminbut i'm procrastinating refactoring over to it
07:11sverihi, has anyone here experience with pedestal and caribou, what would you prefer for future web development?
07:11pyrtsaI dislike the fact in component/Lifecycle that there ends up being separate construction and start steps. A much simpler model would be one where there's just a reset step that disposes of all resources.
07:11pyrtsaGlenjamin: ^
07:12pepijndevosWhat would be a nice way to get a sane default from (key (first ()))
07:12Glenjaminpyrtsa: would that mean you could only have one "instance" ?
07:13pyrtsaGlenjamin: That would be the base case, yes. Then you could have an extension of the base case where you can register a stack full of nested resources that get reset recursively (and in reverse order).
07:13Glenjaminpyrtsa: i think it's useful to be able to have multiple instances around
07:13Glenjaminfor example, my testsuite runs with "production" settings, but my dev server doesn't
07:14pyrtsaOh, sorry, nothing like a singleton.
07:14Glenjaminat the moment i need two JVMs
07:14Glenjaminoh, so you'd have (def system (create-system)) and (reset-system system) ?
07:14pyrtsaSo yeah, you could have several instances. And you could nest them. I'm just saying that the current protocol interface of Lifecycle is not well thought. It gets too complicated.
07:15pyrtsaGlenjamin: Yes. And create-system would both initialize and start.
07:15Glenjaminmy assumption was the separation of init from start was something to do with circular dependencies
07:16Glenjaminbut i'll have to see how it feels when i try it
07:16pyrtsaBecause what good is a system in a not-yet-started state? You could as well just introspect your arguments to create-system.
07:16pyrtsaCircular dependencies: bad idea. :)
07:19Glenjamini suppose this approach lets you build a default system, then replace bits, then "start" it
07:19pyrtsaYou could as well have a set of default arguments that you can replace bits of, before calling create-system.
07:20Glenjaminyeah, you're making a lot of sense
07:20pyrtsaWith the two-step initialization of the system, you just end up having logic that belongs together in two separate places (two differnt functions anyway).
07:23pepijndevosSomehow underscores have become invisible in vim when typing clojure...
08:04freetonikHey, guys! I'm a JS developer and I was digging into Clojure for the past month. I think I'm in love and I want to start my next project with Clojure. The project is an educational platform for programmers (courses, tests, interactive tutorials, homework, etc). The problem is: my colleagues don't really share my new passion and prefer to stick with PHP and
08:04freetonikPython. The only switch they are willing to make is one to Scala. Could you recommend something to convince them?
08:06justin_smithfreetonik: well, both scala and clojure would be big changes from php/python, but some of the reasons are different
08:06klokbaskefreetonik: what are their reasons to want Scala?
08:07freetonikScala: bigger community, wider acceptance and use in production, less painful switch from traditional OOP
08:08justin_smithprobably the best arguments clojure has for it (compared to scala) is being concise and mostly staying uncomplicated
08:08justin_smiththe hard part to sell with clojure is the syntax, but the syntax is actually extremely simple, just unfamilair (as you probably know by now)
08:09freetoniksyntax is not really the issue for them, it's the warm feeling of "more big companies are using it" what matters for many people
08:12justin_smithwell, more big companies won't use it until more big companies use it
08:12kzarfreetonik: I would expect getting a whole company to switch to Clojure when they're against the idea would be harder than getting a new job
08:12mrhankyhow can i change the working dir if using "lein run" where the main method does a (load-file "resources/foo/bar.clj")? i want the working dir to be "resources/foo"
08:12mrhankyis this possible?
08:13freetonikkzar: haha :) unfortunately, I'm not in a position to do that, but I'll write this down for the future
08:13justin_smithmrhanky: java sucks regarding environment variables, working directory happens to be an environment variable
08:13mrhankyi already read that there's no simple "change dir" command :/
08:13justin_smithI guess because there is no portable way to do setenv, the jvm does not provide setenv, kind of sucks
08:13justin_smithas far as the OS is concerned, the "working dir" is just an env dir your process has
08:14justin_smithsee above regarding non-portability of setenv
08:14justin_smithif you know you will always be on posix, there are hacks that work on posix
08:15mrhankyno, should be plattform independ. i though about just symlinking my two files to the project dir where i run lein, but i dont know if symlinks will work on a non-posix system if pushing everything to git
08:16justin_smithmrhanky: are you familiar with clojure.java.io/resource?
08:16justin_smithyou could ensure that the files are in classpath under a unique directory name
08:16justin_smithand set :resource-paths in project.clj to include the parent dir
08:17justin_smiths/and set/by setting
08:17mrhankyno, i'm a bloody clojure-beginner with some java knowledge
08:17justin_smith:resource-paths is a key in project.clj which adds non-source / non-java directories to the classpath at runtime
08:17clojurebotAlles klar
08:18mrhankysounds like this could solve my problem
08:18justin_smithI wonder if :resource-paths can use absolute file paths, if so that would be sufficient for you I think
08:18justin_smiththe trick is, after that you use clojure.java.io/resource to resolve the location
08:19justin_smithif it will always be a true file path, you can do (io/file (io/resource "name"))
08:46jtoyare there any libs for building restful api libraries on existing web apis
08:46jtoylike faraday in ruby
08:58shriphaniHi, I have an expression: (reduce (fn [acc [x y]]) (merge-with concat ......)) which leads to a stackoverflow. Is there anything quick I can do (short of a refactor) to fix this ?
09:10ambrosebsshriphani: is the merge-with inside the reducing function?
09:10shriphaniambrosebs, yes.
09:11shriphaniambrosebs, is a group-by better than the merge-with ?
09:12ambrosebsshriphani: not sure. What's causing the stackoverflow?
09:14shriphaniambrosebs, the stack trace: https://www.refheap.com/22495
09:14shriphaniand I have exactly 1 call to concat in my function
09:15shriphaniso my hypothesis is that there is a large chain of concats
09:16ambrosebsshriphani: all I can think of is trying an eager concat
09:16ambrosebs,((comp doall concat) [1 2] [2 3])
09:16clojurebot(1 2 2 3)
09:17shriphaniambrosebs, let me try that out.
09:17ambrosebsif there are lots of dups in the maps, that might be the issue
09:18shriphaniambrosebs, I convert a large vector of [[k1 v1], [k2 v2], [k1 v3]] format to a map
09:18shriphaniand in this case yes, there are a lot of dups.
09:19shriphaniambrosebs, nah stackoverflow still
09:20shriphaniI increased the stack size to 1g.
09:20ambrosebsshriphani: can you see the bottom of the stacktrace?
09:20shriphaniis there a way to make clojure.stacktrace print that ?
09:20ambrosebs(pst e 100000)
09:20ambrosebs*e rather
09:20ambrosebssorry, (clojure.repl/pst *e 1000000)
09:21ambrosebsnot sure about clojure.stacktrace
09:21shriphaniambrosebs, its concats all the way through
09:22shriphaniand my own ns doesn't appear at all
09:23ambrosebsshriphani: ok that's common IME
09:23shriphaniambrosebs, it looks like that stacktrace I sent you repeated over and over again
09:25shriphaniI guess I can prune the list a bit, after 100 concats, refuse to accept more.
09:26shriphaniambrosebs, do you have a better solution ?
09:26ambrosebsshriphani: not sure if using a set would help
09:27shriphanihmm, I changed the merge-with concat to a merge-with union
09:27shriphaniand it still shows a call to concat in the stacktrace
09:28ambrosebsshriphani: right, seems like the problem is elsewhere?
09:28shriphanihmm, I don't see another call to concat
09:29shriphanilet me paste my function
09:29ambrosebsshriphani: thanks
09:29shriphaniambrosebs: https://www.refheap.com/22496
09:30ambrosebsshriphani: try sticking a doall around your lazy sequence processing functions
09:30ambrosebslike filter and map
09:31ambrosebsperhaps there's too many nested lazily
09:32shriphaniStackOverflowError clojure.core/concat/fn--3923
09:32shriphaniis it in one of the libraries ?
09:33ambrosebshave you tried sprinkling prn's to narrow the source down?
09:34shriphanino not yet.
09:38Glenjaminhave you tried a smaller input?
09:38Glenjaminif you can find the breaking point it may shed some light on the problem
09:38shriphaniGlenjamin, it works fine with smaller input
09:40Glenjaminmaybe try replacing the merge-with with a manual loop..recur?
09:40shriphaniok I found the bug
09:40shriphaniI was performing a cross product using a (reduce concat (map ....))
09:40shriphaniinstead of a (for [x l1 y l2] [x y])
09:42shriphaniambrosebs, thanks for the help
09:44ambrosebsshriphani: np
09:44shriphaniambrosebs, is there any way to find my ns in those stacktraces ?
09:45ambrosebsshriphani: I think java loses the bottom of some SOE's
09:45shriphaniah.
09:45ambrosebsshriphani: I think your message being "null" didn't look like a good sign
09:46ambrosebsshriphani: just from experience, I don't really know what's going on underneath
09:54kzarHaving a go at this puzzle http://www.4clojure.com/problem/85 . I have some code that works but it's too slow to pass the last test. Any ideas? https://gist.github.com/kzar/4be355c7f3b026cd22d5
10:04rovarit can't run on a set of 4 items in 2 seconds?
10:05rovaror 8 items
10:05rovarerr the 10 item one below it..
10:05kzar,(count (range 10))
10:05clojurebot10
10:06kzarI get why it's inefficient I just can't see how else to implement it
10:08rovarkzar: you're recursively building a set
10:08rovarwhich is a log time operation at best
10:08rovarhow about recursively build a list of elements, which is a constant time operation, then call set on it.
10:09rovarso basically have (defn power-set [inval] (set (loop [acc] ... (recur updatedacc)))
10:09rovarso the inner loop builds the list
10:11rovarbtw I mean conj-ing onto a list is a constant time op, the actual building of the list is not :)
10:14kzarrovar: I don't follow
10:15llasramrovar: `conj`ing to a hash-set is also constant-time
10:17noonianit's more expensive to add to a set because the set needs to maintain the property that each element is unique
10:18rovarI assumed the hash-set was a tree
10:19llasramrovar: that would be a TreeSet :-) which you can create via `sorted-set` in Clojure
10:19rovarah
10:19rovarthanks for the clarification
10:33shock_oneIn Haskell I can pattern match on function parameters in a definition. But it looks like in Clojure it's only possible to match on arity. Can I do something like (defn foo ([nil] []) ([param] "result")) ?
10:35joegalloi think https://github.com/clojure/core.match offers something like that, but it wouldn't be at the top-level function definition
10:35TEttingershock_one, I think multimethods can do that
10:35joegalloyou'd have (defn foo [x] (match [x] [nil] [] [_} result))) or something like that
10:36joegallooh yeah, a very good point.
10:36joegallomultimethods.
10:36TEttinger,(binding [*print-dup* true] (print-str (double-array [0.0 1.1 2.2])))
10:36clojurebot#<IllegalArgumentException java.lang.IllegalArgumentException: No method in multimethod 'print-dup' for dispatch value: class [D>
10:36TEttinger,(defmethod print-dup (Class/forName "[D") [a out] (.write ^java.io.FileWriter out (str "#=" `(double-array ~(vec a)))))
10:36clojurebot#<MultiFn clojure.lang.MultiFn@1ceaced>
10:36TEttinger,(binding [*print-dup* true] (print-str (double-array [0.0 1.1 2.2])))
10:36clojurebot"#=(clojure.core/double-array [0.0 1.1 2.2])"
10:36TEttingerthat's a multimethod for double arrays
10:37TEttinger,(defmethod print-dup (Class/forName "[C") [a out] (.write ^java.io.FileWriter out (str "#=" `(char-array ~(vec a)))))
10:37clojurebot#<MultiFn clojure.lang.MultiFn@1ceaced>
10:37TEttinger,(binding [*print-dup* true] (print-str (double-array [\a \b \2])))
10:37clojurebot#<ClassCastException java.lang.ClassCastException: java.lang.Character cannot be cast to java.lang.Number>
10:37TEttinger,(binding [*print-dup* true] (print-str (char-array [\a \b \2])))
10:37clojurebot"#=(clojure.core/char-array [\\a \\b \\2])"
10:44shock_oneTEttinger: here's what I've got with multimethod and without. I think it's a little bit overkill https://gist.github.com/anonymous/69b1079de64750b4f0b5
10:46joegalloyeah, i'd go with the former...
10:46joegalloif you can tolerate nil ~= empty collection punning you could single branch the if.
10:49shock_oneThank you, but it should definitely be an empty collection.
10:52sverihi, has anyone here experience with pedestal and caribou, what would you prefer for future web development?
10:52shock_oneHow much time do you program in Clojure? I started learning it like a week ago. I know a great deal of popular languages, and I absolutely in love with Clojure.
10:53shock_onesveri: compare the amount of stars on github.
10:55sverishock_one: funny idea, i guess that one goes to pedestal
10:55jumblergsveri: i'd suggest taking a look http://hoplon.io/.
10:56kzarsweet I figured it out https://gist.github.com/kzar/4be355c7f3b026cd22d5
10:57sverijumblerg: why would you suggest hoplon instead of pedestal/caribou?
10:59jumblergsveri: i can't speak to caribou. but i started with pedestal and found that it was designed to solve problems that were different from mine before transitioning to holpon, which was just released a couple weeks ago.
11:00shock_onesveri: what is web development? I guess there is no silver bullet, and the choice depends on what you need.
11:01sverijumblerg: i see that, it makes sense, however, pedestal ist just a new way to go and as a developer for years i find it hard to adapt myself to that style and i wonder if i can easily integrate existing libraries into frameworks like pedestal
11:02sverione thing i dont like to care about is authentication, for instance, for clojure there is the friend library and it would be nice if a framewok would support the integration of it
11:04jumblergsveri: pedestal's current design (it is going through a major rewrite now) was designed to solve scalability problems by using an abstraction known as an interceptor on the server that allows threads to be released while an http requests is parked and thereby allow the server to handle more requests. this complexity comes at a cost, however, for a problem you're unlikely to have as someone getting started.
11:06jumblergsveri: the app/browser part of the framework hasn't been finished yet and isn't ready for prime-time.
11:10jumblergsveri: re authentication, friend doesn't play nicely with the interceptors on the server (been there). but if you do go the pedestal route, there's https://github.com/propan/geheimtur.
11:14jumblergsveri: but this library also seems to have difficulty with service interceptors. all functions are all called on the :enter stage and it doesn't implement any of the others such as :leave on the way out, which caused problems i had to refactor around.
11:16jumblergsveri: you might want to try talking to the guys on #hoplon; they're pretty helpful.
11:25jumblergsveri: just noticed your previous comment - on a starbucks network with the usual connectivity issues. are your existing libs written in java, clojure?
11:37sverijumblerg: i am not to sure which libs i might use, normally on the java route its just easy to use some java libs in a traditional web application and i cannot see if its similar in pedestal or not, i just dont really get a grasp on it, part of the problem might be that i am new to clojure at all :D
11:39jumblergsveri: unless your existing libs have specific http dependencies, i can't imagine that your choice of a web development framework will make any difference.
11:40sverijumblerg: so basically one could say that on the backend i might still use whatever i want
11:41jumblergsveri: clojure's java interop should allow you to use all of them.
11:41sverijumblerg: :-) thanks for that geheimtür hint
11:43jumblergsveri: with respect to your java lib interop requirement, yes
11:43sverijumblerg: a friend of mine wants to use pedestal, he likes the way pedestal builds everything around messages, which is nice, but i just cannot get warm with it
11:44jumblergsveri: np! just be aware that, while i think geheimtür is on the right track, i believe it incorrectly implements the service interceptor interface as well.
11:45sverijumblerg: hm, thats another point, it all seems to be so unmature compared to everything that is build around ring
11:46jumblergsveri: it solves different problems with the service and doesn't have a full solution on the client yet.
11:48sverijumblerg: what do you mean with "doesn't have a full solution on the client yet."?
11:53jumblergsveri: last time i checked (a couple months ago) they were working on the clojurescript app model but didn't have the idioms worked out yet for the redering layer, and were relying on third-party libs to fill the gap.
11:53sverijumblerg: ok, thank you very much
11:55jumblergsveri: np! i did find the pedestal team to be quite helpful, so if you have specific questions, i'd suggest directing them there in the google group; i know there are some significant changes underway, and my experience is a bit dated.
11:56sverijumblerg: yea, they are, like every clojurian i met so far
12:02jumblergsveri: i'd recommend taking a serious look at hoplon. it relies on ring for most of the service stuff, but abstracts the http protocol away so you can just call clojure functions across the network. it also puts a layer over the dom to give you a solid client-side development platform.
12:02sverijumblerg: did you do some authentication with hoplon already?
12:05jumblergsveri: yes. using the approach used in the demo apps. it doesn't handle things like oath yet for you, but think you'll find the primitives it does provide more manageable to build on.
12:06sverijumblerg: i see, do you know if they build this themself or if they use something already existent?
12:07jumblergsveri: i'd direct any questions you have about it to octagon in the #hoplon channel, i think he's there now.
12:08sverijumblerg: thank you again very much, i will do it then in a few minutes :-)+
12:08jumblergsveri: i can tell you my company is using it quite successfully, without the ability to go into too much detail.
12:09sverijumblerg: who do you work for? my company has built a pretty large stack of java solutions and i do clojure only for my private projects so far
12:11rovaris there a function to remove the nth item of a seq?
12:12jumblergsveri: a startup.
12:14bbloomrovar: no, intentionally
12:15bbloomrovar: you can make one with concat, take, & drop, but it's something you can only do O(N), so it's not in core to guide you away from that
12:16bbloomrovar: usually there is a better way, but it's totally OK to do the O(N) thing if you've got a short seq (less than 30ish items, probably)
12:19rovarbbloom: I'm working on the power-set problem, I'm trying to figure the most data-structure efficient way to create the permutations..
12:19rovaror the subsets, and the permutations of subsets
12:20rovarI guess if I split the set up into singles, I could recombine them in constant time ops
12:21rovaris conj ing a vector a constant time operation?
12:21rovaror better than O(n) ?
12:21shock_oneYes. Almost.
12:22bbloomrovar: conjing on to anything is an "effectively constant time" operation
12:23bbloomrovar: it's actually constant time on to persistent lists & it's basically log30(N) or log32(N) for vectors, maps, etc
12:23rovarso I could conj two subvecs and get the result I'm after..
12:23shock_oneHow do you plan to permute sets it they're unordered?
12:23rovarI plan to do everything in vectors and then convert back to sets
12:23bbloomrovar: conj adds an item, if you conj a sub vec on to a vec you'll get [something like [this]]
12:24rovarright..
12:24rovarand concat is linear..
12:24rovarfor vectors?
12:25shock_oneI would just write a permutation function by myself. Like a one that takes an array and returns an array of arrays.
12:26rovarthe permutation part is the easy, it is quickly creating all of the subsets that is proving difficult..
12:27pyrtsarovar: concat is fast, but AFAIK it returns a lazy seq that isn't random-accessible anymore. (into vec1 vec2) is O("(count vec2)").
12:27jowagrovar: concat is constant time
12:30hyPiRionconcat is not constant time, it's linear in the length of the second collection. It is, however, lazy
12:30shock_onerovar: if you have a function that creates permutations, you just have to concatenate all the permutations for k Є {1 ... n-1}.
12:30pyrtsahyPiRion: Is it? If you don't traverse the result?
12:31rovarbecause it's lazy, you're both right..
12:32hyPiRionpyrtsa: Then the concat function hasn't finished, but sure
12:32rovarshock_one: I looked at the combinatorics/combinations implementation, I'd really not like to replicate that if I can avoid it.
12:33bkolobaraHi. I'm trying to learn clojure by building a toy project. I'm a bit stuck now and hoped to find help here. I would like to connect from a clojurescript application running in browser to a nREPL instance. When I run lein repl I can see the port that the nREPL is running on. But I can't find information what protocol is nREPL using to talk over this port. Or maybe there is already an existing ClojureScript library that can be used for
12:33rovarbkolobara: check out frodo
12:34rovarit is a wrapper around a project called austin which does what you want
12:34rovarjust makes it easier, IMO
12:39freetonikGuys, is a lot of nested maps a bad sign? I'm trying to describe a large entity and end up having 5-9 levels of nested maps...
12:39freetonikassoc'ing them becomes pain in the ass too
12:40rovarfreetonik: sometimes it's necessary, most clojure apps seem to have a single map of maps for their main data set.
12:40rovaralso, assoc-in and get-in are your friend
12:41freetonikso, I shouldn't really worry about performance in my case?
12:41pyrtsaMeasure first, then worry.
12:41freetonikyeah, assoc-in and get-in help a lot
12:41freetonikokay, thanks a lot!
12:42pyrtsaAlso, update-in.
12:42llasram5-9 levels of distinct semantic entities, where your code is actually needs to reach in 5-9 level deep? That sounds like a design issue in any language
12:42hyPiRionPerformance shouldn't be a consideration unless you notice the app is slow. Obviously don't overdo the "premature optimisation is bad" thing, but if it's not slow, don't worry too much
12:43hyPiRionI see 5-9 levels rather deep, as llasram pointed out. But I don't really know your use case, so heh
12:44freetonikllasram: yeah, I think I need to reconsider the design of that part of the app..
12:45freetonikclojure community seems to be very nice even with stupid questions like mine ;-)
12:55justin_smithsveri: if still have any questions about caribou I am one of the caribou devs, and also I hang out on #caribou
12:55justin_smith*if you still
13:10kzar,(Integer/toString 100 100)
13:10clojurebot"100"
13:10kzarShouldn't that return "10"? ^^
13:11kzar,(map #(Integer/toString % %) (range 100))
13:11clojurebot("0" "1" "10" "10" "10" ...)
13:14llasramFrom the javadoc: "If the radix is smaller than Character.MIN_RADIX or larger than Character.MAX_RADIX, then the radix 10 is used instead. "
13:14llasramSo surprising, but documented
13:14radix:(
13:14llasramheh
13:15llasramJust state in range, radix, and everything will be fine
13:15llasrams,state,stay,
13:15kzarPuzzle I'm doing required I handle things out the rang
13:15kzare
13:17kzarllasram: How do I eval Character.MIN_RADIX at the repl?
13:18llasram,Character/MIN_RADIX
13:18clojurebot2
13:18kzar,Character/MAX_RADIX
13:18clojurebot36
13:18kzarty
13:19kzarboo back to work tomorrow, I've been enjoying messing with some Clojure again
13:20llasramJust use Clojure at your work. Problem solved!
13:22kzarllasram: Well aim is to get somewhat productive this year, that being the ultimate aim
13:22kzargoal*
13:26llasramI see... Well, nothing gets you productive faster than working with something on a regular basis :-)
13:33seangroveI'm seeing a huge delay serving static files when developing locally with ring, about ~1s delay between each file being requested and served (sequentially). Developing cljs with {:optimizations :none} this way makes it pretty painful, since it includes dozens of files (one for each dep).
13:43mrhankydoes clojurescript have (char?) ?
13:53yeoj___I'm trying to learn enlive through the tutorials.... can anyone tell me what :> does inside a vector? I can't seem to find it on the cheat sheet...
13:54marcopolo`yeoj___: It's like the css selector
13:55marcopolo`i.e. "div > #foo"
13:56fredyrmrhanky: nope i don't it exists
13:57fredyrmrhanky: chars don't really exist in clojurescript at all
13:57yeoj___marcopolo`: ok, ok so : says "symbol" and then > is the actual name bit to the symbol?
13:58marcopolo`:> is a keyword, and the > part refers to it's equivalent css selector
13:59yeoj___maybe i have to read up on what a CSS selector actually is... this whole space in new to me.
13:59yeoj___last website i built was perl cgi 15 years ago.
14:01kzarWith defn you can specify a function that takes different optional arguments, can you do the same with fn or letfn?
14:05kzarI want to do something like (defn example ([i] (example i "")) ([i s] ...)) but with letfn or let and fn.
14:06gfredericks,(letfn [(example ([i] (example i "")) ([i s] {:i i :s s}))] (example 12))
14:06clojurebot{:i 12, :s ""}
14:06kzaroh cool
14:06fredyrbtw there isn't a clojurescript bot is there? or a way to eval cljs
14:07fredyr(like a cljs mode for clojurebot)
14:07rhg135fredyr, challange accepted
14:07fredyr:D
14:08rhg135but first i need some help with this
14:08rhg135https://bitbucket.org/rhg135/jimjure/src/c96e5858eef45e424ca1afc07797a6349234f4f0/src/jimjure/json.clj?at=dev#cl-21
14:09rhg135i need a way to make that seq not end on the first bad json
14:09rhg135it hangs up the server
14:09rhg135well that connection
14:10rhg135as in it drops the client if you send bad json
14:10rhg135should be easy, but i don't see it
14:13seangrovefredyr: They're cljs-fiddle
14:13seangroveCould probably be made into a bot
14:14fredyrseangrove: right
14:15gfredericksthere is over a foot of snow here and the high tomorrow is -12F
14:15gfredericks...and it's snowing
14:30rovarbwahaha
14:30rovarI have my partition based superset generator working. And it is slow as balls
14:31rovaractually, I could make the partition logic much more efficient, right now it is a cartesian set of the count..
14:39technomancyI think the spammers are on to me
14:40gfrederickswat oh no
14:40technomancygfredericks: only two @ClojureMarkov RTs in the past three days!
14:40technomancyor maybe they're on vacation
14:41gfrederickswhaht is this tooter
14:41technomancyhttps://mobile.twitter.com/ClojureMarkov
14:41gfredericksI'm immediately disappointed with humanity
14:42technomancyit's so weird; there are no links
14:42pjstadigtechnomancy: you need to just stop using your saved search for "clojure"
14:42technomancyjust some base64-encoded junk like pCZCXe at the end of each
14:42gfrederickswhat percentage of tweets are human-composed?
14:42technomancypjstadig: nevar
14:42gfrederickstechnomancy: probably somebody tunnelling messages over toots, eh?
14:43technomancygfredericks: before christmas there were like 5 or so of these a day
14:43technomancysometimes they get truncated so the bytes aren't even in the tweet https://mobile.twitter.com/NatalieGimson/status/418548865134886912?p=v
14:43technomancywhich I guess is just sloppy?
14:43gfredericksnot a very subtle kind of stegaography
14:44technomancyright now I'm just collecting them
14:44technomancyonce I have a big corpus maybe we'll do analysis for a seajure hack night or osmething
14:44pjstadigwhat are they even getting out of these things? is there like a link in the twitter profile?
14:45rovarGratuity in preference to triumphal clojure twist growth: MzCKZd
14:45rovarfull of wisdom
14:45andyfBronsa: Would I be interfering with your work on Eastwood if I committed changes for linting namespaces in dependency order?
14:45technomancypjstadig: no links! that's the mystery
14:45technomancywell
14:45technomancyoccasional links
14:45TEttingerI think the base64 at the end is a t.co link
14:46TEttingerthat they stripped out to avoid spreading spam
14:46technomancyTEttinger: oh that would make more sense
14:46TEttinger$title http://t.co/MzCKZd
14:46lazybotPage has no title.
14:46Bronsaandyf: not at all, I haven't done anything yet for a lack of time, feel free to commit what you've done :)
14:47technomancyTEttinger: hm, or maybe not
14:47pjstadigTEttinger: yeah i tried one an the link doesn't exist
14:47pjstadigmaybe it *is* some kind of message transmission
14:47andyfBronsa: Good. I'll assign the ticket to me. Should be ready to commit something later today.
14:47TEttingerhttps://twitter.com/BobbyPorter6
14:47TEttingeryeah
14:47TEttingerlooks like it
14:48Bronsaandyf: cool, thanks
14:48TimMc"Gravid bridal buff tips"
14:48TimMcThat's some gooood markov right there.
14:48pjstadigsome kind of one-time pad made out of a corpus of words, and the hex at the end is a checksum
14:48andyfBronsa: I have at least one definite example of a project where linting in the current semi-arbitrary order causes exceptions during analysis, but doing it in dependency order makes those go away.
14:49gfredericksoh time to google "two-time pad" to see what happens
14:49pjstadign-time pad
14:50gfredericksthe 0-time pad is so secure it causes other things to be secure
14:51TimMc0-time pad: The only way to be sure.
14:51gfrederickse.g., "We used a 0-time pad and HTTPS" is a common use case.
14:52andyfThree people can keep a secret, if two of the are dead. -- Benjamin Franklin
14:52pjstadigtechnomancy: you've stumbled into some international spy ring, time to drop off grid and disappear
14:53pjstadiggfredericks: 0-time pad reminds me of http://www.supersimplestorageservice.com/
14:54gfrederickspjstadig: nice
15:00gfredericks10,000 GET requests to an abacus results in eye strain
15:00alewanyone use clojure-mode in emacs? I'm getting new indentation behavior after an update. Looks like this: https://www.refheap.com/22489/edit
15:01mheldanybody here use cursiveclojure?
15:01pjstadigalew: i heard another recent complaint about that, and I think it has to do with https://github.com/clojure-emacs/clojure-mode/commit/492455c3737fe66993c34df2143d6a8ccce4e74b
15:02technomancythe weird thing is they used to consistently get the genders of the avatars to mismatch the fake names
15:02alewah, that must be it
15:04alewpjstadig: did you figure out a workaround or fix?
15:05pjstadigrevert the commit?
15:05pjstadigi haven't actually run into it, since i haven't upgraded since before the Great Cider Change
15:06technomancyone of the links is to http://enigmamar.axfree.com/page-2330/262076?utm_medium=twitter&amp;utm_source=twitterfeed which doesn't seem like much of a revenue source
15:13TimMcpjstadig: For some reason that reminds me of http://devnull-as-a-service.com/ but I can't think why...
15:15pjstadigTimMc: it's webscale!
16:13gfrederickshttp://dev.clojure.org/jira/browse/CLJ-207?focusedCommentId=28133&amp;page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-28133
16:14arrdemsweet
16:15gfredericksI suppose it's not too important that I understand everything rich says
16:17tbaldridgethat's a really odd use case
16:18hiredman(let [...] (for [...] ...)) ?
16:18tbaldridgehiredman: that's not, but trying to patch up for to support (for [:let ...]) is.
16:18gfredericksdoseq allows it
16:19tbaldridgeall for the sake of reducing nesting...and I'm not sure that's a good reason.
16:19hiredmanwell, his example use case in the ticket is really weird
16:19gfredericksis there a good reason not to support that though?
16:19bbloomgfredericks: because "negative 100 points"
16:19gfredericksit's kind of simpler that way
16:19clojurebotIt's greek to me.
16:19tbaldridgeprobably not, but there is a good reason not to do it the way mentioned in the patch
16:20gfredericksbbloom: ?
16:20bbloomclojurebot: -100 points is http://blogs.msdn.com/b/ericgu/archive/2004/01/12/57985.aspx
16:20clojurebotYou don't have to tell me twice.
16:20tbaldridgethe whole (for [a [1]]) is a kludge
16:24rovarman, I thought I was going to end up with the most elegant power set and austintaylor beat mine
16:24gfredericksbbloom: I don't really see this as an additional feature; it really does make for simpler from an API perspective
16:24hiredmanrandom patch in jira, rich doesn't like it, film at 11
16:25bbloomgfredericks: it's not just about features, it's a change
16:25bbloomit's a change that adds little to no value
16:25bbloomjust wrap the damn thing in a let & be done with it
16:25bbloomit's such an uncommon occurrence
16:25gfredericksyou don't put a for inside a let very often?
16:27hiredman"(detect the :let and then have the macro) just put the for in a let please"
16:27gfredericksI don't mind the idea that change is inherently costly
16:27bbloomgfredericks: i put a for in a let all the time, but usually it's like a chain of lets anyway, but still... now i have a question for you:
16:28bbloomis that first let evaluated lazily?
16:28bbloomthe first :let i mean
16:28gfredericksthat's an interesting question
16:28gfredericksthe point being it's just not obvious?
16:28bbloom,(take 0 (for [x (repeatedly #(println 1))] x))
16:28clojurebot()
16:28bbloom,(take 2 (for [x (repeatedly #(println 1))] x))
16:28clojurebot(1\n1\nnil nil)
16:29bbloomclearly that's a dirty contrived example
16:29gfredericksthis is interesting because it distinguishes for from doseq, which is the primary inconsistency
16:29bbloomdoseq is eager
16:29gfredericksexactly
16:29gfredericksso I can see this as a sensible justification for the difference
16:30bbloomi'd argue that the fact a leading let works in doseq is a side effect of the implementation & that a leading let should be disallowed in both cases, as it's potentially inconsistent with respect to laziness and offers zero expressivity benefits over a let/for pair
16:31bbloomunless you want that as a lazy/force situtation
16:31bbloombut that seems insane to me too
16:31gfrederickswhat does laziness have to do with disallowing in doseq?
16:31bbloomi dunno, i'm gonna stop thinking about this now b/c it seems like value of change is at most 5 points, leaving this patch at -95 points :-)
16:32gfredericksbbloom: mind if I mention you in a comment on a recent duplicate of that ticket?
16:32gfredericksin an attributive way
16:32bbloom*shrug* go for it
16:32gfredericksI'm just looking through tickets this afternoon
16:33bbloomjust don't use my name to help your lobbying case one way or another :-P
16:33gfredericksoh I don't have a strong opinion about it
16:33bbloomfeel free to use the -100 points system, however, heh
16:33gfredericksmade
16:33gfredericksjust trying to understand how judgments get made*
16:34gfredericksI have this thing where 50% of the time when an authoritative clojure person makes a value judgment I can't understand their reasoning
16:35bbloomthat's why i mentioned the point system. i think it basically explains 99% of decisions :-)
16:35hiredmanare you familiar with greek tragedies?
16:35gfredericksnot in detail
16:36gfredericksbbloom: there are lots of decisions besides just feature/change rejections
16:36gfredericksbut I do like the -100 points thing
16:36bbloomgfredericks: i enjoy the "what were they thinking?!" game. feel free to ask me to try to rationalize stuff :-)
16:37TimMcIt doesn't matter if it's a "weird" use-case, or can easily be worked around: Warts and inconsistencies can cause pretty nasty effects for metaprogramming.
16:38TimMcThat's why it *matters* if = can take 0 or 1 arguments -- you might use apply.
16:38hiredmangfredericks: in a tragedy mortals are flung about via the capricious will of the gods
16:39TimMcSomeone might have a macro that emits a 'for construct, and there might be a switch for whether to have some other clause in the first slot.
16:39bbloomTimMc: clojure.core/for isn't an ideal metaprogramming target outside of simple template expansion. it's got sytnax
16:39TimMcHmm
16:40TimMcs/$/?/
16:40gfredericksTimMc: oh no where did my dollars go
16:40TimMc:-P
16:40technomancythat's why I like the Oresteia
16:41bbloomTimMc: macros don't compose for a lot of reasons. the main reason is that they are not first class, but they also don't compose b/c syntax doesn't compose (in general)
16:41bbloomTimMc: if you wanted to metaprogramatically generate a lazy sequence, you wouldn't target the syntax of a for-comprehension, you'd target the primitives of such a comprehension
16:41technomancygods pulling shit, someone gets killed; someone else gets killed in revenge; someone else gets killed in revenge-revenge, then one of the gods is all "this has gotta stop, yo. how about a system of justice instead of just killing people"
16:41bbloomTimMc: ie map & mapcat
16:41TimMcMan, I'd do whatever the hell I wanted.
16:41gfredericks(inc bbloom) ;; lucidity
16:41lazybot⇒ 20
16:42TimMcPoint is, this would be a fucked-up bug to run into when building macros.
16:43bbloomTimMc: right, so don't build a big macro ;-)
16:43tbaldridge(inc bbloom)
16:43lazybot⇒ 21
16:43bbloomtbaldridge: lol the builder of the biggest macro of us all
16:44gfrederickswhat what macro did he build
16:44bbloomtbaldridge: core.async :-P
16:44TimMcbbloom: Anyway, 'for appears to emit more optimized code than a stack of mapcats would.
16:44tbaldridgeto be fair, only the last 10 lines are actually a macro, the other 600 are just data manipulation.
16:45bbloomtbaldridge: heh, i know. just kidding
16:45gfredericksclojurebot: a stack of mapcats |would be| a great name for a rock band
16:45clojurebotIn Ordnung
16:46bbloomgfredericks: lol
16:46arrdemis there any sort of convention in using defn- and - prefixing function names?
16:47arrdemit seems like both are techniques for hiding implementation details and both are considered antipatterns.
16:47gfredericksmy convention is to not use defn-
16:47S11001001isn't defn- deprecated now or something?
16:47bbloomTimMc: maybe so, but you can achieve a "stack of mapcats" in an efficient way if you happen to need to produce a data driven list comprehension of any appreciable size
16:47bbloomTimMc: otherwise, it's probably not a big deal
16:48bbloomTimMc: and if it was, i'd extract the internals of map cat & expose that just like datomic has the queries in vector/syntax form and in structured/map form
16:48bbloomTimMc: targeting syntax is convenient, but gets messy.... quick
16:49bbloomarrdem: the - prefix convention is for protocol methods that have a normal function that wraps them
16:50BronsaI've been using that for multimethods aswell
16:50bbloomit's also worth pointing out that with clojure macros (but not cljs macros) you can return stuff other than syntax
16:50gfrederickswho started that one?
16:50bbloom,(defmacro foo [] (range 10))
16:50clojurebot#'sandbox/foo
16:50bbloom,(def bar (foo))
16:50clojurebot#<CompilerException java.lang.ClassCastException: java.lang.Long cannot be cast to clojure.lang.IFn, compiling:(NO_SOURCE_FILE:0:0)>
16:50Bronsagfredericks: first time I saw that was in the cljs source
16:50bbloom,foo
16:50clojurebot#<CompilerException java.lang.RuntimeException: Can't take value of a macro: #'sandbox/foo, compiling:(NO_SOURCE_PATH:0:0)>
16:51bbloom,(foo)
16:51clojurebot#<ClassCastException java.lang.ClassCastException: java.lang.Long cannot be cast to clojure.lang.IFn>
16:51bbloomweird... i just tried that locally
16:51gfredericksBronsa: me too; or core.logic
16:51bbloom,(defmacro foo [] (Object.))
16:51clojurebot#'sandbox/foo
16:51bbloom,(foo)
16:51clojurebot#<Object java.lang.Object@1934946>
16:51bbloom^^ there
16:52seangrov`What's the cljs shortcut for drilling down into javascript objects?
16:52mischanix_,((apply comp (map #(partial + %) (range 10))) 1)
16:52clojurebot46
16:52seangrov`(.. event -target -value) ?
16:52tbaldridgeseangrov`: (-> (aget o k1) (aget o k2))
16:52mischanix_is there a builtin shortcut for apply comp?
16:53tbaldridge(partial apply comp) ?
16:53mischanix_Heh, feel like it's so common
16:53mischanix_alright
16:53seangrov`tbaldridge: Ah, yes, I support I would have to be careful about mangling
16:53seangrov`munging*
16:54bitemyappakurilin: not bad.
16:54tbaldridgetrue
16:54bitemyappakurilin: catching me on the wrong side of a headache for this though.
16:55bitemyapptbaldridge: you should probably mark clojure-py as unstable/alpha btw.
16:55tbaldridgebutemyapp: I thought that was assumed by the fact that all the work on it is about 1 year old.
16:55tbaldridge* bitemyapp
16:58akurilinbitemyapp: yeah I know, a bit intense, no rush :)
17:01akurilinFor UI-heavy functional MVC, has anybody here played around with a pattern where a user action essentially generates this big snowball map of actions to display on the screen, which you process only once the result map has been fully accumulated? Think of a game where you need to display 3-4 different notifications / UI updates to the user, and you postpone making them until the very last step.
17:02seangrov`Hahaha, I can't tell if you're trolling or not, akurilin
17:03akurilinseangrov`: well I'm just trying to figure out how to minimize the spaghettiness of this really thick View/Controller I have which has a ton of visual updates / analytics updates interspersed in it.
17:03seangrov`akurilin: I thought you might just be slyly trying to talk about monads
17:03akurilinSo I'm thinking that if I were to make it as pure as imaginable, things might get a lot saner.
17:03akurilinseangrov`: essentially that's what I'm thinking of
17:04akurilinseangrov`: except I don't know if people actually do this on client-side MVC in JS
17:04seangrov`akurilin: There was a good talk by Chouser (I think) about this
17:04akurilinI'm kind of tempted to.l
17:04seangrov`But yeah, it makes sense. It's also how React/pedestal work in some sense
17:05akurilinThe really big advantage I see here is that you can unit test the crap out of this, unlike pretty much any other UI pattern.
17:05akurilinUnless you like faking mouse clicks.
17:05bitemyappakurilin: not particularly intense, I just get awful headaches.
17:09bitemyapptbaldridge: still, phew. it fell apart fast once I applied some pressure.
17:12tbaldridgewell your conversation about clojure-py started by talking about the reader, iirc, I mentioned at that time that the reader could be lifted and used as-is. clojure-py has been discontinued for quite some time.
17:15mrhankyfredyr, no chars in cljs? umpf
17:17gfredericksI like how the clojure tests have a special.clj file that is ostensibly about testing special forms but it only tests destructuring
17:18mrhankyhow can i check a string for beginning with "\n" in cljs?
17:19noonian,(= (first (str \n \f \o \o)) \n)
17:19clojurebottrue
17:19noonian,(= (first "\nfoo") \n)
17:19clojurebotfalse
17:20alandipertmrhanky: (= \newline (.substring x 0 1)) is another way
17:20noonian,(cons \n "foo")
17:20clojurebot(\n \f \o \o)
17:20noonian,(apply str (cons \n "foo"))
17:20clojurebot"nfoo"
17:20noonian,(fisrt (apply str (cons \n "foo")))
17:20clojurebot#<CompilerException java.lang.RuntimeException: Unable to resolve symbol: fisrt in this context, compiling:(NO_SOURCE_PATH:0:0)>
17:20noonian,(first (apply str (cons \n "foo")))
17:20clojurebot\n
17:20noonian'yay
17:22mrhanky,(= \newline (.substring "\newline" 0 1))
17:22clojurebotfalse
17:23mrhanky,(= \newline (.substring "\n" 0 1))
17:23clojurebotfalse
17:23mrhankyhuh
17:24mrhanky,(= \newline (.substring "\n" 0 2))
17:24clojurebot#<StringIndexOutOfBoundsException java.lang.StringIndexOutOfBoundsException: String index out of range: 2>
17:24mrhanky,(= \newline (.substring \n 0 1))
17:24clojurebot#<IllegalArgumentException java.lang.IllegalArgumentException: No matching method found: substring for class java.lang.Character>
17:24mrhankyi dont get it
17:25alandipertmrhanky: it's a clj/cljs difference - on cljs, \newline is "\n" as there is no Character type
17:26mrhanky,(= "\n" (.substring "\newline" 0 1))
17:26clojurebottrue
17:38mrhankyi'm totally confused about handling chars in cljs
17:40bbloommrhanky: they are just strings of length 1
17:40bbloom,(class \x)
17:40clojurebotjava.lang.Character
17:41bbloomtry that in your cljs repl
17:45mrhankydont have any cljs repl bbloom
17:46bbloommrhanky: check out the cljs source, then run ./script/bootstrap & then run rlwrap ./script/repljs
17:46bbloom:-)
17:47mrhankyi did "lein trampoline cljsbuild repl-rhino"
17:47bbloomthat works too
17:47mrhanky"Error evaluating:" (class \x) :as "cljs.user.class$.call(null,\"x\")"
17:47mrhankyorg.mozilla.javascript.EcmaError: TypeError: Cannot call method "call" of undefined (<cljs repl>#1)
17:52bbloommrhanky: er try "type"
17:53bbloom(type \x) => #<function String ...
17:55mrhanky#<function String() { [native code for String.String, arity=1] }
18:04mrhankywell, what i really need is a replacement for (char?) in cljs
18:05bitemyapptbaldridge: sure, but the reader isn't super useful without working collections - and they don't ;)
18:06bitemyappconsidering replacing those collections and trying to use the reader as-is.
18:06tbaldridgeI'd recommend you don't, Python just isn't a good fit for Clojure. If you want reader, write one from scratch or something.
18:07mrhankyhow can i check if a string equals \newline, \space, \tab, etc in cljs?
18:09shep-homemrhanky: does blank? work for that case?
18:09mrhankyi have no blank?
18:10shep-homeclojure.string/blank?
18:10bbloommrhanky: why do you need a char predicate? not saying there is no good reason, but there is likely a good workaround
18:10shep-homethat's a shame
18:11shep-home,(map clojure.string/blank? ["\t" "\n" " "])
18:11clojurebot(true true true)
18:13shep-homemrhanky: That `map` works ok on http://himera.herokuapp.com/index.html (I don't have CLJS here)
18:15mrhankybbloom, i'm porting a clj script of my professor to cljs. there's a function which checks if a string is a char (\newline, \space etc.)
18:15mrhankyand the original clj shouldnt be modified if possible
18:15bbloommrhanky: unlikely to be possible. that's not a goal for cljs
18:15mrhanky>if possible :)
18:16bbloommrhanky: you can (defn char? [x] (and (string? x) (= (count x) 1))) if that helps
18:16bbloomcould hurt too
18:16bbloomalternatively, if you care about PARTICULAR chars, like \newline or \space, you can just use a set as a predicate:
18:17bbloom(defn interesting-char? [x] (contains? #{\newline \space ...} x)
18:17mrhankyand what if i care about all chars?
18:18shep-homeI think you'll have to go up a level of abstraction - why does it need to be a char
18:18shep-homeand what does it mean to be a char
18:19mrhankythe given script outputs \newline and \space and they need to be displayed correctly on my web project
18:21shep-homeAnd \newline and \space are embedded in a string?
18:21mrhankythe string only contains \newline or \space
18:23shep-homeso, then does comparing exactly to that work? -- (= \newline the-string)
18:23shep-homesince in CLJS \newline *is* a string
18:25mrhankynope, will be false shep-home
18:27shep-homemrhanky: OK, I guess that the CLJS REPL on http://himera.herokuapp.com/index.html must be lying to me then.
18:28mrhanky(.log js/console (= \newline "\newline"))
18:28mrhankygives me false
18:28mrhankyoh wait
18:29shep-home\newline == "\n"
18:32shep-homeAt least in CLJS, I guess
18:33mrhankyoh this is drivin me crazy
18:33shep-home,(= \newline "\n")
18:33clojurebotfalse
18:44johnwalkerghis there currently a way to add libraries to all new projects with lein?
18:45johnwalkerghfor example, if i wanted to have core async available each time i did lein new x whatever
18:45llasramjohnwalkergh: You can create your own project template
18:45johnwalkerghso theres no way to keep this in the profiles or something?
18:46johnwalkerghtemplates would work, but it's usually more trouble to add libraries than remove them
18:46llasramYou can add stuff to your `:user` profile in profiles.clj, but that only makes it available to you, doesn't add it to the project
18:48llasramjohnwalkergh: Re: trouble -- maybe you want the help of the "lein ancient" plugin?
18:49johnwalkerghactually, i have that too
18:49johnwalkerghi guess what i'd really like is to have a :default-libraries [[org.clojure/core.async ...]]
18:49fgallinawhat do Emacs people use nowadays as a clojure debugger? ritz seems to have stalled and not followed the nrepl->cider rename.
18:52johnwalkerghhmm. thanks for the help though
18:53llasramnp... BTW, I believe your custom template could use a profile-provided :default-dependencies
19:01seangrov`Would be nice to be able to use update-in on strings
19:14bitemyappseangrov`: gag gag
19:16bitemyappseangrov`: Data.Text in Haskell has good utilities for that sort of thing but you really have to be quite careful what you mean when you decompose "human" strings into sub-elements.
19:16arrdembitemyapp: meh... as long as the equality semantics are retanined could be OK.
19:16bitemyapparbitrary update-in is a slippery concept.
19:16bitemyapparrdem: that's not the problem, what's a character?
19:17bitemyapparrdem: is it a byte? a logical glyph/mark? a rune-in-total-with-modifiers?
19:17arrdembitemyapp: it's a byte in the unicode vector constituting a string.
19:17bitemyappno, it's not a byte.
19:17bitemyappit's not a byte at all.
19:17arrdembitemyapp: that's the joke
19:17bitemyappunicode is multi-byte.
19:17bitemyappbut my point is that even unicode codepoints aren't necessarily what you want.
19:17bitemyappin many cases what you want is runes unified with modifiers.
19:18bitemyappCJK is total hell.
19:18bitemyapparrdem: you can demand a pretty penny for your services if you have a knack for CJK text processing.
19:18seangrov`bitemyapp: Could be, could be
19:18bitemyapparrdem: http://i.imgur.com/W95z8Pi.png
19:19bitemyappseangrov`: but I get your meaning, I guess what I'm complaining about is that you couldn't have a type-safe update-in that understands Text vs. arbitrary vectors.
19:19seangrov`bitemyapp: Yeah, I hadn't thought about that difference
19:19bitemyappseangrov`: you really want a type system keeping you honest when you're chucking text modifications around.
19:19seangrov`I thought that we already can map over strings, might as well go whole-hog and update-in
19:20arrdembrb upvoting all of r/insanitywolf
19:20bitemyappI don't really like that Strings are seqable either. Should be a bloody type error.
19:20bitemyappseangrov`: well the problem is update-in isn't part of the Seqable interface, it's a property of being "associative"
19:20seangrov`Heh, yes
19:20bitemyappassociativity implies the ability to identify discrete sub-elements
19:20bitemyappwhich is uh...slippery in text.
19:20bitemyappand implies making some kind of concrete decision with regards to what a "rune" is.
19:21seangrov`Well, it's possible with Javascript strings anyway "abc"[0] => "a"
19:21bitemyappyes but that doesn't mean I'm happy about it :(
19:21arrdemseangrov`: for once I agree with bitemyapp. Just because you can make a sequence of it doesn't make it a good idea.
19:21seangrov`Well, cljs being the hosted language that it is, it seems fair enough to extend the associative protocols to it
19:21arrdem... wat no why. that's a reason _not_ to.
19:27bitemyappIt's important to make the distinction between allowing things to be used in an associative way, but type-safe (separate types and functions) vs. glomming everything into the same interface.
19:28bitemyappmap assumes Seqable, fmap assumes Functor. The former should only be used on actual sequences. If you intend a more generic/less specific notion of reach into containers (understanding that it doesn't necessarily mean "collection") then fmap is fine.
19:28bitemyappseangrov`: there are proper ways to do all of this and Clojure/CLJS have successfully ignored all of them.
19:32bitemyappseangrov`: making map into a pseudo-Seqable-cum-Functor is not the right way to do this and leads to more time wasted tracking down type errors from spurious/accidentally-semi-valid inputs.
19:32bitemyappit also makes code reuse harder because when you overload "intent" that much, the libraries can't be very precise or explicit about what sort of inputs are intended/kosher.
19:33bitemyappso given a set of functions in a library that are all expecting roughly the same kind of input, they'll have varying degrees of specificity in the types of their inputs and it'll be utterly lopsided and inconsistent.
19:33bitemyappTerrible.
19:41alewClojure has no generally accepted fmap interface/implementation, correct?
19:43coventryDoes korma have support for postgres arrays?
19:43alewor Functors rather
19:45akhudekalew: https://github.com/clojure/algo.generic/blob/master/src/main/clojure/clojure/algo/generic/functor.clj
19:45Raynesalew: Not built in, but any seqable data structure is mappable fwiw.
19:46arrdemRaynes: not that there's any consensus on the fwiw part...
19:46Raynesarrdem: ?
19:53alewbut when you map you always get back a seq right?
19:54RaynesRight, I didn't say it was functors :p
19:57bitemyappalew: Fluokitten would be more to the point
19:58bitemyappalew: it's still senseless without a type system.
20:02splunk_silly q? does (defn foo [bigseq] (map f bigseq)) hold onto the head of bigseq?
20:04splunk_relatedly, do all non-head-holding operations on bigseq need to happen inside (doseq [x (make-bigseq seq-precursor)] ...)
20:04splunk_which means you pass around seq-precursor, rather than bigseq
20:06ehabsI'm trying to call a java function that writes to one of its arguments. is it possible to do this from clojure? In the following example I want svm/svm_cross_validation to write to `results`. (let [results (double-array (count y))] (svm/svm_cross_validation (make-problem y (map sparse-map x)) (make-params) 3 results))
20:07ehabsor do i have to write a java function to do this?
20:08alewbitemyapp: perhaps being rigorous about it is pointless, but I think having the idiom would be nice instead of having to funnel into one interface
20:10bitemyappalew: you can have your cake and eat it too, if you have a type system that isn't utterly tedious.
20:10bitemyappalew: it isn't just about safety either, you saw how nice Haddock documentation is.
20:12coventryIs there any way to operate on the return value of a korma query before the db connection is closed, or do I have to resort to jdbc for that?
20:14bitemyappcoventry: why would you need to?
20:16akhudekehabs: if you are just passing a primitive array it should work fine
20:16coventryI'm experimenting with postgres arrays. I'm getting back a Jdbc4Array. When I try to call .getArray on it, I get a complaint that the connection has been closed. A solution for this in terms of jdbc was posted here: http://stackoverflow.com/a/6062708 . Was wondering whether there's a way to translate that into korma.
20:17coventrybitemyapp: ^
20:17akhudekcoventry: does korma have a :row-fn like clojure jdbc?
20:18akhudekit's easy to do in raw jdbc
20:19coventryakhudek: It seems as though I could use exec-raw-with. Thanks. https://github.com/korma/Korma/pull/151
20:20coventryOh, except I guess that PR wasn't accepted. :-)
21:38Mandarhi, is there a shortcut for (val (find ...))
21:39hiredman,(doc get)
21:39clojurebot"([map key] [map key not-found]); Returns the value mapped to key, not-found or nil if key not present."
21:39Mandarhiredman, thank you!
21:46andrew__hello
21:46andrew__i'm seeking a short insightful explanation of the difference between a seq and a list
21:46andrew__the REPL reports them as the same class and as identical, and equality tests work between them
21:46andrew__so what's the difference?
21:47hiredmana linked list can act as it's own seq, because it trivialy fulfills the seq first/next contract
21:48andrew__are seqs returns from functions like (seq) just linked lists?
21:48hiredmanno
21:48gwsandrew__: a seq is roughly an "interface", a list is a concrete implementation (one of many possible)
21:49hiredmanseqs are not lists, but (clojure's default) lists are seqs
21:49gwsandrew__: http://clojure.org/sequences
21:49andrew__i see, so a list has the interface of a seq, while other collections must "adopt" that interface by calling seq on them, is that correct?
21:50hiredmana seq is basically a possibly lazy list
21:51eredhttp://stackoverflow.com/questions/4586562/in-clojure-how-can-i-implement-standard-clojure-collection-interfaces-on-my-own
21:51hiredmana (seq [1 2 3]) returns a seq over the contents of the vector, which is a lazily generated list of the values
21:51andrew__and I assume then that it would be meaningless to call seq on an existing list?
21:51hiredmanit may or may not be
21:52hiredmanseq returns a seq
21:53andrew__so if you wanted to make an existing finite list lazy, you could call seq on it, that would be the primary advantage only. unlike a real seq that might be returned from an expression, a literal list cannot be infinitely large, so converting a list to a seq would only provide lazy access to a finite collection
21:58DolfjeAimHere, everyone alwys hates me.
21:58DolfjeNo one likes me.
22:23gfredericksandrew__: if your list is already realized, then "converting it to a lazy seq" adds nothing
22:23gfredericksand in fact a clojure list (proper) is already a seq
22:23andrew__ok, thanks
22:23gfredericksclojure distinguishes (via the interfaces ISeq and Seqable) between things that _are_ seqs and things that can be converted to seqs
22:24andrew__so a list is a seq, but a seq is not a list (since it offers other features)
22:28gfredericksno a seq doesn't offer features, it's an abstraction
22:29gfredericksa list is one kind of seq, a lazy seq is another kind
22:29noonian,(seq? [1 2 3])
22:29clojurebotfalse
22:31gfredericksbbloom: here's a good one for you -- why is cons part of ISeq?
22:47bbloomgfredericks: let me look/think
22:47gfredericksmore particularly I suppose, why would a seq ever have an impl-specific way of consing?
22:48gfredericks(since I assume that's the only reason to include it)
22:48Bronsagfredericks: ISeq.cons is actually.. conj
22:48bbloomBronsa: no, it isn't
22:48gfredericksBronsa: sure; I don't think that changes the question though
22:48bbloomBronsa: that's IPersistentCollection#cons
22:49Bronsabbloom uh, really?
22:49bbloomBronsa: yup, look at the signature of RT/conj
22:49bbloom,(conj 5 10)
22:49clojurebot#<ClassCastException java.lang.ClassCastException: java.lang.Long cannot be cast to clojure.lang.IPersistentCollection>
22:49tbaldridgeBronsa is right, it's a odd "bug" of clojure
22:49bbloom^^ see ?
22:50gfredericksbut ISeq extends IPersistentCollection
22:50bbloomyeah, i suspect that you can simply remove the cons from ISeq & nothing will cahnge
22:50gfredericksI think ISeq repeats the method so it can narrow the signature to return an ISeq
22:50bbloommy java isn't as good as my C#, where that would have to have either an "override" or a "new" modifier, lest it be a compiler error
22:50gfredericksand maybe that's the point?
22:51Bronsaoh, right. that's the point gfredericks
22:51bbloomah, yes, that's precisely what's happening. signature narrowing
22:51BronsaI keep forgetting about that
22:51gfredericksso kind of a java type-system detail I guess
22:51bbloomyeah
22:52bbloomin theory, IPersistentMap could do that too
22:52gfredericksdoes cljs include cons on ISeq?
22:52Bronsa it includes -conj on IPersistentCollection
22:52bbloomanyway, you could remove that interface method & nothing would change except new programs could pass the type checker :-)
22:53gfrederickswell a bunch of the java code would break I'm sure
22:54gfredericksrefuse to compile, I mean
23:33bbloomgfredericks: nothing should break b/c anybody else who implements it will be simililarly narrowing the type