#clojure logs

2016-02-03

01:36marcfontaineusing cursive, I am getting the following error when compiling, there are no errors when sending the form directly to the repl.
01:36marcfontaineCompilerException java.lang.IllegalArgumentException: Value out of range for char: -61, compiling:(extract_from_quotes.clj:80:18)
01:36marcfontaine(def invoice-ids (apply str (interpose "," (map #(:invoiceId %) (flatten (map vals clearquotes)))))
01:36marcfontaine )
01:36marcfontaine=> #'csv.extract-from-quotes/invoice-ids
01:38TEttingertry checking the result of just (map :invoiceId (flatten (map vals clearquotes)))
01:38TEttingerwait
01:39TEttinger,(flatten [{:invoiceId 1 :a 2} {:invoiceId 3 :a 4}])
01:39clojurebot({:invoiceId 1, :a 2} {:invoiceId 3, :a 4})
01:39TEttingerah, wasn't sure if flatten would do something to maps
01:40marcfontaine(map :invoiceId (flatten (map vals clearquotes))) =>("1000882" "1000883" "1000924" “1000926" …. )
01:40TEttingerthat “1000926" is odd
01:41TEttingerone quote is a smart quote, not sure if that's just IRC
01:41TEttinger,(interpose "," ["1000882" "1000883" ])
01:41clojurebot("1000882" "," "1000883")
01:42marcfontaineyeah that’s just me typing
01:42TEttingeris clearquotes from a file?
01:43TEttinger,(apply str (interpose "," ["1000882" "1000883" -61]))
01:43clojurebot"1000882,1000883,-61"
01:44TEttingeris this online, marcfontaine ?
01:44TEttingerthe source I mean
01:46amalloyclojure.string/join
01:46amalloyalso, clojure.core/mapcat
01:47TEttingeramalloy: thoughts on the out of range for char: -61 error?
01:49amalloyi think -61 is not a very good character
01:50marcfontaineok great pointer, the clearquotes are coming from the deserialization of php data.
01:50TEttingerindeed. any idea what could cause that?
01:50TEttingeroooh
01:50TEttingerencoding maybe?
02:40marcfontaineok problem was converting result (a bytearray of valid data size nb) to string using (subs (map char result) 0 nb) instead of (subs (String. result “UTF-8”) 0 nb) so the discrepancy between compilation and repl was due to how the byte-array is initialized in the compiler vs repl.
02:47marcfontaineor better yet (String. result 0 nb "UTF-8")
05:06anti-freezeHi everyone. I'm having issues with core.async and transforming values. I have a list of files, I want to read them and then convert them to js/Blob objects before passing them to the out channel. I've tried this, but to no avail https://www.refheap.com/114412
05:07anti-freezeio/read-file returns a channel
08:00jeayeI see this when I try to minify http://dpaste.com/3X3PTKJ#wrap
08:00jeayeAny ideas what'd cause this?
08:04CaptainLexjeaye: I guess the first thing that springs to mind is the real file path you're trying might not exist or it may be malformed
08:04CaptainLexjeaye: It seems like the kind of error that could be caused by a null file
08:04CaptainLexjeaye: What does it output if you use a file you /know/ doesn't exist?
08:06jeayeSo, I tried specifying full paths for in and out. It gives me an error saying out must be relative. If I make in absolute and out relative, the same initial error shows.
08:06jeayeCaptainLex: If I specify files that don't exist, the same error comes up.
08:06CaptainLexjeaye: That might be a permissions issue then. Do you own the file you're trying to use, and does boot run as your user?
08:07CaptainLexjeaye: I would expect bo things to be true, but one can never be too careful
08:07jeayeEverything is owned by my user and being run by the same user.
08:12CaptainLexjeaye: Sorry, lost connection. Did I miss anything?
08:13jeayeCaptainLex: Someone in #bootclj has it figured out, I think.
08:13jeayeI'll follow up.
08:13CaptainLexjeaye: Thanks!
08:26jeayeCaptainLex: It wasn't part of the fileset `boot show -f` so minify couldn't find the file. I thought I could run it on arbitrary files, but I can't.
08:26jeayeCaptainLex: If I reference something in the src directories, the error doesn't show up.
08:27CaptainLexjeaye: Aha! Yep, I would have never been able to come up with that one. I'm glad it worked out for you!
08:27jeayeCaptainLex: Thank you!
08:54KamuelaElixir must be a lisp in the same way that javascript is a lisp
08:55Kamuelabecause it feels like a basic language with basic syntax to me
08:55Kamuelais “has first-class functions” all it takes?
09:05tdammersIMO neither JS nor Elixir are lisps
09:06mpenetindeed
09:06wmealingelixir is nowhere near a lisp
09:06tdammersdefining feature for being a lisp would be s-expressions, and how they are used for both code and data, essentially making code first-class for free
09:06mpenetit's more about the homoiconicity
09:06wmealingthere is lisp flavored erlang, dont get me wrong
09:10tdammersthere is some heavy lisp influence in both JS and elixir though
09:11mpenetthere are just first class functions the rest is pretty common
09:11tdammersfirst class functions are also pretty common
09:11kvtbquestion, in ClojureScript, (max nil nil) returns nil, but in Clojure, (max nil nil) gives NullPointerException. How can I ensure (max nil nil) in Clojure returns nil like in ClojureScript?
09:12tdammerslots of details that resemble scheme though - scope, closures, defining functions as lambdas bound to variables, etc.
09:12tdammers(in JS, that is)
09:12CaptainLexkvtb: You could try catching that exception and returning nil, right?
09:14kvtbthanks CaptainLex did not not think of that :)
09:15CaptainLexkvtb: No problem!
09:15wmealing1i often wonder if we're going to be stuck in js land forever in the browser.
09:16wmealing1its a little weird.
09:16CaptainLexwmealing1: JS as a target or JS as a high-level language?
09:16wmealing1js as the target
09:16MJB47does asm.js count?
09:17wmealing1it still feels like js
09:17CaptainLexYeah, I worry about that too. If it works "well enough" then there will be no push to move to something nicer and more efficient
09:17CaptainLexOn the other hand, using only JS until every browser agrees on a different standard would be bad for everyone
09:18wmealing1so, thats it then, we're stuck
09:18wmealing1i for one welcome our new js overlords.
09:19wmealing1the browser is going to be around for a long, long time
09:19wmealing1changing / adding another language is like playing chicken with the user
09:19wmealing1while i know other things can transpile to javascript
09:20mpenetgiven that transpiled code often ends up more performant than hand writen code I don't think js is a huge problem anymore
09:20tdammersto be honest, none of the existing compile-to-JS solutions really convince me
09:20wmealing1it seems that js tends to encourage some neurotic programming.
09:21mpenetat least we have options now
09:21wmealing1that is true
09:21CaptainLexYeah, the asynchronicity instead of real multi-threading leads to some really clunky workarounds for really common paradigms
09:21CaptainLexIf we can't figure out a patch over that, every JS-targeting language will suffer from it
09:22mpenetthis cuold evolve, we didn't have xhr until "recently"
09:22mpenetcould*
09:23tdammersfrankly, I believe there isn't a compelling reason why JS couldn't be extended to a multi-threaded runtime
09:23tdammersshared-mutable-state multithreading would be problematic due to the assumptions you can currently make, but with decent concurrency semantics, I believe this could be solved
09:24tdammersbut you'd have to sandbox the whole threading runtime to avoid rogue JS eating up all the available OS threads
09:24tdammersand given how difficult sandboxing JS already is, ...
09:25wmealing1on the side note, i really wanted to like elixir, but clojure won me over elixir due to clojurescript
09:25wmealing1having the same language on both client and server, and one thats not insane.. is nice
09:26CaptainLexwmealing1: Yeah, what sold me on the pairing was shoreleave. Seamlessly sharing data between client and server! A dream come true!
09:26tdammersexcept that clojure and clojurescript are different enough for it to matter
09:27wmealing1tdammers: brain context switching from clojure -> clojurescript is easier than elixir -> javascript
09:27wmealing1i can't fit that in my head
09:27tdammersmaybe I'm different that way
09:28wmealing1(i also need to know C and c++)
09:28wmealing1and erlang
09:28tdammersah, hm
09:28tdammersI'm fairly comfortable with C myself, which helps a lot
09:28wmealing1so ive dropped elixir and erlang..
09:28tdammersmy go-to combo, tentatively, is haskell + js
09:28wmealing1i thought about learning haskell, it seemed.. to be a language people talk about
09:28wmealing1but dont get things done in
09:29wmealing1but again, thats my casual observation
09:29tdammersidk, haskell works fine for me
09:29CaptainLextdammers: Have you looked into Haskell-y JS languages like Elm or PureScript?
09:29tdammersyeah
09:29tdammerspurescript is still on my list
09:29tdammerselm looked promising at first, but I ended up dropping it
09:29wmealing1tdammers: i'd love for it to "work" for me too.. it looks sane as far as a language goes
09:30tdammersfor two reasons; one, it is too simple, and two, it's unstable and the toolchain is a bit brittle
09:30wmealing1brittle like, unstable ?
09:30tdammersyeah
09:30CaptainLexUnstable like the API keeps changing?
09:30tdammersyes
09:30tdammersthe API and the language itself change
09:31tdammersand the toolchain is supposed to deal with it automagically
09:31CaptainLexAhhhh, yes. So good to play around with, but not to write code you need maintain in
09:31CaptainLexNot yet, anyway
09:31tdammerswhich is great, but when the toolchain fails to resolve those issues, you have nowhere to start looking
09:31tdammersthere was this one thing that cost me several hours to figure out, where they had added a validator for the required package field that pointed at a github repo for the package
09:32tdammersand the default value that the package generator inserted was invalid
09:32wmealing1ouch
09:32tdammerswhich is doubly frustrating because I wasn't ever going to publish this package, and it has never been nor will it ever be on github
09:33wmealing1tdammers: i read that many people complain about debugging in haskell
09:33wmealing1tdammers: do you use one, or do any ?
09:33tdammersuse what, a debugger?
09:33wmealing1yes
09:33tdammersI don't
09:33wmealing1ive been tossing up haskell/ocaml on another project
09:34tdammersI don't generally have to do a lot of debugging, most of it is a matter of fixing compiler errors
09:34tdammersthe rest I can almost always resolve using automated tests
09:34tdammershaskell shines at automated testing
09:34wmealing1ok
09:34wmealing1is there a midje like tool ?
09:35sdegutisGood morning all.
09:35sdegutisHi there.
09:35wmealing1if clojure talk happens in here, i'll mute.
09:35sdegutisHaha don't worry about it, we love talking about Haskell in here.
09:35tdammerswmealing1: or head over to #haskell ;)
09:35wmealing1tdammers: heh
09:36sdegutisQuestion: What are the valid namespace characters?
09:36wmealing1tdammers: i was in there for a bit, i felt so many wooshes… listening
09:36sdegutisIs it just alphanumeric plus hyphens?
09:36sdegutisOr can you also use something like % ?
09:36tdammersanyway, there's quickcheck for property tests, hunit for unit and integration tests, and tasty to provide a seamless unified API over them and a bunch of other testing libraries
09:36wmealing1i'll take a look !
09:36tdammersso the approach is different from midje, but definitely powerful
09:37CaptainLexsdegutis: I think you can use any identifier-valid character for namespaces, but be careful your OS can find those special characters on the filesystem
09:37CaptainLexsdegutis: But I don't know for sure
09:37tdammersand, again, a lot of the stuff you'd normally do in unit and property tests can be offloaded to the type checker
09:37sdegutisGood morning justin_smith.
09:37sdegutisBut this only matters on the machine that is compiling the uberjar for deployment, right?
09:38CaptainLexsdegutis: That sounds about right to me, yeah. But I am not a jvm or systems or Clojure-compilation expert of any kind!
09:38wmealing1hmm the jvm itself would need to unpack the filepaths
09:38wmealing1so that could also get wierd
09:39tdammers"which characters are valid in namespaces" is one of those questions where the answer is "if you need to ask, you're doing it wrong" :D
09:39tdammers(like "what is the limit for how many columns I can have in a database table")
09:39CaptainLexHehehe
09:41wmealing1tdammers: my favourite is 'how many subdirectories deep does the operating system support'
09:41wmealing1what.. is someone doing to require that !?
09:42tdammerswell, things like sysfs and such might hit the limit at some point
09:42wmealing1oh this person was -definitely- messing around on ext4
09:44MJB47at work we had a node project that couldnt run on windows because the node modules sub directories were too deep
09:44MJB47was annoying
09:44CaptainLexThat's a complex situation, morally
09:44CaptainLexOn the one hand, what the hell Microsoft, as usual
09:44wmealing1running node, or running windows ?
09:44CaptainLexOn the other, how many directories deep was it??
09:45MJB47idk what the number was
09:45MJB47but it worked fine on every other OS
09:45MJB47wasnt a terribly big project
09:46TMAon Windows(R) the PATH_MAX is the problem
09:46CaptainLexPATH_MAX sounds like a problem
09:46wmealing1you can work around it with relative referencing
09:47Glenjaminunc paths also work around afaik
09:47MJB47idr how we fixed it
09:47wmealing1but its annoying
09:47wmealing1ah
09:47MJB47everyone used unix systems
09:47Glenjaminnpm v3 also made some changes to avoid path lengths
09:47MJB47except 1 guy
09:48wmealing1that guy..
09:48MJB47ikr
09:54sdegutisHi.
09:55CaptainLexsdegutis: Hello again!
10:59Shayanjmping justin_smith
11:47sdegutisHi.
11:48sdegutisHow are you?
12:41justin_smithShayanjm: hello
12:42Shayanjmello justin_smith - managed to get the author on skype to help me debug this thing
12:43justin_smithShayanjm: OK. It's a kafka replacement not a kafka library, right?
12:43Shayanjmjustin_smith: It's a kafka library but it uses redis instead of ZK on the consumer side because of scalability/reliability concerns at scale
12:44Shayanjmthe producer side publishes messages directly to kafka via the brokers
12:44justin_smithoh I had no idea that was an option...
12:44justin_smiththe redis part that is
12:44justin_smithpublishing via brokers is totally standard
12:44justin_smithShayanjm: choosing redis over zookeeper for reliability sounds really sketchy to me
12:45Shayanjmjustin_smith: Yeah, I wanted to try it out because it sounded interesting
12:45Shayanjmif you read the readme on the project he has some points about why he made that decision
12:48justin_smithShayanjm: btw in terms of reliability, out of CAP (where you can pick at most two) redis picks the empty set - it provides none of the three
12:49justin_smithShayanjm: the amount of data you can lose is bounded by the replication lag
12:50justin_smithShayanjm: I don't doubt that redis is easier to use and easier to scale, but reliability-wise it isn't even near zookeeper's league
12:52amalloyi bet it's faster though
12:52justin_smithamalloy: I don't doubt it at all - though this is why kafka uses zookeeper for coordination not for messages
12:52justin_smithonce you have redis replacing zookeeper, why use kafka even?
12:53amalloywho needs reliability when you're blazing fast
12:53justin_smithamalloy: it makes me cry tears of blood because it's true
12:58Shayanjmjustin_smith: got it working, but it's a bit slow
12:58Shayanjmgoing to see if increasing JVM RAM allocation will help
12:59dysfunanyone want to give me some feedback on this pre-release library please? :) https://github.com/irresponsible/emotional
13:00justin_smithShayanjm: what is "slow"? I don't know what your domain is, but based on my vanilla kafka usage, if kafka was my speed bottleneck I would have an amazingly performant system.
13:00CaptainLexdysfun: That's a good URL.
13:00dysfunyeah, it is :)
13:00justin_smithhaha
13:00Shayanjmjustin_smith: it's the way the consumer is built I think
13:00dysfunhadn't really occurred to me haha
13:00Shayanjmat least on his system
13:00Shayanjmit hangs for at least a minute before returning
13:01CaptainLexdysfun: Although assuming your nick is short for dysfunctional, you should figure out how to work that in too
13:01Shayanjmhe provides a vagrant build that can be used for testing, so I might test on that to see if its faster
13:01dysfunCaptainLex: it is, but i'm content to leave that out for this one project. there will be others :)
13:01justin_smithShayanjm: oh wow - so in my usage the consumer doesn't return - I leave a consumer polling for messages (in a go loop or thread) and give it a function to call for each message it gets
13:01dysfunpart of me is curious about what is the limit for people being prepared to use your library's name in front of their managers
13:02justin_smithI mean eventually the consumer returns when I forcibly shut it down but that's different
13:02dysfuni mean if you call your library something downright offensive, you're liable to get entire swathes of users refuse to use it
13:02Shayanjmjustin_smith: Yeah for right now (testing purposes) I wanted to manually see if I could get the messages and do stuff with them
13:02Shayanjmso I wanted the consumer to sit there, read the messages, and stick them somewhere
13:03amalloykafka is for throughput, not latency, isn't it?
13:03justin_smithdysfun: (:require [emotional.core :as rational])
13:03dysfunjustin_smith: this is my 'irresponsible clojure organisation', there is no rational
13:03justin_smithamalloy: throughput plus flexible routing with a log doubling as message queue, yes
13:04justin_smithplus reliability
13:04justin_smithShayanjm: yeah, he has a good point, if latency is more important than throughput kafka might not be your bag, unless you want the other features badly enough that you can cope
13:10justin_smithShayanjm: you mention that this kafka re-implementation has a rationale in the readme, but I'm not finding it. Is this the right README? https://github.com/gerritjvv/kafka-fast/#kafka-clj
13:10Shayanjmhttps://github.com/gerritjvv/kafka-fast/#consumer
13:11Shayanjmthe readme(s) are a bit weirdly set up
13:12justin_smithShayanjm: OK, so he choses fast+simple at the expense of reliable
13:13Shayanjmbasically, with the assumption that by clustering redis you can approach the reliability of ZK at scale
13:13justin_smithShayanjm: that bullshit
13:13justin_smithsorry, *that's bullshit
13:13Shayanjmjustin_smith: Yeah I don't know enough about ZK to speak intelligently about the approach
13:13Shayanjmbut I thought it was interesting that you could use redis + kafka together without them fighting
13:14Shayanjmso i'm poking at it to see how it works
13:14Shayanjmit's basically using redis to store the offsets of each tracked topic
13:14justin_smithShayanjm: by reliability I mean "knowing your message gets from one end to the other", redis can't offer that... but OK
13:14Shayanjmjustin_smith: Yeah I think he means "if one redis instance falls over, you can still guarantee some level of data integrity"
13:14justin_smithso the failure isn't "redis not running" but "silent data loss"
13:15dysfunyay!
13:15justin_smithI mean if continuously available while dropping some messages fits your use case, go for it
13:15Shayanjmyeah that ^^^ I asked him about silent losses earlier and he said "he hasn't seen any with a production deploy of a single redis instance"
13:15amalloyjustin_smith: if you use any of the consumers built into kafka you can't actually know that either
13:15mgaareit depends on the semantics your app requires for message processing.
13:16mgaarewith Kafka, in the case of zk/redis failure you wouldn't get dropped messages, you'd have messages consumed more than once
13:16amalloybecause the consumers ACK the message as soon as they receive it, before your client code can confirm it's acted on the message
13:17justin_smithmgaare: oh, interesting.
13:18mgaarejustin_smith: zk (and presumably redis in this alternate implementation) are only storing a given consumer's position in the topic, not any message data.
13:18justin_smithmgaare: of course, yeah - I should have connected those dots
13:18justin_smithI do know about the partitions on disk vs. the coordination on zk
13:19mgaareI don't think you can be reasonably blamed for a mistake here. services written in java and distributed systems both seem to have documentation that obfuscates the basic idea of what's going on - kafka even more so because it's both
13:20justin_smithamalloy: yeah, we end up using zookeeper directly because of this - we get a message via kafka, if the message describes a job to start zookeeper is used to mark the fact that it was started and in case of a system failure another box can pick up the orphaned job
13:20Shayanjmmgaare justin_smith: mgaare is right. redis just holds the offsets on each topic for the consumers
13:20ShayanjmI'd assume that's exactly what zk does
13:20amalloyright. you're just having to rebuild reliability on top of kafka, justin_smith
13:21justin_smithamalloy: right, fair enough.
13:21amalloywhich like, yuck, isn't that supposed to be the point
13:21amalloyjustin_smith: the workaround i used was to instead disable automatic ACKs, and write consumer offsets to zk myself
13:22justin_smithamalloy: to me distsys is like security - we have a huge number of known was to totally fuck it up, a few heuristics for what works better, and a lot of trying and hoping...
13:22justin_smithamalloy: interesting, I'll have to look into that some time
13:22dysfunjustin_smith: pretty much
13:22amalloyi wish hadoop could be described so positively
13:23dysfunyes but it's difficult to even build hadoop, what do you expect? :p
13:24justin_smithoh, reminds me of this tweet from sorenmacbeth yesterday https://twitter.com/sorenmacbeth/status/694679147784765440
13:24mgaareamalloy: what lib are you using to talk to zk?
13:25amalloyi don't remember. zookeeper-clj or something
13:26justin_smithShayanjm: so it sounds like this redis for offsets thing might have legs - but I don't see where it would help with data throughput
13:26amalloyjustin_smith: not related except that it's an image on twitter: https://twitter.com/HenryHoffman/status/694184106440200192
13:26ShayanjmI'm still piecing it together myself justin_smith
13:26justin_smithamalloy: yeah, I retweeted that one
13:28ShayanjmI still can't figure out why the fuck it's hanging with 6 background polling threads
13:28mgaarejustin_smith Shayanjm: I'd be inclined to look at it from a developer and ops friendliness angle rather than throughput/distributed theory. I think redis is a lot easier to work with than zookeeper for both dev and ops.
13:29Shayanjmmgaare: It could be, but for the most part this library has/is trying to abstract a lot of that away
13:29justin_smith/dev/null has a pretty awesome api
13:29justin_smithreally easy to use!
13:29justin_smith:P
13:29dysfunmaybe that's why mysql writes too much data there :p
13:31amalloyi think a lot of people doing distributed stuff have zookeeper already
13:31justin_smithamalloy: and if they don't, they'll probably need it soon
13:32dysfunonly if they're in the habit of shipping in big use-all-the-things tools
13:45justin_smithdysfun: SELECT 0='banana' http://grimoire.ca/mysql/choose-something-else
13:55justin_smithdysfun: looking at irresponsible/emotional - I never know whether to expect someproject.core to contain "the core" as in the definitions that everything in the project uses vs. the top level functionality a client is looking for
13:55dysfunyup
13:55justin_smithmy solution to this is to never have a .core ns
13:55dysfuna blunt instrument, but sure
13:57justin_smithwhat's the rationale for having one? the fact that lein created one? the fact that clojure has one?
14:01amalloythat many other projects have one
14:01dysfunjustin_smith: mostly that single segment namespaces are disapproved of and you need *somewhere* to act as the main point of interaction
14:02justin_smithdysfun: my github group is noisesmith, if I make a new project foo, the top level ns that clients use will be noisesmith.foo
14:02dysfunyeah i thought of that, then though that irresponsible is a long word and i'm lazy
14:02justin_smithif I followed java conventions more closely it would be org.noisesmith.foo
14:02justin_smithhaha
14:03dysfuni wish i was joking. i think :)
14:03justin_smithdysfun: in fact this is what lein does for you if you run "lein new irresponsible/emotional"
14:03dysfunwell i don't apply the group to all of my things
14:04dysfunthings that i don't expect anyone to make use of
14:04dysfunsometimes these get promoted to projects i feel are worth sharing
14:04dysfunthis project started off as "wildebeest" heh
14:05justin_smiththere's also src/foo/foo.clj if you don't want org in the package name, but I like the java style package names more and more too
14:05dysfuni like minimal
14:05justin_smithbut .core isn't minimal, it's just arbitrary
14:06dysfunmostly because i am a bear of little brain and i like to be able to understand my code afterwards
14:06dysfunyes, it's entirely arbitrary. and commonly used
14:06justin_smithdysfun: but we already established .core doesn't provide information - project by project it might be the core definitions other namespaces use, or the top level ns that clients access
14:06justin_smithit doesn't add info, it adds ambiguity
14:07dysfunmaybe i can rename it emotional.to-the-core for you
14:07justin_smithhaha, sorry, I know everyone uses .core and not just you, so I don't mean to pick on you in particular
14:07justin_smithjust giving my case against this convention
14:08dysfuni think i was hoping for something a bit more gripping than conventions
14:08amalloyjustin_smith: do you actually own noisesmith.org? pretty sweet website there
14:08justin_smithamalloy: WIP :P
14:08justin_smithamalloy: I had plans, then I got a job
14:09hfaafbdid you make it with omnext
14:09justin_smithhfaafb: lol
14:09dysfunthat's so web 0.1
14:09ystaelthat's my school of web design
14:10justin_smithdysfun: I can't lie, life as a professional clojure dev is pretty awesome.
14:11justin_smithI have other things I could rant about, but they would be so off topic on this forum...
14:11dysfunconcur
14:11dysfunalthough i'm startuping, so i don't get vast quantities of money deposited in my bank account every month
14:15spuzjustin_smith, whereabouts are you based?
14:15spuz(just wondering what companies are doing clojure out there)
14:15justin_smithspuz: PDX, if you are a clojure dev who can do frontend looking for work send me a DM
14:16spuzwhere is PDX?
14:16dysfunyou should use my frontend library
14:16justin_smithspuz: out here Walmart, Staples, Puppet are all using clojure, plus many a scrappy startup like mine
14:17spuz'here' being?
14:17justin_smithspuz: sorry, PDX is the airport code for Portland, Oregon
14:17spuzah right
14:17dysfunwe'll be hiring a clojure developer this year in amsterdam
14:17spuzi'm based in london but it's interesting who else is doing clojure
14:17dysfuni was in london until last month heh
14:18dysfunthere are a few clojure-using companies in london, but it's not a common tech yet
14:19spuznope
14:20spuzam currently brushing up on clojure to apply for a position
14:20dysfunthe only way to change that is to use it and build software in it
14:21dysfuni find it a bit miserable how many scala positions there are relative to clojure ones. i wish they were more comparable in popularity
14:25dysfunjustin_smith: i've just created a new core.cljc, thought i'd let you know :p
14:25justin_smithhaha
14:27dysfuncore.clj/core.cljs/core.cljc # core.clj.core.cljs.core
14:28justin_smithlol
14:28dysfun^{:doc "Because calling a module 'core' annoys justinsmith"}
14:31ajbHow would you get a value that is in a 2 level nested map while using another top level value from that map as a key for it?
14:31justin_smithajb: with get-in
14:31ajbe.g. {:word "foo" {:terms {:foo "testing :bar "more testing"}}}
14:32hfaafbhe only has the value
14:32ajbwhile using :word as the key to access the string "testing
14:32hfaafboh v0v
14:32ajbv0v?
14:33hfaafbshrug emote
14:34justin_smithajb: that's not a valid hash-map, what would the actual map look like?
14:34ajbsame thing but with the string testing a full string, typo'd and forgot to include the closing quote
14:34ajbso {:word "foo" {:terms {:foo "testing" :bar "more testing"}}}
14:34justin_smithwhat?
14:34clojurebotwhat is short for ,(doc ...)
14:35amalloythat doesn't fix the issue ajb
14:35justin_smiththat's still not a valid hash map
14:35amalloy{:x 1 2} is not good
14:35ajbOH, sorry, wasn't reading it correctly
14:35ajbso {:word "foo" :terms {:foo "testing" :bar "more testing"}}
14:36justin_smith,((fn [m] (get-in m [:terms (keyword (:word m))])) {:word "foo" :terms {:foo "testing" :bar "more testing"}})
14:36clojurebot"testing"
14:36justin_smithI mean I don't know if that helps or not
14:37amalloyalso, strongly recommend against using keywords for keys if it means you'll be converting string<=>keyword to look things up. it sounds like your terms are really just strings
14:37justin_smithI would either use a string as the key in the nested map, or use a keyword as val under :word to avoid the silly keyword conversion though
14:37justin_smithexactly
14:37justin_smithkeywords are not a magic type for hash map keys
14:38ajbso, just use the string?
14:38justin_smith,((fn [m] (get-in m [:terms (:word m)])) {:word "foo" :terms {"foo" "testing" :bar "more testing"}}) ; yeah, like this
14:38clojurebot"testing"
14:45justin_smithdysfun: also on my annoyances list, using keywords as keys in maps when you already had data that made sense (especially horrific keywords like :1 ...)
14:46dysfunyeah, there's no accounting for taste
14:46dysfunyes, keywords are cool, but we got over them years ago, not *everything* must be one
14:47dysfuni do like them
14:48justin_smith,(def annoying-things {:1 (keyword "core cargo culting")})
14:48clojurebot#'sandbox/annoying-things
14:48justin_smith,annoying-things
14:48clojurebot{:1 :core cargo culting}
14:48amalloy,(keyword 1)
14:48clojurebotnil
14:49tolstoyI think that works in ClojureScript (or did at one time). Which caught me "keywording" UUIDs.
14:49dysfun,'((((unnecessarily :nested))))
14:49clojurebot((((unnecessarily :nested))))
14:49justin_smithtolstoy: in my repl it returns nils
14:50justin_smithtolstoy: for both longs and uuids
14:50justin_smith(in my cljs repl that is)
14:50tolstoyAh.
14:50tolstoyMaybe it's fixed, now?
14:51justin_smithI mean it doesn't fail, it just happily returns nil
14:51clojurebotExcuse me?
14:51tolstoySeems like one of the Clojure's allowed it.
14:51justin_smithwhich would still be a bug
14:51justin_smithdepending on how you go on to use the value at least
14:51dysfun,(-> 1 str keyword)
14:51clojurebot:1
14:51tolstoyAnyway, apropos of inapproprite keywording, I was keywording UUIDs which mostly worked, until one of them starting with a number.
14:52justin_smithhaha, must be an old cljs behavior then
14:52tolstoyCould be. It was a long time ago.
14:52dysfunthat's a 10/16 chance. not good odds
14:54tolstoyHm. Keyword (uuid) in regular clojure works just fine.
14:54tolstoy:17faa74a-c108-4139-aa5e-1e09d8f004b2
14:54justin_smithtolstoy: happily returns nil, I mean that won't be correct code
14:55justin_smithwait, what clojure version does that?
14:55tolstoy1.8
14:55justin_smith,(keyword (java.util.UUID/randomUUID))
14:55clojurebotnil
14:55justin_smithtolstoy: citation needed
14:55justin_smithwas it actually a keyword?
14:55tolstoy,(keyword "2")
14:55clojurebot:2
14:55justin_smithtolstoy: I mean was it actually a uuid?
14:55tolstoy(keyword "17faa74a-c108-4139-aa5e-1e09d8f004b2")
14:55tolstoy,(keyword "17faa74a-c108-4139-aa5e-1e09d8f004b2")
14:56clojurebot:17faa74a-c108-4139-aa5e-1e09d8f004b2
14:56dysfunyes, that's a string
14:56Bronsa,:2/consistency
14:56clojurebot:2/consistency
14:56justin_smiththat's not a UUID, that's a string
14:56tolstoyRight.
14:56Bronsa,:2/3
14:56clojurebot#<RuntimeException java.lang.RuntimeException: Invalid token: :2/3>
14:56dysfunstrings will keywordify quite easily
14:56tolstoySo, keywords can begin with a number?
14:56RedNifreClojure newbie here. If keywords can be arbitrary strings, why would I use them instead of strings?
14:56Bronsatolstoy: no pls
14:56dysfunthe problem isn't keywords, it's that the keyword function doesn't convert numbers to keywords
14:56Bronsait's just an accident
14:57Bronsadysfun: why should it?
14:57tolstoyBronsa: Right. But it "works" in Clojure, not in ClojureScript?
14:57dysfunBronsa: i didn't say it should :)
14:57Bronsatolstoy: a lot of things "work" in clojure, doesn't mean you should use them
14:57justin_smithRedNifre: keywords should be used when the data "stands for itself" and isn't meaningful as a string.
14:57justin_smithRedNifre: if it exists only as a key in a map or a special arg to a function, and you won't need string operations
14:58tolstoyBronsa: I'm not at all advocating that we should. In fact, I was supporting the idea that not everything should be a keyword by mentioning how I got screwed.
14:58justin_smithRedNifre: also, the keyword function accepts all kinds of crap that isn't valid in keywords, and will generate invalid keywords, it does no validation for correctness
14:59Bronsatolstoy: sorry, I chimed into the conversation after it had started and I missed that :)
14:59justin_smith,::1 :P
14:59clojurebot:sandbox/1
14:59Bronsa:(
14:59justin_smithyeah, it's sad that that works
14:59tolstoyBronsa: I don't have a CLJS repl handy, but it might actually balk at (keyword "2akjdas").
15:00justin_smithtolstoy: my cljs repl thinks that is just hunky dory
15:00Bronsait doesn't
15:01justin_smith~keyword is gigo
15:01clojurebotYou don't have to tell me twice.
15:01tolstoyOkay. Maybe it used to? Anyway, I swear I was bitten using keywords build from the string representation of a UUID.
15:02justin_smith,(keyword (pr-str #uuid "a02a5e9a-34bf-4175-b0fa-76b5a6597a87")) omgbarf
15:02clojurebot:#uuid "a02a5e9a-34bf-4175-b0fa-76b5a6597a87"
15:02RedNifrejustin_smith I'm not sure I understand. I interpreted keywords as values of a global enum, so I'm surprised that you can create them dynamically with the keyword function. When would you turn strings into keywords or create keywords programmatically?
15:03justin_smithRedNifre: people like to do this when consuming json. I actually think this is a terrible idea since many valid json keys are not good keywords, but it's popular to do
15:04tolstoyI bet it's popular because it just looks better in the code. (:id (str->json blob))
15:04justin_smithRedNifre: my take is that when doing this people are letting aesthetics or an odd sense of convention eclipse common sense
15:05dysfuni actually quite like it, because if the structure has been validated, you can easily query it (keywords as functions)
15:05dysfunbut in this case you're free to only choose keywords that make sense
15:06RedNifreI guess it's a good idea if you are sure that the JSON keys can be valid clojure keywords, huh?
15:06dysfunas always, check your input
15:06justin_smithRedNifre: there's room for intellegent developers to disagree there.
15:07justin_smithit's also a bunch of work done for a small benefit, creating a whole mess of keywords which takes more time than parsing the json does, just so you can use one or two of them in pretty code.
15:08RedNifreI'm a clojure beginner so I don't see the problem with turning JSON objects into clojure dictionaries where the keys are keywords, please enlighten me :)
15:08dysfunrage against the machine, justin_smith
15:08justin_smithRedNifre: because there are valid json keys that are not valid clojure keywords, and generating all the keywords takes more time then parsing the json does
15:09justin_smithbut like I said, there's room for intelligent developers to disagree here, so whatever
15:09tolstoyRedNifre: For me, anyway, the only problem with keywording json docs is when doing so is more than just a flag on your converter.
15:09dysfundamnit, i was just making popcorn
15:10RedNifreNah, I agree that it's bad if there are JSON keys that aren't valid keywords. That's why I qualified it "when you are sure"
15:10tolstoyRedNifre: Like undoing CamelCase to camel-case, etc, etc.
15:10dysfuntolstoy: camel-snake-kebab
15:12RedNifreWhy does clojure use the dash style instead of camel case?
15:12dysfunbecause it's easier on the eyes
15:12justin_smithRedNifre: historical reasons, and we think it's more readable
15:13tolstoyIMHO, because it's easier to read, but also because it can. No "infix" notation.
15:13tolstoyfoo-bar doesn't mean foo minus bar.
15:13dysfunthe range of characters allowed in symbols helps make clojure very readable
15:13justin_smithRedNifre: LISP was originally meant to be a parsed internal representation that programmers would not use directly, so it doesn't really support much syntax
15:14justin_smithand we borrow heavily from that tradition
15:14RedNifrePersonally I find it harder to read because the dash looks more like a space than a camel case capital letter does but maybe I just need a font with thicker dashes.
15:14justin_smithRedNifre: or it could be you are used to languages where - is not word-constituent?
15:14tolstoyMy issue with CamelCase is its easy to FatFInger.
15:15justin_smithI find it kind of headache-inducing to read
15:15justin_smithit's telling that we don't write that HeadacheInducing
15:15dysfunjustin_smith: i use camelcase for protocols and records. feel sick yet? :p
15:16justin_smithdysfun: that's where camelcase is expected
15:16justin_smithdysfun: since you are naming java classes
15:16justin_smithanything else would be annoying actually
15:16dysfundamnit, you're supposed to disapprove
15:16RedNifre(a-b c d-e-f g h) vs (aB c dEF gH) it's easier for me to see that the second list contains 4 things but you're right, it could be a habit.
15:17justin_smiththe first one contains 5 things
15:17dysfunexcept they're rarely two characters long
15:17sdegutisjustin_smith: what do you think of this idea?
15:17dysfunreal-world example i'm writing just now. PassLocked vs pass-locked
15:18sdegutis(ns myapp.routes.order.orderid%) (defn invoice [request] ...) ;; becomes "/order/:orderid/invoice"
15:19sdegutisOr how about (ns myapp.routes.order) (defn orderid%invoice [request] ...)
15:19justin_smithsdegutis: I don't like it at all!
15:20sdegutisWhy not?
15:20justin_smithmagic
15:20sdegutisIt wouldn't be dynamically found out. It would be, you'd have 'myapp.routes.order in your list of routes, which finds the namespace object and gets the info from that.
15:20dysfunyeah but it's specialcase for things that followed the expected rest routing
15:20justin_smithsdegutis: that's still magic
15:21dysfunand you always get edge cases in real world systems
15:21sdegutisIt just feels too repetitive though, to always type (ANY "/order/:orderid/invoice" [request] ...) when I'm already in the myapp.routes.order namespace.
15:21justin_smithwould creating the route automatically require?
15:21dysfuni mean if it were a macro i'd be okay with it
15:21justin_smithboth yes and no lead to problems
15:21sdegutisjustin_smith: nothing is automatically required
15:21sdegutisbut yeah I think I see your point
15:22dysfunsdegutis: there is a macro for that in compojure as well, context
15:22nkhodyunyasdegutis: which library is that?
15:22dysfunso it's down to once
15:22sdegutisdysfun: it's more that I don't want the repetition between the namespace and the route path.
15:23dysfunbut in my experience it's handy to be able to throw a few isolated handlers into one namespace for organisation
15:23dysfunirrespective of url
15:24dysfunthere's a point at which something turns from a library to a framework. i like the former, i grudgingly use the latter
15:24justin_smithsdegutis: in my experience silly things like client aesthetic choices mean that routes change, and I don't want that to have any effect on my code, ideally all info about routes is totally separated from the code itself and I use bidirectional routings to figure out where my endpoints go
15:24dysfuni think it's the point where you invert control
15:25sdegutisjustin_smith: good point
15:25dysfunjustin_smith: because obviously /node/3456 is a great url!
15:26justin_smithdysfun: ?
15:27sdegutisjustin_smith: thanks for helping me see that more clearly, I dunno what's wrong with my judgment today :/
15:27dysfunaesthetic choices in urls are potentially valid usability concerns
15:28justin_smithdysfun: right, I have a huge respect for that, which is why I want URL structure to be totally decoupled from my code's logic, so that we can swap endpoint names arbitrarily without breaking code
15:29justin_smithnames, structure, the whole deal
15:29dysfun'silly things' was what i was objecting to
15:30justin_smithdysfun: oh, the decoupling is implemented because it could increase usability, but in practice the changes are silly and rarely actually do increase usability, that's just the cynical side coming out
15:31dysfunoh i know, i used to work in marketing and you know what marketing people are like ;)
15:31justin_smithbut it is true, I was likely overly dismissive there
15:31justin_smithhaha
15:31justin_smithdysfun: my product is a tool for marketers, so :P
15:31dysfunfun fun fun :)
15:31dysfunany of them want to help a struggling startup for free?
15:35Shayanjmjustin_smith: I figured it out and this kafka-clj thing is pretty sweet
15:35justin_smithShayanjm: interesting.
15:35Shayanjmit has some assumptions baked in about how you use kafka (i.e: message frequency) for optimization purposes
15:35Shayanjmbut nothing you can't fiddle with
15:36Shayanjmthat's why I was experiencing hanging earlier - a few settings regarding message chunking on the consumer end
15:36justin_smithregular kafka has a config for how long you buffere messages to combine then on a topic
15:36justin_smiththat's a pretty larg default buffer
15:37justin_smithis it configured by size or time?
15:37ShayanjmSize with a timeout I believe
15:37Shayanjmso if it doesn't hit size x by time y it still fires off
15:38Shayanjmit's # of messages on 'size'. It basically accumulates messages and delivers them in chunks as 'work-units'
15:39ShayanjmThe default out of the box is 100k messages to be consumed per 'work unit'
15:39justin_smithwoah
15:39Shayanjmyeah, I think the author was assuming you don't batch inside the messages
15:40Shayanjmso each "message" is a basic record
15:41Shayanjmbut you can change that in the consumer config, I just set it to 1 for testing purposes. Fired off two messages and could iterate over a lazy-seq to find them
16:08zipperHey a good resource for learning clojure coming from haskell?
16:08justin_smithzipper: Joy of Clojure is good, as is Clojure Applied
16:08justin_smithzipper: once you grok the non-syntax it should come pretty easily
16:08zipperjustin_smith: Thanks
16:09zippernon syntax?
16:09zipperYou mean like python?
16:09justin_smithzipper: python has a lack of delimiters and a lot of syntax, clojure has a lack of syntax and a lot of delimiters
16:10devth__not really a clj question, but noticed lein projects follow the convention: why are docs markdown files UPPER_CASE.md ? some gnu convention?
16:10justin_smithzipper: point being that (f arg another-arg) is the structure of just about everything in clojure, with a small set of exceptions that don't take long to learn.
16:11justin_smithsure, we have syntax, but we get as close to not having one as you can get
16:11sdegutisHi.
16:11sdegutisIs anything shaking?
16:13zipperjustin_smith: Okay that's interesting. So delimiters == brackets
16:13justin_smith() {} [] right
16:13zipperjustin_smith: It's a lisp :D
16:14justin_smithzipper: right this whole delimiters instead of syntax thing is something we borrow from lisp
16:14justin_smiththe origing LISP was meant to be a direct representation of program structure, and not a syntax humans would use, but as we all know usage evolved otherwise
16:15justin_smithso the tradeoff is that due to using delimiters explicitly it is very easy to use and manipulate data literals representing source code, the whole macro thing
16:18zipperI guess after learning clojure reading SICP will be easy :)
16:19justin_smithzipper: in fact people have translated parts of SICP to clojure- but SICP is not especially functional and doesn't expose the interesting parts of clojure
16:20seubertjustin_smith: what are the interesting parts
16:20seubertthat you're referring to, I mean
16:20seubertthat's a broad question :P
16:20justin_smithseubert: using immutable values across multiple threads
16:21justin_smithbeing able to use persistent data structures where "modification" doesn't alter the original, nor does it require doing a full copy of the original
16:23justin_smithseubert: and pragmatically, if clojure is used well, large code bases where you don't have to deal with "spooky action at a distance" - things that would effect the result of a given function are explicitly visible where the function is defined and used and you don't have to go hunting for magic
16:23seubertI see
16:23sdegutis3spooky5me
16:34justin_smithsdegutis: you have been spooked by a spoopy clojure, :DOOT
16:34sdegutis:D
16:36sarcherIs clojure well suited for writing code that reads from / writes to sockets?
16:37justin_smithsarcher: we've got some good libs for it
16:37sarcherI've dabbled in clojure from time to time, but it hasn't "stuck" yet.
16:38justin_smitheg. ztellman's gloss for packing data into streams of bytes, and manifold for pushing those streams around
16:38sarcherI haven't had the aha moment.
16:38justin_smithOK
16:38justin_smithsarcher: what have you wanted to do with raw sockets in clojure?
16:38sarcherI work for a company that has a socket-based API for real time data.
16:39sarcherI'd like to write a consumer that receives that data, maintains state based on it, and ultimately displays it on a web page.
16:39rhg135even plain interop isn't too bad if not doing nio
16:39sarcherI have a working version written in node, but i'd like to implement with clojure to learn more about the language.
16:40sarcherTechnically written in javascript on node.
16:40justin_smithso two node instances communicating over sockets?
16:41sarcherSomething like that, yes
16:56sdegutis,(let [[a b :as c] nil] [a b c])
16:56clojurebot[nil nil nil]
16:58noncom|2i am creating a 1-page app with clj+cljs and i have the "#/page" style nav in the app. ok, now i want to send notifications to users which have links to access a specific "#/page/1234-some-id-1233" how do i do this?
17:00noncom|2if i just give them regular link, like "http://address/page/id&quot; then the rest of the in-app nav goes crazy with "http://address/page/id/#/the-rest-of-the-nav-system-is-now-here&quot; instead of "http://address/#/the-correct-nav-behavior&quot;
17:08justin_smithnoncom|2: link to http://address#/page/id
17:11noncom|2yes, probably you are right.. i have to rewrite page allowance mechanism to allow this
17:14noncom|2justin_smith: hmmm for some reason the reagent.session does not recognize the page.. it says the page is nil, though i have "/invitation/:id" in the routes now
17:15justin_smithnoncom|2: are you sure the router is set up to route on the fragment?
17:15noncom|2it does ok for in-app nav, but simply going to a in-app link from nowhere lands me on page nil which in my app redirects to login
17:17noncom|2justin_smith: hmmm, well, i have it specified in the routes just the same way as the rest of the routes...
17:18noncom|2justin_smith: oh, it works
17:18noncom|2cache problems again!
17:18noncom|2damn, there seems to be simply NO WAY to ensure that page cache is cleared...
17:19noncom|2i press the ctrl+f5 for the 5th time and miracously on the 5th time it decicdes to finally clear the cache and rebuild and reload all
17:25justin_smithwith figwheel it will push your new code as you save it
17:49sdegutisHi.
18:16sdegutisjustin_smith: what do you think of (for) taking an optional final argument which is executed when the seq is empty and there's nothing to enumerate?
18:16sdegutis(for [user users] (user/email user) ["n/a"])
18:16sdegutisI don't like this idea but I want to hear what you think.
18:16sdegutisBecause who knows, maybe I should like it?
18:27arrdemsilly idea.
18:28arrdemfor is a lazy/pure sequence comprehension expression.
18:28arrdem"on the first element" "on the nth element" "on the last element" are pretty imperative concepts/states
18:28arrdemno doubt you could do it with CL's for macro, but that macro has very very different goals.
18:35CaptainLexarrdem: I am on the edge of my seat!
18:38arrdemCaptainLex: uh... why?
18:38CaptainLexarrdem: I am waiting for the silly idea! Unless you unveiled before I logged on and you were just explaining it retroactively
18:38justin_smitharrdem: because that's next to "the last element" which he was on before, I think
18:39CaptainLexAhhhhh okay
18:39CaptainLexI just walked in at the wrong time
19:02zoitehi, i'm trying to use korma to select items in a table but with the were get populated from a loop but it doesn't seem to be making the query right and was checking if anyone could point me in the right direction? http://pastebin.com/tzMnwh9N
19:03justin_smithzoite: map with one arg is probably not what you want here
19:04zoiteOk, sorry I'm new to clojure, what should I be using instead?
19:04justin_smithzoite: noticfe in the dry run that where you should have a parameter vector for the parameterized query you instead have a function, returned by map when it only has one arg
19:04justin_smithzoite: you should provide a second arg to map, the collection it should map across to create your query
19:05justin_smith,(map inc)
19:05clojurebot#object[clojure.core$map$fn__4781 0x19d34ba0 "clojure.core$map$fn__4781@19d34ba0"]
19:05justin_smith,(map inc [1 2 2])
19:05clojurebot(2 3 3)
19:05justin_smiththat's the difference
19:05zoiteoh ok
19:05zoiteI just need to loop over the key/value. originally I tried a for loop but then I learned that doesn't return anything
19:06justin_smithif we were like racket we would have a "beginner mode" where map always needs at least two args :0
19:06amalloyprobably exactly two tbh
19:06justin_smithzoite: for isn't a loop, and it does return something, in fact it is designed for returning lists
19:06justin_smithamalloy: yeah, makes sense
19:06zoiteoh
19:07justin_smithzoite: doseq on the other hand, is for side effects and returns nil (but still isn't really a loop)
19:07zoiteoops yeah I meant doseq not for
19:07justin_smithright - changing the doseq to for might have been simpler (probably would have given you easier to read code)
19:08justin_smithbut map works too if you provide the args needed
19:08amalloyspeaking of map int, last night i introduced some clojure guys at work who are doing js at the moment to the beauty of ["1", "23", "10"].map(parseInt)
19:08amalloyif you're not excited enough to run that in your chrome console, the result is [1, NaN, 2]
19:08justin_smithhaha, wow
19:09justin_smithwhat the hell is that even doing?
19:09amalloymake up some more example inputs and try to figure out the pattern
19:11amalloyhint: an exciting slight change to the input: ["1", "23", "10", "112233445566"].map(parseInt) // [1, NaN, 2, 44]
19:11hfaafb:D
19:12justin_smithI'm still not seeing it, sorry...
19:14amalloywell, it's a puzzle! i can't give out spoilers
19:17hyPiRionamalloy: oh, that is just plain evil
19:17amalloyhyPiRion: my posing the puzzle is evil, or you found the answer and it's evil?
19:18hyPiRionamalloy: the answer
19:18amalloysrsly
19:24zoitejustin_smith: I tried changing it to use 'for' but it's giving back clojure.lang.LazySeq, not sure how to get past that http://pastebin.com/vjhE86j0 sorry
19:25hiredmanzoite: you are creating a collection of things, and the dsl just doesn't know how to handle a collecction of things like that, so it doesn't matter how you create the collection
19:25sdegutisarrdem: good point
19:25justin_smithzoite: you changed a couple of things there I think - wasn't there an "and" before? also ((first x) [like (second x)]) is not likely to return anything useful
19:25zoitehiredman: oh, so it's not going to work?
19:25zoitejustin_smith: ya, I added in the and and it just gave back: "SELECT `test`.* FROM `test` WHERE ((NULL, NULL))"
19:26sdegutisDatomic is so cool.
19:26hiredmanif you look at your previous usage of the dsl, when you pass literal things to the dsl (and {...} {...}) you are not passing a collection of maps
19:27zoitewell i'm trying to turn the loop into how I ran it manually, just not sure how to do it
19:27hiredmanyou need whatever the dsls version of 'apply' is
19:29zoitei'm looking through the documentation but I don't think it has one
19:37rhg135does lein trampoline not start nrepl?
19:45justin_smithrhg135: I don't think it does, no, with nrepl you need the two jvms, client and server
19:46justin_smitherr... wait no it's saying nrepl in the boot splash
19:47rhg135yeah... that's what confuses me
19:47justin_smithbut also it seems not to have opened a port
19:47justin_smithso that part of the splash is lying?
19:47rhg135exactly
19:48justin_smithrhg135: lein trampoline repl :headless opens a port and then provides no repl, as expected
19:48justin_smith(I mean you would get a repl on that port, but not in that terminal)
19:49rhg135oh cool then, thx
19:49rhg135this should be documented somewhere
19:50justin_smithrhg135: yes, it should
19:54rhg135meh, I prefer to launch a client even if it takes much longer
19:59rhg135justin_smith: the part that's strange is what is it doing normally? afaik you can't use nrepl without a server.
19:59rhg135the splash is a lie
20:00justin_smithyeah, I think the splash is a lie
20:00justin_smithrhg135: it would be cool if trampoline repl made it start the server and client, both in the same vm
20:01justin_smithwhich more closely matches the expected features of both the trampoline prefix and the repl command
20:13turbofaili made a thing in clojurescript
20:13turbofailhttp://funkenblatt.github.io/coriolis/
22:28marcfontaineis there a more functional way to write the loop ? https://gist.github.com/marcandrefontaine/103e4d2200e19eb6d5a8
22:42justin_smithmarcfontaine: the only thing I would fix is the dangling parens
22:45marcfontainejustin_smith: oups, thanks.