#clojure logs

2016-05-21

00:41tolstoy,(map type (map quote [1 2 *]))
00:41clojurebot#error {\n :cause "Unable to resolve symbol: quote in this context"\n :via\n [{:type clojure.lang.Compiler$CompilerException\n :message "java.lang.RuntimeException: Unable to resolve symbol: quote in this context, compiling:(NO_SOURCE_PATH:0:0)"\n :at [clojure.lang.Compiler analyze "Compiler.java" 6688]}\n {:type java.lang.RuntimeException\n :message "Unable to resolve symbol: quote in this...
00:42tolstoy,(map type (map #(quote %) [1 2 *]))
00:42clojurebot(clojure.lang.Symbol clojure.lang.Symbol clojure.lang.Symbol)
03:20DoubleManFreeware Videogame for windows http://www.indiedb.com/games/unlimited-runner/downloads/unlimited-runner-v10
03:22dysfun,(map type '[1 2 *])
03:22clojurebot(java.lang.Long java.lang.Long clojure.lang.Symbol)
03:22dysfuntolstoy: ^^
03:22tolstoyEh?
03:23dysfuni admit i was confused for a moment by the output of yours til i ran it through in my head
03:23tolstoyI was just wondering if quoting a vector quoted each element of the vector.
03:24tolstoy,(+ '1 '2)
03:24dysfunyes, but it won't change the type of it if you do it like i did
03:24clojurebot3
03:25tolstoyRight. My attempt was to see what _would_ change the type of it.
03:25DoubleManFreeware Videogame for windows http://www.indiedb.com/games/unlimited-runner/downloads/unlimited-runner-v10
03:25dysfun(map type '['1 2])
03:25dysfun,(map type '['1 2])
03:25clojurebot(clojure.lang.PersistentList java.lang.Long)
03:25dysfunwut?
03:26tolstoyHuh.
03:26dysfuni don't even...
03:26dysfun,(type '1)
03:26clojurebotjava.lang.Long
03:27dysfun(type (first '['1]))
03:27dysfun,(type (first '['1]))
03:27clojurebotclojure.lang.PersistentList
03:28tolstoyMaybe it expands '1 to (quote 1) then quotes that, so it's a list?
03:29dysfun,'['1]
03:29clojurebot[(quote 1)]
03:29tolstoy,(type '(quote 1))
03:29clojurebotclojure.lang.PersistentList
03:39TEttingerwowza. wowza. bo-bowza. I need to test Clojure and Lein with this, but I'm getting what appear to be much better startup times using a subset of the modular JRE from JDK 9
03:39TEttingerhttp://zulu.org/zulu-9-pre-release-downloads/
03:39dysfunsweet :)
03:40TEttingernot quite instant with a GUI app, but much better than Zulu 8, which is basically the same as Oracle Java 8
03:40dysfunthe gui stuff is huge
03:40TEttingerI have a compact1 profile that's 20 MB
03:40TEttingermaybe 30, not sure
03:40TEttinger30
03:42dysfuni know some people who deploy a compact1 to production
03:42dysfunas an 'agent' process
03:45tolstoyWhat does that modular stuff mean? A smaller set of classes such that it doesn't take as long to find the one you want to load?
03:46TEttingerI know only that it allows you to make smaller JREs for distribution, which is very relevant on Mac's App Store
03:46dysfunessentially there are three compact build profiles. each one has progressively more of the stdlib included
03:46TEttingerI think it also helps with speed, though I didn't expect it to
03:46TEttingeroh no
03:46TEttingernot that dysfun
03:47TEttingerthat's the "baby's first project jigsaw" that they were making for JDK 8
03:47dysfunand as i recall, a compact profile has fewer problems with distribution rights
03:48tolstoyWhy would fewer classes make things faster?
03:48TEttingercompact3 doesn't have AWT or Swing, for example. I just successfully used a module for desktop and base only, I made it with this command
03:48TEttingerbin\jlink.exe --exclude-files=*.diz --vm=server --modulepath jmods/ --addmods java.desktop --output ../desktop/
03:48TEttinger(windows)
03:48dysfunwell they've since expanded the build profiles so it's not just libraries but configuration
03:48dysfuni don't know how far down the rabbit hole they've gone though
03:48TEttingerjava.desktop actually has less than compact1 by default, you can easily add compact1 in it
03:49TEttingernot sure what the difference is between base and compact1
03:53TEttingeroh nice. "bin\java -jar leiningen-2.6.1-standalone.jar" starts up in under a second, and this computer has a rather worn-out HDD
03:53TEttingerthat's with a compact3 JRE
03:54tolstoyDo you need a JDK with lein to compile stuff?
03:54TEttingernot sure!
03:54TEttingerjavac isn't in this... or is it...
03:55TEttingerIlikethisanother.gif
04:07TEttingerso in lein, how would I print the classpath?
04:07dysfunlein cp
04:17TEttingerdamn... `lein` gives a huge stacktrace. Caused by: java.lang.ClassNotFoundException: sun.misc.Launcher
04:19TEttingersun.misc should be present...
04:34TEttingerit seems it's present but no longer public on Java 9
04:38dysfunyay!
08:06dimon_after I compile my app with "lein uberjar", I get 2 files my_app.jar and my_app.1-0.1.0-SNAPSHOT.jar
08:06dimon_what's the difference between them?
08:06dimon_which one should I deploy to a server?
08:07dimon_my_app.jar is 8 times smaller
08:10Empperidimon_: uberjar
08:10Empperithe larger one
08:11Empperithe difference is the larger one has all it's dependencies included
08:11dimon_I see, thx.
08:11Empperithe smaller one has none, you'd have to include those as separate jar packages and include them via classpath in order to execute your application
08:12Empperimight make sense if you'd have tons of applications running in the same server which used the exact same dependencies
08:12Empperi*might*
08:12Empperiyou could end up in trouble when updating one of the apps and bumping dependencies for that - then all of your apps would get the dependencies udpated too (after reboot)
11:16Furranehello
13:23msenolhi guys
13:23msenolcan someone help me to call this code in clojure REPL?
13:23msenolhttp://stackoverflow.com/a/20517459/2760951
13:24msenolI am new to clojure, I don't know much about java interop
13:25ridcully_something along: (.browse (Desktop/getDesktop) (.toURI thefile))
13:25msenolok thx ridcully_
13:26dysfunand (File. my-uri)
13:26msenolok one more question
13:26msenolhow can I import Desktop in REPL?
13:27dysfundo you know the full class name?
13:27dysfun(import '[foo.bar.ns Desktop])
13:27msenoljava documentation says full class name
13:27msenoljava.awt.Desktop
13:28dysfun(import '[java.awt Desktop])
13:28msenolwow it is working. thx a lot dysfun
13:28dysfunnp :)
14:21Gh0stInTheShellSo I have this program here: http://pastebin.com/5DCMjmbP
14:22Gh0stInTheShellI made it myself and it's not very good. The algorithm for finding pi is optimized but intentionally horrible.
14:22Gh0stInTheShelland when I run it on the jvm it pauses noticably for depth values of 5000
14:23Gh0stInTheShellbut when I run it with a depth of 50 million on clojurescript it takes 300 msecs
14:24Gh0stInTheShellHello ClojureScript!
14:24Gh0stInTheShellcore.cljs:150 "Elapsed time: 301.400000 msecs"
14:24Gh0stInTheShellcore.cljs:150 3.1415926735902504
14:24Gh0stInTheShellAnd so that is blowing my mind a little bit.
14:25dysfuntry running it with reflection warnings enabled and see if you get any enlightening messages
14:25dysfunif not, it's going to take a while to analyse and figure out what's supoptimal
14:26Gh0stInTheShelldysfun: For the JVM?
14:26dysfunyes
14:27Gh0stInTheShellOKay will check that out
14:27Gh0stInTheShellThe algorithm is bad on purpose, didn't expect cljs to handle it either
14:27Gh0stInTheShellcljs is so fast it fixes bad *algorithms* ;)
14:28dysfuni expect when you run with reflection warnings you will see what it is so much slower
14:28Gh0stInTheShellokay checking it out
14:28dysfuncljs will not have to pay those penalties
14:28ridcully_JS only has one number format. java many. as dysfun suggested, you might have to dig deeper into what is happening behind the scenes
14:29Gh0stInTheShellBut, I mean, my function is written as pure Lispy as I could make it, had to use recur. It frightens me to have to worry about all this Java stuff ;)
14:30dysfunclojure had to make a few compromises to sit on top of the jvm
14:30Gh0stInTheShellI'm exploring and I thank you all for your direction and will look into what slows it down on the JVM.
14:30Gh0stInTheShell:)
14:30dysfunthings getting unneccesarily boxed by default was an important one
14:31dysfunreflection was another. the java compiler will never generate a reflection lookup unless you manually write the code for it
14:31dysfunbut we wanted to have a nice dynamic language where things just work
14:31dysfunand the cost of that is that occasionally they don't and it's a pain in the arse figuring out why
14:32Gh0stInTheShellWell, you have that (a nice dynamic language where things just work). I <3 Clojure. It is one of my 5 pillars of world domination.
14:33Gh0stInTheShellNow if I could just learn the stuff. :)
14:33dysfunthere are much better resources these days than when i learned clojure
14:33dysfunwhere are you learning from?
14:33Gh0stInTheShelldysfun: My mind. The docs
14:34Gh0stInTheShelldysfun: Talks at Clojure West and Clojure Conj and Strange Loop
14:34dysfunthe docs aren't really of the quality we'd like them to be yet
14:34Gh0stInTheShelldysfun: on youtube mostly but sometimes in person
14:34Gh0stInTheShelldysfun: They're okay :)
14:34dysfuni find some of those talks great for e.g. trying to understand what a single library is about
14:34dysfunbut i don't know about learning clojure from them
14:35Gh0stInTheShellOr making robots fly around in my unicorn editor!
14:35dysfunyou could read some code :) here's some of mine https://github.com/irresponsible/
14:35Gh0stInTheShellWell I know lisp and scala and java and stuff, clojure seems to be coming pretty naturally
14:35Gh0stInTheShellI read code
14:35Gh0stInTheShellto help
14:37Gh0stInTheShellBUt I really might just be becoming a cljs programmer because I like the speed of javascript but hate the language itself. And I know how lots of people feel about that in this channel and I'm okay with that and unwilling to abandon a possible way for me to stop writing java for work also.
14:37Gh0stInTheShellThe trouble with the java I write for work is it's all for Dalvik/ART
14:37Gh0stInTheShellBut Clojure proper still might bail me out. ;)
14:38vermiculushi all :) question: what's the convention in clojure for testing your test suite?
14:38dysfunif you have to use the jvm, clojure is absolutely my favourite tool
14:38ben_vulpesvermiculus: testing your test suite?
14:38dysfunvermiculus: do you mean "running your tests"?
14:38vermiculusdysfun: nope…
14:38vermiculusi.e. I have a few small functions that I use in my tests to make them readable
14:39vermiculusideally, I need to be able to test that they work
14:39dysfunoh. just write the tests afterwards
14:39ben_vulpesstick them in test/project/test_util.clj
14:39ben_vulpesthen write test/project/test_test_util.clj
14:39ben_vulpes... (:require test-util)) (deftest test-my-util-fn ...)
14:39tolstoyIf the test-utils are used in lots of tests, isn't that good enough?
14:39dysfunyes yes, very silly
14:39vermiculusben_vulpes: yeah, I was thinking something along those lines
14:39Gh0stInTheShellbut who tests the tests fot the tests?
14:40Gh0stInTheShells/fot/for
14:40vermiculusGh0stInTheShell: good point; we must go deeper!
14:40ben_vulpes"my tests are the integration tests for my test utilities"
14:40Gh0stInTheShell(inc vermiculus)
14:40dysfuni see all of these crap jokes i've heard a million times and they make me feel old
14:40vermiculusdysfun: they never get any less funny for me :)
14:40Gh0stInTheShelldysfun: If you've heard them a million times you are old
14:40dysfuni'm not even old.
14:41Gh0stInTheShell:)
14:41vermiculus,(/ (* 3 1000000) 60 60 24 7 364.24)
14:41clojurebot0.013618266693162365
14:41tolstoyI kinda lean towards tbaldridge's stance: test the interfaces of the large-grained concerns.
14:41Gh0stInTheShellThey never get old for me either. Especially if they're about recursion or self-referentiality. Or Unix/Linux. :)
14:42vermiculustechnically, dysfun doesn't have to be more than a year old.
14:42dysfuni heard a particle physicist joke the other day. it was even worse
14:42vermiculusdysfun: ooh, do tell :)
14:42dysfuna higgs boson went to church but was stopped at the door by the minister. "i'm sorry, but you can't visit mass" "but i am the creator of all mass!"
14:43vermiculuso
14:43vermiculusthat's bad
14:43dysfunyes, it is very bad
14:43vermiculusXD
14:43tolstoyMaybe remove the punchline and it's slightly better?
14:43dysfuni was waiting for the punchline for a few seconds before i realised it wasn't coming
14:44dysfunor "cat-ions are puss-itive" is pretty bad too
14:45Gh0stInTheShelllol
14:45dysfunno. that was many things but it was not lol
14:45Gh0stInTheShelllmao
14:46Gh0stInTheShellliterally about to fall out of the chair
14:46ben_vulpeswhere do you find the answers for your chem homework?
14:46ben_vulpesin the solute-ions manual
14:49TimMcThough... testing the tests sometimes does reveal scary things.
14:49vermiculusTimMc: how so?
14:49TimMc*cough*midje*cough*
14:49dysfunactually, rewriting midje tests in clojure.test has put me off midje
14:49vermiculusmidje?
14:49clojurebot#<RuntimeException java.lang.RuntimeException: Invalid token: :>
14:50TimMcI still like midje, but some of the behavior is a little too unintuitive.
14:50dysfunthere were way many more failures than i expected, and i don't mean in my new tests
14:50ben_vulpesTimMc: does midge still do that thing where it runs the tests on compile?
14:50TimMcYes.
14:50ben_vulpesfuck
14:50ben_vulpesthat
14:50ben_vulpesnoise
14:51TimMcI feel like it could very easily be switched to not do that.
14:51TimMcdysfun: Midje tests are like (fact ...) at the top level, and that's when they execute their bodies -- unlike clojure.test's deftest, which is defined and then later called.
14:52dysfunyes. why is this a problem?
14:52Gh0stInTheShell,(double (pi 50))
14:52clojurebot3.16119861298705
14:52TimMcIt means, among other things, that you cannot skip a test or run just one very easily.
14:52Gh0stInTheShell,(double (pi 500))
14:52clojurebot3.143588659585787
14:52TimMc tihnk it also means you cannot load a midje test file for analysis without running the tests.
14:53dysfunclojure static analysis is a joke anyway
14:53TimMcNo, I've gotten good use of eastwood, or tools to map the namespaces and var usages.
14:54dysfunhrm. well those won't be needed on your test suite anyway
14:56TimMcNot true.
14:57TimMcJust because you don't use static analysis doesn't mean it's a good idea to make an entire toolset difficult to use.
14:57TimMcWe can't always know in advance what we want...
14:57dysfunthat is true, but i've tried static analysis of clojure a few times and i've never found it adds a great deal
14:58TimMcI have a tool that, given a git diff, shows me a visual graph of the namespaces involved.
14:59TimMcI use that when I'm reviewing a pull request because it allows me to start with the low-level changes and work my way up.
14:59dysfuntools.namespace can do that and i'd hardly call what it does static analysis
14:59TimMcIt involves loading clojure files.
14:59TimMcYou're the one that called it static analysis. :-P
14:59dysfunand reading a single form out of them...
14:59ben_vulpesmidge + reloaded is an utter misery.
15:00TimMcI'll be expanding the tool to include var dependencies.
15:00ben_vulpesmoreover running /all of an ns' tests/ on compile is a similar misery.
15:01ben_vulpesalso it's another cutesy test runner, which i'm just sour on in principle.
15:01TimMcno wait
15:02TimMcThe thing I'm doing will not involve loading the files, it really is static analysis and this is irrelevant.
15:02TimMcEh, I don't remember the stuff it actually interferes with. :-)
15:02tolstoyben_vulpes Where's the fancy DSL that helps spin up servers, throw a ton of concurrent requests against them, and make sure a "real" database is on the other end.
15:02ben_vulpes> spin up servers
15:02ben_vulpes> in muh tests
15:02ben_vulpes> wut
15:03TimMcEnd-to-end tests.
15:03Gh0stInTheShell,(time (pi 5000))
15:03clojurebot#error {\n :cause "Unable to resolve symbol: pi in this context"\n :via\n [{:type clojure.lang.Compiler$CompilerException\n :message "java.lang.RuntimeException: Unable to resolve symbol: pi in this context, compiling:(NO_SOURCE_PATH:0:0)"\n :at [clojure.lang.Compiler analyze "Compiler.java" 6688]}\n {:type java.lang.RuntimeException\n :message "Unable to resolve symbol: pi in this context"...
15:03ben_vulpestolstoy: fixturing?
15:03ben_vulpesand custom aws integration?
15:04ben_vulpesi honestly have no idea what you're banging on about.
15:04tolstoyben_vulpes I guess it was my back-handed way of saying that these DSLs look appealing when you're testing purely functional code, but my problems are integration.
15:04TimMcben_vulpes: I guess what I'd like is a library of stuff like midje has, but done in a more imperative way like clojure.test does.
15:04Gh0stInTheShell,(time (double (pi 2000)))
15:05clojurebot"Elapsed time: 2399.306607 msecs"\n3.142092403683528
15:05ben_vulpesi used some 'bdd' thinger once
15:06ben_vulpesabstractions bit me though
15:06Gh0stInTheShellclojurebot is awesome :)
15:06ben_vulpesand i don't actually want to test form submissions
15:06TimMcI hate having to run everything through set and sort and other normalization chains because that makes the tests harder to read -- you have to think "OK, now which part of this is normalization and which part is the test subject?"
15:07TimMcBeing able to say (contains [:a :b :c] :in-some-order) is *fantastic* for concision.
15:07TimMcBut I'd really be fine with (contains foo [:a :b :c] :in-some-order) -- just make it explicit.
15:08dysfuni wonder if any of the other test frameworks steal any of the good bits from midje for the clojure.test model yet
15:08TimMcMidje: The Good Parts
15:09dysfunso i started trying to port midje to cljs
15:09TimMcdysfun: If you find one, let me know!
15:09ridcully_are there any more popular ones beside c.t and midje?
15:09dysfunfirst problem: it depends on a module whose tests are written in midje
15:09TimMchaha
15:09dysfun"ah. yes. i can see that being a problem" -- marick
15:11tolstoyridcully_ https://github.com/jaycfields/expectations
15:12dysfuni was a bit saddened when i had to drop midje. until i found all those bugs in my midje test suite. that was pretty disturbing
15:15dysfun"simply require expectations and your tests will be run on JVM shutdown, no call to any 'run' function is necessary."
15:15dysfunwut?
15:17dysfunthat's even more broken than midje
15:18mr-foobarhi all. what is the difference between clojure channels and a message bus ? I am trying to understand the technical / implementation differences.
15:18dysfunmessage bus is a very overloaded term
15:19dysfunand by clojure channels, i presume you mean core.async channels
15:19mr-foobarYes. I am using the term Message Bus from the perspective of topics / publish / subscribe.
15:20dysfunokay, well there is no pubsub mechanism built into channels, but it is possible to build one using channels as the basis for it
15:20mr-foobarcore.async seems be the same from the outside chnanels / put / take.
15:20dysfunthere are several functions in core.async that could help
15:21mr-foobarI understand the usage part. I just am not able to understand how they are different.
15:21dysfunchannels are basically simple queues of messages, conceptually
15:22dysfunwell pubsub requires that you publish topics that can be subscribed to
15:22ridcully_isn't there pub and sub in core.async?
15:23dysfunyes, but not built in to channels
15:23mr-foobardysfun: ah good point. topics need to be explicit.
15:24dysfuna pubsub system actually performs logic for distribution
15:24mr-foobarthey are not values as channels which can be passed around but more like strings.
15:24dysfuna channel is a dumb thing
15:24dysfunit's just a plain queue that you queue data in
15:26dysfunfor instance, rabbitmq has you define various queues and then 'exchanges'. depending on which exchange you post to, it will be distributed to zero or more queues
15:26dysfuneach queue in rabbitmq is t
15:26dysfunhus a single subscription to a 'topic'
15:27dysfunwhereas core.async channels are analogous just to the queue part of my rabbitmq analogy
15:27mr-foobaryup. got it !
15:27dysfuncool :)
15:28mr-foobarI suppose a Bus topic is more discoverable than channels.
15:29mr-foobarWith core.async I remember having to use a global map of pre-defined channels.
15:29dysfunwell a bus is a discoverability mechanism :) you can implement your own if you like, or you can use core.async's
15:31mr-foobarI was watching https://channel9.msdn.com/Shows/Going+Deep/Hewitt-Meijer-and-Szyperski-The-Actor-Model-everything-you-wanted-to-know-but-were-afraid-to-ask and I ended up at CSP and clojure.async :)
15:33mr-foobarI think CSP is more easier to approach than the actor model which is a bit recursive.
15:34dysfunhah, you'll have fun debugging core.async and wondering where the stack traces are ;)
16:09msenolhi guys
16:09msenolI want to access values defined via intern function, in -main method
16:09msenolhere is my code
16:09msenolhttps://bitbucket.org/snippets/msenol86/kKRpj
16:09msenolit gives error
16:09msenolCaused by: java.lang.RuntimeException: No such var: chap-9.core/yyy
16:14TEttingeryou didn't show that you had declared an ns when that was run, should I assume you're in the ns chap-9.core ?
16:15TEttinger,(doc intern) ; let's see here...
16:15clojurebot"([ns name] [ns name val]); Finds or creates a var named by the symbol name in the namespace ns (which can be a symbol or a namespace), setting its root binding to val if supplied. The namespace must exist. The var will adopt any metadata from the name symbol. Returns the var."
16:18msenolyes Tettinger I am in chap-9.core
16:18msenolI am adding the namespace thing into bitbucket snippet one minute
16:19msenolok added
16:21TEttingercan you try (println yyy) instead of the ns and then yyy?
16:22msenolCaused by: java.lang.RuntimeException: Unable to resolve symbol: yyy in this context
16:23TEttingerthis is where I hope justin_smith or amalloy is around
16:24msenolok thx :)
16:24amalloy*ns* isn't bound after compilation is done
16:24amalloyso you're interning stuff into clojure.core
16:26msenolummm ok
16:26amalloybut i guess it never even gets to that point
16:26amalloybecause the intern only happens at runtime, and you try to resolve the var at compile time
16:26msenoloh
16:27msenolis there a way to force it to resolve at runtime?
16:27msenolinstead of at compile time?
16:28amalloyyes, you can call (resolve 'yyy) or whatever
16:28msenoloh ok
16:28amalloy,resolve
16:28clojurebot#object[clojure.core$resolve 0x23fd5492 "clojure.core$resolve@23fd5492"]
16:28msenolthank yout very much amalloy :)
16:28msenolalso thank you very much TEttinger
16:29TEttingeryw, also thanks amalloy!
16:34msenola little problem :)
16:34msenol#'user/yyy
16:34justin_smithI thought *ns* was typically user
16:34msenolresolve returns that
16:34msenolhow can i get the value of it
16:34dysfun@
16:34justin_smithmsenol: @
16:34justin_smithwhich is shorthand for deref
16:34msenolwow
16:34msenolthx
16:34msenolall
16:35msenolI am asking these questions here becaue it is diffucult to test stuff when you are workin with -main method. you have to call lein run everytime
16:35msenolit is not easy as repl
16:35msenolagain thx a lot all
16:36justin_smithmsenol: there are very few things that are not identical in a repl vs. running from a file, and you can call -main from your repl
16:36msenoloh ok
16:36msenolclojure is great
16:36msenolthx for tip justing_smith :)
16:42amalloyjustin_smith: notably though *ns* is different
16:43amalloyand that is exactly what msenol is toying around with atm
16:43justin_smithahh, right
16:45justin_smithmsenol: why not provide a symbol instead of *ns* when using intern?
16:47msenoljustin_smith: umm I want to add a value to current namespace, how can I use a symbol for that?
16:47msenoljustin_smith: should I provide a symbol to produce another namespace?
16:48justin_smithmsenol: if you want to put a var in a specific namespace, yes
16:48msenoloh ok
16:48msenoljustin_smith: I want to make something similar to scrapy library in python
16:49justin_smithbecause *ns* at runtime in normal runs is typically user (it's even user in repls, until you make clojure switch to sometthing else)
16:49msenoljustin_smith: in scrapy u can do this scrapy 'www.google.com'
16:49msenoljustin_smith: and after that you can access to google.com page using variable "response" in scrapy shell
16:50msenoljustin_smith: I want to build something like that
16:50justin_smithyeah, we tend to avoid things like this in clojure, preferring locality of reference rather than creating values indirectly
16:51msenoljustin_smith: ok thx a lot
16:52justin_smithmsenol: it would be possible to make a function that creates a var in your current namespace, but it's not simple, and the most straightforward way probably involves passing in the namespace that should get this new var - but why not use a composite return value (or just a return value) rather than an automatic var creation?
16:53justin_smithcode that uses return values is much more predictable
16:55msenoljustin_smith: yeah in first version of the function it returns a value and you have to assign it to a var in repl
16:55msenol(def parsed-html (my-parser ("www.google.com")))
16:55msenoljustin_smith: it was working in this way
16:55justin_smithI assume there are extra parens there, but yeah
16:55msenoljustin_smith: but I try to make it user friendly like scrapy
16:56msenoljustin_smith: yeah one extra paren sorry
16:56amalloymsenol: that's not really user-friendly, it's just python-style
16:56msenolamalloy: ok :)
16:56amalloya clojure style would be to have the function return a value, and then you call other functions on that value
16:57amalloypossibly you def it to a var, possibly not
16:57msenolyeah, but I want to design a shell, so when user calls my program in command-line like this:
16:57msenolscrapy-clojure "www.google.com"
16:57msenolthen user will put into a shell
16:58msenolafter that user can call functions predefined (which works on www.google.com html)
16:58msenollike
16:58msenol(css-select "div#some_div")
16:58msenoland it returns a node or list of nodes
16:59justin_smithOK, in that case you could make sure that the vars you create are interned into the shell's primary namespace - that should be simple enough
17:00msenoljustin_smith: oh ok. so I should create a namespace for my shell. thank you very muc
17:00justin_smithmsenol: yeah - you could even use the main ns you are already using - just make sure to explicitly provide that ns symbol as an arg to intern - to ensure that definitions end up there
17:01msenoljustin_smith: ok I understood
17:02msenolyou guys are great
19:29jumanjihi guys how do you reduce a list of maps via a specific key value? I tried it here but not sure if I'm doing it correctly : http://stackoverflow.com/questions/37369012/clojure-given-a-list-of-maps-get-the-total-sum-value-of-a-specific-key-value
19:29TEttingerthis is one of those things that I think gets solved easily with a transducer
19:30Lewixis there an easy wha to add an index to repeat
19:30Lewix,(repeat 5 "lewix")
19:30clojurebot("lewix" "lewix" "lewix" "lewix" "lewix")
19:30TEttingerrepeatedly takes a 0-arg fn. what I would do is a map on range
19:31TEttinger,(map #(str "lewix" %) (range 5))
19:31clojurebot("lewix0" "lewix1" "lewix2" "lewix3" "lewix4")
19:37LewixTEttinger: thanks it's neat
20:32ob_hi is there any facility for showing docs within clojure repl?
20:34Lewixob_: (doc foo)
20:34Lewix,(doc doc)
20:34clojurebot"([name]); Prints documentation for a var or special form given its name"
20:34ob_ty Lewix
21:05ealfonsohow do I ask lein to take a dependency from a local jar?
23:17tolstoyHeh. That question. ;) Reminds me of struggling with what to do with an Oracle JDBC jar.