2015-10-06
| 01:21 | hoppfull | I'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:31 | wmealing | i dont know how up to date clojure on .net is |
| 01:31 | wmealing | i know thats not helpful.. |
| 01:32 | TEttinger | wmealing, not that it matters, hoppfull left a minute before you said that and actually while I was typing a response too. |
| 01:32 | TEttinger | it is something I would like to know more about too |
| 01:32 | wmealing | oh man |
| 01:33 | wmealing | Clojure.Compile.exe -include test.clj -include test2.clj -outputAssemblyName test.dll |
| 01:33 | wmealing | apparently |
| 01:33 | wmealing | (i dont have a windows machine to play with) |
| 04:35 | oOzzy`_ | 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:36 | amalloy | neither really maps multiple times because of laziness, but mapping multiple times does produce more intermediate garbage |
| 04:36 | amalloy | er, loops multiple times |
| 04:44 | tgoossens | when I use clojure-csv to parse a CSV the column name of the first column always starts with: �� |
| 04:44 | tgoossens | I have no clue where this comes from |
| 04:44 | oOzzy`_ | amalloy: Vectors aren't lazy though, are they? |
| 04:44 | amalloy | map is |
| 04:44 | oOzzy`_ | amalloy: https://gist.github.com/ojung/78411bf3b8df0507057d |
| 04:45 | amalloy | the input data structure makes no difference, because the output is a lazy seq |
| 04:45 | oOzzy`_ | Ah |
| 04:45 | oOzzy`_ | I see |
| 04:45 | justin_smith | oOzzy`_: your difference there is that vectors are chunked |
| 04:46 | justin_smith | oOzzy`_: if you had a larger input, you would see that 32 items at a time were being processed |
| 04:46 | mavbozo | tgoossens, where do those csv comes from? it's possible that you encounter UTF_8 BOM |
| 04:46 | tgoossens | mavbozo, I just noticed that with 'slurp' it is already like that |
| 04:47 | oOzzy`_ | justin_smith amalloy that explains things, thank you |
| 04:47 | tgoossens | mavbozo, apparantly it has to be UTF-16 |
| 04:47 | tgoossens | never heard of that |
| 04:48 | oOzzy`_ | Still, would you rather read code with chained map calls or one map call with a composed function? |
| 04:48 | mavbozo | tgoossens, java uses UTF-16 |
| 04:49 | justin_smith | oOzzy`_: if you chained transducers via map with one arg only (the function), that would be another approach |
| 04:50 | justin_smith | ,(apply str (sequence (comp (map char) (map inc) (map int)) "hello")) |
| 04:50 | clojurebot | #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:50 | mavbozo | tgoossens, 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:50 | amalloy | oOzzy`_: depends on xontext and how you wrote it, probably |
| 04:50 | justin_smith | ,(apply str (sequence (comp (map int) (map inc) (map char)) "hello")) |
| 04:50 | clojurebot | "ifmmp" |
| 04:51 | amalloy | neither is unconditionally better. it's like in english: sometimes i use the first person, and sometimes one speaks in the third person |
| 04:52 | oOzzy`_ | True. Doesn't really make a big difference anyway. |
| 04:53 | mungojelly | i like how here people talk about programming languages as language |
| 04:53 | justin_smith | with the transducer (single arg map) version, you can also intermix map with other operations like filter in a single step operation |
| 04:54 | mungojelly | i 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:55 | oOzzy`_ | justin_smith: how would that look like? Havn't used them yet, really :/ |
| 04:56 | justin_smith | ,(apply str (sequence (comp (map int) (filter even?) (map inc) (map char)) "hello, this is gibberish from a transducer")) |
| 04:56 | clojurebot | "imm-!ui!!ccsi!gs!!usoes" |
| 04:57 | oOzzy`_ | justin_smith: I would use the thread macro for those things |
| 04:57 | justin_smith | oOzzy`_: that's much less efficient |
| 04:57 | justin_smith | this is why those things exist |
| 04:58 | justin_smith | oOzzy`_: the thread version of the above would create 4 lazy-seqs, the transducer version shown creates 1 |
| 04:59 | oOzzy`_ | much less efficent? Pardon my ignorance, I have only watched the talk about transducers I fear. |
| 05:00 | justin_smith | oOzzy`_: 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:01 | amalloy | honestly though for most programs you dont' care about efficiency most of the time |
| 05:02 | justin_smith | sure, but the composed transducers also get something like the chained op syntax wise as well |
| 05:02 | justin_smith | with comp replacing ->>, and a small amount of extra wrapping |
| 05:02 | oOzzy`_ | amalloy: doesn't look worse than -zz though |
| 05:03 | oOzzy`_ | ->> |
| 05:18 | triss | whats the deal with type hints that look like this: |
| 05:18 | triss | ^"[[Lclojure.lang.Atom;" |
| 05:18 | triss | ^"[Lclojure.lang.IFn;" |
| 05:18 | justin_smith | triss: it's a java array of java arrays of clojure atoms |
| 05:18 | justin_smith | the second one is a java array of clojure functions |
| 05:19 | triss | ah 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:19 | justin_smith | that's the name of the class, and yeah, it's ugly |
| 05:20 | triss | oh well... I wonder If I can refactor it away. thanks man |
| 05:22 | TEttinger | triss: 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:23 | TEttinger | (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:23 | amalloy | TEttinger: "valid" in the sense that it's not valid at all? |
| 05:23 | TEttinger | it was in earlier clojure versions |
| 05:23 | amalloy | no |
| 05:23 | amalloy | it doesn't even get by the reader |
| 05:25 | TEttinger | ,(defn atom-arr [^[[Lclojure.lang.Atom atomz] @(aget ^[[Lclojure.lang.Atom atomz 0 0)) |
| 05:25 | clojurebot | #<RuntimeException java.lang.RuntimeException: Unmatched delimiter: )> |
| 05:25 | TEttinger | ,(defn atom-arr [^[[Lclojure.lang.Atom; atomz] @(aget ^[[Lclojure.lang.Atom; atomz 0 0)) |
| 05:25 | clojurebot | #<RuntimeException java.lang.RuntimeException: EOF while reading> |
| 05:25 | TEttinger | I remember doing this in 1.4 or so |
| 05:27 | amalloy | no way. that can't have worked in any version of clojure since at least 1.2 |
| 05:27 | TEttinger | it didn't have the semicolon, I know that much |
| 05:28 | amalloy | i wonder what would be the right way to search the git history to prove or disprove this claim |
| 05:28 | TEttinger | ,(defn floatarr [^[[F floatz] @(aget ^[[F floatz 0 0)) |
| 05:28 | clojurebot | #<RuntimeException java.lang.RuntimeException: Unmatched delimiter: )> |
| 05:28 | TEttinger | it was probably a bug if it did work... |
| 05:29 | oOzzy`_ | justin_smith: how would sort and flatten work with transducers? they can't be part of the composition, can they? |
| 05:29 | TEttinger | I do remember profiling and seeinga ton of class/byname stuff |
| 05:29 | justin_smith | oOzzy`_: some functions have transducer versions, others don't |
| 05:29 | TEttinger | flatten's usually a bad idea |
| 05:29 | TEttinger | ~flatten |
| 05:29 | clojurebot | flatten 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:29 | justin_smith | oOzzy`_: flatten doesn't have a transducer, but mapcat might |
| 05:30 | justin_smith | yeah, mapcat has a transducer, so you can do the saner alternative mentioned above |
| 05:31 | justin_smith | I don't think sort can be a transducer though... |
| 05:32 | oOzzy`_ | Alright, cheers |
| 06:15 | clgv | Hello, is there an easy way to access the ChannelId associated to a channel of a stream when using aleph? |
| 07:40 | hoppfull | hello! 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:42 | clgv | hoppfull: there is probably a simillar naming convention as in Clojure JVM |
| 07:44 | clgv | hoppfull: but the best way is to go through the official API which should exist for Clojure CLR as well |
| 07:45 | hoppfull | clgv: where can I find this official API? |
| 07:45 | hoppfull | clgv: I already know how to do this with JVM. The CLR is giving me difficulties. |
| 07:46 | clgv | hoppfull: there should be something similar as clojure.java.api.Clojure |
| 07:46 | clgv | hoppfull: https://github.com/clojure/clojure-clr/wiki/Using-ClojureCLR-in-a-C%23-project |
| 07:47 | hoppfull | clgv: yeah, I was looking into that |
| 07:47 | hoppfull | clgv: what is load.invoke("some.thing")? |
| 07:47 | clgv | hoppfull: just retrieve the variables you need via Clojure.var(...) and then invoke them as needed |
| 07:48 | clgv | hoppfull: e.g. IFn inc = Clojure.var("clojure.core", "inc"); inc.invoke(1); |
| 07:49 | clgv | <=> (clojure.core/inc 1) |
| 07:51 | hoppfull | clgv: 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:51 | clgv | yeah |
| 07:52 | hoppfull | clvg: mm. Another error. ArityException, wrong number of args(1) |
| 07:52 | hoppfull | clvg: this makes no sense |
| 07:53 | clgv | hoppfull: for `f`? then check its arity |
| 07:54 | hoppfull | It only takes a single argument. |
| 07:56 | hoppfull | This 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:59 | clgv | hoppfull: This is the official way to call your Clojure function from C# |
| 08:00 | clgv | hoppfull: I am not sure what your comparison scenario on the jvm is |
| 08:01 | Fender | Hi 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:02 | hoppfull | clgv: Compile hello.clj to hello.dll and hello.clj.dll, reference in c# like any other method. |
| 08:02 | troydm | what is the difference between (require 'test :reload) and (require 'test :reload :all) ? |
| 08:02 | troydm | what is the difference between (require 'test :reload) and (require 'test :reload :all) ? |
| 08:02 | troydm | what is the difference between (require 'test :reload) and (require 'test :reload :all) ? |
| 08:02 | clgv | hoppfull: This is not possible in Java neither |
| 08:03 | clgv | troydm: reloading the namespace only vs reloading all of its dependencies |
| 08:03 | hoppfull | clgv: Yes it is. I have an example right here that works wonderful. |
| 08:04 | troydm | clgv: does it removes all definitions from namespace when reloading it? |
| 08:04 | troydm | clgv: in both cases? |
| 08:04 | clgv | hoppfull: care to show that - so that I have an idea what you are trying to do |
| 08:04 | clgv | troydm: in none of them. that's why tools.namespace was written |
| 08:05 | troydm | clgv: ic, so I have to remove-ns |
| 08:05 | hoppfull | clgv: absolutely, let me write exactly what I do |
| 08:05 | hoppfull | clgv: give me a minute |
| 08:05 | clgv | troydm: or use tools.namespace ;) |
| 08:07 | troydm | clgv: ic, thx |
| 08:07 | hoppfull | clgv: here is hello.clj http://pastebin.com/YrqvVGzu |
| 08:07 | clgv | hoppfull: ah right, you are using gen-class |
| 08:08 | hoppfull | Then in repl I call (compile 'hello) which generates the class files |
| 08:08 | clgv | hoppfull: should be the same on the CLR |
| 08:08 | hoppfull | clgv: and visual studio recognizes the class and its member |
| 08:09 | hoppfull | clgv: and it recognizes the correct types and everything. But when I run it, it gives me errors. |
| 08:10 | clgv | hoppfull: you ruled out implementation or invocation errors? |
| 08:11 | xcv | What 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:12 | xcv | Any opinions on honeysql or yesql? |
| 08:12 | tdammers | yesql is refreshingly simple |
| 08:13 | xcv | I'd lean more toward dynamic query generation like honeysql or Korma, but I'm open to new ways of doing things. |
| 08:13 | hoppfull | clgv: I surrounded it with try catch and analyzing the message, brb |
| 08:13 | tdammers | the 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:13 | xcv | Yeah, that's what bothered me a bit. But of course, one can mix and match. |
| 08:14 | tdammers | also, if you need to construct queries dynamically, yesql is out |
| 08:14 | xcv | Yeah. |
| 08:14 | xcv | I guess yesql's sweet spot are complex, structurally static queries. |
| 08:14 | tdammers | yep |
| 08:15 | xcv | Building complex stuff with dynamic generators is a bit fiddly, but worth it if the dynamism is needed. |
| 08:15 | tdammers | if 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:15 | hoppfull | specified cast is not valied. I'm not casting anything. Is the int in c# not the same as int in clojure? |
| 08:16 | tdammers | c# may be casting implicitly, I think |
| 08:17 | clgv | hoppfull: what's your invocation look like? |
| 08:17 | hoppfull | clgv: I'm pasting my two files exactly |
| 08:17 | hoppfull | clgv: just a sec |
| 08:21 | hoppfull | http://pastebin.com/gzdFmkad, http://pastebin.com/NKpyRM94 |
| 08:22 | clgv | hoppfull: you have defined `f` with arity 2 but call it with arity 1 |
| 08:22 | freedon | Anyone have any pointers on resolving a FileNotFoundException Could not locate *__init.class error? |
| 08:22 | clgv | hoppfull: you probably want to remove the `this` |
| 08:22 | hoppfull | clgv: no, this has to be there. without it I get arity error. That I am assigning 2 with arrity 1. |
| 08:23 | oddcully | freedon: first shot in the dark: are you using a .cljc library with clojure 1.6 ? |
| 08:24 | clgv | hoppfull: I doubt that the `this` is correct there. That would explain the arity exception mentioned earlier |
| 08:25 | freedon | I'm not familiar with cljc unfortunately - I am using Clojure 1.7 |
| 08:25 | clgv | hoppfull: hm, ok might be valid - I only use static main method so far... |
| 08:25 | oddcully | freedon: then maybe you could provide the exact error and your requires/project file in a gist/refheap/...? |
| 08:26 | hoppfull | clgv: the arity exception dissappears if I use this. Yes, if it's static, then no this. |
| 08:27 | hoppfull | clgv: I'm sure it's something simple. |
| 08:28 | tdammers | hmm, is there any documentation on kioo's emit-opts argument? |
| 08:29 | clgv | hoppfull: I am not quite sure which problem remains if the arity exception is already fixed |
| 08:30 | freedon | Thanks taking a look - much appreciated. http://pastebin.com/mHkteUkx |
| 08:31 | hoppfull | clgv: it says in the c# file. I get error message "specified cast is not valid." |
| 08:33 | oddcully | freedon: shouldn't that be imports then? |
| 08:33 | clgv | hoppfull: no idea, where that comes from. I have no c# availbe here atm |
| 08:34 | clgv | hoppfull: does c# use auto-boxing? |
| 08:35 | clgv | hoppfull: you could use a decompiler and look at the decompiled hello class |
| 08:35 | hoppfull | clgv: I solved it (almost) |
| 08:36 | hoppfull | clgv: don't know what auto-boxing is. The decompiler is new to me. |
| 08:37 | hoppfull | clgv: If I redefine the function type signature from (int -> int) to (double -> double) instead it works. |
| 08:37 | hoppfull | What kind of ints are there? int, short and byte, right? |
| 08:37 | clgv | probably "long" as well |
| 08:38 | clgv | and "long" to "int" conversion is usually not applied implicitely. |
| 08:38 | hoppfull | clgv: interesting. x is to 5 what 5.0 is to 5D. |
| 08:38 | tdammers | generally, C# is more lenient with widening casts than with narrowing ones |
| 08:39 | tdammers | e.g., it'll complain about int -> byte, but not byte -> int |
| 08:39 | hoppfull | How do i specify a number as long? |
| 08:39 | freedon | oddcully: wow thanks big time. Think this is a classic case of trying to run before one can walk |
| 08:39 | hoppfull | 5L? |
| 08:39 | freedon | really appreciate your help. |
| 08:40 | luma | widening promotions (byte->short->int->long) can happen automatically, narrowing (long->int->short->byte) can't |
| 08:40 | luma | hoppfull, in clojure, integers are by default Long |
| 08:40 | tdammers | although IIRC int -> double is considered widening |
| 08:40 | luma | ,(type 1) |
| 08:40 | clojurebot | java.lang.Long |
| 08:41 | luma | yes, integer type to float/double is widening as well |
| 08:41 | hoppfull | longs worked |
| 08:42 | troydm | how can I remove only one occurence of value from vector? |
| 08:42 | hoppfull | if 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:43 | hoppfull | Is there a way to specify that the 4 is an int the same way I specify that 4 is a long with 4L? |
| 08:44 | hoppfull | It seems trivial now but I'd like to figure this out. |
| 08:48 | clgv | hoppfull: you could assign 4 to an int variable |
| 08:49 | hoppfull | clgv: interesting |
| 08:50 | hoppfull | clgv: no, it doesn't work. I guess it doesn't really matters. Longs and doubles work. But it's annoying. |
| 08:50 | hoppfull | clgv: I hope bool works. |
| 08:52 | hoppfull | boolean wors |
| 08:52 | hoppfull | *works |
| 09:02 | troydm | what is the simplest way to check if vector contains any elements of another vector? |
| 09:04 | tdammers | convert both to sets, find intersection |
| 09:06 | tdammers | ,(clojure.set/intersection (set [1 2 3]) (set [5 4 1])) |
| 09:06 | clojurebot | #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:06 | m1dnight_ | Is the dev of clj-slack here by any chance? |
| 09:07 | snowell | Looks like there's a julienXX here |
| 09:07 | snowell | That ^ should have pinged them |
| 09:08 | julienXX | hi :) |
| 09:08 | julienXX | is there something I can do for you m1dnight_ ? |
| 09:08 | troydm | tdammers: I want to preserve the position of elements in first vector |
| 09:08 | fehrenbach | ,(type (int 1)) |
| 09:08 | clojurebot | java.lang.Integer |
| 09:08 | m1dnight_ | Yeah i was looking at your bot and i was wondering if you are actively maintaining it? |
| 09:09 | m1dnight_ | I would like to contribute. |
| 09:09 | m1dnight_ | E.g., a module system |
| 09:09 | tdammers | ,(filter #(contains? (set [3 4 5 1]) %) [1 2 3]) |
| 09:09 | clojurebot | (1 3) |
| 09:09 | tdammers | something like this, then? |
| 09:10 | tdammers | (or filterv if you want to keep it a vector) |
| 09:10 | julienXX | m1dnight_ 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:10 | m1dnight_ | I have written my own irc bot which has such a system. Maybe youd like it. |
| 09:11 | julienXX | sure we are talking about the same clj-slack (https://github.com/julienXX/clj-slack)? |
| 09:13 | m1dnight_ | oh, it seems we are not! :) |
| 09:13 | m1dnight_ | oh wait. my bad. its clj-slackbot. |
| 09:13 | m1dnight_ | Sorry about the confusion! |
| 09:13 | snowell | Hey, I still brought people together :D |
| 09:13 | julienXX | np :D |
| 09:14 | m1dnight_ | the user is verma. He doesn't seem to be here. |
| 09:14 | m1dnight_ | Oh well, Ill fork it and go my own way. I was hoping to work on it together with someone :p |
| 09:14 | snowell | It looks like verma has been receptive of PRs in the past |
| 09:18 | m1dnight_ | 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:19 | m1dnight_ | `lein run` seems to work perfectly so I'm unsure what could be wrong. |
| 09:21 | vijaykiran | m1dnight_: possibly version conflicts |
| 09:22 | vijaykiran | m1dnight_: try a lien deps tree and check |
| 09:23 | m1dnight_ | lein deps tree doesnt give any output? |
| 09:23 | m1dnight_ | okay got it! |
| 09:25 | m1dnight_ | that is giving me some information but nothing concrete on jetty. Ill resolve these conflicts for now and then see. |
| 09:27 | vijaykiran | m1dnight_: looks similar - https://github.com/pedestal/app-tutorial/issues/42 |
| 09:41 | m1dnight_ | 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:42 | vijaykiran | m1dnight_: is the project somewhere on Github ? |
| 09:42 | m1dnight_ | right here: https://github.com/m1dnight/clj-slackbot |
| 09:49 | vijaykiran | m1dnight_: I suggest lein ancient - and update the versions |
| 09:50 | vijaykiran | m1dnight_: it worked with this : https://gist.github.com/vijaykiran/9b5f8b9bc09c9b2641db |
| 09:50 | roelof | Hello, Is it normal in Windows 10 that I cannot install Lighttable in the directory downloads ? |
| 09:50 | vijaykiran | m1dnight_: comparing deps before and after is left as an exercise :P |
| 09:51 | m1dnight_ | hahaha to the diff mobile |
| 09:51 | m1dnight_ | ,(inc vijaykiran) |
| 09:51 | clojurebot | #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:51 | m1dnight_ | (inc vijaykiran) |
| 09:51 | vijaykiran | roelof: not sure what you mean by "install" |
| 09:52 | roelof | vijaykiran: 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:53 | m1dnight_ | wow the deps tree for clj-http has shrunken immensly. |
| 09:53 | m1dnight_ | (im not sure about my grammar there) |
| 09:53 | clgv | roelof: If it's on the C:\ drive that's the case since Win 7 |
| 09:53 | clgv | roelof: you can adjust the permissions as admin |
| 09:54 | roelof | clgv: no it's a clean install of Win 10 |
| 09:54 | vijaykiran | roelof: perhaps a stupid question, are you sure you "unpacked it" and not running from within the zip ? |
| 09:54 | roelof | vijaykiran: no. when I try that I see a message that iI first need to unpack it |
| 09:55 | vijaykiran | roelof: okay, just checking :) as clgv pointed out perhaps it has something to do with UAC stuff |
| 09:56 | clgv | roelof: I meant they are enforcing those permission since win 7 and seem to continue in win 10 |
| 09:56 | roelof | I now will try uppack in Documents |
| 09:56 | vijaykiran | Isn't Program Files\LightTable more apt ? |
| 09:56 | clgv | wait? you can download to "Downloads" but not unpack there? muhahaha |
| 09:57 | roelof | I never had this problems earlier. A week ago I could install it without any problems |
| 09:57 | roelof | Maybe IM going seek for a cloud enviroment for clojure. This sort of things are no fun in Windows |
| 09:58 | roelof | clgv: that is correct |
| 09:59 | clgv | roelof: you could install a linux on a usb flash drive and use that for clojure dev |
| 09:59 | xemdetia | or virtualbox |
| 09:59 | xemdetia | and have a real linux |
| 10:00 | roelof | I will look what I do |
| 10:00 | clgv | sure. if win 10 let's him ;) |
| 10:00 | roelof | thanks all |
| 10:00 | clgv | roelof: but you could just change the directory permission ^^ |
| 10:01 | roelof | I will try |
| 10:35 | roelof | How can I make this script work at repl http://lpaste.net/142412 |
| 10:41 | vijaykiran | roelof: just type it in |
| 10:41 | vijaykiran | roelof: into the repl |
| 10:41 | roelof | So I cannot type it in a editor and then load it into repl ? |
| 10:42 | vijaykiran | roelof: depends on which editor you are using, you can also load a file into repl |
| 10:43 | roelof | I use the editor rom nitroius.io so I have to load it manually into repl |
| 10:43 | justin_smith | you can load from a file regardless of editor |
| 10:43 | vijaykiran | roelof: in the repl you can just use (load-file "filename") |
| 10:45 | roelof | (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:45 | roelof | I do this in the root directory of my project |
| 10:46 | justin_smith | roelof: can you guess what to do about the fact that it looks for "fourclojure/clore.clj.clj" |
| 10:46 | vijaykiran | roelof: try (load-file "clore.clj") not (load "clore.clj") |
| 10:47 | vijaykiran | http://webcache.googleusercontent.com/search?q=cache:ZDcY15uVus4J:https://clojuredocs.org/clojure.core/load-file |
| 10:48 | snowell | ,(doc load-file) ; vijaykiran: this is easier :) |
| 10:48 | clojurebot | "([name]); Sequentially read and evaluate the set of forms contained in the file." |
| 10:48 | vijaykiran | snowell: :) yup, I thought examples there were better |
| 10:48 | roelof | im giving up : fourclojure.core=> (load-file "clojure.clj") FileNotFoundException clojure.clj (No such file or directory) java.io.FileInputStream.open (FileInputStream.java:-2) |
| 10:48 | vijaykiran | roelof: what's your file name ? |
| 10:49 | vijaykiran | roelof: also, looks like your repl is already in the core namespace of your project |
| 10:49 | roelof | the file name is core.clj |
| 10:49 | roelof | very wierd |
| 10:50 | justin_smith | roelof: why did you ask for "clojure.clj" when the file is named "core.clj" |
| 10:50 | vijaykiran | roelof: ah, then you are in the namespace, can you "call" the function in the repl ? |
| 10:51 | roelof | I was thinkig yes, but when I do ( -main) I see another error message |
| 10:51 | vijaykiran | roelof: there was no -main in your namespace from lpaste, so just type (palingdrome '(1,2,3)) and see what happens |
| 10:52 | roelof | im going crazy now (-main) works |
| 10:54 | roelof | is there a way to reload the file so the new contents is avaible ? |
| 10:54 | justin_smith | sure, the same way you load it the first time |
| 10:55 | justin_smith | if you used require you can add :reload |
| 10:55 | roelof | oke, rhanks all Its time for dinner now |
| 11:29 | troydm | how can I exclude definition from (:use (my.lib this that)) ? |
| 11:29 | troydm | in (ns clause |
| 11:29 | justin_smith | ,(doc use) |
| 11:29 | clojurebot | "([& 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:29 | justin_smith | troydm: :exclude |
| 11:29 | troydm | justin_smith: thx, I'll try |
| 11:30 | justin_smith | also, the general community consensus is require with :as is almost always better than use |
| 11:30 | pjstadig | or require with :refer |
| 11:31 | justin_smith | :refer has the same problem with reloads, but yeah |
| 11:31 | troydm | how do I use :exclude exactly? |
| 11:32 | troydm | I've tried (:use [[mylib :exclude funname] myotherlib]) |
| 11:32 | troydm | but it seems it's not working |
| 11:32 | justin_smith | troydm: :exclude needs a vector |
| 11:32 | justin_smith | :exclude [funname] |
| 11:32 | justin_smith | also drop the output vector |
| 11:33 | justin_smith | (:use [mylib :exclude [funname]] myotherlib) |
| 11:34 | justin_smith | and don't use the (my.lib this that) shorthand |
| 11:34 | troydm | justin_smith: ahh, ic, thx |
| 11:41 | soleado | I'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:57 | roelof | Is there a alternative for light table. I cannot unpack it and when I try to run I see a virus error message |
| 12:04 | oddcully | roelof: cursive |
| 12:04 | clgv | roelof: Counterclockwise. but you probably need to unpack all of those |
| 12:08 | roelof | thanks, I will look at both |
| 12:11 | oddcully | roelof: if you are by chance already familiar with emacs or vim you might be better off with those instead of learning new tools |
| 12:15 | soleado | sublime text 3 |
| 12:16 | roelof | oddcully: nope iM not a vim or a emacs person. I like Lighttable but for some reason it wont install anymore |
| 12:45 | zexperiment | shame about light table, I'm using it with the vim bindings plugin |
| 13:20 | roelof | sveri: are you here ? |
| 13:21 | justin_smith | so 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:22 | justin_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:22 | cloj_dev | how can I update a map such that a nested vector is spliced? |
| 13:23 | cloj_dev | so that there is no longer a nested vector |
| 13:30 | matthavener | (update-in mymap [:some-key] #(apply concat)) ? |
| 13:32 | matthavener | er, with a % after concat |
| 13:32 | tsantos | When was the last time clojuredocs.org drew breath? |
| 14:00 | TimMc | Is that a fancy way of saying the site is down? |
| 14:02 | mavbozo | oh no! clojuredocs.org down |
| 14:07 | xemdetia | clojuredocs just needs some electrolytes |
| 14:11 | amalloy | oh, i thought it was a fancy way of saying it never gets updates |
| 14:12 | roelof | sveri: are you here ? |
| 14:13 | roelof | anyone else who has "installed " light table today ? |
| 14:21 | roelof | Nobody who can tell me if he zip from lighttable has a virus in it ? |
| 14:33 | ane | why would there be? |
| 14:39 | ane | has anyone implemented some sort of Travis CI setup which pushes Codox docs to github pages? |
| 14:40 | ane | can't seem to find anything |
| 15:12 | arrdem | clojuredocs looks fine right now... |
| 15:23 | zxc | Hello! What are the Clojure design patterns? |
| 15:27 | mavbozo | zxc, there's a talk about functional design patterns in clojure by stuartsierra http://www.infoq.com/presentations/Clojure-Design-Patterns |
| 15:28 | ane | arrdem: if you were replying to me, that's not at all what i was after |
| 15:30 | mavbozo | zxc, also there's a Clojure Applied book that helps me understand designing system with clojure |
| 15:31 | oddcully | and joy of clojure has a block about how to map OO patterns (if that was the question) |
| 15:32 | sandbags | any Cursive user know if there's a way to have it rename a .clj file to .cljc? |
| 15:34 | arrdem | cfleming: ping |
| 15:35 | sandbags | arrdem: thanks, I couldn't remember col's nick :) |
| 15:35 | arrdem | sure |
| 15:35 | sandbags | hrmm... from a github issue seems there isn't but may be in future |
| 15:36 | sandbags | i do wish duckduckgo was a better SE |
| 15:38 | zxc | mavbozo: Tank you! |
| 15:41 | neoncontrails | Help, O sage ones. I've managed to quash all my dev server errors but one. |
| 15:41 | neoncontrails | http://pastebin.com/8yn5Q9z6 |
| 15:42 | neoncontrails | Can anyone read a cause from this? I can't even find one of my src files referred to in the stack trace. |
| 15:44 | sandbags | neoncontrails: apologies in advance if this seems a dumb question but you haven't accidentally used a String for one of your namespace definitions? |
| 15:45 | sandbags | just looking at the definition of Named and guessing where it might be relevant |
| 15:46 | neoncontrails | I suppose it's possible -- yeah, you're right that seems like a solid conclusion. Let's see |
| 15:46 | sandbags | it is a classic Clojure exception though :) |
| 15:47 | neoncontrails | (I seem to be limited to pico via sshfs right now for some reason. I miss my syntax highlighting!) |
| 15:54 | arry | Hi! I've got a few questions about Reagent/re-frame. |
| 15:54 | arry | 1. How to include HTML entities (eg "•") in a Reagent component? If it's in a plain string, then it's html-escaped, not what I want. |
| 15:55 | dnolen | arry: you'll likely get a better answer in #clojurescript |
| 15:55 | dnolen | arry: there's also an active Reagent channel in Slack these days |
| 15:55 | arry | thanks, I didn't realize there's a special channel for it |
| 15:55 | neoncontrails | Me either. That's good to know :) |
| 15:59 | neoncontrails | sandbags: 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:01 | neoncontrails | cjlarose: Meetup Chris! |
| 16:09 | ucb | trying 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:09 | ucb | has 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:02 | gfredericks | if you used get-in with indexes I think you'd get nils |
| 18:02 | gfredericks | no I take that back |
| 18:02 | gfredericks | ,(get-in [2] 13) |
| 18:02 | clojurebot | #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:02 | gfredericks | ,(get-in [2] [13]) |
| 18:02 | clojurebot | nil |
| 18:02 | gfredericks | wait yes |
| 18:02 | gfredericks | it does give nils |
| 18:09 | cloj_dev | test |
| 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:10 | justin_smith | ,(get-in [2] [13] :NUMBERWANG) |
| 18:11 | clojurebot | :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:12 | justin_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:51 | cfleming | arrdem: ack |
| 19:29 | arrdem | cfleming: someone was asking about renaming a .clj to .cljc |
| 19:30 | wmealing | yeah, whats that about ? |
| 19:30 | wmealing | clj vs cljc ? |
| 19:30 | cfleming | Oh right. Sadly not possible right now, although it sounds like sandbags found the relevant issue. |
| 19:31 | arrdem | on 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:32 | cfleming | Nice - will you be at the conj to pay up? |
| 19:32 | arrdem | nah conj is right in the middle of exams and this year is really hectic |
| 19:32 | arrdem | not that I don't want to since Chas is making it out of the woods to appear |
| 19:33 | cfleming | Oh nice. |
| 19:34 | cfleming | Bummer you won't be there, though. |
| 19:34 | cfleming | I'll have to have the drink without you. |
| 19:34 | arrdem | I can't justify the time :/ |
| 19:34 | cfleming | Although I'll be jetlagged up the wazoo |