#clojure logs

2015-10-06

01:21hoppfullI'm trying to figure out how to compile clojure to dll. Is there a special flag for clojure.compile? I'm using clojure clr
01:31wmealingi dont know how up to date clojure on .net is
01:31wmealingi know thats not helpful..
01:32TEttingerwmealing, not that it matters, hoppfull left a minute before you said that and actually while I was typing a response too.
01:32TEttingerit is something I would like to know more about too
01:32wmealingoh man
01:33wmealingClojure.Compile.exe -include test.clj -include test2.clj -outputAssemblyName test.dll
01:33wmealingapparently
01:33wmealing(i dont have a windows machine to play with)
04:35oOzzy`_Is it considered good practice to comp functions and use a single map with that composed function or to chain multiple maps? As I understand it composition would have the benefit of not looping multiple times in situations where the input can be either vector or list.
04:36amalloyneither really maps multiple times because of laziness, but mapping multiple times does produce more intermediate garbage
04:36amalloyer, loops multiple times
04:44tgoossenswhen I use clojure-csv to parse a CSV the column name of the first column always starts with: ��
04:44tgoossensI have no clue where this comes from
04:44oOzzy`_amalloy: Vectors aren't lazy though, are they?
04:44amalloymap is
04:44oOzzy`_amalloy: https://gist.github.com/ojung/78411bf3b8df0507057d
04:45amalloythe input data structure makes no difference, because the output is a lazy seq
04:45oOzzy`_Ah
04:45oOzzy`_I see
04:45justin_smithoOzzy`_: your difference there is that vectors are chunked
04:46justin_smithoOzzy`_: if you had a larger input, you would see that 32 items at a time were being processed
04:46mavbozotgoossens, where do those csv comes from? it's possible that you encounter UTF_8 BOM
04:46tgoossensmavbozo, I just noticed that with 'slurp' it is already like that
04:47oOzzy`_justin_smith amalloy that explains things, thank you
04:47tgoossensmavbozo, apparantly it has to be UTF-16
04:47tgoossensnever heard of that
04:48oOzzy`_Still, would you rather read code with chained map calls or one map call with a composed function?
04:48mavbozotgoossens, java uses UTF-16
04:49justin_smithoOzzy`_: if you chained transducers via map with one arg only (the function), that would be another approach
04:50justin_smith,(apply str (sequence (comp (map char) (map inc) (map int)) "hello"))
04:50clojurebot#error {\n :cause "java.lang.Character cannot be cast to java.lang.Number"\n :via\n [{:type java.lang.ClassCastException\n :message "java.lang.Character cannot be cast to java.lang.Number"\n :at [clojure.lang.Numbers inc "Numbers.java" 112]}]\n :trace\n [[clojure.lang.Numbers inc "Numbers.java" 112]\n [clojure.core$inc invokeStatic "core.clj" 895]\n [clojure.core$inc invoke "core.clj" -1]\n ...
04:50mavbozotgoossens, I don't understand about this BOM machinery either, there's a recent discussion about this in clojure mailing list https://groups.google.com/forum/#!searchin/clojure/utf-8$20bom/clojure/Rk5JGhq-IJY/z_54tdaXENQJ
04:50amalloyoOzzy`_: depends on xontext and how you wrote it, probably
04:50justin_smith,(apply str (sequence (comp (map int) (map inc) (map char)) "hello"))
04:50clojurebot"ifmmp"
04:51amalloyneither is unconditionally better. it's like in english: sometimes i use the first person, and sometimes one speaks in the third person
04:52oOzzy`_True. Doesn't really make a big difference anyway.
04:53mungojellyi like how here people talk about programming languages as language
04:53justin_smithwith the transducer (single arg map) version, you can also intermix map with other operations like filter in a single step operation
04:54mungojellyi thought it might make sense to give my program a snappy CLI by having a python script talk to a daemon, is that ridiculous
04:55oOzzy`_justin_smith: how would that look like? Havn't used them yet, really :/
04:56justin_smith,(apply str (sequence (comp (map int) (filter even?) (map inc) (map char)) "hello, this is gibberish from a transducer"))
04:56clojurebot"imm-!ui!!ccsi!gs!!usoes"
04:57oOzzy`_justin_smith: I would use the thread macro for those things
04:57justin_smithoOzzy`_: that's much less efficient
04:57justin_smiththis is why those things exist
04:58justin_smithoOzzy`_: the thread version of the above would create 4 lazy-seqs, the transducer version shown creates 1
04:59oOzzy`_much less efficent? Pardon my ignorance, I have only watched the talk about transducers I fear.
05:00justin_smithoOzzy`_: it creates a bunch of lazy-seqs that are only used as intermediate steps, the point of transducers is not to have to pay for that overhead, by combining the operation into a single one with comp
05:01amalloyhonestly though for most programs you dont' care about efficiency most of the time
05:02justin_smithsure, but the composed transducers also get something like the chained op syntax wise as well
05:02justin_smithwith comp replacing ->>, and a small amount of extra wrapping
05:02oOzzy`_amalloy: doesn't look worse than -zz though
05:03oOzzy`_->>
05:18trisswhats the deal with type hints that look like this:
05:18triss^"[[Lclojure.lang.Atom;"
05:18triss^"[Lclojure.lang.IFn;"
05:18justin_smithtriss: it's a java array of java arrays of clojure atoms
05:18justin_smiththe second one is a java array of clojure functions
05:19trissah thanks justin_smith. is that the only way to specify it? I'm working on some code with reflection warnings on an it's really ugly.
05:19justin_smiththat's the name of the class, and yeah, it's ugly
05:20trissoh well... I wonder If I can refactor it away. thanks man
05:22TEttingertriss: you can refactor it to be even uglier. this is a valid type hint AND it breaks bracket matching in many editors: ^[[Lclojure.lang.Atom;
05:23TEttinger(not sure, but it may avoid a Class/byName call by not having it as a string. or it may not. you should still probably use the string)
05:23amalloyTEttinger: "valid" in the sense that it's not valid at all?
05:23TEttingerit was in earlier clojure versions
05:23amalloyno
05:23amalloyit doesn't even get by the reader
05:25TEttinger,(defn atom-arr [^[[Lclojure.lang.Atom atomz] @(aget ^[[Lclojure.lang.Atom atomz 0 0))
05:25clojurebot#<RuntimeException java.lang.RuntimeException: Unmatched delimiter: )>
05:25TEttinger,(defn atom-arr [^[[Lclojure.lang.Atom; atomz] @(aget ^[[Lclojure.lang.Atom; atomz 0 0))
05:25clojurebot#<RuntimeException java.lang.RuntimeException: EOF while reading>
05:25TEttingerI remember doing this in 1.4 or so
05:27amalloyno way. that can't have worked in any version of clojure since at least 1.2
05:27TEttingerit didn't have the semicolon, I know that much
05:28amalloyi wonder what would be the right way to search the git history to prove or disprove this claim
05:28TEttinger,(defn floatarr [^[[F floatz] @(aget ^[[F floatz 0 0))
05:28clojurebot#<RuntimeException java.lang.RuntimeException: Unmatched delimiter: )>
05:28TEttingerit was probably a bug if it did work...
05:29oOzzy`_justin_smith: how would sort and flatten work with transducers? they can't be part of the composition, can they?
05:29TEttingerI do remember profiling and seeinga ton of class/byname stuff
05:29justin_smithoOzzy`_: some functions have transducer versions, others don't
05:29TEttingerflatten's usually a bad idea
05:29TEttinger~flatten
05:29clojurebotflatten is rarely the right answer. Suppose you need to use a list as your "base type", for example. Usually you only want to flatten a single level, and in that case you're better off with concat. Or, better still, use mapcat to produce a sequence that's shaped right to begin with.
05:29justin_smithoOzzy`_: flatten doesn't have a transducer, but mapcat might
05:30justin_smithyeah, mapcat has a transducer, so you can do the saner alternative mentioned above
05:31justin_smithI don't think sort can be a transducer though...
05:32oOzzy`_Alright, cheers
06:15clgvHello, is there an easy way to access the ChannelId associated to a channel of a stream when using aleph?
07:40hoppfullhello! I need help! I've compiled a clojure file into a .dll-file and now I am trying to call its methods from c#. Does someone have experience with this?
07:42clgvhoppfull: there is probably a simillar naming convention as in Clojure JVM
07:44clgvhoppfull: but the best way is to go through the official API which should exist for Clojure CLR as well
07:45hoppfullclgv: where can I find this official API?
07:45hoppfullclgv: I already know how to do this with JVM. The CLR is giving me difficulties.
07:46clgvhoppfull: there should be something similar as clojure.java.api.Clojure
07:46clgvhoppfull: https://github.com/clojure/clojure-clr/wiki/Using-ClojureCLR-in-a-C%23-project
07:47hoppfullclgv: yeah, I was looking into that
07:47hoppfullclgv: what is load.invoke("some.thing")?
07:47clgvhoppfull: just retrieve the variables you need via Clojure.var(...) and then invoke them as needed
07:48clgvhoppfull: e.g. IFn inc = Clojure.var("clojure.core", "inc"); inc.invoke(1);
07:49clgv<=> (clojure.core/inc 1)
07:51hoppfullclgv: I've got a file called hello.clj, with (defn f [x] (* x 2)). Would that be IFn f = Clojure.var("hello", "f"); f.invoke(5);?
07:51clgvyeah
07:52hoppfullclvg: mm. Another error. ArityException, wrong number of args(1)
07:52hoppfullclvg: this makes no sense
07:53clgvhoppfull: for `f`? then check its arity
07:54hoppfullIt only takes a single argument.
07:56hoppfullThis is a rather inelegant way of doing it. It should work seamlessly to compile it to DLL and just call members. The JVM-version works perfectly.
07:59clgvhoppfull: This is the official way to call your Clojure function from C#
08:00clgvhoppfull: I am not sure what your comparison scenario on the jvm is
08:01FenderHi guys, I want an async web server in clojure (such as httpkit or ring-async), however, no single server is able to deal with an async channel for the complete response (only for the body). This means, I cannot set the HTTP status code of the response and I'll probably have to respond with 200 all the time. Is this usual, am I missing something or is there no fully async web server available right now?!
08:02hoppfullclgv: Compile hello.clj to hello.dll and hello.clj.dll, reference in c# like any other method.
08:02troydmwhat is the difference between (require 'test :reload) and (require 'test :reload :all) ?
08:02troydmwhat is the difference between (require 'test :reload) and (require 'test :reload :all) ?
08:02troydmwhat is the difference between (require 'test :reload) and (require 'test :reload :all) ?
08:02clgvhoppfull: This is not possible in Java neither
08:03clgvtroydm: reloading the namespace only vs reloading all of its dependencies
08:03hoppfullclgv: Yes it is. I have an example right here that works wonderful.
08:04troydmclgv: does it removes all definitions from namespace when reloading it?
08:04troydmclgv: in both cases?
08:04clgvhoppfull: care to show that - so that I have an idea what you are trying to do
08:04clgvtroydm: in none of them. that's why tools.namespace was written
08:05troydmclgv: ic, so I have to remove-ns
08:05hoppfullclgv: absolutely, let me write exactly what I do
08:05hoppfullclgv: give me a minute
08:05clgvtroydm: or use tools.namespace ;)
08:07troydmclgv: ic, thx
08:07hoppfullclgv: here is hello.clj http://pastebin.com/YrqvVGzu
08:07clgvhoppfull: ah right, you are using gen-class
08:08hoppfullThen in repl I call (compile 'hello) which generates the class files
08:08clgvhoppfull: should be the same on the CLR
08:08hoppfullclgv: and visual studio recognizes the class and its member
08:09hoppfullclgv: and it recognizes the correct types and everything. But when I run it, it gives me errors.
08:10clgvhoppfull: you ruled out implementation or invocation errors?
08:11xcvWhat SQL generation libraries are recommended these days? I initially thought Korma was the go-to, but then I saw this https://twitter.com/ibdknox/status/557236505639665664 and this https://groups.google.com/forum/#!topic/clojure/rDyYHfC01RQ
08:12xcvAny opinions on honeysql or yesql?
08:12tdammersyesql is refreshingly simple
08:13xcvI'd lean more toward dynamic query generation like honeysql or Korma, but I'm open to new ways of doing things.
08:13hoppfullclgv: I surrounded it with try catch and analyzing the message, brb
08:13tdammersthe downside is that if you have a lot of single-table CRUD stuff, you'll end up with a lot of repetitive query definitions
08:13xcvYeah, that's what bothered me a bit. But of course, one can mix and match.
08:14tdammersalso, if you need to construct queries dynamically, yesql is out
08:14xcvYeah.
08:14xcvI guess yesql's sweet spot are complex, structurally static queries.
08:14tdammersyep
08:15xcvBuilding complex stuff with dynamic generators is a bit fiddly, but worth it if the dynamism is needed.
08:15tdammersif you can cover the complexity of your data with a relational model, and expose a statically-shaped interface at the query level, then yesql is gold
08:15hoppfullspecified cast is not valied. I'm not casting anything. Is the int in c# not the same as int in clojure?
08:16tdammersc# may be casting implicitly, I think
08:17clgvhoppfull: what's your invocation look like?
08:17hoppfullclgv: I'm pasting my two files exactly
08:17hoppfullclgv: just a sec
08:21hoppfullhttp://pastebin.com/gzdFmkad, http://pastebin.com/NKpyRM94
08:22clgvhoppfull: you have defined `f` with arity 2 but call it with arity 1
08:22freedonAnyone have any pointers on resolving a FileNotFoundException Could not locate *__init.class error?
08:22clgvhoppfull: you probably want to remove the `this`
08:22hoppfullclgv: no, this has to be there. without it I get arity error. That I am assigning 2 with arrity 1.
08:23oddcullyfreedon: first shot in the dark: are you using a .cljc library with clojure 1.6 ?
08:24clgvhoppfull: I doubt that the `this` is correct there. That would explain the arity exception mentioned earlier
08:25freedonI'm not familiar with cljc unfortunately - I am using Clojure 1.7
08:25clgvhoppfull: hm, ok might be valid - I only use static main method so far...
08:25oddcullyfreedon: then maybe you could provide the exact error and your requires/project file in a gist/refheap/...?
08:26hoppfullclgv: the arity exception dissappears if I use this. Yes, if it's static, then no this.
08:27hoppfullclgv: I'm sure it's something simple.
08:28tdammershmm, is there any documentation on kioo's emit-opts argument?
08:29clgvhoppfull: I am not quite sure which problem remains if the arity exception is already fixed
08:30freedonThanks taking a look - much appreciated. http://pastebin.com/mHkteUkx
08:31hoppfullclgv: it says in the c# file. I get error message "specified cast is not valid."
08:33oddcullyfreedon: shouldn't that be imports then?
08:33clgvhoppfull: no idea, where that comes from. I have no c# availbe here atm
08:34clgvhoppfull: does c# use auto-boxing?
08:35clgvhoppfull: you could use a decompiler and look at the decompiled hello class
08:35hoppfullclgv: I solved it (almost)
08:36hoppfullclgv: don't know what auto-boxing is. The decompiler is new to me.
08:37hoppfullclgv: If I redefine the function type signature from (int -> int) to (double -> double) instead it works.
08:37hoppfullWhat kind of ints are there? int, short and byte, right?
08:37clgvprobably "long" as well
08:38clgvand "long" to "int" conversion is usually not applied implicitely.
08:38hoppfullclgv: interesting. x is to 5 what 5.0 is to 5D.
08:38tdammersgenerally, C# is more lenient with widening casts than with narrowing ones
08:39tdammerse.g., it'll complain about int -> byte, but not byte -> int
08:39hoppfullHow do i specify a number as long?
08:39freedonoddcully: wow thanks big time. Think this is a classic case of trying to run before one can walk
08:39hoppfull5L?
08:39freedonreally appreciate your help.
08:40lumawidening promotions (byte->short->int->long) can happen automatically, narrowing (long->int->short->byte) can't
08:40lumahoppfull, in clojure, integers are by default Long
08:40tdammersalthough IIRC int -> double is considered widening
08:40luma,(type 1)
08:40clojurebotjava.lang.Long
08:41lumayes, integer type to float/double is widening as well
08:41hoppfulllongs worked
08:42troydmhow can I remove only one occurence of value from vector?
08:42hoppfullif I set type signature in hello.clj f::int->int, passing f(4) wont work. But setting f::long->long, passing f(4L) works, strange
08:43hoppfullIs there a way to specify that the 4 is an int the same way I specify that 4 is a long with 4L?
08:44hoppfullIt seems trivial now but I'd like to figure this out.
08:48clgvhoppfull: you could assign 4 to an int variable
08:49hoppfullclgv: interesting
08:50hoppfullclgv: no, it doesn't work. I guess it doesn't really matters. Longs and doubles work. But it's annoying.
08:50hoppfullclgv: I hope bool works.
08:52hoppfullboolean wors
08:52hoppfull*works
09:02troydmwhat is the simplest way to check if vector contains any elements of another vector?
09:04tdammersconvert both to sets, find intersection
09:06tdammers,(clojure.set/intersection (set [1 2 3]) (set [5 4 1]))
09:06clojurebot#error {\n :cause "clojure.set"\n :via\n [{:type java.lang.ClassNotFoundException\n :message "clojure.set"\n :at [java.net.URLClassLoader$1 run "URLClassLoader.java" 366]}]\n :trace\n [[java.net.URLClassLoader$1 run "URLClassLoader.java" 366]\n [java.net.URLClassLoader$1 run "URLClassLoader.java" 355]\n [java.security.AccessController doPrivileged "AccessController.java" -2]\n [java.net.URL...
09:06m1dnight_Is the dev of clj-slack here by any chance?
09:07snowellLooks like there's a julienXX here
09:07snowellThat ^ should have pinged them
09:08julienXXhi :)
09:08julienXXis there something I can do for you m1dnight_ ?
09:08troydmtdammers: I want to preserve the position of elements in first vector
09:08fehrenbach,(type (int 1))
09:08clojurebotjava.lang.Integer
09:08m1dnight_Yeah i was looking at your bot and i was wondering if you are actively maintaining it?
09:09m1dnight_I would like to contribute.
09:09m1dnight_E.g., a module system
09:09tdammers,(filter #(contains? (set [3 4 5 1]) %) [1 2 3])
09:09clojurebot(1 3)
09:09tdammerssomething like this, then?
09:10tdammers(or filterv if you want to keep it a vector)
09:10julienXXm1dnight_ hmm clj-slack isn't a bot, it a wrapper around Slack API but yes it's actively maintained and I accept PRs with pleasure
09:10m1dnight_I have written my own irc bot which has such a system. Maybe youd like it.
09:11julienXXsure we are talking about the same clj-slack (https://github.com/julienXX/clj-slack)?
09:13m1dnight_oh, it seems we are not! :)
09:13m1dnight_oh wait. my bad. its clj-slackbot.
09:13m1dnight_Sorry about the confusion!
09:13snowellHey, I still brought people together :D
09:13julienXXnp :D
09:14m1dnight_the user is verma. He doesn't seem to be here.
09:14m1dnight_Oh well, Ill fork it and go my own way. I was hoping to work on it together with someone :p
09:14snowellIt looks like verma has been receptive of PRs in the past
09:18m1dnight_hmm, the uberjar command doesnt seem to work and google fails me when I google the stacktrace. Can anyone give pointers? https://www.refheap.com/110321
09:19m1dnight_`lein run` seems to work perfectly so I'm unsure what could be wrong.
09:21vijaykiranm1dnight_: possibly version conflicts
09:22vijaykiranm1dnight_: try a lien deps tree and check
09:23m1dnight_lein deps tree doesnt give any output?
09:23m1dnight_okay got it!
09:25m1dnight_that is giving me some information but nothing concrete on jetty. Ill resolve these conflicts for now and then see.
09:27vijaykiranm1dnight_: looks similar - https://github.com/pedestal/app-tutorial/issues/42
09:41m1dnight_oddly enough I dont have a lein profile yet on this machine and its giving me the same issue. I have fixed all my dep confusions as well. still no fix.
09:42vijaykiranm1dnight_: is the project somewhere on Github ?
09:42m1dnight_right here: https://github.com/m1dnight/clj-slackbot
09:49vijaykiranm1dnight_: I suggest lein ancient - and update the versions
09:50vijaykiranm1dnight_: it worked with this : https://gist.github.com/vijaykiran/9b5f8b9bc09c9b2641db
09:50roelofHello, Is it normal in Windows 10 that I cannot install Lighttable in the directory downloads ?
09:50vijaykiranm1dnight_: comparing deps before and after is left as an exercise :P
09:51m1dnight_hahaha to the diff mobile
09:51m1dnight_,(inc vijaykiran)
09:51clojurebot#error {\n :cause "Unable to resolve symbol: vijaykiran in this context"\n :via\n [{:type clojure.lang.Compiler$CompilerException\n :message "java.lang.RuntimeException: Unable to resolve symbol: vijaykiran in this context, compiling:(NO_SOURCE_PATH:0:0)"\n :at [clojure.lang.Compiler analyze "Compiler.java" 6704]}\n {:type java.lang.RuntimeException\n :message "Unable to resolve symbol: vij...
09:51m1dnight_(inc vijaykiran)
09:51vijaykiranroelof: not sure what you mean by "install"
09:52roelofvijaykiran: I downloaded the zip file and I want to unpack it in Downloads. But I see then a message that I do not have the permissions to do so.
09:53m1dnight_wow the deps tree for clj-http has shrunken immensly.
09:53m1dnight_(im not sure about my grammar there)
09:53clgvroelof: If it's on the C:\ drive that's the case since Win 7
09:53clgvroelof: you can adjust the permissions as admin
09:54roelofclgv: no it's a clean install of Win 10
09:54vijaykiranroelof: perhaps a stupid question, are you sure you "unpacked it" and not running from within the zip ?
09:54roelofvijaykiran: no. when I try that I see a message that iI first need to unpack it
09:55vijaykiranroelof: okay, just checking :) as clgv pointed out perhaps it has something to do with UAC stuff
09:56clgvroelof: I meant they are enforcing those permission since win 7 and seem to continue in win 10
09:56roelofI now will try uppack in Documents
09:56vijaykiranIsn't Program Files\LightTable more apt ?
09:56clgvwait? you can download to "Downloads" but not unpack there? muhahaha
09:57roelofI never had this problems earlier. A week ago I could install it without any problems
09:57roelofMaybe IM going seek for a cloud enviroment for clojure. This sort of things are no fun in Windows
09:58roelofclgv: that is correct
09:59clgvroelof: you could install a linux on a usb flash drive and use that for clojure dev
09:59xemdetiaor virtualbox
09:59xemdetiaand have a real linux
10:00roelofI will look what I do
10:00clgvsure. if win 10 let's him ;)
10:00roelofthanks all
10:00clgvroelof: but you could just change the directory permission ^^
10:01roelofI will try
10:35roelofHow can I make this script work at repl http://lpaste.net/142412
10:41vijaykiranroelof: just type it in
10:41vijaykiranroelof: into the repl
10:41roelofSo I cannot type it in a editor and then load it into repl ?
10:42vijaykiranroelof: depends on which editor you are using, you can also load a file into repl
10:43roelofI use the editor rom nitroius.io so I have to load it manually into repl
10:43justin_smithyou can load from a file regardless of editor
10:43vijaykiranroelof: in the repl you can just use (load-file "filename")
10:45roelof(load "clore.clj") FileNotFoundException Could not locate fourclojure/clore.clj__init.class or fourclojure/clore.clj.clj on classpath. clojure.lang.RT.load (RT.java:449)
10:45roelofI do this in the root directory of my project
10:46justin_smithroelof: can you guess what to do about the fact that it looks for "fourclojure/clore.clj.clj"
10:46vijaykiranroelof: try (load-file "clore.clj") not (load "clore.clj")
10:47vijaykiranhttp://webcache.googleusercontent.com/search?q=cache:ZDcY15uVus4J:https://clojuredocs.org/clojure.core/load-file
10:48snowell,(doc load-file) ; vijaykiran: this is easier :)
10:48clojurebot"([name]); Sequentially read and evaluate the set of forms contained in the file."
10:48vijaykiransnowell: :) yup, I thought examples there were better
10:48roelofim giving up : fourclojure.core=> (load-file "clojure.clj") FileNotFoundException clojure.clj (No such file or directory) java.io.FileInputStream.open (FileInputStream.java:-2)
10:48vijaykiranroelof: what's your file name ?
10:49vijaykiranroelof: also, looks like your repl is already in the core namespace of your project
10:49roelofthe file name is core.clj
10:49roelofvery wierd
10:50justin_smithroelof: why did you ask for "clojure.clj" when the file is named "core.clj"
10:50vijaykiranroelof: ah, then you are in the namespace, can you "call" the function in the repl ?
10:51roelofI was thinkig yes, but when I do ( -main) I see another error message
10:51vijaykiranroelof: there was no -main in your namespace from lpaste, so just type (palingdrome '(1,2,3)) and see what happens
10:52roelofim going crazy now (-main) works
10:54roelofis there a way to reload the file so the new contents is avaible ?
10:54justin_smithsure, the same way you load it the first time
10:55justin_smithif you used require you can add :reload
10:55roelofoke, rhanks all Its time for dinner now
11:29troydmhow can I exclude definition from (:use (my.lib this that)) ?
11:29troydmin (ns clause
11:29justin_smith,(doc use)
11:29clojurebot"([& args]); Like 'require, but also refers to each lib's namespace using clojure.core/refer. Use :use in the ns macro in preference to calling this directly. 'use accepts additional options in libspecs: :exclude, :only, :rename. The arguments and semantics for :exclude, :only, and :rename are the same as those documented for clojure.core/refer."
11:29justin_smithtroydm: :exclude
11:29troydmjustin_smith: thx, I'll try
11:30justin_smithalso, the general community consensus is require with :as is almost always better than use
11:30pjstadigor require with :refer
11:31justin_smith:refer has the same problem with reloads, but yeah
11:31troydmhow do I use :exclude exactly?
11:32troydmI've tried (:use [[mylib :exclude funname] myotherlib])
11:32troydmbut it seems it's not working
11:32justin_smithtroydm: :exclude needs a vector
11:32justin_smith:exclude [funname]
11:32justin_smithalso drop the output vector
11:33justin_smith(:use [mylib :exclude [funname]] myotherlib)
11:34justin_smithand don't use the (my.lib this that) shorthand
11:34troydmjustin_smith: ahh, ic, thx
11:41soleadoI'm calling a function in a library and it throws an exception if the argument isn't the expected type. Is there a more idiomatic way to handle this -- wrap the call in a try/catch or validate the type of type of the argument or anything else?
11:57roelofIs there a alternative for light table. I cannot unpack it and when I try to run I see a virus error message
12:04oddcullyroelof: cursive
12:04clgvroelof: Counterclockwise. but you probably need to unpack all of those
12:08roelofthanks, I will look at both
12:11oddcullyroelof: if you are by chance already familiar with emacs or vim you might be better off with those instead of learning new tools
12:15soleadosublime text 3
12:16roelofoddcully: nope iM not a vim or a emacs person. I like Lighttable but for some reason it wont install anymore
12:45zexperimentshame about light table, I'm using it with the vim bindings plugin
13:20roelofsveri: are you here ?
13:21justin_smithso I was trying to figure out why my core.async using function wasn't returning, turns out it's "async" http://i.imgur.com/05yKVcd.png
13:22justin_smith(the function that is, core.async is fine, I just have a bug that is, as can be seen in that thread trace, causing only one core.async thread at a time to be doing any work
13:22cloj_devhow can I update a map such that a nested vector is spliced?
13:23cloj_devso that there is no longer a nested vector
13:30matthavener(update-in mymap [:some-key] #(apply concat)) ?
13:32matthavenerer, with a % after concat
13:32tsantosWhen was the last time clojuredocs.org drew breath?
14:00TimMcIs that a fancy way of saying the site is down?
14:02mavbozooh no! clojuredocs.org down
14:07xemdetiaclojuredocs just needs some electrolytes
14:11amalloyoh, i thought it was a fancy way of saying it never gets updates
14:12roelofsveri: are you here ?
14:13roelofanyone else who has "installed " light table today ?
14:21roelofNobody who can tell me if he zip from lighttable has a virus in it ?
14:33anewhy would there be?
14:39anehas anyone implemented some sort of Travis CI setup which pushes Codox docs to github pages?
14:40anecan't seem to find anything
15:12arrdemclojuredocs looks fine right now...
15:23zxcHello! What are the Clojure design patterns?
15:27mavbozozxc, there's a talk about functional design patterns in clojure by stuartsierra http://www.infoq.com/presentations/Clojure-Design-Patterns
15:28anearrdem: if you were replying to me, that's not at all what i was after
15:30mavbozozxc, also there's a Clojure Applied book that helps me understand designing system with clojure
15:31oddcullyand joy of clojure has a block about how to map OO patterns (if that was the question)
15:32sandbagsany Cursive user know if there's a way to have it rename a .clj file to .cljc?
15:34arrdemcfleming: ping
15:35sandbagsarrdem: thanks, I couldn't remember col's nick :)
15:35arrdemsure
15:35sandbagshrmm... from a github issue seems there isn't but may be in future
15:36sandbagsi do wish duckduckgo was a better SE
15:38zxcmavbozo: Tank you!
15:41neoncontrailsHelp, O sage ones. I've managed to quash all my dev server errors but one.
15:41neoncontrailshttp://pastebin.com/8yn5Q9z6
15:42neoncontrailsCan anyone read a cause from this? I can't even find one of my src files referred to in the stack trace.
15:44sandbagsneoncontrails: apologies in advance if this seems a dumb question but you haven't accidentally used a String for one of your namespace definitions?
15:45sandbagsjust looking at the definition of Named and guessing where it might be relevant
15:46neoncontrailsI suppose it's possible -- yeah, you're right that seems like a solid conclusion. Let's see
15:46sandbagsit is a classic Clojure exception though :)
15:47neoncontrails(I seem to be limited to pico via sshfs right now for some reason. I miss my syntax highlighting!)
15:54arryHi! I've got a few questions about Reagent/re-frame.
15:54arry1. How to include HTML entities (eg "&bull;") in a Reagent component? If it's in a plain string, then it's html-escaped, not what I want.
15:55dnolenarry: you'll likely get a better answer in #clojurescript
15:55dnolenarry: there's also an active Reagent channel in Slack these days
15:55arrythanks, I didn't realize there's a special channel for it
15:55neoncontrailsMe either. That's good to know :)
15:59neoncontrailssandbags: I undid a change I slipped in earlier that quoted the location of the handler location. This suppressed the error I was getting! And now "sudo lein ring server-headless" just idles and gives no output. Hmm...
16:01neoncontrailscjlarose: Meetup Chris!
16:09ucbtrying to get the clojure gradle plugin to work with a java project at work, but I keep getting errors since we have our own javadocs tasks
16:09ucbhas anyone managed to get it to work with existing javadocs/test tasks?
18:01{blake}Given a board, b, and a position x and y, you can take a 3x3 area of that pretty neatly with: (map #(take 3 (drop (dec x) %)) (take 3 (drop (dec y) b))))
18:02{blake}Except if the x and y are on the edges. And I can't think of a nice way to handle that. (Say, always return 3x3, but with nils if that would go off the board.)
18:02gfredericksif you used get-in with indexes I think you'd get nils
18:02gfredericksno I take that back
18:02gfredericks,(get-in [2] 13)
18:02clojurebot#error {\n :cause "Don't know how to create ISeq from: java.lang.Long"\n :via\n [{:type java.lang.IllegalArgumentException\n :message "Don't know how to create ISeq from: java.lang.Long"\n :at [clojure.lang.RT seqFrom "RT.java" 535]}]\n :trace\n [[clojure.lang.RT seqFrom "RT.java" 535]\n [clojure.lang.RT seq "RT.java" 516]\n [clojure.core$seq__4116 invokeStatic "core.clj" 137]\n [clojure.co...
18:02gfredericks,(get-in [2] [13])
18:02clojurebotnil
18:02gfrederickswait yes
18:02gfredericksit does give nils
18:09cloj_devtest
18:10{blake}gfredericks: Yeah, I had that...for some reason I wasn't liking it but now that I code it out, it's even cleaner.
18:10justin_smith,(get-in [2] [13] :NUMBERWANG)
18:11clojurebot:NUMBERWANG
18:11{blake}Just: (for [x (range -1 2) y (range -1 2)](get-in b [x y]))
18:11{blake}This is a family program. I can't use :NUMBERWANG.
18:12justin_smith{blake}: I'm guessing you haven't seen the skit
18:12{blake}I have not. I have seen many skits, involving dead parrots, bumblebees, head crushing, and what-not. But no numberwang.
18:51cflemingarrdem: ack
19:29arrdemcfleming: someone was asking about renaming a .clj to .cljc
19:30wmealingyeah, whats that about ?
19:30wmealingclj vs cljc ?
19:30cflemingOh right. Sadly not possible right now, although it sounds like sandbags found the relevant issue.
19:31arrdemon a personal note I owe you at least one drink for the intro to intellij.. saving my bacon right now as I'm playing with monojava repos
19:32cflemingNice - will you be at the conj to pay up?
19:32arrdemnah conj is right in the middle of exams and this year is really hectic
19:32arrdemnot that I don't want to since Chas is making it out of the woods to appear
19:33cflemingOh nice.
19:34cflemingBummer you won't be there, though.
19:34cflemingI'll have to have the drink without you.
19:34arrdemI can't justify the time :/
19:34cflemingAlthough I'll be jetlagged up the wazoo