2015-12-04
| 01:01 | allen_ | hello |
| 01:01 | allen_ | can someone help me load a java file into a clojure project |
| 01:02 | allen_ | i keep getting class not found exception |
| 02:03 | sara | is anyone know how to connect mysql database with my clojure project using clojurescript and om? |
| 02:39 | Lovey | wow . hello |
| 02:42 | thatslif_ | having trouble understanding this, any suggestions? #(reduce + (map (constantly 1) %)) |
| 02:56 | opqdonut | thatslif_: that's a convoluted way of computing the length of the input |
| 02:56 | opqdonut | thatslif_: (reduce + foo) is the sum of all elements in list foo |
| 02:57 | opqdonut | thatslif_: (constantly 1) is a function that always returns 1: ((constantly 1) x) ==> 1 |
| 02:57 | opqdonut | thatslif_: so (map (constantly 1) bar) gives you a list with the same number of elements as bar, but all of the elements are 1 |
| 02:58 | thatslif_ | oh awesome, thanks for the explanation! |
| 03:32 | bionj | i'm trying to un-interleave by an arbitrary number of steps. for 2 dimensions this works: ((juxt #(take-nth 2 %) #(take-nth 2 (rest %))) (range 10)). but i need n dimensions |
| 03:32 | bionj | any thoughts? |
| 03:59 | kungi | Is cider 0.10 connect to lein repl so much faster or does it just feel like it? |
| 04:04 | bbaz | hi |
| 04:16 | Trioxin | i think my IDEA might be messed up. I'm just now finally getting back to learning clojure. what's the procedure for loading a namespace into the repl again so I can call functions in lets say the core.clj file? |
| 04:17 | Trioxin | i tried running the iml, project.clj, and then the core file all in the repl but wasn't able to run the functions I'm after |
| 04:17 | Trioxin | i'm using cursive |
| 04:18 | Trioxin | nvm, switch namespace /facepalm |
| 04:18 | Trioxin | actually that didn't work |
| 04:20 | Trioxin | (myfunc somestring) |
| 04:22 | Trioxin | it's unable to resolve the function name |
| 04:23 | Trioxin | nvm I got it |
| 05:41 | somnasper | http://www.infoworld.com/article/2987529/java/insider-oracle-lost-interest-in-java.html |
| 05:41 | somnasper | So, what does this mean for Clojure's future? |
| 05:41 | mavbozo | java platform is one of those platform that is too big to fail |
| 05:42 | mavbozo | lots of multi-nationals, mega corporations depend on java platform |
| 05:42 | somnasper | So, it's more likely they'll get bought out than successfully stop supporting it? |
| 05:48 | mavbozo | somnasper, more likely oracle gets more pressure from those big mega corps to continue support java |
| 05:48 | mavbozo | most probably by buying oracle shares |
| 05:51 | powered | or we'll just all bail to clojurescript |
| 05:51 | somnasper | Argh, Figwheel keeps freezing on "notifying browser that file changed" |
| 05:51 | somnasper | It didn't do this before, and it's doing it on two different projects |
| 05:53 | somnasper | Server's working, but shows "Page not found" |
| 05:56 | TEttinger | I think the JVM has been slowly dying for a while under Oracle. I would not be surprised if the JDK9 changes to modularity finally encourage a large-scale fork of the VM itself |
| 05:56 | TEttinger | (to remove any link to oracle) |
| 05:56 | TEttinger | (probably also to fix things they have neglected) |
| 05:58 | powered | I don't think java will break backwards compatibility |
| 05:59 | TEttinger | I think they did in 8, in a few tiny ways |
| 06:01 | TEttinger | oooh this is good |
| 06:01 | TEttinger | http://docs.oracle.com/javase/7/docs/api/java/awt/image/renderable/RenderContext.html |
| 06:01 | TEttinger | still in 8 http://docs.oracle.com/javase/8/docs/api/java/awt/image/renderable/RenderContext.html |
| 06:02 | TEttinger | concetenate eh? |
| 06:02 | TEttinger | were they hiring kids fresh out of middle school? |
| 06:02 | TEttinger | "spell check good bro" |
| 06:03 | powered | " It is here for backward compatibility with previous releases which misspelled the method name" |
| 06:03 | powered | lol |
| 09:07 | powered | memoize doesn't actually guarantee that the function is only called once per argument |
| 09:07 | powered | how would I get such a setup? |
| 09:08 | powered | actually nevermind that, I logged something double so there's no problem :) |
| 09:21 | jonathanj | how would i perform some function f on every key-value pair in a map recursively and transform the map by the return value |
| 09:22 | beaky | iterate? |
| 09:22 | jonathanj | clojure.walk/walk seems like what i would want, calling walk again from the inner function if the value is a map |
| 09:22 | beaky | ,(iterate (fn [[k v]] (+ k v)) {0 1 1 2 2 3}) |
| 09:23 | clojurebot | #<UnsupportedOperationException java.lang.UnsupportedOperationException: nth not supported on this type: PersistentArrayMap> |
| 09:23 | beaky | oops |
| 09:25 | muhuk | ,(map (fn [[k v]] (+ k v)) {0 1 1 2 2 3) |
| 09:25 | clojurebot | #<RuntimeException java.lang.RuntimeException: Unmatched delimiter: )> |
| 09:25 | muhuk | ,(map (fn [[k v]] (+ k v)) {0 1 1 2 2 3}) |
| 09:25 | clojurebot | (1 3 5) |
| 09:29 | jonathanj | i want to retain the structure, just transform the values recursively |
| 09:30 | MJB47_ | ,(map (fn [[k v]] {k (+ k v)}) {0 1 1 2 2 3}) |
| 09:30 | clojurebot | ({0 1} {1 3} {2 5}) |
| 09:30 | MJB47_ | ? |
| 09:30 | MJB47_ | nvm |
| 09:31 | muhuk | (into {} (map (fn [[k v]] ... [new-k new-v]) coll)) actually |
| 09:32 | muhuk | jonathanj: and the fn inside map may be the outer function (calling itself) |
| 09:54 | sdegutis | Hi there. |
| 09:56 | beaky | hello sdegutis |
| 09:56 | sdegutis | How are you. |
| 09:58 | beaky | im alright |
| 11:29 | puredanger | hello all, the 2015 Clojure community survey is now open - would be great to see your responses! http://blog.cognitect.com/blog/2015-clojure-community-survey |
| 11:39 | ARM9 | not sure what the difference between 'slightly important' and 'somewhat important' is |
| 11:40 | ARM9 | both sound equally indecisive to me |
| 11:49 | xemdetia | ARM9, to me somewhat important > slightly important |
| 11:52 | ARM9 | maybe the meaning is lost in translation, both words translate to pretty much the exact same meanings |
| 11:53 | ARM9 | would've been clearer to just use 'important' for the third option imo |
| 11:53 | puredanger | it's a fairly arbitrary scale :) |
| 11:53 | xemdetia | well then you should let the user define their own in a variety of emojis |
| 11:55 | ARM9 | 4 👍 out of 5 |
| 11:56 | jonathanj | the dictionary definition of "slightly" is "to a small degree", while the definition of "somewhat" is "to a moderate extent" |
| 11:57 | jonathanj | maybe they could have been worded in a way that makes their differences more apparent to the majority of readers but they do have different meanings |
| 12:06 | kwladyka | (defn bar [page-size elems & opts] ...) (defn foo [page-size & opts] (rotator-cms page-size 1 opts)) <- how to pass foo opts into bar opts :) |
| 12:10 | sdegutis | puredanger: your css is so post-modern that I had a really hard time finding the link to the survey itself :( |
| 12:11 | puredanger | sorry :) |
| 12:11 | puredanger | squarespace junk |
| 12:12 | sdegutis | puredanger: ok :) |
| 12:13 | sdegutis | puredanger: also 1/4 of these questions have words and phrases i dont understand, and 1/2 of the questions are worded such that i cant answer it correctly given the choices |
| 12:13 | puredanger | such as? |
| 12:13 | kwladyka | ok i know, with apply :) |
| 12:13 | sdegutis | puredanger: in #7 what is the difference between trad-infra and public-clud? |
| 12:13 | puredanger | public cloud would be stuff like AWS |
| 12:13 | sdegutis | puredanger: such as: in #5, our app has parts that are customer facing and parts that are internal |
| 12:13 | sdegutis | puredanger: then whats trad-infra? |
| 12:13 | puredanger | trad-infra would be stuff like a box in your own data center |
| 12:14 | puredanger | in #5, can't you select both? |
| 12:14 | sdegutis | puredanger: okay that makes a lot more sense; i didnt know those phrases before, some "e.g. [bla]" might help next to answers |
| 12:14 | puredanger | ok |
| 12:14 | sdegutis | puredanger: for #5 yes but thats probably not what you mean by the question: the internal parts are for devops and scheduling and stuff, but they only serve the user facing parts |
| 12:15 | puredanger | I would just check both |
| 12:15 | sdegutis | puredanger: and in #3 its difficult to say my "primary" language, because i used several of them for work and several of them for hobby outside work, all being used heavily |
| 12:15 | jonathanj | how would i associate a value with a key only when the key doesn't exist? |
| 12:15 | sdegutis | puredanger: ok |
| 12:15 | puredanger | then check multiple |
| 12:15 | puredanger | that's why it's multi select |
| 12:15 | sdegutis | puredanger: ok just wanted to let you know in case you intended teh answers to mean different things than im meaning when i check them |
| 12:16 | puredanger | jonathanj: you can check if it exists first |
| 12:16 | sdegutis | puredanger: from these questions and how they're worded, i have a strong feeling that you're not gonna get accurate data from me and from a lot of people is what i mean according to the definitions at their face value |
| 12:16 | puredanger | sdegutis: I think it's impossible for questions to be worded in such a way that they are universally understood |
| 12:16 | sdegutis | puredanger: i.e. #5 is going to look like i use clojure for micro-services and stuff, when thats not really the case |
| 12:17 | sdegutis | puredanger: ok +1 |
| 12:17 | sdegutis | puredanger: also im guessing #6 doesnt really apply to teams of 1 dev |
| 12:17 | puredanger | if something doesn't apply, skip it |
| 12:17 | puredanger | only the first 2 questions are required |
| 12:17 | sdegutis | oh |
| 12:17 | sdegutis | ok |
| 12:23 | ecmike | puredanger: done, first two pages only though |
| 12:23 | puredanger | well it doesn't count till you get to the end :) |
| 12:24 | ecmike | I clicked next to the end, just didn't fill anything out after page 21 |
| 12:24 | ecmike | *2 |
| 12:27 | puredanger | cool, thx! |
| 13:35 | Guest19_ | hi! I was wondering if someone could help me write a function having trouble getting parity with |
| 13:36 | Guest19_ | fuck changed name. |
| 13:36 | Guest19_ | anywyas, does anyone have a good example of a 'dissoc-in' that handles vectors as well? |
| 13:38 | Guest19_ | or i guess a dissoc that handles vectors. |
| 13:38 | momerath | you might check out Specter: https://github.com/nathanmarz/specter |
| 13:38 | WorldsEndless | Is there a more elegant way to perform this kind of lazy-seq/defrecord-delving? https://www.refheap.com/112348 |
| 13:40 | WorldsEndless | I guess a related question: is "first" the best way to grab a scalar value out of a lazy seq? |
| 13:42 | Guest19_ | @momerath what should i check out in Specter? |
| 13:42 | justin_smith | WorldsEndless: especially when experimenting in the repl, I find -> very helpful with things like that |
| 13:43 | justin_smith | so I'd start with (-> personal-info type) - see it's a lazy-seq, (-> personal-info first type) - see it's a hash, (-> personal-info first keys) - OK, we've got a :content key (-> personal-info first :content type) etc. etc. etc. |
| 13:44 | justin_smith | WorldsEndless: I find the linear chain of lookups with -> much easier to read and explore with, compared with mixed nesting like you have |
| 13:46 | beaky | hello |
| 13:46 | WorldsEndless | justin_smith: Yeah, usually I use the thread, too, but I'm havin gtrouble at the point I get to the (filter #()) portion, since macros can't be nested |
| 13:46 | justin_smith | WorldsEndless: check this out --- |
| 13:46 | justin_smith | ,'#(foo) |
| 13:46 | clojurebot | (fn* [] (foo)) |
| 13:47 | justin_smith | fn does nest, and #() is just a shorthand for fn |
| 13:47 | WorldsEndless | gotcha |
| 13:47 | justin_smith | WorldsEndless: and if you want to switch away from ->, deep nesting only obfuscates, I'd use let bindings instead |
| 13:48 | justin_smith | hard to read code leads to hard to find bugs |
| 13:48 | WorldsEndless | justin_smith: I definitely want -> . It's just a matter of getting it right with the records and filters |
| 13:48 | justin_smith | WorldsEndless: sure, ->> nests inside -> |
| 13:49 | WorldsEndless | justin_smith: really? I'll have to think about that. It's making me dizzy. |
| 13:49 | justin_smith | (-> personal-info first :content (->> filter (fn [x] (= :PFNAME (:tag x)))) first :content first) |
| 13:50 | justin_smith | oh, wait |
| 13:50 | justin_smith | no, yeah, that should work |
| 13:50 | justin_smith | except filter needs parens around it, of course |
| 13:51 | Guest19_ | can i get feedback on |
| 13:51 | Guest19_ | https://gist.github.com/fzakaria/740c16e07fb3835d2285 |
| 13:51 | Guest19_ | seems to work in my case of using JSON pointers (to remove a certain element) in a nested container with maps + vectors |
| 13:52 | justin_smith | Guest19_: on line 7, I think you can get away with using into instead of vec and concat |
| 13:52 | justin_smith | ,(into (subvec [:a :b :c :d] 2 3) [:g :h :i]) |
| 13:52 | clojurebot | [:c :g :h :i] |
| 13:52 | justin_smith | that saves a few operations |
| 13:52 | Guest19_ | thanks |
| 13:53 | Guest19_ | simplified |
| 13:54 | Guest19_ | is there a lein plugin that will minimize my requires |
| 13:54 | Guest19_ | to what im using |
| 13:55 | justin_smith | Guest19_: I think eastwood might help with unneeded required libs - if not that slamhound might help |
| 13:56 | Guest19_ | thanks. |
| 13:59 | WorldsEndless | Well, it's still some of the more difficult clojure code I've had to read, but it's much better: https://www.refheap.com/112348 |
| 14:00 | justin_smith | WorldsEndless: also, an alternative to (fn [x] (= :PFNAME (:tag x))) is (comp #{:PFNAME} :tag) |
| 14:01 | justin_smith | whether the latter is more straightforward might be controversial |
| 14:01 | WorldsEndless | Guess it might be time for me to learn (comp) |
| 14:02 | justin_smith | the function is simple - knowing how it can simplify code and make it more powerful is the tricky / subtle part |
| 14:02 | justin_smith | imho |
| 14:02 | justin_smith | it's sort of a functional programming nerd goto, replacing nested function calls with using comp to generate a function |
| 14:03 | rhg135 | Very much so, it just obfuscates mine |
| 14:04 | rhg135 | Knowing when to use it is difficult |
| 14:27 | timmmm | ,q |
| 14:27 | clojurebot | #error {\n :cause "Unable to resolve symbol: q in this context"\n :via\n [{:type clojure.lang.Compiler$CompilerException\n :message "java.lang.RuntimeException: Unable to resolve symbol: q 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: q in this context"\n ... |
| 14:28 | beaky | hehe |
| 14:40 | jakedust | hi! say I want to validate that for a map, every value is also a key. is prismatic schema good for that? |
| 14:40 | jakedust | I'd just to attach a predicate like (clojure.set/subset? (set (vals my-map)) (set (keys my-map))) to a schema |
| 14:42 | justin_smith | jakedust: well, you can express the fact that the map is made of keyword keys with keyword values directly in a schema definition |
| 14:42 | clojurebot | In Ordnung |
| 14:43 | justin_smith | {s/Keyword s/Keyword} |
| 14:44 | justin_smith | jakedust: nb. keywords are not only for map keys (of course) and are not the only type allowed as keys in maps |
| 14:44 | MJB47 | i think he means more {:a :b :b :a} is valid but {:a :b :c :a} isnt |
| 14:44 | jakedust | yup, as MJB47 said |
| 14:44 | justin_smith | oh |
| 14:45 | justin_smith | that's different, sorry |
| 14:45 | jakedust | actually, I'd happy just being able to say that (vals map) is a subset of (keys map) |
| 14:46 | jakedust | while using the nice machinery of prismatic schema |
| 14:47 | justin_smith | jakedust: yeah, clearly I misunderstood what you were trying to do, but it looks like that's a reasonable approach |
| 15:11 | beaky | how do i do imperative programming in clojure |
| 15:11 | beaky | with good old mutable variables and for (int i = 0; i < n; i++) loops |
| 15:11 | justin_smith | beaky: if you use mutable java data types, you can do everything to them in clojure that you can in java |
| 15:12 | ARM9 | (dotimes [i n] foo) |
| 15:12 | muhuk | beaky: check out https://github.com/ztellman/proteus |
| 15:36 | kenrestivo | what's the general philosophy on dealing with a java lib that has lots of mutable state? use its state, duplicate its functionality outside of the lib using clojure reference types? |
| 15:36 | kenrestivo | similar question regarding callbacks: deal with its callback hell? or wrap it in core.async channels and go loops? |
| 15:38 | muhuk | kenrestivo: depends on the functionality I guess |
| 15:38 | kenrestivo | yeah, maybe there's no right answer. |
| 15:38 | muhuk | kenrestivo: but generally the host functionality is embraced |
| 15:39 | muhuk | if you're interested, you can take a look at ring jetty adapter's source for example |
| 15:39 | kenrestivo | that's a great idea, thanks. |
| 15:39 | muhuk | yw |
| 15:40 | muhuk | another interesting case could be clojure.java.jdbc |
| 15:41 | kenrestivo | interesting is an apt word |
| 15:42 | kenrestivo | i think in this case i'm going to go all out and write a core.async wrapper |
| 15:42 | kenrestivo | this is an mqtt library. there's already a clojure wrapper that works ok but is kind of thin |
| 15:43 | kenrestivo | there's a neat core.async wrapper for sockets that i found a while ago; i might use that for inspiration |
| 15:43 | kenrestivo | com.gearswithingears/async-sockets <-- something like this for mqtt is what i'd really like, so i'll try writing it |
| 15:45 | kenrestivo | better link https://github.com/bguthrie/async-sockets the existing wrapper is here https://github.com/clojurewerkz/machine_head |
| 17:35 | Frozenlo` | yogthos: is there a function to create a table of contents in your markdown-clj? I gave it a quick look but found nothing of the sort. |
| 17:47 | justin_smith | Frozenlo`: markdown can do TOC? |
| 17:51 | Frozenlo` | Markdown lets you make titles/subtitles/subsub...titles. A TOC could just take them a link to their anchor. |
| 17:53 | Frozenlo` | /s/take/make |
| 17:59 | alive876 | hi, newbie from a tutorial, when i run "lein ring server-headless " i get "'ring' is not a task. Did you mean this? lein run "the main program is here web.clj http://pastebin.com/yJ1Wfr9m and this is project.clj http://pastebin.com/zQn1up7i |
| 18:00 | Frozenlo` | alive876: I think you are missing the lein-ring plugin. |
| 18:01 | Frozenlo` | Wait, that's not the project.clj |
| 18:01 | justin_smith | yeah, that's a namespace, not a project.clj |
| 18:02 | justin_smith | alive876: did you use lein new to make your project, or just copy that one file? |
| 18:03 | alive876 | i used this "lein new heroku crisco" from the tutorial |
| 18:03 | justin_smith | alive876: and then did you cd into the created dir before starting lein? |
| 18:04 | alive876 | yes |
| 18:04 | justin_smith | can you share your actual project.clj? because that file above is not a valid project.clj, it's a namespace defining an http server |
| 18:05 | alive876 | ok |
| 18:07 | alive876 | here is the project,clj, sorry about mixup http://pastebin.com/PZj7CywW |
| 18:08 | alive876 | and this is tutorial http://ben.vandgrift.com/2014/04/24/a-clojure-datomic-web-app-tutorial.html |
| 18:08 | justin_smith | alive876: yeah, that project doesn't have the lein ring plugin, so the lein ring commands won't be available |
| 18:09 | justin_smith | I guess that's a bug in the template? |
| 18:09 | alive876 | seems to be |
| 18:09 | alive876 | there are those other ring deps in there |
| 18:10 | justin_smith | easiest fix is to add the lein-ring plugin under the :plugins key https://github.com/weavejester/lein-ring [lein-ring "0.9.7"] |
| 18:10 | justin_smith | right, but you need a lein plugin to add lein commands |
| 18:10 | justin_smith | if you don't want to use lein ring you can start ring manually, but lein-ring is convenient (especially for the lein ring uberwar task) |
| 18:11 | alive876 | ok, much thanks |
| 18:11 | justin_smith | alive876: one of my complaints about lein is that you can't explicitly ask for a template version (as far as I know), which makes tutorials break :( |
| 18:12 | justin_smith | so the users who are least able to fix the problem are stuck with broken intro materials |
| 18:12 | alive876 | yea, as a newbie is kind of discourging |
| 18:13 | alive876 | but its nice to have you guys out there! |
| 18:13 | ecmike | but irc help is encouraging, no? |
| 18:13 | justin_smith | we try |
| 18:14 | alive876 | its the greatest, thats atleast half of why i'm going with clojure |
| 18:14 | alive876 | i mean that too |
| 18:24 | WorldsEndless | Can anyone see why the final line brings a "No matching field found" error? https://www.refheap.com/112349 |
| 18:24 | WorldsEndless | Even autocomplete agrees with all commands, but the REPL won't take it. |
| 18:28 | WorldsEndless | Think I found the problem. Checking: clojure nil will be read as java "null", right? |
| 18:37 | alive876 | at this point it tells me it wants :ring {:handler your.app/handler} , however i'm not sure what your.app is, the project name is "crisco" but i am aware that namespaces may come into play? |
| 18:44 | gfredericks | WorldsEndless: yes, nil and null are entirely the same |
| 18:45 | gfredericks | different names for the same thing |
| 18:45 | WorldsEndless | Do I need to do anything special to invoke a java final class in Clojure? |
| 18:45 | WorldsEndless | Using (Class.) isn't seeming to do it fo rme |
| 18:45 | gfredericks | what does invoking a class mean? |
| 18:45 | gfredericks | (Class.) will instantiate it with the no-arg constructor |
| 18:46 | WorldsEndless | I'm trying to get one of these guys: https://pdfbox.apache.org/docs/2.0.0-SNAPSHOT/javadocs/org/apache/pdfbox/io/MemoryUsageSetting.html |
| 18:47 | gfredericks | do you know how you would do it in java? |
| 18:47 | WorldsEndless | But I'm getting a "no matching ctor" error. |
| 18:48 | gfredericks | right, there is no public constructor it looks like |
| 18:48 | gfredericks | (so that shouldn't work in java either) |
| 18:48 | WorldsEndless | Yeah, thought I just wasn't finding it. |
| 18:48 | gfredericks | there are various static methods that return instances of the class |
| 18:48 | gfredericks | maybe one of those does what you want |
| 18:49 | gfredericks | e.g. (MemoryUsageSetting/setupTempFileOnly) would do something (dunno what) |
| 18:49 | WorldsEndless | Yeah, that's what I was wondering |
| 18:49 | WorldsEndless | Ok, I'll try that syntax |
| 18:49 | gfredericks | (works for any static method) |
| 18:54 | alive876 | newbie here, in the ring plug-in , it mentions it needs this handler in project file :ring {handler hello-world.core/handler}, hello-world.core supposed to me the path to the core.clj file? tanks |
| 19:00 | gfredericks | alive876: under default leiningen settings, you would have src/hello_world/core.clj with a (defn handler ...) inside it |
| 19:05 | alive876 | <gfredericks> thanks. i am not actually using that hello world, one i am instead trying to get this other example working refered to above, where i think the equivalent is this file, http://pastebin.com/zQn1up7i but i don't see any ring handlers defined |
| 19:08 | gfredericks | alive876: `app` is technically a ring handler, but there are features in wrap-app that aren't included there |
| 19:08 | gfredericks | wrap-app isn't a handler, it's a function that returns a handler |
| 19:08 | gfredericks | and I'm not sure how to make that work with lein-ring |
| 19:09 | alive876 | so it seems another mistake in this template (?) |
| 20:41 | troydm | how do I override default toString() implementation for a deftype? |
| 20:41 | troydm | ah, nvm |
| 21:14 | troydm | https://www.refheap.com/112355 |
| 21:14 | troydm | is there any way to improve this? |
| 21:15 | troydm | I mean instead of writing everytime a function for both t and f, to instead use something that would be more suitable? |
| 21:16 | troydm | I'm thinkin of omitting a# part and instead have it just and then write functions as (+ 3 a) etc |
| 21:16 | troydm | but not sure if it's good idea |
| 21:16 | michaelrose | anyone use vim + clojure + fireplace + eastwood? |
| 21:17 | troydm | michaelrose: I use but don't use eastwood |
| 21:17 | troydm | michaelrose: I'm not sure what that even is |
| 21:17 | michaelrose | I seem to have the first 3 working but have some trouble with the last, I just basically want it to highlight stupid errors if any while I'm learning |
| 21:17 | michaelrose | its a linter for syntastic |
| 21:17 | troydm | oic, nope never tried it |
| 21:20 | michaelrose | any decent alternatives? |
| 21:22 | troydm | michaelrose: not sure, never tried using linters, but you probably can use it from inside clojure code as a library probably |
| 21:22 | michaelrose | that does not appear to be so |
| 21:22 | troydm | michaelrose: or some plugin for lein |
| 21:22 | michaelrose | its both a plugin in lein and a vim plugin |
| 21:23 | troydm | michaelrose: use it as lein plugin then |
| 21:23 | troydm | michaelrose: not from vim but using command line |
| 21:24 | michaelrose | that kind of negates the usefulness |
| 21:25 | michaelrose | well its not so bad evaluating with fireplace gives an error and a line number |
| 21:26 | WickedShell | ,(float-array [1 2 3]) |
| 21:26 | clojurebot | #object["[F" 0x2336417 "[F@2336417"] |
| 21:26 | WickedShell | https://clojuredocs.org/clojure.core/float-array leads me to believe I should get float[] back? not obj? |
| 21:27 | WickedShell | ,(type (float-array [1 2 3])) |
| 21:27 | clojurebot | [F |
| 21:27 | michaelrose | and I can still run it from the command line to check the whole project so thats good enough |
| 21:54 | WickedShell | Has anyone ever had a problem creating a java array? all the into-array or float-array etc don't seem to be given me an array back, at least in the REPL if I print I never see []'s and they don't seem quite right (ie type gives me F or LFloat) |
| 22:33 | TEttinger | WickedShell: that's one of those weirdnesses of the JVM |
| 22:33 | TEttinger | ,(type (int-array [1 2 3])) |
| 22:33 | clojurebot | [I |
| 22:33 | TEttinger | ,(type (long-array [1 2 3])) |
| 22:33 | clojurebot | [J |
| 22:34 | TEttinger | ,(type (boolean-array [true true false])) |
| 22:34 | clojurebot | [Z |
| 22:34 | WickedShell | TEttinger, yeah I've determined it seems to be working just that its not a response on type like I expected at all... |
| 22:34 | TEttinger | those are, with some caveats, essentially the types |
| 22:34 | TEttinger | you can type hint something as taking a long array with ^longs or with ^"[L" |
| 22:35 | TEttinger | err |
| 22:35 | TEttinger | you can type hint something as taking a long array with ^longs or with ^"[J" |
| 22:35 | WickedShell | I now wish I marked error's as higher on the state of clojure survey :P I've been tripping on that for a bit for now :P |
| 22:35 | TEttinger | 2D long array? [[J |
| 22:35 | WickedShell | is there a list somewhere of the various I J Z stuff? |
| 22:35 | TEttinger | yeah, I found a blogpost a while back... |
| 22:46 | TEttinger | WickedShell: http://docs.oracle.com/javase/7/docs/technotes/guides/jni/spec/types.html#wp276 |
| 22:46 | TEttinger | damn... |
| 22:46 | TEttinger | clojurebot: primitive arrays |are| http://docs.oracle.com/javase/7/docs/technotes/guides/jni/spec/types.html#wp276 |
| 22:46 | clojurebot | Alles klar |
| 22:47 | TEttinger | ~primitive arrays |
| 22:47 | clojurebot | primitive arrays are http://docs.oracle.com/javase/7/docs/technotes/guides/jni/spec/types.html#wp276 |
| 22:47 | WickedShell | hey thanks! now to bookmark that again as I spent waaay to long on that |
| 22:48 | TEttinger | same here! I can't believe it isn't in a more prominent place somewhere |