2015-01-25
| 14:48 | gfredericks | chouser update: chouser appreciates being watched out for |
| 14:48 | chouser | That's ... comforting? |
| 14:49 | gfredericks | clojurebot: chouser is C. House R. |
| 14:49 | clojurebot | Alles klar |
| 14:49 | sdegutis | justin_smith watches over chouser as he sleeps, ostensibly to protect him etc |
| 14:53 | uptown | to catch a predicator |
| 14:56 | imanc | holy carp - an hour staring at that code example and the penny has just dropped |
| 14:56 | SagiCZ1 | imanc: was it loud? |
| 14:57 | imanc | oh yes |
| 14:58 | augustl | is there a function to create an infinite sequence of the same item? |
| 14:59 | augustl | I'm trying to (zipmap that-infinite-collection (map :get-some-val other-coll)) |
| 14:59 | justin_smith | augustl: repeatedly? |
| 14:59 | SagiCZ1 | ,(take 10 (repeat 4)) |
| 14:59 | justin_smith | or even repeat |
| 14:59 | clojurebot | (4 4 4 4 4 ...) |
| 14:59 | justin_smith | yeah |
| 14:59 | augustl | on second thought.. will zipmap handle an infinite sequence as its first argument? :) |
| 14:59 | justin_smith | augustl: wait, it would need to be the second arg... |
| 15:00 | justin_smith | augustl: it will handle it, by having each one replace the previous |
| 15:00 | justin_smith | so you end up with only one key |
| 15:00 | augustl | doh, what was I thinking, brainfart |
| 15:00 | justin_smith | &(zipmap (repeat 10) [:a :b :c :d]) |
| 15:00 | lazybot | ⇒ {10 :d} |
| 15:01 | chouser | that amuses me |
| 15:01 | justin_smith | &(zipmap [:a :b :c :d] (repeat 10)) |
| 15:01 | lazybot | ⇒ {:d 10, :c 10, :b 10, :a 10} |
| 15:02 | kaiyin | clojurebot is Dutch? |
| 15:02 | justin_smith | chouser: we can add it to our obfuscated clojure toolkit, along with ##((get get get get) {:a 0} :a) |
| 15:02 | lazybot | ⇒ 0 |
| 15:03 | chouser | nice |
| 15:03 | SagiCZ1 | ,(get get get get) |
| 15:03 | clojurebot | #<core$get clojure.core$get@72a421fc> |
| 15:03 | SagiCZ1 | ,get |
| 15:03 | clojurebot | #<core$get clojure.core$get@72a421fc> |
| 15:04 | SagiCZ1 | ,(get {:a 0} :a) |
| 15:04 | clojurebot | 0 |
| 15:04 | SagiCZ1 | ,(= get (get get get get)) |
| 15:04 | clojurebot | true |
| 15:04 | SagiCZ1 | ,(= + (+ + + +)) |
| 15:04 | clojurebot | #<ClassCastException java.lang.ClassCastException: clojure.core$_PLUS_ cannot be cast to java.lang.Number> |
| 15:04 | dpathakj | haaa, that’s nice |
| 15:04 | SagiCZ1 | is it... |
| 15:04 | justin_smith | SagiCZ1: the trick with the four gets is that get is very forgiving about its first arg |
| 15:04 | dpathakj | SagiCZ1: sorry, timing issue. |
| 15:05 | dpathakj | referring to the (get get get get) thing |
| 15:05 | SagiCZ1 | dpathakj: yeah i just think its not very nice.. |
| 15:05 | dpathakj | ,(doc get) |
| 15:05 | clojurebot | "([map key] [map key not-found]); Returns the value mapped to key, not-found or nil if key not present." |
| 15:05 | SagiCZ1 | yeah so the first args should be a map |
| 15:05 | justin_smith | I aint gonna lie, I am proud of (get get get get), and sad that it is likely my most notable contribution to the world of clojur programming |
| 15:05 | SagiCZ1 | heh |
| 15:05 | justin_smith | SagiCZ1: associative |
| 15:06 | justin_smith | a set or vector or whatever would work there too |
| 15:06 | SagiCZ1 | justin_smith: so why get works too? |
| 15:06 | mavbozo | i try to login to datomic.com but it says "Username or Password incorrect". I try to reset my password, it says "Email address not found.". Maybe its database currently time travels to the past. |
| 15:07 | justin_smith | SagiCZ1: get takes up to three args - if the second is not "in" the first (including situations where the first isn't even an associative structure that supports lookup) it returns the third |
| 15:07 | chouser | ,(:foo :foo :foo) |
| 15:07 | clojurebot | :foo |
| 15:07 | SagiCZ1 | ,(get :foo 42) |
| 15:07 | clojurebot | nil |
| 15:08 | justin_smith | SagiCZ1: now add one more arg |
| 15:08 | SagiCZ1 | ,(get :foo 42 99) |
| 15:08 | clojurebot | 99 |
| 15:08 | SagiCZ1 | mmmkaaay |
| 15:09 | justin_smith | in conclusion, get is like "The Dude" and will let really weird shit go down because he's like "whatever, just use nil or the default", and is the source of many errors that pop up in other weird places |
| 15:09 | SagiCZ1 | justin_smith: so is it considered flawed in a sense? |
| 15:10 | justin_smith | SagiCZ1: considered by whom? it has good reasons to be so forgiving, but also leads to confusing errors popping up elsewhere |
| 15:10 | SagiCZ1 | i see |
| 15:11 | justin_smith | and of course get is what implements hash-maps or keywords used in the function position |
| 15:11 | justin_smith | (or symbols even) |
| 15:11 | justin_smith | ,('a 'b 'c 'd) |
| 15:11 | clojurebot | #<ArityException clojure.lang.ArityException: Wrong number of args (3) passed to: Symbol> |
| 15:11 | justin_smith | oops! |
| 15:11 | justin_smith | ,('a 'b 'c) |
| 15:11 | clojurebot | c |
| 15:11 | SagiCZ1 | very odd |
| 15:23 | chouser | ,[(gensym) :a, (gensym) :b] |
| 15:24 | clojurebot | [G__27 :a G__28 :b] |
| 15:24 | chouser | ,{(gensym) :a, (gensym) :a} |
| 15:24 | clojurebot | #<IllegalArgumentException java.lang.IllegalArgumentException: Duplicate key: (gensym)> |
| 15:25 | justin_smith | ,`{~@[:a 0] ~@[:b 1]} |
| 15:25 | clojurebot | {:b 1, :a 0} |
| 15:25 | justin_smith | ,`{~@[:a 0] ~@[:b 1] ~@[:c 2]} |
| 15:25 | clojurebot | #<RuntimeException java.lang.RuntimeException: Map literal must contain an even number of forms> |
| 15:29 | justin_smith | but, of course this works ##(do `{~@[:a 0 :b] ~@[1 :c 2]}) |
| 15:29 | lazybot | ⇒ {:c 2, :b 1, :a 0} |
| 15:34 | dpathakj | ,(source get) |
| 15:35 | clojurebot | Source not found\n |
| 15:36 | AeroNotix | I'm sure I've asked this before, but why isn't there a def- ? |
| 15:36 | hellofunk | i'm curious about your gensym map keys there. not behaving the same as your vector, chouser |
| 15:37 | Bronsa | hellofunk: at read-time (gensym) is the same as (gensym), the map can't have two equal keys |
| 15:37 | hellofunk | Bronsa: so key duplication in maps is a reader task, not a compiler? |
| 15:38 | justin_smith | {} is a read time construct, so it kind of needs to be as I understand it |
| 15:38 | hellofunk | ah, i see. |
| 15:40 | hellofunk | justin_smith: wait, how is {} read time, yet [] is not? |
| 15:41 | justin_smith | [] doesn't care how many items are in it |
| 15:41 | justin_smith | {} cares about duplicates, and needs an even count |
| 15:41 | hellofunk | justin_smith: actually i guess they'd both be, but vectors don't have these constraints on content, so reader lets it through |
| 15:41 | justin_smith | right |
| 15:42 | hellofunk | i don't think of those as reader constructs. is the compiler seeing them as hash-map and vector fns? |
| 15:42 | Bronsa | ,(read-string "{1 1}") |
| 15:42 | clojurebot | {1 1} |
| 15:42 | Bronsa | ,(class (read-string "{1 1}")) |
| 15:42 | clojurebot | clojure.lang.PersistentArrayMap |
| 15:42 | Bronsa | hellofunk: that's what the compiler sees them as |
| 15:43 | hellofunk | Bronsa: i tried that read-string earlier and was suprised to see the reader output be the same as the input |
| 15:43 | Bronsa | it's not the same |
| 15:43 | Bronsa | you input a string, you get back a map |
| 15:44 | Bronsa | hellofunk: this is how lisps work. eval takes a lisp form, so does the compiler |
| 15:45 | andyf | I was wondering about the ?expanded from the outside in? nature of macros recently. Would anything ?go wrong? if one tried to implement macros that ?expanded from the inside out? ? |
| 15:45 | andyf | and of course all of those ? or whatever you saw them as should be quotes |
| 15:50 | hiredman | I think ideally macros would be expanded as you walk down the tree and then expanded again walk back up, until you reach a steady state |
| 15:50 | gfredericks | macros should expand in alphabetical order |
| 15:51 | hiredman | so if you have a macro that wants all its args macroexpanded, it can jsut decline to do anything for the down the tree pass, and do all its work on the up the tree pass |
| 15:53 | gfredericks | it always seemed like macroexpanding the args was a feature that deserved to be builtin |
| 15:53 | andyf | Do Common Lisp macros have the same 'outside in' behavior? |
| 15:54 | andyf | Can't say I've ever noticed, as I haven't written any macros fancy enough that I've noticed a difference. |
| 15:58 | AeroNotix | andyf: what would be the benefit? |
| 15:58 | gfredericks | I wrote a macro for curried/partially-evaluated functions that I think had to macroexpand its arguments first |
| 15:59 | andyf | AeroNotix: I haven't thought through it deeply enough to see why, but there was a recent proposal on the Clojure development email list suggesting an alternative to feature expressions, but it had some flaws due to the way that it used macros, because macros expand from the outside in. |
| 16:00 | AeroNotix | I don't see the value in feature expressions, either :) |
| 16:00 | AeroNotix | They're the same things |
| 16:01 | andyf | Do you see a value in source files that can be used for multiple flavors of Clojure? |
| 16:01 | AeroNotix | Of course, but you can already do that. |
| 16:01 | andyf | You mean cljx? |
| 16:01 | AeroNotix | sure |
| 16:01 | alandipert | https://gist.github.com/alandipert/47f0badda7bcdb28af87 is another way /cc gfredericks |
| 16:02 | AeroNotix | alandipert: madness |
| 16:02 | gfredericks | huh what? |
| 16:02 | andyf | How could that be madness if cljx is sufficient? |
| 16:03 | justin_smith | andyf: I think that would require fexpr support - there was extensive debate about fexprs in lisp in the early '80s, they lost and macros won (partially for compiler optimization reasons - fexprs make a whole lot of optimizations impossible) |
| 16:03 | andyf | It's a stone's throw away :) |
| 16:03 | AeroNotix | andyf: not necessarily a bad thing |
| 16:03 | gfredericks | alandipert: does that relate to me in some way I'm missing? |
| 16:03 | AeroNotix | Using a tested preprocessor is better than writing yet another preprocessor. |
| 16:03 | AeroNotix | What value do feature expressions have over other methods? |
| 16:16 | AeroNotix | anyone^? |
| 16:17 | justin_smith | AeroNotix: what other methods? |
| 16:17 | justin_smith | ~anyone |
| 16:17 | clojurebot | anyone is anybody |
| 16:17 | AeroNotix | justin_smith: well, cljx, gcc defines :) |
| 16:22 | justin_smith | AeroNotix: building is much simpler if all libs are parameterised for clj / cljs in the same way |
| 16:23 | justin_smith | unless the expansion happens before constructing the jar I guess |
| 16:23 | SagiCZ1 | what is cljx? |
| 16:23 | justin_smith | SagiCZ1: cljx is a lein plugin for generating clojurescript and clojure from one file |
| 16:24 | SagiCZ1 | justin_smith: thank you |
| 16:24 | SagiCZ1 | wait, generating? |
| 16:24 | justin_smith | SagiCZ1: it has expressions that expand differently for clj / cljs |
| 16:25 | SagiCZ1 | oh.. well thats interesting |
| 16:32 | zmiller | does anybody know how to setup a clojurescript project.clj with a dev and prod build? I thought I had done it correctly, but I have to delete the target folder before building prod or it fails. |
| 16:33 | Glenjamin | zmiller: could you post your project.clj? |
| 16:34 | zmiller | can i paste it here? |
| 16:34 | justin_smith | zmiller: use refheap.com, or a github gist, sometihng like that |
| 16:34 | justin_smith | don't paste it directly here |
| 16:35 | zmiller | https://www.refheap.com/96472 |
| 16:35 | zmiller | sorry, i am new to IRC. |
| 16:39 | zmiller | i don't know if it has to do with the fact that i didn't specify source-map or output-dir, but it looked like those were optional |
| 16:41 | dnolen | zmiller: dev & prod can't really share the same output folder due to different code emission |
| 16:41 | dnolen | zmiller: also there is a #clojurescript channel, probably get answers quicker there |
| 16:41 | zmiller | okay, thank you. i will try specifying an output-dir and see whether that works. |
| 16:42 | barelyfunctional | Hi, had question around type hints, is it possible to type hint Object array? |
| 16:42 | justin_smith | barelyfunctional: what would that accomplish? |
| 16:42 | SagiCZ1 | barelyfunctional: you cant get any more vague than Object |
| 16:43 | justin_smith | yeah, unless I am mistaken, hinting Object would effectively be the same as no hint |
| 16:44 | barelyfunctional | I dont want object, I want an array of Objects |
| 16:44 | justin_smith | barelyfunctional: ,(into-array Object [1 2 :a :b "whatever"]) |
| 16:44 | justin_smith | ,(into-array Object [1 2 :a :b "whatever"]) |
| 16:44 | clojurebot | #<Object[] [Ljava.lang.Object;@529088ed> |
| 16:45 | justin_smith | barelyfunctional: that's not a type hint though, that's creating an array of Object |
| 16:45 | clojurebot | Titim gan éirí ort. |
| 16:45 | barelyfunctional | sure, but whats the type hint to apply? for a array of ints, it would be ^ints |
| 16:45 | justin_smith | barelyfunctional: the hint is pointless |
| 16:45 | barelyfunctional | for an array of doubles: ^doubles |
| 16:46 | gfredericks | ,[(get #{3} 3) (get (transient #{3}) 3)] |
| 16:46 | clojurebot | [3 nil] |
| 16:46 | gfredericks | ^ that's great |
| 16:46 | justin_smith | barelyfunctional: but it would be "[Object;" iirc |
| 16:46 | justin_smith | needs to be a string |
| 16:46 | justin_smith | (since it has a "[" in it) |
| 16:47 | barelyfunctional | so its ^"LObject;" |
| 16:47 | justin_smith | I don't think the L belongs there |
| 16:47 | justin_smith | and you need the [ |
| 16:47 | justin_smith | [ is part of the name |
| 16:47 | justin_smith | arrays are weird |
| 16:48 | barelyfunctional | its nasty, i know, vectors are much nicer etc, but i'm working with some performance sensitive code |
| 16:48 | justin_smith | but the point of hinting is that it lets Clojure compile better code, and the "[Object;" hint cannot help the compiler generate better code |
| 16:48 | justin_smith | if it's performance sensetive you should use something other than Object, because it will need to reflect on every method |
| 16:49 | SagiCZ1 | barelyfunctional: you have no idea what will be in the array? |
| 16:49 | justin_smith | unless the only thing you do is lookup? |
| 16:49 | barelyfunctional | the only thing i need to do is lookup by index |
| 16:50 | justin_smith | barelyfunctional: than use aget which is totally unambiguous and does not need hinting |
| 16:50 | justin_smith | (doc aget) |
| 16:50 | clojurebot | "([array idx] [array idx & idxs]); Returns the value at the index/indices. Works on Java arrays of all types." |
| 16:52 | gfredericks | is there a correct way to lookup a key in a transient set? |
| 16:54 | justin_smith | gfredericks: get will just return nil (as you showed us), and contains? fails... are there other options? |
| 16:54 | barelyfunctional | justin_smith: so aget has an inline to clojure.lang.RT/aget |
| 16:55 | gfredericks | justin_smith: .get and .contains |
| 16:55 | gfredericks | seems weird to have to resort to interop |
| 16:55 | barelyfunctional | justin_smith: if the compiler can deduce the context it should able able to inline the access with no casting or instance checking |
| 16:56 | justin_smith | barelyfunctional: I think the way array lookup works, it doesn't need reflection anyway |
| 16:56 | justin_smith | arrays are not Objects |
| 16:56 | gfredericks | arrays are weird |
| 16:57 | barelyfunctional | different bytecodes for different array type lookups |
| 16:57 | justin_smith | oh really? I didn't realize |
| 16:58 | barelyfunctional | http://en.wikipedia.org/wiki/Java_bytecode_instruction_listings |
| 16:59 | barelyfunctional | for instance: daload - load a double from an array |
| 17:00 | barelyfunctional | iaload - load an int from an array |
| 17:01 | justin_smith | barelyfunctional: as I understand it those are optimizations for primitives, the other version would just auto-box |
| 17:01 | gfredericks | uapfload - load a UserAuthenticationProviderFactory from an array |
| 17:01 | justin_smith | part of the general "make N versions of this so we support primitives, plus one more for all Objects" pattern |
| 17:02 | gfredericks | guys...I made an OOP naming joke...that's supposed to be funny. |
| 17:03 | gfredericks | they told me it would be funny. |
| 17:03 | barelyfunctional | justin_smith - yeah i agree its ugly, I'll compile two versions, with and without the type hints and look at the bytecode, would probably make a good blog post, thanks for the type hint advice |
| 17:03 | justin_smith | gfredericks: HumorNotRecognizedError |
| 17:05 | gfredericks | justin_smith: don't you mean RecognitionErrorProviderRegistry.getInstance().findProvider("Humor").errorFor("Recognition")? |
| 17:06 | SagiCZ1 | ,(rand) |
| 17:06 | clojurebot | 0.011752048560500605 |
| 17:07 | gfredericks | that's not random look how many 5s and 0s and 6s it ends with |
| 17:07 | SagiCZ1 | gfredericks: yeah its broken on my machine as well |
| 17:07 | gfredericks | it doesn't even have a 3 on it |
| 17:07 | SagiCZ1 | not random enough |
| 17:08 | SagiCZ1 | i used it for boolean and it outputed six true's in a row.. |
| 17:08 | gfredericks | impossible! |
| 17:08 | gfredericks | file a ticket |
| 17:08 | SagiCZ1 | exactly! |
| 17:08 | gfredericks | btw the past tense of output is "outpat" |
| 17:09 | SagiCZ1 | is it? now when i think about it shouldnt it be put/put/put? |
| 17:09 | gfredericks | put/pat/pout |
| 17:09 | SagiCZ1 | you know it's not nice to josh with non-native speakers? |
| 17:11 | gfredericks | I actually didn't know you were, but I definitely should have hedged that way on IRC |
| 17:12 | gfredericks | I was counting on it being obviously nonsense but that wasn't a good idea |
| 17:12 | SagiCZ1 | hah.. ok.. i am sorry i pat you in a bad position, no need to apologize |
| 17:14 | gfredericks | hah |
| 17:16 | hadronzoo | Any ideas as to why this multiple-arity protocol doesn't type check? https://gist.github.com/hadronzoo/7e8d2984707cff23bf60 |
| 17:22 | samiswellcool | is there an idiomatic way to use clojure as a server and clojurescript as clientside code in the same project? the best way to transpile the clojurescript into the right place etc |
| 17:22 | gfredericks | Bronsa: okay fine but Var#{swap,unbind,commute}Root are surely dead code |
| 17:23 | samiswellcool | I'm used to javascript/node so I'm not sure the best way to do it with the clojure ecosystem |
| 17:24 | hellofunk | samiswellcool: certainly. the chestnut template (among others) does this |
| 17:24 | Bronsa | gfredericks: likely, there is a lot of dead code in the clojure java sources |
| 17:25 | samiswellcool | I'll have a look at that then. I'm enjoying clojure so far so I'm excited to be able to do the stuff I currently do with javascript |
| 17:25 | gfredericks | Bronsa: do you think vars were intended to participate in STM? |
| 17:25 | hellofunk | chestnut is heavy on clojurescript tools and includles weasel and figwheel. but it's an easy intro to clojure/clojurescript combo |
| 17:26 | hellofunk | samiswellcool: ^ , and also, chestnut uses Om |
| 17:26 | Bronsa | gfredericks: no idea, I wasn't here back then :P |
| 17:26 | samiswellcool | I've been looking forward to giving Om a try, I use React a lot |
| 17:26 | nic77 | what can clojure be used for? how long has this been around? |
| 17:27 | samiswellcool | I imagine just about anything, it's a general purpose, practical language |
| 17:27 | nic77 | how did you guys start out learning computer languages? |
| 17:27 | havenwood | writing batch scripts to launch games |
| 17:28 | gfredericks | nic77: TI-83+ manual |
| 17:28 | samiswellcool | found an old Amstrad CPC 464 in my mums cellar and learned amstrad basic usingit |
| 17:28 | nic77 | i think ive tinkered with batches and some mirc stuff, |
| 17:28 | nic77 | thanks guys that sounds like the ticket |
| 17:29 | nic77 | couple good sources :D |
| 17:30 | samiswellcool | I don't recommend learning the way I did though haha, it was filled with frustration and limited in scope |
| 17:30 | samiswellcool | took me until 6 years or so after that to really get into coding |
| 17:30 | gfredericks | I don't think I knew a single person who knew how to program for several years |
| 17:30 | nic77 | theres a cap on the market with education and often times you can get the book they are going to teach from |
| 17:31 | justin_smith | I first did a very simple program when someone in the advanced class showed me in middle school. But I was a D student so I didn't get into any classes that used computers. My dad refused to allow a computer in our house. I didn't learn to use a mouse properly until I was 22. |
| 17:32 | nic77 | i went to a trade school and mostly found out i didnt need to go the school |
| 17:32 | samiswellcool | I was told growing up that I should stop messing about with computers so much and do something that would help me get a job instead |
| 17:32 | justin_smith | haha, nice |
| 17:32 | samiswellcool | I hope that my parents remember that haha |
| 17:33 | nic77 | sounds tough samis |
| 17:33 | hellofunk | i learned programming on a 1980s calculator by Tandy that was programmable in BASIC. It had 2k of total storage. |
| 17:34 | nic77 | its strange how the times go |
| 17:34 | justin_smith | hellofunk: oh, the miniature version of the tandy 100? |
| 17:34 | gfredericks | my favorite thing about the TI-83+ was that variables could only have one letter |
| 17:34 | gfredericks | I needed lots of auxiliary documentation on notebook paper |
| 17:34 | hellofunk | justin_smith: let me see if i can dig up a photo/model number |
| 17:35 | justin_smith | gfredericks: in tandy 100 basic, the variable can have as many letters as you like, but only the first two letters in the variable matter - so pie and poke are two different variables, but pie and pig are the same variable |
| 17:35 | justin_smith | well poke can't be a variable because it is a basic keyword, but you get the idea |
| 17:35 | gfredericks | justin_smith: that still woulda been nicer |
| 17:36 | gfredericks | you name things PFDESCRIPTIVENAME |
| 17:36 | nic77 | hey samiswellcool maybe your parents werent thinking big enough :D they were exposed and experienced in a small thinking age. |
| 17:36 | nic77 | context |
| 17:37 | samiswellcool | nic77: probably, they've grown with the times since and are very supportive now hah |
| 17:37 | nic77 | yeah |
| 17:37 | nic77 | my grandpa invested heavy into solar panels in the 70's |
| 17:37 | nic77 | about 40 years early |
| 17:37 | hellofunk | justin_smith: this is the one http://www.rskey.org/CMS/index.php/7?manufacturer=Radio+Shack&model=PC-7 |
| 17:38 | nic77 | no battle plan survives the first shot |
| 17:38 | justin_smith | my dad still thinks programming is silly and I should be acquiring basic hands-on survival skills because civilization is going to collapse into a post-technological dystopia (and I think he actually likes the idea of that happening) |
| 17:38 | nic77 | justin thats fantastic |
| 17:38 | justin_smith | hellofunk: ahh, not the one I was thinking of |
| 17:38 | nic77 | im like your dad justin, the main difference is i want to know about programming!!!!!!! |
| 17:38 | justin_smith | nic77: literally fantastic in the sense of "product of fantasy, having no ties to actual reality" |
| 17:39 | nic77 | its amazing |
| 17:39 | nic77 | why have it one way or the other |
| 17:39 | hellofunk | justin_smith: in this thing, each new line number was 2 bytes, i learned from experimentation. so my programs were full of combined statements on a single line to save from multi-line memory bloat |
| 17:39 | hellofunk | good times |
| 17:39 | justin_smith | nic77: because our technological civilization is evil incarnate and you are rooting for nature to have its revenge of course! |
| 17:40 | nic77 | diversification is what ive seen we need as a people im about 26 and thats been the big ask so far as ive been looking |
| 17:41 | nic77 | i can make a profit with anything and so far my education has been with my hands all of the guy stuff |
| 17:41 | nic77 | its not enough |
| 17:41 | nic77 | i can handle the idea of trying to learn everything i guess |
| 17:41 | nic77 | just fit it all in |
| 17:42 | samiswellcool | I'm liking chestnut, a lot |
| 17:42 | samiswellcool | very quick to get started |
| 17:42 | mavbozo | justin_smith: according to james mickens, your are already know what to do when society breaks down -> "A systems programmer will know what to do when society breaks down, because the systems programmer already lives in a world without law." https://research.microsoft.com/en-us/people/mickens/thenightwatch.pdf |
| 17:43 | justin_smith | mavbozo: lol, nice |
| 17:43 | mavbozo | another quote: "The most important person in my gang will be a systems programmer. A person who can debug a device driver or a distributed system is a person who can be trusted in a Hobbesian nightmare of breathtaking scope; a systems programmer has seen the terrors of the world and understood the intrinsic horror of existence." |
| 17:45 | nic77 | well survival stuff isnt as elaborate and extensive a subject as anything computer |
| 17:45 | nic77 | it should be observed and noted and perfected mentally |
| 17:46 | nic77 | then your good |
| 17:46 | nic77 | no rules to survival, just dont die |
| 17:47 | nic77 | i grew up on a farm camped alot, i can see the need to know everthing if that was a more permanent situation |
| 17:48 | nic77 | the more data the better in my opinion statistics paint a nice picture almost a treasure map |
| 18:16 | SupermanChest | Hello, everybody |
| 18:19 | samiswellcool | SupermanChest: hey |
| 18:20 | SupermanChest | I stumbled on this channel whilst searching for a general technology channel. |
| 18:21 | pdurbin | is there a general technology channel? |
| 18:21 | justin_smith | there's like #programming iirc |
| 18:23 | pdurbin | I think there's an algorithms channel too. |
| 20:58 | tomvolek | HI all a beginner , what does this produce and why ? (set {:one 1 :two 2 :three 3}) |
| 20:58 | gfredericks | ,(set {:one 1 :two 2 :three 3}) |
| 20:59 | clojurebot | #{[:three 3] [:two 2] [:one 1]} |
| 20:59 | gfredericks | tomvolek: it's a set containing three key-value pairs |
| 20:59 | tomvolek | ok that I understand . I dont understadn the result when i type into a repel |
| 20:59 | gfredericks | because a the `set` function will dump a collection into a set, and the map you give it can be viewed as a collection of key-value pairs |
| 21:00 | gfredericks | you get something different in your repl? |
| 21:00 | tomvolek | #{[:two 2] [:three 3] [:one 1]} |
| 21:00 | justin_smith | tomvolek: so you mean the ordering? |
| 21:00 | tomvolek | yes |
| 21:00 | justin_smith | sets and maps are not ordered types |
| 21:00 | justin_smith | there are no guarantees about the order of the contents, at all |
| 21:01 | tomvolek | oh |
| 21:01 | tomvolek | so the order is random ? |
| 21:01 | gfredericks | not actually |
| 21:01 | tomvolek | why doenst it keep the same order that I inputed ... ? |
| 21:01 | justin_smith | not random - it has to do with hash collisions and space efficiency and such |
| 21:01 | gfredericks | but there's no reason for you to care what it is |
| 21:01 | tomvolek | ok |
| 21:01 | justin_smith | tomvolek: because that would be slower, and use more space |
| 21:02 | tomvolek | ok if I want order , then I have to create an ordered set then ... no ? |
| 21:02 | justin_smith | if you want a set that respects insertion order, I think there is one out there |
| 21:02 | justin_smith | but you can use sorted-set-by if you want them to be sorted by some ordering function |
| 21:02 | tomvolek | just curious , what do you use Closure for ? |
| 21:03 | justin_smith | tomvolek: ordered sets / maps https://clojars.org/org.flatland/ordered |
| 21:03 | tomvolek | tx |
| 21:03 | justin_smith | tomvolek: I use Clojure for web server backends |
| 21:04 | tomvolek | event processing ? |
| 21:04 | brainacid | Yes Hi. I want to install Coljure and my sys asks if I want jdk7 or jdk8? how do I choose correctly? |
| 21:04 | justin_smith | brainacid: clojure is just a jar file, but it is better to use lein or boot to manage it |
| 21:05 | brainacid | There is a difference of 36MB over jdk7 |
| 21:05 | tomvolek | our company decided to rewrite our platform to be able to scale better using Clojure, I have to learn it fast |
| 21:05 | justin_smith | brainacid: install as many jdks as you like, newer is likely better, but you don't need the jdk, a jvm suffices |
| 21:05 | justin_smith | tomvolek: oh, that sounds fun and/or intimidating |
| 21:06 | tomvolek | @justin_smith our company's product is a VOIP product .. |
| 21:06 | brainacid | justin_smith: Thanks for the speedy response. |
| 21:06 | justin_smith | brainacid: unlike some programming environments, jdks don't break each other, you can have all the jdks / jvms you like installed without stability problems |
| 21:07 | justin_smith | also, jvms are much better about backward compatibility than most platforms, old stuff breaking with a newer vm is very rare, and is considered a bug to be fixed in almost all cases |
| 21:08 | brainacid | justin_smith: Thanks for that information. I am very new to Unix and Clojure. |
| 21:08 | justin_smith | brainacid: similarly, you can have as many versions of any lib installed as you like - each process will only use one version of a given lib, but you won't greak anything by having them all installed |
| 21:09 | justin_smith | but use lein for library deps, it makes everything much easier (unless you have a compelling need to use something else to manage deps) |
| 21:09 | brainacid | justin_smith: Very interesting. I wish I had started when I was younger. Oh well I hope I can stick this out... I tend to get frustrated and quit. |
| 21:09 | tomvolek | @brainacid , you can have a small script in yoru .bashrc or .profile to set which JDK or Java you want to use .. ie you can have multiple version of jdk installed but use the one u like |
| 21:09 | justin_smith | best of luck! there are lots of reasons to love clojure |
| 21:10 | justin_smith | tomvolek: brainacid: yeah, that's what I was trying to get at - they don't conflict with one another, you can pick one as you like |
| 21:10 | justin_smith | you can even explicitly type in the full path, and for that you don't even need to have the file installed to anywhere in particular |
| 21:10 | tomvolek | @brainacid look at a sample => http://paste.scsys.co.uk/459057 |
| 21:11 | tomvolek | I run mac , and have jdk 1.6, 1.7, 1.8 installed and use the one i want |
| 21:11 | tomvolek | they get installed in different directory , u just invoke the one u like |
| 21:12 | brainacid | I have success: lein repl user=> |
| 21:12 | justin_smith | yeah, lein tends to just work :) |
| 21:12 | justin_smith | and then when it doesn't, there are people here or on #leiningen happy to help |
| 21:13 | brainacid | Now to sort through the documentation to find the correct introduction. |
| 21:13 | justin_smith | introduction to which? |
| 21:13 | brainacid | Yes. justin_smith Thank you and tomvolek as well Thanks |
| 21:14 | tomvolek | I am using 4clojue.com to learn :) , any other site you guys recommend ? |
| 21:14 | justin_smith | the clojure koans are good |
| 21:15 | tomvolek | cool |
| 21:15 | justin_smith | also there is "clojure from the ground up" and "clojure for the brave and true" for intros |
| 21:15 | justin_smith | (web tutorials) |
| 21:15 | justin_smith | also, the books, of course |
| 21:15 | tomvolek | roger |
| 21:15 | justin_smith | ~books |
| 21:15 | clojurebot | books is book |
| 21:15 | justin_smith | err... |
| 21:15 | justin_smith | ~book |
| 21:15 | clojurebot | book is http://www.pragprog.com/titles/shcloj/programming-clojure |
| 21:15 | tomvolek | reading the book as of yesterdasy :) |
| 21:16 | justin_smith | ~books |
| 21:16 | clojurebot | books is http://www.pragprog.com/titles/shcloj/programming-clojure |
| 21:16 | justin_smith | there are actually multiple factoids, and you don't always get the one you want |
| 21:16 | justin_smith | cool |
| 21:24 | brainacid | please define factoid justin_smith |
| 21:24 | brainacid | i didnt understand |
| 21:24 | justin_smith | ~factoids |
| 21:24 | clojurebot | I don't understand. |
| 21:24 | brainacid | ~factoid |
| 21:24 | clojurebot | Pardon? |
| 21:24 | justin_smith | OK, nobody understands! |
| 21:24 | brainacid | ~fact |
| 21:25 | clojurebot | excusez-moi |
| 21:25 | brainacid | excused |
| 21:25 | justin_smith | sorry, in all seriousness, the bits of info clojurebot has are called factoids |
| 21:25 | justin_smith | and when you use on like ~book it will get any of the various definitions clojurebot has for book |
| 21:25 | justin_smith | ~book |
| 21:25 | clojurebot | book is http://clojurebook.com/ http://joyofclojure.com/ |
| 21:25 | justin_smith | there's more than one |
| 21:25 | justin_smith | ~book |
| 21:25 | clojurebot | book is http://www.pragprog.com/titles/shcloj/programming-clojure |
| 21:27 | brainacid | I understand now. Thanks |
| 21:27 | brainacid | May you tell me what OS you use? |
| 21:27 | brainacid | Linux I use |
| 21:27 | justin_smith | I use Ubuntu Linux |
| 21:27 | justin_smith | because that's the version I could get pre-installed |
| 21:27 | justin_smith | usually I would use debian |
| 21:28 | brainacid | Ok. How lon have you used? I started at 15 y/o, 30 now |
| 21:28 | brainacid | *long |
| 21:28 | brainacid | But I am still very clumsy with it and learn everyday how to be a better user/root on my current hardware. |
| 21:29 | brainacid | I hope chit chat is allowed here not only support-focused? |
| 21:29 | justin_smith | about 14, 15 years also |
| 21:29 | justin_smith | brainacid: the clojure topic takes precedence, but not strictly enforced |
| 21:30 | justin_smith | we also have #clojure-offtopic for people who like clojure / this channel but want to ramble about other things freely |
| 21:30 | brainacid | Well does the culture of programmer, Unix and general enthusiast sentiment welcomed? |
| 21:30 | brainacid | Some may even use the incorrect term 'fanboy' |
| 21:30 | justin_smith | of course, but we do have the primary topic of clojure - it does run on every major OS after all |
| 21:31 | brainacid | Incorrect at least in my opinion |
| 21:31 | brainacid | oh no doubt |
| 21:31 | TimMc | justin_smith: Android, Debian, and OS/2! |
| 21:31 | brainacid | I plan to ask 'bout clojure ;) |
| 21:31 | justin_smith | especially considering that it clojurescript compiles to js, which is just about everywhere |
| 21:32 | brainacid | indeed |
| 21:32 | brainacid | I was wondering trying that side of clojure |
| 21:32 | brainacid | I have never explored web-dev, only html at the very beginning of my learning but nothing with js |
| 21:33 | justin_smith | I think it's easier to start with jvm clojure - the tooling around clojurescript is a bit more complex |
| 21:33 | justin_smith | and there are more places to make things work, which means more things to go wrong of course |
| 21:33 | brainacid | justin_smith: I can figure almost anything out with enough trial and error...so I will agree and start with jvm and learn then maybe move to the complex tooling you say of |
| 21:34 | brainacid | I really have no real programming experience but I am seeking for a home for my thinking. |
| 21:36 | justin_smith | well, clojure is a great place to start, I think |
| 21:36 | nic77 | sounds good |
| 21:36 | nic77 | same here |
| 21:45 | brainacid | Well I am reading Eric S. Raymond Art of Unix Programming at the moment, I plant to apply the principles in his book using clojure, at least that is my superficial estimate at the moment. |
| 21:47 | brainacid | I have a very bad record of quitting. And I dont believe its a lack of something, it might be simply an excess of some bad habit. I want to "fit in" some community that welcomes eager personaloty |
| 21:47 | justin_smith | Clojure and Unix have different ideas and goals in many ways |
| 21:49 | brainacid | Well Im sure that I may have the opportunity to have some fun coding, learning to improve my self as a thinker and enhance my toolbox as a technician, lol, with no real formal certifications nor employment...pathetic really since I live under the illusion that I may be able to work as a professional. |
| 21:50 | brainacid | But I know that there are so many younger and smarter people out there that can do the job faster and probably cheaper. haha... :| |
| 21:50 | justin_smith | brainacid: I am self taught, after many years of weekend experiments and such I became a professional |
| 21:51 | brainacid | justin_smith: Alas! I have hope. I must be truly fortunate to be able to speak here with you. |
| 21:51 | brainacid | It is truly possible then |
| 21:51 | justin_smith | computers have a nice way of cutting through the bs, and if you can make something work, that shows through regardless of anything else |
| 21:51 | brainacid | Exactly |
| 21:51 | brainacid | Oh boy someone at last who truly understands my logic |
| 21:52 | brainacid | See my dad, a 30 yr IT Tech, continues to say that if I dont have Microsoft certs I wont be able to become an admin |
| 21:53 | justin_smith | that's maybe true, if you want to be a Microsoft admin? I don't know. But that's not the case with many programming jobs. |
| 21:54 | brainacid | If I could somehow show someone my skill set and maybe be interviewed on a per-task-accoplimshed basis, I might have some chance although I lack much knowledge for large-scale admin |
| 21:55 | brainacid | Well then, I must start teaching myself in a better way since I feel so behind the curb. |
| 21:55 | nic77 | your ahead of me brain |
| 21:55 | brainacid | nic77: Hey mate. How so, you say ahead? |
| 21:56 | nic77 | just starting out no experience with even html |
| 21:56 | brainacid | I see. Well my friend if you wish to ask me anything I will try to answer to my best experience. |
| 21:56 | nic77 | sweet, thanks |
| 21:57 | brainacid | Although I know nothing of clojure |
| 21:57 | brainacid | I do have ok skill in google research |
| 21:57 | nic77 | same here, i saw some good resources mentioned earlier though |
| 21:58 | brainacid | Im looking with torrentz-eu some books |
| 21:58 | brainacid | Also on the Web tutorials |
| 21:58 | nic77 | im gonna investigate them books at some point in the near future |
| 21:58 | nic77 | im opposed to the certs aspect of things though |
| 21:58 | brainacid | Mostly focused on re-arranging my intentions within so I can attack and flow in my learning process. |
| 21:59 | brainacid | Well nic77 I have no money for certs anyways so I will continue this open-source way of life and try to exert myself in an area so I could maybe one day be useful and be part of a support team. |
| 22:00 | nic77 | theres a cap on the market of education so your expected to play ball and pay up at the moment |
| 22:00 | nic77 | thats changing though |
| 22:00 | nic77 | its a paradigm shift coming |
| 22:00 | justin_smith | brainacid: nic77: what I suggest is start a project. Take the time to figure out git and use git to manage your version history / branches. Have concrete goals of what you want to develop, and put deadlines on those goals. |
| 22:01 | justin_smith | the nice thing is that creates a history of your project's progress, and over a few projects, a history of your learning. And the better projects are the start of a portfolio to show what you can do. |
| 22:06 | brainacid | nic77: You want to form a team and we can get together whenver convinient for you since I am pretty much available 24hr. I can start learning git real quick and we can brainstorm and learn together. Whats your ideas about my proposal? |
| 22:07 | brainacid | Then we can come here and blame justin_smith for giving us the idea in the first place...:P |
| 22:16 | brainacid | quit |
| 22:20 | nic77 | whered he go |
| 22:22 | gfredericks | well he did say he has a very bad record of quitting |
| 22:31 | tomjack | suppose I have a function f that maps forms to core.match pattern forms |
| 22:32 | tomjack | it seems I can't write (match x (f y) z) |
| 22:32 | tomjack | is there another way besides creating a reader literal and doing (match x #f y z)? |
| 22:32 | justin_smith | you can make a macro that expands (f y) before the match form is evaluated |
| 22:33 | tomjack | macros don't seem to work either |
| 22:33 | tomjack | "AssertionError: Invalid list syntax in (foo)" |
| 22:33 | justin_smith | they should, if you get the quoting etc. right |
| 22:34 | justin_smith | use macroexpand-1 to see how the output of the macro is different from the form that should have been created |
| 22:35 | tomjack | https://www.refheap.com/dfd64fab4a031df718e458398 |
| 22:36 | tomjack | doesn't even macroexpand |
| 22:36 | justin_smith | tomjack: in order for a macro to help you, the match call has to be inside the macro |
| 22:36 | tomjack | wat |
| 22:36 | justin_smith | tomjack: you need to quote the argument to macroexpand |
| 22:36 | justin_smith | tomjack: match is a macro |
| 22:37 | tomjack | I did quote the argument |
| 22:37 | justin_smith | oh, sorry, I did not finish reading the paste |
| 22:37 | justin_smith | yeah, the match macro invokes an error before foo can expand |
| 22:37 | tomjack | I don't really want to walk a '(match ...) form and replace patterns myself |
| 22:37 | tomjack | I want to use match's extensibility |
| 22:37 | justin_smith | that's not what I am talking about |
| 22:38 | justin_smith | match is a macro, in order to craft args to match, you sometimes need to write a macro that builds the match call you want |
| 22:38 | justin_smith | that doesn't have to mean walking a form and replacing things |
| 22:38 | justin_smith | but it does mean a bit of massaging of things with your macro so match gets input it can accept |
| 22:38 | tomjack | you mean write a macro that expands to a match form? |
| 22:39 | justin_smith | right |
| 22:39 | tomjack | that could work, but it's not my question :) |
| 22:39 | justin_smith | that's the most straightforward option I think |
| 22:39 | tomjack | match's extension points don't accomodate a case like this? |
| 22:40 | justin_smith | tomjack: they may. I don't know though. I am certain that you can construct what you want with a macro, on the other hand. |
| 22:42 | tomjack | a further problem: matching noms |
| 22:43 | tomjack | currently I write e.g. (match t [:fn {:binding-nom x :body r}] ...) |
| 22:43 | tomjack | ah. so of course my macro can just expand to that. nevermind :) |
| 22:44 | tomjack | would be more convenient to just have noms inside the pattern, but that will work |
| 22:44 | tomjack | s/noms/ties/g |
| 22:45 | justin_smith | you may be thinking of core.lolcat |
| 22:53 | tomjack | took me a while to get that :) |
| 22:54 | justin_smith | it was a subtle yet very bad joke |