2012-05-22
| 00:32 | Raynes | Write cemerick hate mail. |
| 00:33 | nDuff | actually -- I'm tempted to try using drawbridge rather than the TCP socket handler -- I'm already running a servlet, and if that does a better job of shutting down cleanly, it'll kill multiple birds with one stone. |
| 00:34 | nDuff | (the client not shutting down cleanly is annoying; the server end not shutting down cleanly is a showstopper) |
| 01:24 | Roxxi | If I have java classes compile in my source directory (via leiningen) how do I reference them in clojure? |
| 01:29 | nDuff | Roxxi: are you asking about Java interop, or about building Java with leiningen? If the latter, do you have :java-source-paths set in your project.clj? |
| 01:29 | nDuff | Roxxi: ...if you don't know which of those the problem is in, have you checked whether .class files are generated? |
| 01:30 | Roxxi | I'm talking about Java interop, it seems that my classes are indeed being created. |
| 01:30 | Roxxi | I suppose I'm looking for the analogous invocation of (require 'package :as short-name) |
| 01:31 | nDuff | (import '[com.example ClassOne ClassTwo]) |
| 01:31 | nDuff | ...or something like that -- I usually just use the (ns) macro form |
| 01:31 | Roxxi | yeah, what's the ns macro form? |
| 01:31 | Roxxi | that's what I'm trying to find |
| 01:32 | nDuff | (ns foo (:import [com.example ClassOne ClassTwo])) |
| 01:37 | Roxxi | Thanks! |
| 02:57 | ro_st | i have (map (something) … ) |
| 02:57 | ro_st | what's the paredit spell for killing the (map … ) part and leaving (something) behind? |
| 03:08 | neotyk | ro_st: kill (something), kill (map ...), C-y, M-y |
| 03:09 | neotyk | ro_st: sorry no paredit spell I know of |
| 03:10 | amalloy | whaaaat |
| 03:10 | amalloy | (map |(something) ...) ;; M-r => |(something) |
| 03:11 | amalloy | ro_st, neotyk: ^ |
| 03:11 | neotyk | amalloy: sweet |
| 03:12 | neotyk | &(inc amalloy) |
| 03:12 | lazybot | java.lang.RuntimeException: Unable to resolve symbol: amalloy in this context |
| 03:12 | neotyk | (inc amalloy ) |
| 03:12 | lazybot | ⇒ 3 |
| 03:12 | amalloy | there's paredit commands for pretty much anything interesting you can do with sexps |
| 03:14 | amalloy | even the occasionally-useful paredit-convolute-sexp: (fn [x] (fn [y] |(/ x y))) ==> |(fn [y] (fn [x] (/ x y))) |
| 03:15 | ro_st | amalloy: thank you. you rockstar you |
| 03:15 | ro_st | that's paredit-raise-sexp |
| 03:15 | ro_st | found it in the paredit cheatsheet i have stuck on my wall |
| 03:15 | ro_st | thanks! |
| 03:17 | ro_st | ah, convolute: turn inside out? |
| 03:18 | ro_st | wow, that rocks |
| 03:19 | ro_st | once you know all the paredit commands as 2nd nature, i can't think that any programmer in any other language could possibly be more efficient at expressing intent as code |
| 03:19 | michaelr` | last time i used paredit i somehow got to a situation of unbalanced []s and had to disable paredit to fix it and renable it again... it was very annoying |
| 03:20 | michaelr` | every time i start using emacs i have to deal with shit like this :) |
| 03:21 | michaelr` | emacs is my IRC client of choice, though :) |
| 03:21 | ro_st | why does the paredit indent feature double indent 'resource' in this code snippet? http://rationalist.co.za/uploads/Screen%20Shot%202012-05-22%20at%209.18.07%20AM-hpeksKuFXO.PNG |
| 03:21 | tomoj | you can just C-u DEL or C-u C-d to delete and e.g. C-q ) to just insert a close paren |
| 03:22 | michaelr` | oh.. thanks |
| 03:22 | ro_st | michaelr`: i've found it goes out of its way to keep parens balanced, actually. C-k will only kill to the closing paren, hitting ; on a line will only comment out the form and put the closing parens on the next line, etc |
| 03:23 | tomoj | I don't get that indentation |
| 03:23 | tomoj | I get this https://gist.github.com/651495618665de2a2041 |
| 03:23 | ro_st | michaelr`: put this in your emacs init script: (require 'rainbow-delimiters) (global-rainbow-delimiters-mode) |
| 03:24 | michaelr` | ro_st: that what annoyed me, that it failed it's main porpuse too keep the parens balanced and then i had to make an extra effort to fix it |
| 03:24 | tomoj | paredit doesn't handle indentation I believe, so maybe you have some difference in your emacs lisp or clojure-mode indent settings? |
| 03:24 | ro_st | tomoj: ah, ok. i think it's slime that does indentation |
| 03:24 | ro_st | i'll look into it |
| 03:25 | tomoj | seems doubtful they'd reimplement indentation in slime |
| 03:26 | tomoj | michaelr`: it shouldn't fail unless you paste something unbalanced into it |
| 03:26 | ro_st | my slime menu has Editing > Update Indentation |
| 03:26 | tomoj | michaelr`: or comment stuff out without properly selecting a balanced form |
| 03:26 | neotyk | tomoj: if you ([ and hit backspace it goes unbalanced |
| 03:27 | tomoj | that would be silly |
| 03:27 | tomoj | for me, ([|]) -DEL> (|) |
| 03:28 | neotyk | not for me, (]) |
| 03:28 | tomoj | DEL should be bound to paredit-backward-delete |
| 03:28 | michaelr` | ro_st: what's that rainbow coloring? |
| 03:28 | ro_st | rainbow parens colouring |
| 03:28 | michaelr` | ro_st: i have (highlight-parentheses-mode t) it does that too |
| 03:28 | ro_st | seem my screenshot link above |
| 03:28 | tomoj | (and you should be using paredit version 23) |
| 03:28 | neotyk | tomoj: it is paredit-backward-delete |
| 03:29 | ro_st | oh, right :) |
| 03:29 | tomoj | dunno if the version matters |
| 03:29 | neotyk | version 22 here |
| 03:30 | kral | hola |
| 03:31 | neotyk | tomoj: where did you get v23 from, marmelade has v22 |
| 03:31 | tomoj | http://mumble.net/~campbell/emacs/paredit-beta.el |
| 03:31 | tomoj | (rename to paredit.el before putting in load-path) |
| 03:32 | tomoj | seems odd that they wouldn't have thought of that until v23 though.. |
| 03:32 | tomoj | I mean that's the main point of paredit-backward-delete t ome |
| 03:32 | ro_st | what's new in 23? |
| 03:33 | tomoj | no clue :( |
| 03:37 | kima | /join #arch-linux |
| 04:04 | muhoo | how would i pass command-line args to an app on heroku? |
| 04:08 | tomoj | huh, I never noticed seque |
| 04:08 | hiredman | many a splendid thing |
| 04:10 | amalloy | i was sad to discover that you can't use seque from inside an agent action |
| 04:11 | amalloy | (because it's implemented using an agent, and when inside an agent action, sends are queued until the action completes) |
| 04:15 | al-maisan | Good morning |
| 04:22 | si14 | Does Luke Vanderhart visit this room? |
| 04:36 | ro_st | si14: you can tweetle him at @levand |
| 04:36 | ro_st | sorry, @levanderhart |
| 04:41 | muhoo | i'm dealing with a function that runs (eval `(~stuff ~blah)) on things passed to it. so, i can't pass it anything defined with let, sadly. what are my options? |
| 04:41 | muhoo | i don't control that eval function btw, so i have to deal with it. |
| 04:42 | si14 | ro_st: thanks |
| 04:44 | muhoo | i was thinking of fighting `s with `s, an doing some hacky (let [ugly (whatever)] `(do (def fubar# ~ugly) (call-thing-that-evals fubar#))) but that seems.... so veyr wrong to me |
| 04:50 | muhoo | or this atrocity: https://www.refheap.com/paste/2824 |
| 04:53 | kima | I don't think you have much options ... |
| 04:53 | kima | Are you able to reimplement the functionality without using eval |
| 04:54 | muhoo | maybe, i'm just not sure how many breaking changes i want to introduce into someone else's library :-) |
| 04:58 | kima | maybe you could try to change the eval to contextual eval wich can take a map of local variables. You could make the context map an optional parameter of the function. Do you have a copy of the Joy of Clojure it's defined there |
| 04:59 | kima | so when called normal the function has the default behavior and when called with the context map extra parameter it works with let bindings |
| 04:59 | muhoo | i do, i'll look in there. |
| 05:00 | muhoo | still, maybe i'm chasing the wrong thing. the error is actually this: https://www.refheap.com/paste/2825 |
| 05:00 | kima | section 8.1 |
| 05:00 | kima | for use case page 309-310 |
| 05:00 | muhoo | no matching ctor. which is weird, because, it's a function that takes one arg, and it's being called as a function with one arg. |
| 05:01 | clgv | muhoo: code? |
| 05:01 | muhoo | good idea, let me narrow it down to the 3 lines that'll fail |
| 05:03 | muhoo | clgv: this is all that's required to make the fireworks happen: https://www.refheap.com/paste/2826 |
| 05:03 | fliebel | Raynes: ping |
| 05:05 | amalloy | i suppose custom-handler* is some silly macro? |
| 05:06 | clgv | amalloy: it's a defn |
| 05:06 | muhoo | it's actually a noir.core function. |
| 05:06 | muhoo | a defn, with eval |
| 05:08 | clgv | muhoo: does your (:list-url fsettings) evaluate to something like [:post "/login"] ? |
| 05:08 | muhoo | have a look |
| 05:08 | muhoo | it's in the refheap paste |
| 05:09 | muhoo | fails with just simple str "/urls" as well as [:post "/fuu/:id/routes/too"] |
| 05:09 | clojurebot | I don't understand. |
| 05:09 | clgv | muhoo: ah right - it does not |
| 05:09 | muhoo | it's the eval that's making my life complicated, but why, i'm still unsure |
| 05:10 | clgv | you can try: [:post (:list-url fsettings)] or :get or what you need ^^ |
| 05:10 | muhoo | it's not that arg that's the assplosion. it's the second arg, the function |
| 05:10 | muhoo | by the way, if i move that out of a defn, it all works |
| 05:11 | amalloy | muhoo: just fyi, asplosion is a cutesy way to say explosion. assplosion is a cutesy way to say diarrhea |
| 05:12 | clgv | amalloy: rofl |
| 05:12 | muhoo | the stacktraces i got were more akin to an ass-plosion than an asplosion, it's true |
| 05:12 | ro_st | +1 for applying cutesy to diarrhea |
| 05:13 | clgv | muhoo: can you post the stacktrace from the minimal example? |
| 05:13 | muhoo | clgv: i think it's an inner-class thing in jvm maybe? https://www.refheap.com/paste/2827 |
| 05:13 | muhoo | clgv: minimal stacktrace is more cutesy: https://www.refheap.com/paste/2828 |
| 05:15 | clgv | muhoo: you could go through custom-handler* code to see what results you get in the single steps |
| 05:15 | muhoo | clgv: i did that |
| 05:15 | amalloy | muhoo: minimal repro case is basically (eval `(~(constantly 1) 10)) |
| 05:15 | amalloy | you can't eval closures |
| 05:15 | muhoo | added printlns. everything checks out |
| 05:15 | muhoo | amalloy: that's the problem, yes |
| 05:16 | muhoo | hmm. wow. i guess i'm screwed thenn. |
| 05:17 | clgv | muhoo: you can create a patched implementation of custom-handler*, I guess |
| 05:17 | muhoo | i think that's the only option. |
| 05:18 | clgv | muhoo: do you know why an eval is needed there? |
| 05:19 | muhoo | the line is this: (eval `(~action ~url {params# :params} (~func params#))) |
| 05:19 | muhoo | and action is compojure.core/GET or POSt |
| 05:19 | muhoo | it's basically creating the route, then storing it in an atom. |
| 05:20 | muhoo | at page reloads, the routes and app are regenerated, makes for nice interactive development of the rails-y style |
| 05:21 | clgv | muhoo: ah, eval is for reloading so that the code in there is not compiled already. |
| 05:22 | clgv | muhoo: but if you create that handle via settings anyway you wont need that, right? |
| 05:22 | muhoo | what i'm trying to do is generate a whole bunch of pages dynamically |
| 05:23 | muhoo | from a defn. then the body of that defn calls noir to generate the routes and put them into the atom |
| 05:23 | Raynes | fliebel: pon |
| 05:23 | Raynes | h |
| 05:23 | Raynes | Jesus. |
| 05:24 | Raynes | fliebel: pong |
| 05:25 | fliebel | Raynes: How do I get lazybot in another channel? Can it tell it "go there", or do I need to run it on my won sever? |
| 05:25 | Raynes | You can do one of two things: 1) ask me to put him there (permanently) and I'll happily host him for you 2) run him yourself and deal with maintaining your own instance. |
| 05:26 | ro_st | how do i get paredit going in the slime-repl? |
| 05:26 | amalloy | Raynes: is lazybot still busted re: evaluating clojure? |
| 05:26 | Raynes | amalloy: define 'busted' |
| 05:26 | amalloy | &(inc 1) |
| 05:26 | lazybot | ⇒ 2 |
| 05:26 | fliebel | Raynes: Ok, do I owe you some project maintainance or cake? If you could add it to #hackerschool, that'd be grewat. |
| 05:27 | amalloy | &`inc |
| 05:27 | lazybot | ⇒ clojure.core/inc |
| 05:27 | amalloy | hey, he's working! |
| 05:27 | amalloy | $login |
| 05:27 | lazybot | You've been logged in. |
| 05:27 | Raynes | amalloy: I didn't do anything to fix it. I restarted him but it was still broken. |
| 05:27 | amalloy | $join #hackerschool |
| 05:27 | Raynes | fliebel: You don't owe us anything. <3 |
| 05:27 | fliebel | yay! |
| 05:27 | muhoo | it is kind of weird to hear a bot referred to as "him" |
| 05:27 | ro_st | can paredit work in the repl? |
| 05:27 | Raynes | amalloy: Can you add it to the channel list for me? I'm on my desktop and don't feel like getting sshed in and using emacs with this keyboard. |
| 05:28 | ro_st | i thought it was but it appears not |
| 05:28 | amalloy | fiiiine |
| 05:28 | fliebel | Raynes: I might write some plugins for it, regardless. |
| 05:28 | clgv | muhoo: I think you function only has to make sure that you assoc the needed data in both maps. so you can definitely write something like custom-handler* yourself |
| 05:29 | Raynes | fliebel: Great. You write 'em, I'll add 'em. :p |
| 05:29 | amalloy | fliebel: do you want channel logs? |
| 05:30 | Raynes | Goodnight pals. |
| 05:30 | Raynes | <3 |
| 05:30 | muhoo | clgv: yep, that seems like a reasonable next thing to try. |
| 05:30 | fliebel | amalloy: erm, dunno, doesn't hurt I guess, havn't thought deeply about it. |
| 05:30 | fliebel | amalloy: But if you run out of space, feel free to scrap them :P |
| 05:30 | amalloy | $reload |
| 05:30 | lazybot | Reloaded successfully. |
| 05:31 | amalloy | he might or might not be logging now, but he should at least log next time we restart him |
| 05:31 | fliebel | there are quite a few people interrested in learning clojure at hackerschool :) |
| 05:32 | clgv | fliebel: what's hackerschool? |
| 05:32 | ro_st | good. the more, the merrier. clojure rocks |
| 05:32 | fliebel | $google hacker school |
| 05:32 | lazybot | [Hacker School] https://www.hackerschool.com/ |
| 05:41 | michaelr` | what's a good function/macro to measure execution time? |
| 05:41 | amalloy | ,(clojure.repl/apropos "time") |
| 05:41 | clojurebot | (time dotimes read-instant-timestamp parse-timestamp) |
| 05:41 | amalloy | ,(doc time) ;; tada! |
| 05:41 | clojurebot | "([expr]); Evaluates expr and prints the time it took. Returns the value of expr." |
| 05:42 | michaelr` | &(time (count (range 1000))) |
| 05:42 | lazybot | java.lang.ClassNotFoundException: clojure.core |
| 05:42 | michaelr` | ,(time (count (range 1000))) |
| 05:42 | clojurebot | "Elapsed time: 7.161 msecs" |
| 05:42 | clojurebot | 1000 |
| 05:43 | michaelr` | how about printing a label |
| 05:45 | michaelr` | like (time "db fetch" (fetch-db db)) |
| 05:48 | michaelr` | okay, i'll write my first clojure macro ever ;) |
| 05:48 | michaelr` | after this there will be no way to go back.. |
| 05:56 | muhoo | clgv: aha, i see why he did it this way. there's a trap here. |
| 05:57 | muhoo | to call GET, you need to supply args. those need to be gensymed, and so you need syntax quoting, and then you're stuck evaling |
| 05:58 | muhoo | but, i think i can do it manually, bypassing most of this stuff |
| 06:24 | michaelr` | ooh performance optimization is so fun |
| 06:27 | clgv | muhoo: you dont need syntaxquoting for gensym. there is 'gensym ##(doc gensym) |
| 06:27 | lazybot | ⇒ "([] [prefix-string]); Returns a new symbol with a unique name. If a prefix string is supplied, the name is prefix# where # is some unique number. If prefix is not supplied, the prefix is 'G__'." |
| 06:30 | muhoo | kima: i see, that contextual eval is pretty crazy. [k `'~v] , eh? |
| 06:31 | kima | it becomes clear after a bit thought and macroexpand :-) |
| 08:03 | kima | hi #clojure |
| 08:32 | lewang | hello all |
| 08:33 | gfredericks | this must be the sound of #clojure waking up in the morning |
| 08:34 | ordnungswidrig | it's midday over here. maybe everybody is on the plane to uk |
| 08:35 | foxdonut | (ns good.morning) |
| 08:36 | clgv | java.lang.RuntimeException: java.lang.ExceptionInInitializerError |
| 08:36 | foxdonut | (let [your-day be-a-good-one] ..) |
| 08:36 | clgv | java.lang.Exception: Unable to resolve symbol: be-a-good-one in this context |
| 08:57 | Borkdude | is there a shortcut for (keep identity coll)? |
| 09:02 | lewang | Can anyone lend me a hand with swank-clojure and Emacs? It works, but I can't get meaningful stack traces. |
| 09:03 | foxdonut | Borkdude: doesn't seem like there is. (keep identity coll), (filter identity coll), (remove nil? coll), etc. |
| 09:04 | ordnungswidrig | (remove nil? coll) is the easiest to understand, IMHO. |
| 09:07 | hyPiRion | foxdonut: (filter identity coll)? ##(filter identity [true false nil 1]) |
| 09:07 | lazybot | ⇒ (true 1) |
| 09:07 | hyPiRion | &(keep identity [true false nil 1]) |
| 09:07 | lazybot | ⇒ (true false 1) |
| 09:07 | hyPiRion | It's subtle, isn't it. |
| 09:08 | michaelr` | ibdknox: ping |
| 09:12 | ro_st | what's a nifty way to get a subset of a map's data by keys? |
| 09:13 | ro_st | (gimme-a-map-with-just-these-keys-please source-map (:key1 :key2)) |
| 09:14 | S11001001 | ,(doc select-keys) |
| 09:14 | clojurebot | "([map keyseq]); Returns a map containing only those entries in map whose key is in keys" |
| 09:14 | ro_st | i really should read through the api some time. thanks s11 |
| 09:14 | foxdonut | hyPiRion: good point. I think (remove nil? coll) is most obvious at what it does. |
| 09:15 | hyPiRion | foxdonut: Yeah, it's more or less verbatim of how I would've described the function. |
| 09:16 | S11001001 | ro_st: best check what happens when a key in keyseq isn't in your map, and make sure it's what you want |
| 09:16 | hyPiRion | If I were to describe it in a non-programming language. |
| 09:16 | ro_st | s11: thanks for the tip. in this case, the source map is sql data, so they'll always be there |
| 09:17 | ro_st | is there a clever way to select the current form so that i can copy it? emacs + paredit |
| 09:18 | ro_st | right now i'm ctrl-space, C-M-f, enter |
| 09:18 | hyPiRion | Current form? |
| 09:19 | ro_st | oui |
| 09:19 | ro_st | the form at the point: |(my form) or (m|y form) |
| 09:19 | hyPiRion | Ah. |
| 09:20 | hyPiRion | For the first one, I use C-<space> C-M-n |
| 09:20 | hyPiRion | C-M-p and C-M-n are good when you're at the start or end, but I'm an emacs newbie myself :) |
| 09:22 | S11001001 | ro_st: I imagine killing the current form only would have a paredit-specific binding; try C-h m |
| 09:23 | vijaykiran | ro_st: C-k and C-_ should be the same |
| 09:23 | ro_st | ?! now my repl says "Unable to resolve symbol: doc in this context" |
| 09:23 | ro_st | this is in slime |
| 09:24 | ro_st | i thought doc was one of them global ones? |
| 09:24 | vijaykiran | may be you should (use 'clojure.repl) |
| 09:24 | bobry | is it possible to initialize a record with a map? i.e. with keyword arguments instead of positional? |
| 09:24 | ro_st | ah. my slime repl doesn't seem to do that |
| 09:25 | hyPiRion | bobry: Is speed essential for you? If not, I'd try to replace the record with a map. |
| 09:25 | AWizzArd | bobry: in Clojure 1.4 you can you it with map->XYZ |
| 09:25 | AWizzArd | (defrecord Foo [a b]) (map->Foo {:b 2, :a 1}) |
| 09:26 | AWizzArd | In earlier Clojure versions you could do (into (Foo. nil nil) {:b 2, :a 1}) |
| 09:26 | AWizzArd | This is a bit unfortunate, as you first have to create a throw-away Foo instance. |
| 09:26 | hyPiRion | AWizzArd: are there any other functions defined at defrecord-time? |
| 09:26 | bobry | AWizzArd: thanks! 'map->*' is exactly what I was looking for |
| 09:27 | hyPiRion | Sounds practical. |
| 09:28 | clgv | hyPiRion: yes, (->Foo 10 20) as a kind of constructor as well |
| 09:28 | bhenry | is there a (clojure-version) equivalent for clojurescript? |
| 09:29 | hyPiRion | clgv: Fancy. |
| 09:30 | ro_st | there must be a way to have the slime repl run some code on startup ¿ |
| 09:30 | ro_st | ? too |
| 09:30 | matessim | Hey, i'm abit confused about lambda's vs fn's |
| 09:30 | matessim | if lambda's don't have explicit do's basically only the last form in the lambda will be evaluated? |
| 09:31 | dnolen | bhenry: that works in CLJS |
| 09:31 | bhenry | dnolen: i'll restart the repl. that throws me an error |
| 09:32 | matessim | What's wrong with this? => (#(println "a")(println "b")) |
| 09:32 | matessim | b |
| 09:32 | matessim | ArityException Wrong number of args (1) passed to: user$eval560$fn clojure.lang.AFn.throwArity (AFn.java:437) |
| 09:33 | dnolen | matessim: the anon fn takes no arguments |
| 09:33 | matessim | i didn't give it any arguements. |
| 09:33 | matessim | or did i somehow? |
| 09:33 | dnolen | matessim: you did. |
| 09:33 | ro_st | (println "b") is being passed as an arg to #(println "a") |
| 09:33 | foxdonut | the (println "b") is an argument |
| 09:33 | ro_st | #() is a function 'literal' |
| 09:34 | matessim | oh i'm missing a bunch of parenthesis |
| 09:34 | matessim | thanks |
| 09:34 | rhc | matessim: i think you want this: #(do (println "a") (println "b")) ? |
| 09:34 | matessim | I was trying to see the difference in anon vs fn myself(From what i understood, anon would print b and fn would print ab) |
| 09:34 | matessim | and yeah rhc |
| 09:34 | ro_st | is there a way to specify a clj script to run on startup of my slime repl? |
| 09:35 | dnolen | ro_st: probably, perhaps technomancy knows |
| 09:35 | matessim | Now i'm even more confused, whats wrong with this? |
| 09:35 | matessim | => (#((println "a")(println "b"))) |
| 09:35 | matessim | a |
| 09:35 | matessim | b |
| 09:35 | matessim | NullPointerException user/eval564/fn--565 (NO_SOURCE_FILE:1) |
| 09:35 | vijaykiran | println returns nil |
| 09:35 | dnolen | matessim: you are calling nil as a function |
| 09:35 | vijaykiran | so you are truing to call (nil) |
| 09:35 | foxdonut | ,(doall (map println ["a" "b"])) |
| 09:35 | clojurebot | a |
| 09:35 | clojurebot | b |
| 09:35 | rhc | matessim: break that down, its basically (#(nil nil)) |
| 09:35 | clojurebot | (nil nil) |
| 09:36 | matessim | aha |
| 09:36 | matessim | if it was (#(nil)), would that be alright? |
| 09:36 | dnolen | ,(macroexpand '#((println "a")(println "b"))) |
| 09:36 | rhc | matessim: nope |
| 09:36 | clojurebot | (fn* [] ((println "a") (println "b"))) |
| 09:36 | dnolen | matessim: ^ |
| 09:36 | rhc | matessim: (nil) is just trying to call 'nil' which isnt a valid function |
| 09:37 | matessim | so isn't it mean its evaluating twice? |
| 09:37 | dnolen | ,(macroexpand '#(do (println "a") (println "b"))) |
| 09:37 | clojurebot | (fn* [] (do (println "a") (println "b"))) |
| 09:37 | dnolen | ,(#(nil)) |
| 09:37 | clojurebot | #<CompilerException java.lang.IllegalArgumentException: Can't call nil, compiling:(NO_SOURCE_PATH:0)> |
| 09:38 | dnolen | matessim: there's no implicit do when using #(...) |
| 09:38 | dnolen | ,(#(do nil)) |
| 09:38 | clojurebot | nil |
| 09:38 | matessim | but #(do(nil)) is still wrong, right? and println evaluates to nil |
| 09:38 | ro_st | matessim: the first symbol in a list is in function position, and clojure will attempt to call it as a function.. unless you quote the list '(nil 1 2 3) |
| 09:39 | rhc | matessim: yes, because (nil) is still trying to call nil |
| 09:39 | dnolen | matessim: (nil) will never work, nil is not a function |
| 09:39 | matessim | so i need to qoute the anonymous function? |
| 09:39 | matessim | '#(do(nil)) is fine? |
| 09:40 | dnolen | matessim: I think you stop a moment and think this through :) |
| 09:40 | vijaykiran | ro_st: I think you need :repl-init in your project.clj |
| 09:40 | matessim | dnolen, i'm just a bit confused, for example ,i'll want to print something with an anonymous function |
| 09:40 | dnolen | ,(macroexpand '#(do (nil))) |
| 09:40 | clojurebot | (fn* [] (do (nil))) |
| 09:41 | dnolen | matessim: figure what is wrong with ^ |
| 09:41 | rhc | matessim: read the first chapter of this book: http://cdn.oreilly.com/oreilly/booksamplers/9781449394707_sampler.pdf |
| 09:41 | matessim | i'm reading |
| 09:41 | matessim | Programming Clojure |
| 09:41 | dnolen | matessim: and you'll understand why none of your ideas so far work. |
| 09:41 | matessim | just got it yesterday |
| 09:41 | matessim | dnolen, i understand, the macro is expanded, but the whole thing is a string |
| 09:41 | rhc | oh ok, perfect. the first chapter should help a lot |
| 09:41 | matessim | that's not being evaluated |
| 09:41 | matessim | because of the ' |
| 09:42 | ro_st | vijaykiran: ah, that sounds promising! does slime/swank respect it? |
| 09:42 | rhc | matessim: its not exactly "just a string" |
| 09:42 | rhc | for example, you can't do '([) |
| 09:42 | dnolen | matessim: sorry didn't mean to confuse. the macroexpand was just an illustration of what you're code actually will get compiled as. |
| 09:43 | dnolen | your |
| 09:43 | rhc | its still parsing it, just not evaluating '(a b c) as "call a with b c" |
| 09:43 | matessim | okay rhc, and i think i understand a bit better |
| 09:43 | foxdonut | dnolen: +1.. trying to grasp too many concepts at once |
| 09:43 | vijaykiran | ro_st: I'm guessing - it will - I didn't try it though |
| 09:43 | matessim | extra question, what's the green text in the REPL? i understand black is stdout |
| 09:44 | matessim | but when i do (do #(println "x")) |
| 09:44 | matessim | it does x in black, and nil in green. |
| 09:44 | vijaykiran | the return value of the function |
| 09:44 | vijaykiran | every function must return a value - in this case println returns nil |
| 09:45 | matessim | thanks. |
| 09:45 | rhc | and do returns the return value of the last argument |
| 09:46 | bhenry | dnolen: https://gist.github.com/25cdcee02bb03d506f70 |
| 09:48 | matessim | the only difference between letn and fn is the namespace binding? |
| 09:49 | matessim | defn* |
| 09:49 | matessim | not letn |
| 09:50 | vijaykiran | ,(macroexpand '(defn x [] (y))) |
| 09:50 | clojurebot | #<Exception java.lang.Exception: SANBOX DENIED> |
| 09:51 | bhenry | matessim: (defn x [] …) is just a shortcut for (def x (fn [] …)) |
| 09:51 | vijaykiran | &(macroexpand '(defn x [] (y))) |
| 09:51 | lazybot | ⇒ (def x (clojure.core/fn ([] (y)))) |
| 09:51 | S11001001 | matessim: defn has lots more sugar too |
| 09:51 | matessim | right, thanks again |
| 09:51 | clgv | &(macroexpand '(clojure.core/fn ([] (y)))) |
| 09:51 | lazybot | ⇒ (fn* ([] (y))) |
| 09:52 | vijaykiran | matessim: if you are feeling adventurous, try (source defn) :) |
| 09:52 | matessim | wow thats awesome vijaykiran, had no idea you can do that :P |
| 09:53 | matessim | how can i pull the metadata? (preferably by key?) |
| 09:53 | matessim | the ^[:doc stuff. |
| 09:54 | ro_st | (meta thing) |
| 09:54 | matessim | ty |
| 09:54 | Bronsa | ,(meta #'first) |
| 09:54 | clojurebot | {:ns #<Namespace clojure.core>, :name first, :arglists ([coll]), :added "1.0", :static true, ...} |
| 09:54 | Bronsa | ,(:doc (meta #'first)) |
| 09:54 | clojurebot | "Returns the first item in the collection. Calls seq on its\n argument. If coll is nil, returns nil." |
| 09:54 | clgv | ,(doc first) |
| 09:54 | clojurebot | "([coll]); Returns the first item in the collection. Calls seq on its argument. If coll is nil, returns nil." |
| 09:55 | matessim | Bronsa, why is the #' in the meta tag?(I sort of understand the ' but not the #) |
| 09:55 | Bronsa | #' is reader macro for var |
| 09:55 | Bronsa | ,(:doc (meta (var first))) |
| 09:55 | clojurebot | "Returns the first item in the collection. Calls seq on its\n argument. If coll is nil, returns nil." |
| 09:56 | Bronsa | the metadata is attached to the Var `first` not to the symbol |
| 09:57 | matessim | i see, thanks |
| 09:57 | Bronsa | so, #' is not related to ' |
| 09:58 | Borkdude | ,#'+ |
| 09:58 | clojurebot | #'clojure.core/+ |
| 09:58 | Borkdude | ,'+ |
| 09:58 | clojurebot | + |
| 09:58 | Bronsa | ,'#'+ |
| 09:58 | clojurebot | (var +) |
| 09:59 | Borkdude | ,'# |
| 09:59 | clojurebot | #<ExecutionException java.util.concurrent.ExecutionException: java.lang.RuntimeException: EOF while reading character> |
| 09:59 | Bronsa | 'nception |
| 09:59 | Borkdude | ,#"+" |
| 09:59 | clojurebot | #<ExecutionException java.util.concurrent.ExecutionException: java.util.regex.PatternSyntaxException: Dangling meta character '+' near index 0 |
| 09:59 | clojurebot | + |
| 09:59 | clojurebot | ^> |
| 09:59 | matessim | Q_Q |
| 10:00 | Borkdude | , #" " |
| 10:00 | clojurebot | #" " |
| 10:00 | Borkdude | ,#(+ % %1) |
| 10:00 | clojurebot | #<sandbox$eval304$fn__305 sandbox$eval304$fn__305@e2be94> |
| 10:01 | Borkdude | ,`(let [+# -] (+# 1 2 3)) |
| 10:01 | matessim | ,(#(+ % %1) 1) |
| 10:01 | clojurebot | 2 |
| 10:01 | clojurebot | (clojure.core/let [+__27__auto__ clojure.core/-] (+__27__auto__ 1 2 3)) |
| 10:01 | Borkdude | ,#{1 2 3} |
| 10:01 | clojurebot | #{1 2 3} |
| 10:02 | Borkdude | ,(contains? #{1 2 3} 1) |
| 10:02 | clojurebot | true |
| 10:02 | Borkdude | have we covered every use of # now? |
| 10:03 | Borkdude | ,#_(eval '(+ 1 2 3)) |
| 10:03 | clojurebot | #<ExecutionException java.util.concurrent.ExecutionException: java.lang.RuntimeException: EOF while reading> |
| 10:03 | Borkdude | ,#_1 |
| 10:03 | clojurebot | #<ExecutionException java.util.concurrent.ExecutionException: java.lang.RuntimeException: EOF while reading> |
| 10:03 | Borkdude | , |
| 10:03 | clojurebot | #<ExecutionException java.util.concurrent.ExecutionException: java.lang.RuntimeException: EOF while reading> |
| 10:04 | bhenry | ,#_ 1 2 |
| 10:04 | clojurebot | 2 |
| 10:06 | gtuckerkellogg | i'm feeling pretty stupid, but there's something I don't understand about "=" |
| 10:06 | Borkdude | maybe reader literals, but I can't show it here |
| 10:06 | gtuckerkellogg | I had thought all of these comparisons would be true |
| 10:07 | gtuckerkellogg | http://pastebin.com/ndfUJtQg |
| 10:08 | Borkdude | ,(= {:a 1, :b 2} {:a 1, :b 2}) |
| 10:08 | clojurebot | true |
| 10:09 | Borkdude | ,(= {:a #" ", :b 2} {:a #" ", :b 2}) |
| 10:09 | clojurebot | false |
| 10:09 | Borkdude | gtuckerkellogg: I guess it has to do with how equals is defined on regexes |
| 10:09 | gtuckerkellogg | oh! |
| 10:09 | gtuckerkellogg | why? |
| 10:09 | clojurebot | Why is the ram gone is <reply>I blame UTF-16. http://www.tumblr.com/tagged/but-why-is-the-ram-gone |
| 10:10 | Borkdude | ,(type #" ") |
| 10:10 | clojurebot | java.util.regex.Pattern |
| 10:10 | gtuckerkellogg | ,(doc =) |
| 10:10 | clojurebot | "([x] [x y] [x y & more]); Equality. Returns true if x equals y, false if not. Same as Java x.equals(y) except it also works for nil, and compares numbers and collections in a type-independent manner. Clojure's immutable data structures define equals() (and thus =) as a value, not an identity, comparison." |
| 10:10 | Borkdude | ,(resolve 'javadoc) |
| 10:10 | clojurebot | nil |
| 10:11 | Bronsa | ,(= #"" #"") |
| 10:11 | clojurebot | false |
| 10:11 | Borkdude | gtuckerkellogg: regexes are never equal except when they are the same object |
| 10:12 | gtuckerkellogg | hmm |
| 10:12 | Bronsa | ,(hash #"") |
| 10:12 | clojurebot | 28127006 |
| 10:12 | Bronsa | ,(hash #"") |
| 10:12 | clojurebot | 31360080 |
| 10:12 | gtuckerkellogg | aha |
| 10:12 | Borkdude | gtuckerkellogg: i.e., they don't define equality, the equals method is inherited from Object |
| 10:12 | gtuckerkellogg | i see |
| 10:12 | vijaykiran | http://stackoverflow.com/questions/10055034/java-comparing-two-pattern-objects |
| 10:14 | gtuckerkellogg | ok, that's very helpful. thanks Borkdude, Bronsa, and vijaykiran |
| 10:14 | ro_st | is there a shortcut in emacs to select the symbol under the current point? |
| 10:14 | Bronsa | i guess it would be convenient if for patterns `=` compared their .toString |
| 10:14 | ro_st | paredit's cheatsheet doesn't show anything for selection |
| 10:14 | gtuckerkellogg | Bronsa, it sure would! |
| 10:15 | gtuckerkellogg | ro_st, you might get an answer here, but have you checked the #emacs channel? |
| 10:15 | ro_st | what? this isn't #emacs-incognito? :-) |
| 10:22 | S11001001 | ro_st: you will have better luck if you use emacs lingo for such things rather than some other UI's lingo :) |
| 10:23 | ro_st | so i have this form (convert-resource-media r). cursor is somewhere in the function element. i want to select the first element of the list. surely there's a quick way to do that? |
| 10:23 | ro_st | eclipse ccw has a gesture for this, i think |
| 10:24 | vijaykiran | ro_st: I'm sure #emacs guys will point you to : http://emacswiki.org/emacs/MarkCommands#toc6 :) |
| 10:24 | ro_st | thank you :) |
| 10:24 | ro_st | i'll stop pestering you guys with emacs questions |
| 10:25 | vijaykiran | but M-x mark-word seems to work fine, just bind it to whatever keycombi you like |
| 10:25 | ro_st | M-@ :-) |
| 10:26 | ro_st | whoever made emacs show you the bound keybindings when you use M-x (command) is a bloody genius |
| 10:28 | TimMc | Yay for discoverable interfaces! |
| 10:31 | ro_st | yay indeed |
| 10:32 | clgv | TimMc: ? |
| 10:33 | vijaykiran | so how many of you guys here will be in-person at EuroClojure ? |
| 10:35 | Borkdude | vijaykiran: are you going? |
| 10:35 | vijaykiran | yeah, I'll be there |
| 10:36 | Borkdude | what is the official hashtag for euroclojure? #euroconj ? |
| 10:36 | vijaykiran | I guess https://twitter.com/#!/search/%23euroclojure |
| 10:36 | vijaykiran | oops #euroclojure |
| 10:37 | gfredericks | futures always spawn new threads?? |
| 10:37 | lazybot | gfredericks: What are you, crazy? Of course not! |
| 10:37 | TimMc | clgv: My name for user interfaces that allow you discover new ways of using them, unobtrusively. |
| 10:38 | clgv | TimMc: ah kk |
| 10:38 | TimMc | clgv: Similarly, having keyboard shortcuts next to items in a drop-down menu. |
| 10:38 | clgv | gfredericks: they use an executorservice |
| 10:38 | matessim | what happens if i have a java object with a void method by the name a and a public variable a(not static), what will i get when i do (.a instanceName) |
| 10:38 | Borkdude | TimMc: clgv or help -> search (in menu items) in OSX |
| 10:38 | matessim | not void, no args i meant |
| 10:39 | TimMc | Or especially having commands grouped into menus in the first place! You can find new commands by accident. |
| 10:39 | matessim | public class A{public int x; public A(){...) public int x()} |
| 10:40 | matessim | doing in clojure (.x instanceOfA) would give me what? |
| 10:40 | gfredericks | clgv: I could have sworn that was true but my coworker just made a jackload of futures which created a jackload of threads |
| 10:40 | gfredericks | and eventually crashed the jvm for having too many threads |
| 10:40 | gfredericks | I think |
| 10:40 | TimMc | matessim: I was wondering about that when I was writing an interop lib! I think the official answer is "Don't do that!" :-/ |
| 10:40 | matessim | TimMc, so its a undocumented implementation detail? i'll check later though, but that sounds like sound advice :P |
| 10:40 | clgv | gfredericks: humm I hope I didnt confuse it with pmap. I'll check |
| 10:40 | TimMc | matessim: (. instanceOfA (x)) should be unambiguous for the nullary method, though. |
| 10:41 | TimMc | so maybe fields are checked first? |
| 10:41 | matessim | why? the book i have says the unsugared syntax for both is the same(fields and methods) |
| 10:41 | matessim | both the sugared and unsugared is the same for fields and no-arg methods |
| 10:42 | clgv | gfredericks: yes it is an executor service - this one: Executors.newCachedThreadPool(); |
| 10:42 | clgv | gfredericks: it's probably not limited like the FixedThreadPool |
| 10:44 | gfredericks | hrm |
| 10:44 | clgv | I had issue with future myself when using it for blocking shell calls |
| 10:45 | TimMc | &(. "foo" (toString)) |
| 10:45 | lazybot | ⇒ "foo" |
| 10:45 | TimMc | &(. "foo" toString) |
| 10:45 | lazybot | ⇒ "foo" |
| 10:45 | TimMc | matessim: ^ |
| 10:46 | matessim | err. what? |
| 10:46 | matessim | why would it return anything else? |
| 10:46 | matessim | As far as i'm aware the String type has no public toString field |
| 10:46 | matessim | &(.toString "foo") |
| 10:46 | lazybot | ⇒ "foo" |
| 10:46 | gfredericks | clgv: yeah I just created 10000 sleepy threads and it stayed up. I will ridicule coworker. |
| 10:47 | TimMc | Right... just demo'ing the two .-forms of method calling |
| 10:47 | matessim | those aren't the two forms though (what you wrote is the same) |
| 10:47 | TimMc | matessim: Count the parens. |
| 10:47 | matessim | just with a extra parenthesis... |
| 10:47 | matessim | aren't the two forms |
| 10:47 | TimMc | ... |
| 10:47 | matessim | : |
| 10:47 | matessim | aren't the two forms these?: |
| 10:47 | matessim | &(.toString "Foo") |
| 10:47 | lazybot | ⇒ "Foo" |
| 10:48 | matessim | &(. "Foo" toString |
| 10:48 | lazybot | java.lang.RuntimeException: EOF while reading, starting at line 1 |
| 10:48 | matessim | &(. "Foo" toString) |
| 10:48 | lazybot | ⇒ "Foo" |
| 10:48 | TimMc | Parens are never "extra" in a Lisp. |
| 10:48 | matessim | &(. "Foo" (((toString)))) |
| 10:48 | lazybot | java.lang.IllegalArgumentException: Malformed member expression |
| 10:48 | matessim | hmm |
| 10:48 | matessim | what do those extra parenthesis do there then? |
| 10:48 | matessim | between the forms you posted. |
| 10:48 | TimMc | THey say, "this is explcitily a method". |
| 10:49 | matessim | oh, okay. |
| 10:50 | TimMc | Unfortunately, CLojure doesn't actually have a specification. You'd have to make a class and see what happens. |
| 10:50 | matessim | pr = clojure wrapper for println? |
| 10:50 | TimMc | pr = print read'ably |
| 10:50 | matessim | TimMc, is that something on purpose or just lack of people documenting? |
| 10:50 | TimMc | Not sure. |
| 10:51 | TimMc | matessim: pr is (mostly) the inverse of read (or pr-str vs. read-string) |
| 10:51 | matessim | okay, so its basically for "dynamic code"(Code that creates extra code?) |
| 10:51 | matessim | or w/e the terminology is |
| 10:52 | zakwilson | No. |
| 10:52 | zakwilson | Parens *usually* indicate that the first thing in them is callable - a function, special form, macro, etc... |
| 10:53 | zakwilson | Or were you asking about pr? |
| 10:53 | matessim | zakwilson i understand that... |
| 10:53 | matessim | yeah |
| 10:53 | matessim | :) |
| 10:53 | vijaykiran | " By default, pr and prn print in a way that objects |
| 10:53 | vijaykiran | can be read by the reader" |
| 10:54 | zakwilson | That's generally for serialization. It would be unusual to pr something then run it as code. |
| 10:54 | TimMc | matessim: pr-str and read-string are for reading and serializing data objects. |
| 10:54 | matessim | Okay, makes sense :). |
| 10:55 | TimMc | matessim: Great for config files. Just read the doc for *read-eval* if you read user-controlled data! |
| 10:55 | matessim | what are "things" that are in between asterisks btw? |
| 10:55 | TimMc | &(doc *read-eval*) |
| 10:55 | lazybot | java.lang.SecurityException: You tripped the alarm! *read-eval* is bad! |
| 10:55 | matessim | i saw it with *ns* |
| 10:56 | zakwilson | For runtime code generation, eval takes lists, not strings. |
| 10:56 | TimMc | matessim: They're part of the symbol. It's a convention for naming dynamic vars. |
| 10:56 | matessim | the bot doesn't want us to use read eval? :P |
| 10:57 | TimMc | ,(doc *read-eval*) ;; let's try a less secure bot |
| 10:57 | clojurebot | "; When set to logical false, the EvalReader (#=(...)) is disabled in the read/load in the thread-local binding. Example: (binding [*read-eval* false] (read-string \"#=(eval (def x 3))\")) Defaults to true" |
| 10:57 | zakwilson | I can't imagine why the bot wouldn't want us to poke at something like that. |
| 10:58 | ibdknox | Would anyone like lots of karma on HN? :) |
| 10:58 | ibdknox | http://www.chris-granger.com/2012/05/21/the-future-is-specific/ |
| 10:58 | ibdknox | second Light Table demo ^ |
| 10:59 | zakwilson | Can I buy things with it? |
| 10:59 | matessim | ibdknox I found out about Clojure because of your kickstarter, i was like "What is this awesome language" when i saw the demo |
| 11:00 | matessim | i ordered Programming Clojure the same day :P |
| 11:00 | ibdknox | haha |
| 11:00 | ibdknox | cool :) |
| 11:00 | zakwilson | The rest of you have about a minute before I take that karma. |
| 11:01 | ibdknox | zakwilson: someone beat you to it |
| 11:01 | Borkdude | this dude already did it: http://news.ycombinator.com/user?id=olauzon |
| 11:01 | zakwilson | ibdknox: how did that prototype idea work out for you? I was considering doing something similar. |
| 11:01 | olauzon | just managed to slip in |
| 11:01 | zakwilson | Good. I have enough karma. |
| 11:01 | Borkdude | haha |
| 11:01 | Borkdude | I don't care about karma |
| 11:01 | ibdknox | zakwilson: there was lots of interest, but the projects were depressing |
| 11:02 | zakwilson | I don't mind depressing projects right now. I like money. |
| 11:03 | ibdknox | one of them was an airbnb for bicycles :( |
| 11:03 | ibdknox | most of the people really need help at the idea phase |
| 11:03 | ibdknox | which I could've done |
| 11:03 | ibdknox | but is harder to sell |
| 11:04 | zakwilson | http://renthubnyc.com/ <-- airbnb for arbitrary stuff |
| 11:04 | ibdknox | hah |
| 11:04 | ibdknox | no I mean this guy ripped it off |
| 11:04 | ibdknox | his example used the same font faces |
| 11:04 | ibdknox | the same design entirely |
| 11:04 | lucian | python mode for lighttable yay |
| 11:05 | ibdknox | lucian: well, an example of one :) |
| 11:06 | zakwilson | I'd tell a client it's not a good idea to copy a design that closely. Still, if somebody has a bad idea and wants to pay me to build it, I'm not about to refuse. |
| 11:08 | Borkdude | ibdknox: nice video |
| 11:09 | ibdknox | thanks :) |
| 11:11 | zakwilson | Your video is too popular. It's buffering slowly. |
| 11:12 | foxdonut | it's about 14MB in HD |
| 11:13 | ibdknox | I'm waiting for the "Y U NO USE DJANGO?" |
| 11:14 | Borkdude | ibdknox: why you not use clojure-py :P |
| 11:14 | lucian | ibdknox: sure, but i still think it's nice that it's being considered |
| 11:14 | zakwilson | I'm guessing because it's a hammer and you weren't driving a nail. |
| 11:16 | ibdknox | here's a youtube link for the slowness |
| 11:16 | ibdknox | http://www.youtube.com/watch?v=osLReQSB9F0 |
| 11:18 | zakwilson | Just in time for it to finish buffering! |
| 11:20 | RickInGA | ibdknox: new light table post/video is amazing |
| 11:20 | TimMc | Oh, and posted to reddit as well: http://www.reddit.com/s/http%3A//www.chris-granger.com/2012/05/21/the-future-is-specific/ |
| 11:26 | zakwilson | ibdknox: The future of tools? It's the past too - seems to me Emacs had the same idea of being easy to adapt to the problem at hand. I could see something like this replacing Emacs for me, and that's huge. |
| 11:27 | ibdknox | zakwilson: totally, I've been thinking about having something like a major and minor modes distinction :) |
| 11:28 | gtrak | I'd rather invest my tool-molding learning into something smaller and more modern than emacs, ibdknox is LT scriptable with clojure? |
| 11:28 | ibdknox | it's Clojure + ClojureScript |
| 11:28 | ibdknox | + whatever language back end you use |
| 11:28 | gtrak | awesome |
| 11:30 | gtrak | yea, a scriptable JVM-based editor with a browser UI sounds excellent |
| 11:32 | Wild_Cat | I'm not so hot about the browser UI TBH |
| 11:32 | zakwilson | A lot of what I'm seeing there reminds me of Slime. I don't understand why that sort of thing isn't already more popular for other dynamic languages. |
| 11:32 | Wild_Cat | ...then again I used to say that about email clients too, so who knows. |
| 11:32 | ro_st | is there a method that returns true if all the elements in the coll are truthy? |
| 11:32 | zakwilson | Why are we still running those in batch mode most of the time instead of having the editor talk to a running program? |
| 11:34 | ro_st | sorry, not a method, a function :) |
| 11:35 | vijaykiran | (every? true? '(blah)) |
| 11:35 | ro_st | gah. of course. |
| 11:35 | TimMc | vijaykiran: Not quite. |
| 11:36 | TimMc | &(map true? [1 true false nil]) |
| 11:36 | lazybot | ⇒ (false true false false) |
| 11:36 | foxdonut | ,(true? 42) |
| 11:36 | clojurebot | false |
| 11:36 | TimMc | ro_st: You can use identity instead of true? there. |
| 11:36 | ro_st | actually, i want to assert whether 3 particular keys in a map are nil or not |
| 11:36 | TimMc | Specifically non-nil? |
| 11:37 | ro_st | so i'm using (select-keys) to restrict to those 3, and now i want a yes/no on all not nil or not |
| 11:37 | foxdonut | &(every? identity [1 true false nil]) |
| 11:37 | lazybot | ⇒ false |
| 11:37 | foxdonut | &(every? identity [1 true false]) |
| 11:37 | lazybot | ⇒ false |
| 11:37 | TimMc | ro_st: Instead of select-keys, you can also use juxt. :-) |
| 11:37 | TimMc | &((juxt :a :b :c) {:a 4 :b 5 :c 6 :d 7}) |
| 11:37 | lazybot | ⇒ [4 5 6] |
| 11:37 | foxdonut | &(every? (complement nil?) [1 true false]) |
| 11:37 | lazybot | ⇒ true |
| 11:38 | ro_st | ah that's even better! |
| 11:40 | metellus | &(every? (not nil?) [1 true false]) |
| 11:40 | lazybot | java.lang.ClassCastException: java.lang.Boolean cannot be cast to clojure.lang.IFn |
| 11:40 | metellus | that explains that |
| 11:40 | ro_st | complement is like ! from javascript? |
| 11:41 | S11001001 | no |
| 11:41 | metellus | &(doc complement) |
| 11:41 | lazybot | ⇒ "([f]); Takes a fn f and returns a fn that takes the same arguments as f, has the same effects, if any, and returns the opposite truth value." |
| 11:41 | timvisher | anyone know why clojure.java.shell would find an executable specified later in PATH when it had the opportunity to find the same executable name earlier in PATH? |
| 11:42 | foxdonut | &(not (some nil? [1 true false nil])) |
| 11:42 | lazybot | ⇒ false |
| 11:42 | TimMc | ro_st: It's a higher-order function. ! is like not. |
| 11:42 | pandeiro | anybody use clojurescript on a low powered processor (like atom, athlon)? |
| 11:42 | foxdonut | &(not (some nil? [1 true false])) |
| 11:42 | lazybot | ⇒ true |
| 11:42 | pandeiro | the compile times i'm getting with lein cljsbuild + cljs 1236 are painful |
| 11:42 | TimMc | $inc foxdonut |
| 11:42 | lazybot | ⇒ 1 |
| 11:42 | pandeiro | like one minute to compile a 10 line cljs file |
| 11:42 | foxdonut | ro_st: that's another option according to your taste. |
| 11:43 | TimMc | That's an application of De Morgan's law, right? |
| 11:43 | ro_st | thanks fox |
| 11:43 | foxdonut | welcome |
| 11:46 | foxdonut | $inc TimMc |
| 11:46 | lazybot | ⇒ 6 |
| 11:47 | TimMc | heh |
| 11:47 | S11001001 | pandeiro: have used plain clojure on atom, seems fine |
| 11:47 | ro_st | ((juxt :triple_namespace :triple_key :triple_value) %) |
| 11:47 | dnolen | raph_amiard: ping |
| 11:48 | ro_st | "java.lang.Boolean cannot be cast to clojure.lang.IFn" |
| 11:48 | ro_st | why?! |
| 11:48 | ro_st | % here is a map |
| 11:48 | TimMc | TOo many parens somewhere? |
| 11:48 | S11001001 | fun fact: juxt is lifting vector into the reader monad |
| 11:49 | TimMc | I'll take it on faith that that was English. |
| 11:50 | foxdonut | lol |
| 11:50 | ro_st | one day i'll learn what a monad is |
| 11:51 | timvisher | `(System/getenv "PATH")` returns the right thing |
| 11:51 | S11001001 | and comp is just a less-powerful version of map :) |
| 11:51 | foxdonut | ,((juxt :a :b :c) {:a 1 :b 2 :c 42}) |
| 11:51 | clojurebot | [1 2 42] |
| 11:51 | timvisher | is there another place that Runtime.exec looks for executables that supersedes PATH? |
| 11:52 | pandeiro | S11001001: yeah clojure is fine, but lein-cljsbuild is taking eons... dunno wats up |
| 11:52 | ro_st | https://gist.github.com/2769905 |
| 11:52 | TimMc | timvisher: Are you in Cygwin by any chance? |
| 11:52 | pandeiro | ibdknox: f'ing awesome, haven't even watched the demo but i loved the writeup.. esp. about routes being the logical unit, context switching etc |
| 11:52 | ro_st | so i'm trying to either just grab :name, or :triple_* if those aren't nil |
| 11:52 | TimMc | Although someone was experiencing some PATH weirdness in SLIME or something the other day. |
| 11:53 | timvisher | TimMc: windows |
| 11:53 | timvisher | in cmd |
| 11:53 | timvisher | from within emacs |
| 11:53 | TimMc | Maybe it was you! |
| 11:53 | foxdonut | ro_st: you have extra parens #(if (( |
| 11:53 | timvisher | I believe it was ;) |
| 11:53 | ro_st | foxdonut: thank you. was killing me |
| 11:54 | timvisher | interestingly, I was experiencing the same thing from a cmd shell _but_ if I cd out of the default directory (`c:\windows\system32`) then it does find the correct path |
| 11:54 | foxdonut | ro_st: welcome |
| 11:54 | timvisher | which leads me to believe that windows somehow honors `.` before anything, even if it's not in PATH |
| 11:54 | ro_st | man, i'm really digging this language |
| 11:54 | TimMc | timvisher: Oh god... |
| 11:54 | TimMc | You might be right. |
| 11:55 | ro_st | makes me think hard. i've spent all day writing code and i'm at 83 lines of code, and i'm mentally exhausted! |
| 11:55 | timvisher | even stranger, perhaps is that `(sh "pwd")` does not tell me that i'm in that default directory |
| 11:55 | timvisher | ro_st: eventually you want that amount of effort to stop, probably ;) |
| 11:55 | timvisher | unless you're doing something that is inherently very hard. lol |
| 11:55 | gtrak | ro_st: I found that density terrifying initally, but then I started thinking about how much code I would have written in java for the same thing, and felt better |
| 11:55 | foxdonut | ro_st: I've lost 15 pounds by sheer mental exercise ;) |
| 11:56 | ro_st | yes, naturally. but it's been a long time that i've been so nicely challenged |
| 11:56 | timvisher | where are you coming from? |
| 11:56 | ro_st | i'm only about a week and a half into clojure |
| 11:56 | timvisher | java? |
| 11:56 | clojurebot | ☕ |
| 11:56 | ro_st | oh, all the usual imperative stuff. ruby, javascript, php, actionscript in no particular order |
| 11:56 | timvisher | yeah, it'll probably take you awhile to get used to clojure then. :) |
| 11:57 | timvisher | well worth it, though, imo |
| 11:57 | ro_st | absolutely! |
| 11:57 | TimMc | JS really helped me learn Scheme, though. |
| 11:57 | timvisher | you know that is true |
| 11:57 | ro_st | its not just learning clojure. it's also learning emacs |
| 11:57 | timvisher | i always forget how functional javascript can be |
| 11:57 | TimMc | just insofar as callbacks |
| 11:57 | timvisher | most people don't teach it that way but it can be done |
| 11:57 | timvisher | ro_st: double whammy |
| 11:58 | timvisher | what are you doing to learn emacs? |
| 11:58 | gtrak | underscore.js looks pretty good actually |
| 11:58 | ro_st | timvisher: deep end |
| 11:58 | foxdonut | to me a hurdle was to "unlearn" the solutions I'm used to from OO for which FP has different (usually better) solutions |
| 11:58 | ro_st | pestering folks on here, mostly :) |
| 11:58 | TimMc | ro_st: Oof. I failed to learn either when I tried to learn both at the same time. If you can, do one at a time. |
| 11:58 | timvisher | lol |
| 11:58 | timvisher | it may sound crazy to you but _read the manual_ |
| 11:59 | timvisher | it's an astonishingly good resource |
| 11:59 | ro_st | i have several post-its on my monitor with swank and paredit shortcuts |
| 11:59 | ro_st | already internalised enough to get around without swearing in the high decibels |
| 11:59 | ro_st | main thing is the core text editing stuff. once that's natural, the rest is jam |
| 12:00 | foxdonut | emacs is not something I've gone back to though. I'm staying with vim. One less problem to solve. |
| 12:00 | ro_st | i come from windows text editing |
| 12:00 | vijaykiran | ro_st: http://shop.fsf.org/product/gnu-emacs-reference-mugs/ :) |
| 12:00 | ro_st | so it's been particularly .. fun |
| 12:00 | timvisher | if you go on an emacs binge, i highly recomend https://peepcode.com/products/meet-emacs and http://vimeo.com/channels/222837 |
| 12:00 | timvisher | pardon the self-promotion, of course. ^_^ |
| 12:00 | ro_st | i want maximum productivity in the long term |
| 12:00 | timvisher | foxdonut: i hear that paredit is getting ported to vim, is that true? |
| 12:00 | ldopa | ro_st: ms text editing ... you mean like word? |
| 12:00 | lucian | i've used emacs + evil for a few months, it was ok |
| 12:00 | ro_st | i tried ccw, sublime text 2, intellij + la clojure |
| 12:00 | ro_st | all subpar |
| 12:01 | foxdonut | timvisher: I dunno.. I use vimclojure and surround, works well.. |
| 12:01 | ro_st | ldopa: no, using ctrl left right to move between words and variants thereof |
| 12:01 | timvisher | gotcha |
| 12:01 | ldopa | ro_st: sorry, bad joke ;) |
| 12:01 | timvisher | paredit was pretty life-changing. miss it in every language that i'm in, even the ones that don't have the revealed ast |
| 12:01 | ro_st | timvisher: i already have the peepcast. reeeaally helpful |
| 12:02 | ro_st | i'll check the vimeo stuff out. it's on the list along with disclojure and all the itunes clojure podcast material |
| 12:02 | ro_st | and joy of clojure, of course |
| 12:03 | ro_st | to think i was going to commit our company to using rails -shudder- |
| 12:03 | timvisher | for my next revelation, `(sh "which" "convert")` … returns the right thing |
| 12:03 | zakwilson | Paredit is pretty useful, though I find Slime to be the best thing about Emacs. It's like LightTable, kindasortaalmost. |
| 12:03 | timvisher | joy of clojure is awesome |
| 12:03 | banseljaj | Hello everyone. :) |
| 12:04 | timvisher | zakwilson: i'll agree with you there. the slime video was one of the 2 things that brought me back to to emacs about 5 years ago |
| 12:04 | ro_st | i still maintain a php codebase, and i'm still actively developing a google-closure javascript app. going to find ways to emacsify those asap |
| 12:04 | zakwilson | I kind of like Rails for quick one-off projects. I don't think I'd want to run a big project on it long-term; it's not *simple* - there's a lot of complecting. |
| 12:05 | ro_st | already using magit in emacs as well. feels completely natural |
| 12:05 | mprentice | magit is pretty great |
| 12:05 | foxdonut | just watched a quick video to see what paredit's about: http://www.youtube.com/watch?v=hiwEm88xaxM |
| 12:06 | foxdonut | it's funny, the guy is almost whispering and rushing/talking fast, so it sounds like he's recording the demo on someone else's computer that he's not supposed to be using :D |
| 12:06 | mprentice | i remapped paredit to make more sense to me. { } to spit back and forward respectively, ( ) to gobble same |
| 12:06 | RickInGA | thanks guys for all these good emacs links. |
| 12:06 | ro_st | foxdonut: how do i get that completion?! |
| 12:06 | ro_st | the popup showing the possible symbols to complete to |
| 12:07 | vijaykiran | M-Tab |
| 12:07 | foxdonut | :) |
| 12:07 | ro_st | i have completion, i don't have the displayed list |
| 12:07 | ro_st | not like he does there |
| 12:08 | ro_st | i get it in a separate buffer - one of my pending annoyances to fix |
| 12:08 | timvisher | ro_st: i'm pretty sure that'd be icicles mode |
| 12:08 | vijaykiran | ro_st: you mean something like this: https://github.com/overtone/live-coding-emacs |
| 12:08 | ro_st | -beam- |
| 12:08 | ro_st | i love open source |
| 12:09 | timvisher | looks like it's time to get off of imagemagick and move to pure java |
| 12:09 | TimMc | timvisher: Just because of path? :-( |
| 12:09 | ro_st | ok, i have to unplug. upvotes, everyone! later |
| 12:10 | timvisher | TimMc: I've been looking at this on and off for the past week and really haven't gotten any leads |
| 12:10 | timvisher | works great on my mac |
| 12:10 | timvisher | it's my windows machine that screws up |
| 12:10 | TimMc | timvisher: `which convert` gets you the absolute path though, right? |
| 12:11 | TimMc | Also, is there a shell=true thing to explore? |
| 12:15 | timvisher | TimMc: in cmd: c:\windows\system32>which convert => c:\windows\system32\convert.exe |
| 12:16 | timvisher | cmd: c:\windows>which convert => c:\...ImageMagick...\convert.exe |
| 12:16 | timvisher | in clojure i can only get which to report the imagemagick path |
| 12:16 | timvisher | and i can only appear to find the convert path when executing as the firstargument |
| 12:16 | timvisher | first argument* |
| 12:17 | timvisher | and `pwd` reports the directory i ran lein from |
| 12:17 | timvisher | ^_^ |
| 12:17 | timvisher | and opening a new CMD shell automatically starts in c:\windows\system32 |
| 12:21 | nDuff | ...so, the JVM doesn't actually have a mechanism to change the current working directory, but you can select one for your subprocess to run in |
| 12:22 | timvisher | nDuff: i'm aware of that, but i don't actually want to change my working directory |
| 12:22 | timvisher | unless my working directory turns out to be c:/windows/system32 |
| 12:22 | timvisher | in which case i might care very much to change out of that ;) |
| 12:23 | dnolen | dherman: ping |
| 12:23 | dherman | pong |
| 12:23 | timvisher | basically, i'm experiencing a strange issue where java is electing an executable found later in my PATH over one that appears earlier in my PATH |
| 12:23 | TimMc | timvisher: Change out of the default, run which, then you have the correct path, right? |
| 12:23 | dnolen | dherman: so was there ever any ES discussion about ctors with only final fields? |
| 12:23 | TimMc | (I'm in problem-solving mode, not debugging mode.) |
| 12:24 | TimMc | Then you can use the absolute path in future shell-outs. |
| 12:24 | dherman | dnolen: saw your tweet... not quite sure what you mean by "final" here |
| 12:24 | dherman | can't be shadowed by prototype extension? |
| 12:24 | dherman | immutable? |
| 12:24 | dnolen | dherman: property which can only be set in the cnostructur and never again. |
| 12:24 | timvisher | I believe I could chop off the end of :out and that should give me the full path to convert |
| 12:24 | dnolen | oops ctor |
| 12:26 | timvisher | (sh (.trim (:out (sh "which" "convert")))) seems to be a fairly interesting option |
| 12:26 | timvisher | although i'd still love understanding exactly what is happening here |
| 12:27 | LeNsTR | https://github.com/liebke/avout |
| 12:27 | LeNsTR | > Latest commit to the master branch | liebke authored 4 months ago |
| 12:27 | LeNsTR | is it alive? |
| 12:28 | Bronsa | maybe it got stable enough? |
| 12:28 | dnolen | dherman: it seems to me that such a facility would be far more useful then Object.freeze which is broken really. You want your instance to immutable at the time of construction. |
| 12:29 | dnolen | dherman: then you could safely pass that instance to a Worker - no copying. |
| 12:29 | LeNsTR | latest version "0.5.3" |
| 12:29 | LeNsTR | not sure |
| 12:30 | dnolen | dherman: I note that Dart has final fields - I suspect over time they'll be able to really run with that. |
| 12:31 | dherman | dnolen: what you're talking about is not much different from freeze, in the sense that it's not immutable at time of construction; it's immutable after an arbitrarily long period of computation |
| 12:32 | dnolen | dherman: it's very different. freeze encourages leaking |
| 12:32 | gfredericks | is (def ^:private foo ...) not how to create a private var...? |
| 12:32 | S11001001 | no, it is |
| 12:32 | TimMc | dnolen: Can you call freeze at the end of the constructor? |
| 12:32 | gfredericks | S11001001: it behaves differently from (defn- ...) |
| 12:32 | dnolen | TimMc: still encourages leaking |
| 12:32 | gfredericks | specifically it gives :tag :private rather than :private true |
| 12:32 | gfredericks | and ns-publics doesn't respect :tag :private |
| 12:32 | dnolen | TimMc: dherman: Java Concurrency in Practice covers this stuff. |
| 12:33 | S11001001 | what cloj version? |
| 12:33 | gfredericks | oh 1.2 ew |
| 12:34 | gfredericks | that's what I get for using `lein repl` outside a project |
| 12:34 | dnolen | var o = ctor(); concurrentProcess(o); will always work with final fields |
| 12:34 | dnolen | var o = ctor(); concurrenctProcess(o); Object.freeze(o); |
| 12:34 | dnolen | BOOM |
| 12:34 | hc | hi |
| 12:35 | TimMc | dnolen: No, I mean effectively Object.freeze(this) inside the constructor. |
| 12:35 | dnolen | TimMc: won't work |
| 12:35 | dnolen | function ctor(...) { concurrentProcess(this); Object.freeze(this); } |
| 12:35 | dnolen | BOOM |
| 12:36 | dnolen | TimMc: the whole reason why deftype and defrecord ctors work the way they do, they eliminate that stuff. |
| 12:37 | dnolen | they're even better since you can put executable stuff in/around field assignments |
| 12:37 | dnolen | cannot I mean |
| 12:38 | TimMc | OK, I guess I'm confused about what concurrentProcess is doing. Setting timeouts that further whack on o? |
| 12:38 | TimMc | err, "this"? |
| 12:38 | dnolen | TimMc: possibly attempting mutating fields |
| 12:39 | dnolen | attempting to mutate I mean. |
| 12:40 | dnolen | dherman: I actually don't see how any of Niko Matsakis Parallel JS could ever really work w/o something like this. |
| 12:42 | dherman | sorry, back. reading backscroll |
| 12:43 | dherman | dnolen: what you're talking about has the exact same problem |
| 12:43 | dnolen | dherman: it does not |
| 12:43 | dherman | function C() { concurrentProcess(this); this.foo = 12 } |
| 12:43 | dherman | BOOM |
| 12:43 | dnolen | dherman: only field assignment |
| 12:43 | dnolen | in ctor |
| 12:44 | dnolen | dherman: better if it's just implicit, like a tuple type. |
| 12:44 | dherman | dnolen: ok, so yeah, with sufficient restrictions you can have something that is immutable on construction |
| 12:44 | dherman | there are many options in the design space |
| 12:44 | dnolen | dherman: Type(a, b c). No executable body. |
| 12:44 | dherman | and yes, we have talked about that kind of thing, though not exactly as you're describing it |
| 12:45 | dherman | but, PJS does not need any of that |
| 12:45 | dherman | PJS is a very different approach |
| 12:45 | dnolen | dherman: I recall Niko saying he didn't have a solution for sharing data at all. |
| 12:45 | dherman | he would not have said that :) |
| 12:45 | dherman | given that PJS is *all about* sharing data |
| 12:46 | dherman | PJS is a dynamic approach to enforcing no shared writes -- basically, write barriers |
| 12:46 | dherman | dynamically guard against writing to shared data |
| 12:46 | dherman | so reads are cheap |
| 12:46 | dherman | and writes are fail-fast |
| 12:47 | dnolen | dherman: so the runtime checks are really that small? |
| 12:47 | dherman | we don't know yet, 's why it's research :) |
| 12:47 | dherman | but our memory architecture is a pretty nice fit for it |
| 12:48 | dherman | we have memory "compartments" that have mechanisms for installing automatic proxies between one another |
| 12:48 | dherman | we have an intern just starting this week to work on implementation |
| 12:48 | dherman | so we'll see how it goes |
| 12:48 | dherman | note that reads are cheap, though |
| 12:49 | dherman | they don't require any guards |
| 12:49 | dnolen | dherman: gotcha. Though it seems you could just avoid research and provide immutable non-executable ctors :) but that does sound interesting. |
| 12:50 | metajack | With enlive, is there a way to clone the first element of a list and delete the rest. For example, the template html has an example list.. |
| 12:50 | dnolen | dherman: one pressure we have is that engines currently punish Object.freeze last I checked. So we can't use it to protect our persistent data structures yet. |
| 12:55 | dnolen | dherman: so you think PJS would work with persistent data structures, essentially nested arrays? |
| 13:03 | TimMc | dnolen: Under what circumstances would the CLJS compiler produce a constructor containing concurrent code? |
| 13:03 | brainproxy | dnolen: you'll be presenting on cljs at Strange Loop, that's awesome; Hickey's keynote last year stirred my interest in Clojure, and I've tried to apply his ideas/advice to my nodejs prog'ing even before getting into clojure/script |
| 13:03 | jhulten | How do people decide between atoms, refs, etc? Is there common understanding of what is best to use where? |
| 13:03 | dnolen | TimMc: it would not |
| 13:03 | jhulten | brainproxy: His 'Simple made Easy' talk rocked my world. |
| 13:04 | dnolen | brainproxy: yep, mostly talking about nerdy details of the CLJS complier. |
| 13:04 | brainproxy | jhulten: yeah, mine too, really enjoyed it |
| 13:04 | technomancy | jhulten: it basically comes down to whether you need consistency among multiple threads |
| 13:04 | TimMc | dnolen: So I fail to see the problem with using freeze -- except you said something about penalization. |
| 13:05 | jhulten | Atoms lock across threads and refs use STM? Ref changes can be reordered? |
| 13:05 | dnolen | TimMc: yes, yes - we'd be ok with Object.freeze if engines don't hurt us for it. |
| 13:05 | TimMc | Atoms are always uncoordinated (independent of each other.) |
| 13:05 | TimMc | dnolen: Gotcha, thanks. |
| 13:06 | jhulten | Ah. So if you need to change two things in concert you use refs? |
| 13:06 | nDuff | jhulten: yes |
| 13:06 | TimMc | jhulten: Right. Or change one thing based on the current value of another. |
| 13:06 | technomancy | jhulten: if it's important that each thread gets a consistent view of the world |
| 13:06 | brainproxy | dnolen: so last night I had some success coming up w/ some logic to wrap up unoptimized output as spit out by n/cljsc in such a way that it can be run on nodejs |
| 13:06 | jhulten | Thinking on a clojure based statsd as a learning project. |
| 13:07 | ibdknox | woah. |
| 13:08 | ibdknox | Matt Mullenweg just kicked in 10k |
| 13:08 | nDuff | jhulten: ...you wouldn't be the first person to use clojure for real-time stream processing and statistics, and the last folks I knew using it in that space were very, very happy. |
| 13:08 | dherman | dnolen: I think PJS would work with persistent data structures. I want immutable data structures too. but that's hard too, b/c JS still has mutable prototypes |
| 13:08 | timvisher | ibdknox: whoo! |
| 13:09 | rplevy | jhulten: atom is by far the most common way of dealing with state, refs are only needed for those things discussed above. |
| 13:09 | technomancy | jhulten: you might be interested in https://github.com/heroku/pulse |
| 13:09 | dherman | dnolen: and also b/c shallow immutability is still not a guarantee of deep immutability |
| 13:09 | TimMc | I still haven't had to use an agent. |
| 13:09 | timvisher | i don't mean to be 'that guy' because lighttable is freaking awesome looking, but so much of what you're saying seems true of emacs. is there a quick answer as to why you wouldn't just enhance emacs? |
| 13:09 | rplevy | TimMc: I have used agents, but it almost always ends up being future that makes more sense |
| 13:09 | brainproxy | dnolen: beyond the use of java facilities for doing file i/o, are there parts of compiler.clj that simply couldn' be expressed in cljs vs. clj? |
| 13:10 | timvisher | i think people would even still be willing to pay to have that sort of work done, as pointed out by technomancy |
| 13:10 | TimMc | Because elisp. :-P |
| 13:10 | dnolen | brainproxy: not that I'm aware of. |
| 13:10 | rplevy | timvisher: because ibdknox is vi-user (troll) |
| 13:10 | TimMc | rplevy: Oy! Come to BAZNEX tomorrow! |
| 13:10 | technomancy | I doubt you could get USD200k+ for implementing it in Emacs |
| 13:11 | rplevy | TimMc: I live in Vermont now, dude ;) |
| 13:11 | brainproxy | dnolen: I'm considering an attempt to split out the file i/o parts into a separate namespace, which I could then implement with nodejs's fs module |
| 13:11 | timvisher | technomancy: i wonder if there would be less work to do though? probably not |
| 13:11 | TimMc | rplevy: Vermont is no excuse! |
| 13:11 | technomancy | there would be much less work to do |
| 13:11 | brainproxy | in which case I could then compile compiler.clj down to standalone javascript |
| 13:11 | ibdknox | I highly doubt that |
| 13:11 | timvisher | i'm not familiar enough with what the demos are being written in |
| 13:11 | dnolen | dherman: hmm, why are mutable prototypes a problem? seems like worrying about people doing the wrong thing? |
| 13:11 | technomancy | if you based it on the xembed branch of emacs anyway; since you can embed webkit |
| 13:12 | ibdknox | starting from emacs means I can never break away from any of the things it did wrong |
| 13:12 | dherman | dnolen: aren't your data structures deeply immutable? |
| 13:12 | dherman | I mean, how do you avoid data races? |
| 13:12 | technomancy | if you had to make it work with the current trunk version it would be hard |
| 13:12 | brainproxy | it would only be good for generating unoptim'd output, i.e. if you waned optimized output, you would still have to pass back through closure.clj to get at the google closure routines |
| 13:12 | timvisher | i really am not trying to put down the idea at all. like i said the ui alone is jaw dropping, let alone the actual interactive demos, but this last post especially talking about customizing your environment and tool etc is a classic selling point of emacs |
| 13:12 | dnolen | dherman: they are. |
| 13:12 | ibdknox | I think do things as I showed |
| 13:12 | ibdknox | would take far longer starting from emacs |
| 13:13 | dherman | so...? |
| 13:13 | ibdknox | you'd end up with a better base editor certainly |
| 13:13 | timvisher | ibdknox: good enough :) |
| 13:13 | ibdknox | at least in the near term |
| 13:13 | TimMc | ibdknox: Maybe you can embed emacs for the editing. :-P |
| 13:13 | ibdknox | TimMc: it's a thought |
| 13:13 | ibdknox | not going to worry about it anytime soon |
| 13:13 | TimMc | Good. |
| 13:14 | timvisher | i really wish you the best of luck. feels like an editor with enough good ideas that it could have the same effect that clojure seems to be having on the programming world |
| 13:14 | timvisher | also, didn't you mention at some point that the underlying tech supports different editor modes? |
| 13:14 | foxdonut | ibdknox: "...I also advise and invest in startups through my company Audrey Capital." |
| 13:14 | dnolen | dherman: I don't follow ... like being worried that somebody will change prototype underneath you? |
| 13:14 | timvisher | you wouldn't get the lispy extension of emacs, but you could at least get it's keybindings |
| 13:15 | rplevy | TimMc: codemirror is pretty cool, someone should make a codemirror-like thing that is full emacs maybe |
| 13:16 | TimMc | timvisher: Presumably it would Clojure-scriptable at the very least. |
| 13:16 | foxdonut | ibdknox: that is awesome. you might have to up the number of 10k slots available before the 10 days are up! |
| 13:16 | rplevy | except it would be clojurescript instead of elisp hehe |
| 13:17 | timvisher | you wouldn't hear any arguments from me if you could get clojurescript to be the extension language of my editor. :) |
| 13:17 | technomancy | timvisher: how about for extending your desktop? =) |
| 13:17 | p_l | well, elisp seems easier to get a runtime running... |
| 13:18 | timvisher | oh come now, you know i've though over and over of getting an emacs written in clojure! |
| 13:18 | dnolen | brainproxy: wasn't following closely enough - somebody needs to port more of the Clojure reader before bootstrapping is possible. |
| 13:18 | technomancy | no, I mean gnome |
| 13:18 | timvisher | lol, i know |
| 13:18 | timvisher | old emacs joke |
| 13:18 | dnolen | brainproxy: I'd also be concerned about performance of the compiler - CLJ on JVM highly tuned - CLJS perf work still in progress. |
| 13:19 | technomancy | =) |
| 13:19 | rplevy | LightTable seems awesome. the question is, is it awesom enough to pull me (and "people like me") away from emacs, at least some of the time. Another question is, is it worth it for non-front-end kinds of hacking. |
| 13:19 | brainproxy | dnolen: point taken |
| 13:19 | timvisher | do have something like that running? or are we dreaming of a lisp machine? |
| 13:19 | technomancy | timvisher: I have hello world, but I don't have the repl hooked up yet |
| 13:19 | timvisher | cljsmacs, maybe? |
| 13:19 | brainproxy | dnolen: so basically I'd run into issues where I needed support from cljs.reader that just isn't there yet? |
| 13:19 | timvisher | woah! publishing that any time soon? |
| 13:19 | technomancy | timvisher: https://github.com/technomancy/lein-gnome |
| 13:19 | timvisher | that might be reason to finally kick my Apple habbit |
| 13:20 | rplevy | timvisher: just emajin |
| 13:20 | dnolen | brainproxy: yes it's not there. |
| 13:20 | dnolen | brainproxy: compiler.clj would also need to change - very Java reader result type centric ATM |
| 13:20 | brainproxy | dnolen: alright, I'll hold off then ... not that I've got the ability to run a "detached" JVM ncljsc server, compile times are down to ~2 secs anyway |
| 13:20 | brainproxy | i.e. because I don't have to spin up the jvm every time |
| 13:21 | timvisher | well boy oh boy. now i'm fairly sure that technomancy is an alien too |
| 13:21 | timvisher | lol |
| 13:21 | brainproxy | *now that.. |
| 13:21 | timvisher | i don't how you all do it |
| 13:21 | dherman | dnolen: if we allow concurrent/parallel access to a data structure, we have to ensure race freedom. a shallowly immutable data structure that has immutable references to mutable data structures would still make races possible |
| 13:21 | dnolen | brainproxy: yeah, compiler is not slow - but booting JVM, compiling CLJS is killer. |
| 13:23 | rplevy | technomancy: I might have switch back from KDE to gnome. the massive fail of Unity led me revisit KDE and it made amazing progress since the old days. |
| 13:24 | technomancy | Unity makes me sad just because of how divisive it is. |
| 13:24 | rplevy | ironic too... |
| 13:24 | technomancy | gnome could be so much better if all this effort wasn't being poured into duplicating its features in unity. |
| 13:24 | technomancy | but gnome will win in the long run because of its extension mechanism |
| 13:24 | technomancy | it will just take longer |
| 13:25 | gtrak | kde is freaking great now |
| 13:25 | technomancy | does it have a repl? =) |
| 13:26 | gtrak | hmm, well I have enough things to mess with, honestly :-) |
| 13:27 | gtrak | http://techbase.kde.org/Development/Tutorials/Plasma/JavaScript/GettingStarted |
| 13:27 | glitch99 | Is there a way to get at the javadoc statements about a function from the REPL? |
| 13:28 | glitch99 | AH (doc <func>) - sorry that was too easy |
| 13:29 | gtrak | I just find any other DE unusable for multiple monitors, I've used gnome 3 and 2 for years though. Gnome2 not really an option anymore. gnome3 and unity are optimized for one app at-a-time, imo. |
| 13:30 | technomancy | gtrak: yeah, but that's easy to fix with an extension |
| 13:30 | technomancy | it's all just JS |
| 13:30 | technomancy | runtime-modifiable |
| 13:30 | beffbernard | technomancy: I'm experiencing some odd behavior with how swank-clojure is dealing with async callbacks. i.e. It doesn't appear to be calling my callbacks |
| 13:31 | beffbernard | technomancy: oops.. looks like that was premature.. obv it was all my doing.. closing the connection too soon |
| 13:32 | clojure-newcomer | Hi guys. If I have a clojure.lang.Cons result like : http://pastebin.com/nALzZF6K can anyone help me with emitting it as XML using clojure.data.xml ? It is the mapping function I am struggling with. |
| 13:32 | beffbernard | disregard |
| 13:32 | gtrak | technomancy: I'll believe it when I see it :-). The gnome guys interpretation of 'usability' isn't really viable. But those other spinoffs look interesting. eg. cinnamon |
| 13:33 | clojure-newcomer | The result is from clojure.java.jdbc with-query-results |
| 13:33 | technomancy | gtrak: it doesn't really matter what their opinions are; it matters that they provide a good foundation and reasonable abstractions to build upon. |
| 13:33 | gtrak | technomancy: I know you're interested in doing some stuff with that, I'll definitely check it out :-) |
| 13:33 | rplevy | gtrak: I agree, so many aspects of the UI are just complete WTF I can't believe they shipped this... |
| 13:34 | dnolen | dherman: yeah, I suppose that would be less of a real issue if you could control field visibility. |
| 13:34 | rplevy | but if I can customize it al in ClojureScript.... |
| 13:34 | technomancy | rplevy: try it! =) |
| 13:34 | TimMc | technomancy: It matters that they don't seem to do user testing. |
| 13:34 | p_l | gtrak: GNOME lost the sight of what they were doing somewhere around 2.4 |
| 13:34 | dherman | dnolen: yeah, it's remarkably hard to shoe-horn immutability onto JS. but I believe it's possible. we just need to try different ideas |
| 13:34 | technomancy | TimMc: it matters if you're going to use unmodified gnome |
| 13:34 | dherman | dnolen: and I agree Object.freeze blows. if I weren't so busy on my PhD at the time it happened, I might've fought it |
| 13:35 | rplevy | technomancy: I definitely will, it sounds awesome! |
| 13:35 | technomancy | TimMc: Emacs still ships with ido-mode off by default for crying out loud. |
| 13:35 | dnolen | dherman: :) |
| 13:35 | technomancy | TimMc: that kind of problem is easy to fix if you know what you're doing |
| 13:35 | TimMc | technomancy: I'm customization-shy these days. THings break too quickly due to upgrades. |
| 13:35 | TimMc | I still do it, but I don't like to rely on it. |
| 13:35 | gtrak | I think the fragmentation issue is kind of a big deal. for instance, if I invest time into learning light table, why not make that the DE? Anything can do anything. |
| 13:36 | technomancy | gtrak: I actually think light table would be an interesting base for a browser |
| 13:36 | TimMc | yo dawg |
| 13:36 | gtrak | sure, but things will settle on some local maxima, and it's hard to go against the grain as a normal user |
| 13:37 | technomancy | "the reasonable man adapts himself to the world; the unreasonable man adapts the world to him; therefore all progress depends upon the unreasonable man." |
| 13:37 | technomancy | Shaw had it right |
| 13:37 | TimMc | I'm pretty damn unreasonable, but I have other work to do. |
| 13:38 | gtrak | I agree with TimMc :-) |
| 13:38 | technomancy | you guys are no fun =( |
| 13:38 | ibdknox | lol |
| 13:38 | ibdknox | gtrak: DE? |
| 13:38 | ibdknox | development env? |
| 13:38 | TimMc | Desktop Env |
| 13:38 | gtrak | window manager? |
| 13:38 | ibdknox | ah |
| 13:38 | gtrak | why not? |
| 13:39 | ibdknox | I sort of think of it that way to be honest, but the answer to "why not" is time |
| 13:39 | gtrak | right |
| 13:39 | technomancy | gjs can control X =) |
| 13:39 | ibdknox | I also think we need to get one thing really, really right first |
| 13:40 | ibdknox | if that happens, who knows what people will do with it :) |
| 13:40 | dnolen | dherman: still seems like something like this could be solved with an immutable record type. no customizable constructor, prototype with non-mutable implementations (can be extended), only final private fields (this.field only works in prototype methods) |
| 13:41 | technomancy | tiling window manager in javascript: https://github.com/gfxmonk/shellshape |
| 13:42 | gtrak | I think it'd be lovely to run some kitchen-sink environment like emacs or LT as a window manager |
| 13:43 | gtrak | if you're a developer, I mean.. |
| 13:44 | technomancy | yeah, I'm all for reducing the number of programs you use that you don't have direct control over |
| 13:46 | TimMc | Dynamic langs make that easier. |
| 13:46 | sjl | since contrib is gone, what should I use to replace dissoc-in ? |
| 13:46 | TimMc | sjl: update-in with dissoc |
| 13:46 | sjl | ick |
| 13:46 | sjl | that won't clear out the intermediate empty lists though, right? |
| 13:47 | technomancy | TimMc: I think that's a red herring. |
| 13:47 | technomancy | TimMc: interactive languages make it easier. dynamic languages historically have had the edge on interactivity. |
| 13:48 | technomancy | but I don't think there's anything intrinsic to the typing discipline. |
| 13:49 | foxdonut | technomancy: do you use shellshape? the demo looks pretty good. |
| 13:51 | technomancy | foxdonut: no, I'm not on 3.4 yet. Just good to see it's possible |
| 13:53 | foxdonut | technomancy: indeed. |
| 13:53 | TimMc | technomancy: You're right, interactive is what I really mean. |
| 13:53 | TimMc | Interpreted/compiled on-the-fly langs too. |
| 13:54 | technomancy | yeah, languages that compile directly to machine code seem to have a harder time with seamless interactivity |
| 13:54 | TimMc | ...which I would call a slightly different concept. |
| 13:54 | technomancy | it's easier to do on a VM/interpreter, but that's not required |
| 13:55 | technomancy | IIRC haskell's interactive compiler has subtle differences vs the mainline one |
| 13:55 | hiredman | technomancy: that may have more to do with immutability of top level references |
| 13:55 | gtrak | the whole java stack and how we abuse it is pretty bizarre but awesome, when you think about it |
| 13:56 | hiredman | and issues with redefining types |
| 13:56 | technomancy | hiredman: that would make sense |
| 13:57 | brainproxy | woohoo, strange loop ticket acquired :) |
| 13:57 | technomancy | would be interesting to see how the straight-to-C schemes do it |
| 13:57 | technomancy | if they do in fact do it |
| 13:57 | brainproxy | any other #clojure folks will be attending? |
| 13:57 | gtrak | brainproxy: duh :-) |
| 13:57 | dnolen | brainproxy: a lot :) |
| 13:58 | brainproxy | I actually live in St. Louis, so it's just down the street for me |
| 13:58 | brainproxy | almost literally |
| 13:58 | brainproxy | about 2 miles :D |
| 13:58 | hiredman | technomancy: direct memory access is pretty much the definition of "mutable global reference" |
| 13:59 | jlongster | dnolen: I will see you at Strange Loop as well :) |
| 13:59 | devn | oh shite. i need a strange loop ticket. |
| 13:59 | foxdonut | *sigh* wish I could go to these things. :_( |
| 13:59 | dnolen | jlongster: cool! I look forward to more Lisp conversation :) |
| 13:59 | technomancy | hiredman: heh; sure |
| 14:00 | Borkdude | devn: cool |
| 14:00 | jlongster | dnolen: me too! |
| 14:00 | imami|afk | hey technomancy |
| 14:01 | technomancy | ohai |
| 14:05 | kmicu | whether val,key, int, etc... fns are implemented in the latest version of clojurescript? Where I can find such an info? |
| 14:06 | dnolen | kmicu: at the moment no better documentation than the source really. |
| 14:08 | kmicu | dnolen: thx |
| 14:09 | brainproxy | i'm the organizer of the JS meetup here in Saint Louis (stljs.org) ... w/ all the JS-related speakers setup for SL2012 (inc. Eich!) i'm wondering if I should push Sept's meeting to the week and try to get one of the SL speakers to make an appearance |
| 14:10 | Borkdude | what is the leading repo of clojurescript, I assume https://github.com/clojure/clojurescript ? |
| 14:10 | brainproxy | Borkdude: yeah, thats the one |
| 14:10 | Borkdude | it has a "forked from … " message on the top, but that one doesn't even exist anymore |
| 14:11 | rplevy | how would I configure lein to always run clean? would I use the prep-tasks feature for this? |
| 14:11 | brainproxy | ah, right ... you can safely ignore that i think, all the official commits go to clojure/clojurescript |
| 14:11 | technomancy | rplevy: in 2.x, yeah |
| 14:11 | technomancy | :prep-tasks ["clean"] |
| 14:11 | technomancy | rplevy: more interested in why you need it though |
| 14:12 | rplevy | well, I have run into problems with tests passing, running lein clean, and then seeing tests fail (as they should) |
| 14:13 | dnolen | Borkdude: that's the official repo |
| 14:16 | S11001001 | rplevy: you aren't overusing macros are you? |
| 14:17 | S11001001 | &aot |
| 14:17 | lazybot | java.lang.RuntimeException: Unable to resolve symbol: aot in this context |
| 14:17 | S11001001 | no |
| 14:17 | rplevy | S11001001: only using them appropriately haha |
| 14:18 | S11001001 | so not at all in the aot case then |
| 14:18 | rplevy | S11001001: need AOT though |
| 14:18 | S11001001 | welp |
| 14:18 | S11001001 | macros and aot only get together during the holidays, and then always subjecting everyone around to uncomfortable silences |
| 14:19 | rplevy | LOL |
| 14:22 | S11001001 | so anyway that's what lein test! is for, yes? |
| 14:22 | rplevy | there should be a lein midje! then |
| 14:22 | S11001001 | lein clean, midje |
| 14:23 | rplevy | true enough |
| 14:23 | Borkdude | S11001001: lein test! as in destructive testing? |
| 14:23 | rplevy | or... prep-tasks |
| 14:23 | rplevy | Borkdude: it runs clean and deps |
| 14:23 | S11001001 | clean can be annoying, especially if you're repling at the same time |
| 14:24 | S11001001 | gets all turned around |
| 14:24 | Borkdude | write a script ;) |
| 14:24 | rplevy | Borkdude: I don't want to have to run lein through a script though that is the obvious last resort |
| 14:25 | S11001001 | hmm, it would be better to freshly clone the dir and run a build and test out of that |
| 14:27 | Borkdude | Some programming language tend to use a lot of $ characters, clojure doesn't. it's obviously not interested in money making. |
| 14:28 | foxdonut | Borkdude: the money's in the (tax) brackets! |
| 14:28 | S11001001 | rplevy: you missed Jeff talking about Kiln at bos cloj, was pretty good |
| 14:28 | rplevy | is there video?! |
| 14:28 | rplevy | that sounds good |
| 14:28 | S11001001 | doubt it |
| 14:28 | rplevy | you guys should record these things... |
| 14:29 | S11001001 | with any luck, we're just getting to the "having regular meetings" stage |
| 14:29 | rplevy | nice |
| 14:32 | robink | I know Clojure 1.5.0-alpha1 is out, but in future, how do I specify clojure-1.5.0-master-SNAPSHOT in a project.clj? |
| 14:33 | rplevy | S11001001: is Jeff somehow using Kiln at work or is this completely his personal project |
| 14:35 | S11001001 | former I think was the implication |
| 14:36 | Borkdude | robink: [org.clojure/clojure "1.5.0-master-SNAPSHOT"] ? |
| 14:37 | robink | Borkdude: Doesn't find it if I specify it that way. |
| 14:37 | Borkdude | robink: that's because it doesn't exist |
| 14:37 | wkmanire | Howdy folks. |
| 14:37 | robink | Borkdude: It does on Sonatype's repository. If I include the repository it still fails to resolve. |
| 14:37 | Borkdude | robink: http://search.maven.org/#search%7Cgav%7C1%7Cg%3A%22org.clojure%22%20AND%20a%3A%22clojure%22 |
| 14:37 | Borkdude | robink: ah well, I don't know then |
| 14:39 | raek | the sonatype repo of releases might be different from the repo of snapshots |
| 14:39 | raek | wouldn't be suprised if only the releases repo is used by lein by default |
| 14:40 | Borkdude | robink: when I search here I don't see it: https://repository.sonatype.org/index.html#nexus-search;quick~clojure |
| 14:41 | TimMc | rplevy: Doesn't Vermont have trains? |
| 14:43 | rplevy | TimMc: yeah, do you know how far north Burlington is? |
| 14:43 | rplevy | damn near Canada |
| 14:44 | TimMc | nonsense |
| 14:44 | rplevy | beautiful though, I can see the Adirondacks across the lake from my porch |
| 14:44 | rplevy | this might be off-topic |
| 14:45 | TimMc | OK, maybe a bit closer to Canada. |
| 14:45 | robink | Borkdude: https://oss.sonatype.org/service/local/repositories/snapshots/content/org/clojure/clojure/1.5.0-master-SNAPSHOT/clojure-1.5.0-master-20120519.020223-8.jar |
| 14:45 | rplevy | other than as an unpaid advertisment for Clojurers to come work at Draker |
| 14:46 | S11001001 | it's clojurian |
| 14:46 | rplevy | aha |
| 14:46 | Borkdude | S11001001: how do you pronounce clojurian, could you spell it phonetically? |
| 14:46 | rplevy | Clojurista |
| 14:46 | TimMc | cljer ("kludger") |
| 14:46 | S11001001 | like centurion, emphasis on 2nd syllable |
| 14:47 | Borkdude | S11001001: I was wondering about the j, if it is still pronounces as an s? |
| 14:47 | S11001001 | I wouldn't pronounce it as an s in Clojure |
| 14:47 | S11001001 | given the other billion things that already means |
| 14:47 | Borkdude | S11001001: how do you pronounce clojure? |
| 14:47 | rplevy | me neither |
| 14:47 | S11001001 | hard J |
| 14:48 | rplevy | same |
| 14:48 | antares_ | Borkdude: as in "jurassic" |
| 14:48 | TimMc | I think Rich wants it pronounced like an s, but there's no chance of that. |
| 14:49 | S11001001 | honestly have never heard it as "closure", though perhaps I just missed it |
| 14:49 | rplevy | I've heard Rich say it that way |
| 14:49 | rplevy | zh |
| 14:49 | Borkdude | I always pronounce it as "closure" |
| 14:49 | S11001001 | madness |
| 14:49 | S11001001 | I'll just assume anyone who says that means the Clozure CL implementation |
| 14:49 | TimMc | Or GClosure |
| 14:50 | TimMc | (Google Closure) |
| 14:50 | S11001001 | or the Closure web browser written in CL |
| 14:50 | Borkdude | Closure means Clojure unless stated otherwise |
| 14:50 | TimMc | Nah, too much talk about GClosure in here due to CLJS. |
| 14:50 | Borkdude | gclosure is fine |
| 14:51 | Borkdude | I had a discussion with some american Dutch people (from America originally) about how to pronounce Clojure |
| 14:51 | TimMc | Except people often leave off the "G". |
| 14:51 | Borkdude | they told me: if the author wants it to be pronounced as closure, that's fine |
| 14:51 | S11001001 | Nabokovite |
| 14:51 | TimMc | It's not his choice to make. :-P |
| 14:52 | Borkdude | so from then on, I just did that |
| 14:52 | rplevy | Lolitian? |
| 14:52 | S11001001 | it was Nabokov's position that the artistic life of a book existed entirely in the mind of the author, and it was the job of the reader to, as closely as possible, rediscover precisely that interpretation |
| 14:53 | S11001001 | in other words, writer-supremacy |
| 14:53 | Borkdude | clojure with a hard j doesn't sound very nice in Dutch, like calling names |
| 14:53 | TimMc | As opposed to what I see as the prevailing view these days. |
| 14:53 | Borkdude | not really, but it just doesn't sound nice |
| 14:53 | robink | Borkdude: Also: https://oss.sonatype.org/index.html#nexus-search;quick~clojure (oss.sonatype.org, not repository.sonatype.org). |
| 14:53 | TimMc | What's that quote? "As the author, you're the least qualified person in this room to discuss what your book means!" |
| 14:54 | Borkdude | TimMc: so do you agree with Nabokov? |
| 14:54 | S11001001 | I should think not |
| 14:54 | S11001001 | what being a hard J user and all |
| 14:54 | p_l | TimMc: that's the motto of literature PhDs |
| 14:54 | pipeline | my english dialect has no difference between a "zh" and "j" sound anyway |
| 14:54 | rplevy | dzh = j |
| 14:55 | rplevy | diphthong |
| 14:55 | pipeline | given that there are millions of us, "clojure" and "closure" are gonna blur together |
| 14:55 | Borkdude | lol means let over lambda in here right? |
| 14:55 | rplevy | no it means land of lisp |
| 14:55 | Borkdude | or let over fun? |
| 14:55 | Borkdude | lof |
| 14:55 | Borkdude | let over fn |
| 14:55 | foxdonut | rplevy: you live near Canada? |
| 14:55 | rplevy | yeah |
| 14:55 | rplevy | not far from Montreal |
| 14:56 | rplevy | Burlington, VT |
| 14:56 | mfex | robink: use [org.clojure/clojure "1.5.0-alpha1"] or do you need something more recent even? |
| 14:57 | robink | mfex: I don't currently, just wondering how one would specify "1.5.0-master-SNAPSHOT" as a dependency. |
| 14:57 | foxdonut | rplevy: that's cool. I live in Montreal. |
| 14:57 | rplevy | cool, is there a meetup there? |
| 14:57 | TimMc | foxdonut: Hold a Clojure meetup, maybe rplevy can make it t... damn, beat me to it. |
| 14:57 | rplevy | hehe |
| 14:58 | foxdonut | heh, well we have Bonjure :) |
| 14:58 | Borkdude | clojure eyes, give me your hand…. total eclipse of the code |
| 14:58 | rplevy | foxdonut: leiningen will allow if ironic |
| 14:58 | foxdonut | http://www.bonjure.org/ |
| 14:58 | rplevy | oh it's a thing |
| 14:58 | rplevy | nice |
| 14:59 | ibdknox | dnolen: with cljs master I'm getting the following: clojure.lang.ArityException: Wrong number of args (3) passed to: core$get |
| 14:59 | ibdknox | dnolen: not happening with any of the releases |
| 14:59 | dnolen | ibdknox: looking |
| 15:00 | ibdknox | dnolen: I'm trying to track it down, just wondering if you've seen anything around this lately. It's something to do with macroexpansion |
| 15:01 | dnolen | ibdknox: yes, a small optimization get's are now inlined to -lookup |
| 15:01 | ibdknox | ah |
| 15:01 | dnolen | ibdknox: not sure where that would be coming from tho |
| 15:02 | dnolen | ibdknox: did you try cleaning? re-checking out your clojurescript? |
| 15:02 | foxdonut | rplevy: I think many Montrealers drive down to Burlington to fly out for cheaper |
| 15:02 | ibdknox | dnolen: cleaned, but I'll try cloning the repo again |
| 15:03 | dnolen | ibdknox: hmm, oh sorry that looks like an error in the compiler side of things. |
| 15:04 | ibdknox | compiler.clj 1407 is where the problem starts apparently |
| 15:05 | rplevy | is Bonjure French-speaking or English? |
| 15:05 | dnolen | ibdknox: I think I've spotted it |
| 15:06 | rplevy | the website is in English, and the discussion group too, so... |
| 15:06 | foxdonut | rplevy: either or according to those present :) |
| 15:07 | rplevy | cool |
| 15:07 | foxdonut | basically English is the default not to ever make anyone feel left out |
| 15:07 | dnolen | ibdknox: sorry about that, pull latest |
| 15:07 | dnolen | ibdknox: let me know if the issue persists |
| 15:08 | felideon | heh Bonjure |
| 15:09 | ibdknox | dnolen: hm, still getting it |
| 15:10 | dnolen | ibdknox: huh, I don't suppose you can isolate the code that causes the problem? |
| 15:12 | ibdknox | dnolen: I wish I could :( It's not the result of any change I made, I just pulled and ended up here, so my whole codebase is suspect. What goes down that codepath? maybe I can isolate it that way |
| 15:14 | dnolen | ibdknox: trying re-checking out one more time. |
| 15:14 | dnolen | ibdknox: core$get just doesn't make sense to me, that's the alias and it's only used in one place. |
| 15:15 | dnolen | ibdknox: it most certainly supports 3 args. |
| 15:16 | y3di | where can i see clojurelogs |
| 15:16 | y3di | s/clojurelogs/#clojure logs |
| 15:16 | dnolen | ibdknox: if you could paste the entire stacktrace that would be helpful too. |
| 15:17 | mfex | robink: this worked for me to get 1.5.0-master-SNAPSHOT: https://gist.github.com/2771033 |
| 15:17 | ibdknox | dnolen: I'll have to piece it back together, that stupid printing thing is still happening haha. This is a comedy of errors. Give me a sec |
| 15:17 | robink | mfex: Thanks! I'll try it out. |
| 15:17 | uvtc | y3di, <http://clojure-log.n01se.net/> |
| 15:17 | dnolen | ibdknox: thx |
| 15:19 | ibdknox | dnolen: https://www.refheap.com/paste/2830 |
| 15:19 | robink | mfex: Works, thank you very much, I'll keep that repository in mind in future. |
| 15:20 | brainproxy | dnolen: is there any project (yet) akin to clojuredocs for clojurescript? it would be nice to be able to reference a list of all the operators in core, core.reader, etc. |
| 15:21 | dnolen | ibdknox: in your checkout can you look at src/clj/cljs/core.clj line 253? |
| 15:21 | dnolen | brainproxy: there is not - and i agree that would be useful. |
| 15:21 | brainproxy | maybe not even something as fancy as clojuredocs, even just a list |
| 15:22 | ibdknox | dnolen: (-dissoc! [tcoll key]) |
| 15:22 | y3di | thanks uvtc |
| 15:22 | dnolen | ibdknox: that's not the right file, not core.cljs |
| 15:22 | antares_ | Just released Welle 1.0: https://twitter.com/clojurewerkz/status/205013459379818499 (more at http://clojureriak.info) |
| 15:22 | ibdknox | oh sorry |
| 15:22 | dnolen | ibdknox: the macros file, same directory as compiler.clj |
| 15:23 | ibdknox | dnolen: https://www.refheap.com/paste/2831 |
| 15:23 | dnolen | ibdknox: do you see why I think that error is bizarre? |
| 15:23 | ibdknox | haha yes |
| 15:23 | dnolen | ibdknox: there's the 3 argument case right there. |
| 15:24 | Raynes | ibdknox: It'd be cool to have a clojure stacktrace pygments lexer. |
| 15:24 | Raynes | One that did things like clj-stacktrace. |
| 15:24 | ibdknox | Raynes: that would be neat |
| 15:24 | dnolen | ibdknox: if that didn't work I would have seen errors myself when running the tests. |
| 15:24 | Raynes | But I'll be damned if I plan on writing the Python to do it. |
| 15:25 | amalloy | dnolen: related to the implicit &env, &form arguments? |
| 15:25 | dnolen | amalloy: how? |
| 15:25 | dnolen | amalloy: and if that was true, why aren't the other multiarity macros affected? |
| 15:26 | amalloy | occasionally i've seen "incorrect" error messages about wrong number of args to macros |
| 15:26 | amalloy | like a three-arg macro being "omg i can't handle three args" because really it wants five |
| 15:27 | dnolen | amalloy: again I could believe that if +, -, etc didn't all work. |
| 15:27 | amalloy | *nod* i understand what you mean. i'm just brainstorming here since you guys seem at a loss, but i don't have a lot of cljs expertise |
| 15:28 | dnolen | ibdknox: what version of Clojure are you running? 1.4.0? |
| 15:28 | ibdknox | dnolen: yeah |
| 15:28 | amalloy | but suppose someone were calling (get x) - that *should* fail, and you might get this error message |
| 15:28 | dnolen | amalloy: oh huh that's probably it. |
| 15:28 | TimMc | Sneaky. |
| 15:28 | dnolen | ibdknox: look for (get x) |
| 15:29 | dnolen | ibdknox: a typo in your own code |
| 15:29 | ibdknox | looking |
| 15:29 | dnolen | ibdknox: wouldn't have come before |
| 15:29 | amalloy | right. an error in ibdknox's code that would be at runtime before, but is macro-time now |
| 15:29 | ibdknox | there are no runtime errors |
| 15:30 | ibdknox | if I move off to the latest release everything is fine |
| 15:30 | amalloy | ibdknox: if you never call the function there wouldn't be |
| 15:30 | ibdknox | mm |
| 15:30 | ibdknox | true |
| 15:30 | ibdknox | wait |
| 15:30 | ibdknox | could it be that it's no longer respecting if I exclude get? |
| 15:31 | ibdknox | dnolen: ^ |
| 15:31 | amalloy | probably |
| 15:31 | dnolen | ibdknox: actually I just verified I get the same error if I write (fn [x] (get x)) |
| 15:31 | brainproxy | dnolen: regarding JS concurrency (generally speaking), did you ever look into the Flapjax project, headed up by some comp sci students at Brown a couple years back? |
| 15:31 | ibdknox | amalloy: I bet that's what it is then |
| 15:31 | dnolen | brainproxy: I have though I don't find such projects (adding a concurrency layer) that interesting. |
| 15:32 | ibdknox | dnolen: that's it |
| 15:32 | ibdknox | dnolen: you can no longer name something get |
| 15:32 | amalloy | dnolen: i don't understand why you make things like `get` a separate macro - can't you put it as :inline metadata on the function? that might help with excluding from the namespace |
| 15:32 | dnolen | amalloy: there is not such thing as :inline metadata, nor is it necessary. |
| 15:33 | brainproxy | dnolen: you think the concepts are too limiting? not that helpful? |
| 15:33 | dnolen | ibdknox: were you excluding get? |
| 15:33 | ibdknox | yep |
| 15:33 | dnolen | brainproxy: performance mostly. |
| 15:33 | amalloy | oh, really? i guess the feature's nonexistence would be a good reason not to use it |
| 15:34 | dnolen | amalloy: you just don't need it, compiler macros do what :inline did |
| 15:34 | dnolen | ibdknox: can you paste your ns declaration? excluding macros is closed ticket |
| 15:35 | ibdknox | mm |
| 15:35 | amalloy | i always thought of :inline as just being a way to declare a compiler macro. is the way you're doing this (separate function/macro) the cljs way of doing compiler macros, then? |
| 15:35 | dnolen | amalloy: yes |
| 15:36 | ibdknox | dnolen: https://www.refheap.com/paste/2833 |
| 15:37 | brainproxy | dnolen: I had been trying to build a generalized flapjax (fully variadic, with monad-like transforms) using coffeescript, but hit difficult areas because some of the abstractions are tricky sitting atop js/coffee, will probably try again w/ clojurescript |
| 15:37 | dnolen | brainproxy: that sounds interesting :) |
| 15:38 | dnolen | ibdknox: hmm at the REPL that exclude w/ (get x) compiles fine |
| 15:38 | brainproxy | dnolen: i think so.. will let you know if/when I have any luck w/ it |
| 15:38 | ibdknox | dnolen: it was fixed by just changing the name from get |
| 15:39 | dnolen | ibdknox: do you have multiple :requires, :refer-clojure, :uses etc ? |
| 15:39 | ibdknox | dnolen: nope, that's the whole ns |
| 15:39 | ibdknox | very simple one |
| 15:39 | ibdknox | dnolen: here's the file https://www.refheap.com/paste/2834 |
| 15:40 | pepijndevos | amalloy: ohnoes, huggle is broken in lazybot. |
| 15:41 | dnolen | ibdknox: why does it say clojure.core/get ? is that a typo? |
| 15:42 | ibdknox | hah |
| 15:42 | ibdknox | that is |
| 15:42 | amalloy | hah, neue |
| 15:43 | amalloy | you know you can just use new there, right? |
| 15:43 | ibdknox | dnolen: switching to cljs.core/get doesn't fix it |
| 15:43 | ibdknox | amalloy: habit |
| 15:43 | ibdknox | amalloy: so used to not being able to name things new :) |
| 15:43 | amalloy | i like the spelling though. it's a cute workaround |
| 15:44 | Borkdude | ibdknox: german roots? |
| 15:44 | ibdknox | Borkdude: stimmt |
| 15:44 | dnolen | ibdknox: can you do me a favor |
| 15:44 | ibdknox | Borkdude: though it works nicely with Helvetica Neue and such too |
| 15:44 | dnolen | ibdknox: compile a project with just that file. |
| 15:44 | ibdknox | sure |
| 15:47 | ibdknox | dnolen: blows up with the same stacktrace |
| 15:49 | drguildo | has anyone else used seesaw? |
| 15:49 | dnolen | ibdknox: checking it out here |
| 15:50 | drguildo | oops |
| 15:50 | drguildo | sorry! |
| 15:50 | dnolen | ibdknox: hmm ... it successfully compiles |
| 15:50 | drguildo | i didn't think it'd spit it out here |
| 15:51 | pepijndevos | Raynes: Y U remove good stufz? https://github.com/flatland/lazybot/commit/9f3629b6abd84ab8c65ee978ecc08d305f743077 |
| 15:51 | dnolen | ibdknox: it definitely did not work for you in a project by itself? |
| 15:51 | raek | drguildo: if you have a question, just go ahead and ask it |
| 15:51 | ibdknox | dnolen: yeah, that was the only cljs file in it |
| 15:52 | Raynes | pepijndevos: Bahaha. |
| 15:52 | Bronsa | are you sure you are both using the same clojurescript version? :) |
| 15:52 | Raynes | pepijndevos: A lot of those were vulgar test commands from the early days of lazybot. |
| 15:52 | pepijndevos | $guards |
| 15:52 | lazybot | SEIZE HIM! |
| 15:52 | drguildo | i'm just wondering whether i'm doing something wrong or whether seesaw is badly written because whenever i build against it my jar file is massive and it includes a ton of crap that i shouldn't even be using |
| 15:52 | ibdknox | Bronsa: both on master |
| 15:52 | amalloy | also a lot of them didn't work at all |
| 15:53 | amalloy | like balance. really |
| 15:53 | Raynes | amalloy: No, they all worked. |
| 15:53 | drguildo | crap being other libraries |
| 15:53 | amalloy | well okay, by "a lot" i meant one |
| 15:53 | Raynes | amalloy: They all worked in that almost all of them just printed a silly message and did something trivial. Balance did what I wanted it to do, which was stupid. :p |
| 15:54 | emezeske | drguildo: Your jar file, or your uberjar file? |
| 15:54 | drguildo | also loading the resulting program takes ages |
| 15:54 | drguildo | emezeske, uberjar |
| 15:54 | pepijndevos | Raynes: Maybe I can reintroduce them by the weird x is y syntax? |
| 15:54 | ibdknox | dnolen: maybe it's the way I'm including master? |
| 15:54 | Raynes | pepijndevos: You mean the whatis plugin? |
| 15:54 | ibdknox | dnolen: I'm just doing the extra-classpaths thing |
| 15:54 | emezeske | drguildo: Of course that's going to be big, it contains all the dependencies for your entire project, including dependencies of dependencies, etc |
| 15:55 | Raynes | pepijndevos: amalloy and I have been discussing rewriting whatis as a more clojureboty factoid plugin, but we always argued over syntax and such and never actually did it. Feel free to ignore us and do it yourself. |
| 15:55 | drguildo | emezeske, so what are my options? i want to be able to run it standalone with as little unused/unneeded stuff as possible. |
| 15:56 | drguildo | emezeske, and that also doesn't explain why programs built with seesaw are so slow |
| 15:56 | dnolen_ | ibdknox: I've emailed you the project that I tested with, can you 'lein deps', 'lein-cljsbuild once' to see if that doesn't work for you? |
| 15:56 | emezeske | drguildo: Well I can't speak for seesaw's performance. |
| 15:56 | emezeske | drguildo: If you want a smaller uberjar, I guess have less dependencies? |
| 15:57 | drguildo | emezeske, i only depend on seesaw; i wouldn't be surprised if i depended on all the other stuff |
| 15:57 | pepijndevos | Raynes: I mean this one ??? |
| 15:57 | lazybot | pepijndevos: How could that be wrong? |
| 15:57 | emezeske | drguildo: You can see what seesaw depends on here: https://github.com/daveray/seesaw/blob/develop/project.clj |
| 15:58 | emezeske | drguildo: Of course, any of its deps might have their own deps and so on |
| 15:58 | drguildo | emezeske, i guess it's just bloated |
| 15:58 | Raynes | pepijndevos: That's completely random. No x is y. |
| 15:58 | pepijndevos | ok |
| 15:58 | drguildo | they include the kitchen sink when i just want a more clojurey way of using swing |
| 15:59 | raek | drguildo: ahead of time compiling your application should reduce the start up time greatly |
| 15:59 | pepijndevos | drguildo: Yea... I think there should be a Object.toSwing protocol, just data as code, code as data, etc... |
| 16:00 | drguildo | raek, okay, thanks, but if i write an equivalent pure swing program it compiles and runs a ton faster which leads me to believe that the problem lies with seesaw unless i'm doing something "wrong" |
| 16:00 | ibdknox | dnolen_: that seems to have worked |
| 16:01 | raek | drguildo: is there noticeable performance degradation after it has started up? |
| 16:01 | dnolen_ | ibdknox: I'd like to isolate what's different between my project and your project. |
| 16:01 | drguildo | raek, kinda impossible to tell because it's just a jlabel embedded in the main jframe |
| 16:01 | raek | drguildo: clojure is always slow to start up without aot, basically |
| 16:02 | raek | since you compile all code at startup |
| 16:02 | dnolen_ | ibdknox: are you not using lein-cljsbuild? some custom build process here? |
| 16:02 | ibdknox | dnolen_: yeah using noir.cljs |
| 16:02 | ibdknox | dnolen_: one sec |
| 16:02 | raek | drguildo: have you tried enabling aot compilation? |
| 16:02 | drguildo | raek, like i say, direct calls to swing using clojure are fine, seesaw is slow as hell compiling and running |
| 16:03 | drguildo | raek, nope |
| 16:04 | drguildo | wouldn't lein uberjar compile the clojure code anyway? |
| 16:04 | raek | no |
| 16:05 | ibdknox | dnolen_: it must be something to do with the difference in the way the classpath is set up |
| 16:05 | ibdknox | not sure how that could be true though |
| 16:06 | uvtc | ,(def m {:a 1 :b 2}) (type m) |
| 16:06 | clojurebot | #<Exception java.lang.Exception: SANBOX DENIED> |
| 16:06 | uvtc | ,(def m {:a 1 :b 2}) (println (type m)) |
| 16:06 | clojurebot | #<Exception java.lang.Exception: SANBOX DENIED> |
| 16:06 | uvtc | &(def m {:a 1 :b 2}) (println (type m)) |
| 16:06 | lazybot | java.lang.SecurityException: You tripped the alarm! def is bad! |
| 16:06 | ibdknox | dnolen_: either way, this issue is on my end |
| 16:06 | dnolen_ | ibdknox: hmm I don't think so. you could only see that error if somehow that :excludes information was discarded before compilation. |
| 16:06 | uvtc | &(println (type {:a 1 :b 2})) |
| 16:06 | lazybot | ⇒ clojure.lang.PersistentArrayMap nil |
| 16:06 | ibdknox | dnolen_: oh |
| 16:06 | drguildo | are there any good clojure gui/swing libraries? |
| 16:06 | uvtc | Why is that an array map, and not a hash map? |
| 16:06 | dnolen_ | ibdknox: before expanding any macros we check to make sure that the macro hasn't been excluded. |
| 16:07 | dnolen_ | ibdknox: it could only fail if something is messing around with cljs.compiler/namespaces atom |
| 16:07 | ibdknox | dnolen_: not touching it |
| 16:07 | emezeske | uvtc: I think because it's very small. |
| 16:08 | Raynes | drguildo: https://github.com/daveray/seesaw |
| 16:08 | emezeske | uvtc: I'm not sure where the threshold is, but smaller maps are created as ArrayMap and larger ones as HashMap |
| 16:08 | uvtc | emezeske, Interesting. Will experiment. Thanks! |
| 16:08 | Bronsa | uvtc maps with more than 8 elements should be hash-maps |
| 16:08 | drguildo | Raynes, seesaw is slow and bloated |
| 16:08 | emezeske | &(type {:a 1 :b 1 :c 1 :d 1 :e 1 :f 1 :g 1 :h 1 :i 1 :j 1 :k 1 :l 1 :m 1}) |
| 16:08 | lazybot | ⇒ clojure.lang.PersistentHashMap |
| 16:08 | emezeske | uvtc: ^ |
| 16:09 | Raynes | ...okay. |
| 16:09 | Raynes | In that case, I guess not. :\ |
| 16:09 | uvtc | emezeske, Ah, ok. Thanks guys (emezeske, Bronsa ) |
| 16:10 | help_please | hi. are there any users of korma here? I'm running into what I feel like should be a simple join, but i cant get it to work |
| 16:10 | drguildo | https://github.com/stathissideris/clarity |
| 16:11 | Raynes | drguildo: Have you talked to daveray about your problems though? Opened issues on Github? |
| 16:12 | drguildo | Raynes, nope, i'm not sure how constructive my criticism would be |
| 16:12 | gtrak | drguildo: you might learn something useful if you dig into it |
| 16:12 | uvtc | drguildo, if the apps are just for Gnome, I recently heard about this: https://github.com/technomancy/lein-gnome |
| 16:13 | drguildo | uvtc, i'm using windows and wouldn't want to do platform specific stuff anyway |
| 16:13 | dnolen_ | ibdknox: I may have a fix for you ... one second |
| 16:14 | uvtc | drguildo, how about using clojurescript and creating your app in the GUI? (sorry if that's already been suggested...) |
| 16:15 | drguildo | uvtc, haven't really thought about it |
| 16:16 | uvtc | drguildo, Aack! typo: s/GUI/browser/. Sorry. :) |
| 16:19 | dnolen_ | ibdknox: try master now |
| 16:33 | brainproxy | anybody know if the source document for the paredit cheat sheet is available somewhere ... would love to generate a high-res PDF rather than magnifying a relatively low-res png file |
| 16:35 | muhoo | is it true that ` is exactly equivalent to (comp list quote) ? |
| 16:36 | gtrak | brainproxy: I had good results through a combination of scaling, sharpening, and mathematical morphology ops in gimp, unfortunately, not sure what I did with that file :-) |
| 16:36 | S11001001 | muhoo: no, 1st quote's not a function |
| 16:38 | muhoo | well then to (list (quote)), no way to comp macros, |
| 16:38 | muhoo | or special forms. i'm just trying to understand what it *does* |
| 16:38 | gtrak | by morphology I mean erode/dilate |
| 16:39 | aperiodic | brainproxy: andy fingerhut is the guy who puts it together; you could shoot him an email |
| 16:39 | muhoo | seems like ` behaves the same as (list (quote ...)), but i might be oversimplifying |
| 16:40 | brainproxy | aperiodic: sweet thanks |
| 16:40 | brainproxy | gtrak: sounds complicated :o |
| 16:41 | mebaran151 | I'm getting a weird EOF error from clojure/clojurescript project. Anyway to get the compiler to tell me which file is EOF'ing it? |
| 16:42 | amalloy | muhoo: i don't think that makes sense. ` behaves like (quote ...) with a couple exceptions; i don't know where you're getting the idea of an extra (list) |
| 16:43 | mebaran151 | muhoo: here's a nice little guide that explains how they all subtly change the reader's behavior: http://www.learningclojure.com/2010/11/syntax-quote-kata-for-confused.html |
| 16:45 | muhoo | amalloy: thanks, i'm just kind of thrashing around trying to understand stuff. |
| 16:46 | muhoo | mebaran151: thanks, that looks good |
| 16:46 | brainproxy | dnolen_: just found this https://github.com/jafingerhut/clojure-cheatsheets/blob/master/pdf/cljs-cheatsheet.pdf ... certainly along the lines of what I said I was wishing for |
| 16:46 | dnolen_ | brainproxy: is that different than this? http://himera.herokuapp.com/index.html |
| 16:47 | muhoo | ahh. that makes more sense. it's quote with full qualification |
| 16:48 | TimMc | muhoo: And the possiblity of unquoting. |
| 16:50 | brainproxy | dnolen_: nope .. had forgotten about that, though I have made frequent reference to himera's "synonyms" page |
| 16:59 | uvtc | I could've sworn that there was a longer "javascript --> clojure" sort of cheatsheet/quick-ref at fogus's himera ... anyone remember that or have a link to it? |
| 16:59 | uvtc | It had the same styling as what's currently at http://himera.herokuapp.com/index.html . |
| 17:01 | mebaran151 | hey ibdknox, I think I tracked down this EOF error to cljs/start: any idea how I could get the file that is throwing it for a loop? |
| 17:05 | uvtc | Ah ha! Found it: <http://himera.herokuapp.com/synonym.html> |
| 17:06 | dnolen_ | nice latest WebKit's support drawing without smoothing. |
| 17:10 | jtoy | from inside of a method, can I know the name of the method I am in? |
| 17:11 | gtrak | jtoy: why? |
| 17:11 | gtrak | methods don't have names, vars do? |
| 17:11 | jtoy | i guess i need to use a macro for that |
| 17:11 | joegallo | you mean in a proper java method? or were you speaking loosely about clojure functions? |
| 17:12 | jtoy | joegallo: clojure function |
| 17:13 | TimMc | gtrak: Fns have names too! |
| 17:13 | TimMc | Or they can, at least. |
| 17:13 | gtrak | yea, just saw that, though I've never used it for anything |
| 17:13 | jtoy | i want do to this? (defn mymethod (log nameofthismethod)) |
| 17:13 | TimMc | It's useful for general recursion. |
| 17:13 | jtoy | and i want to add the (log nameofthismethod) into a bunch of methods without having to type the actual name of the method |
| 17:14 | TimMc | jtoy: This is for debugging, yeah? |
| 17:14 | jtoy | no, for logging some data |
| 17:16 | gtrak | &(.getClass (fn inscrutable [] (+ 1 2))) |
| 17:16 | lazybot | ⇒ sandbox7529$eval10218$inscrutable__10223 |
| 17:17 | jtoy | gtrak: can I do that from inside inscrutable though? |
| 17:17 | gtrak | hmm, probably? |
| 17:17 | jtoy | how, what would I pass to .getClass ? |
| 17:18 | gtrak | you might have to have it close over itself |
| 17:18 | TimMc | &(((fn foooo [] (fn baaaar [] (.getClass #()))))) |
| 17:18 | lazybot | ⇒ sandbox7529$eval10258$foooo__10259$baaaar__10260$fn__10265 |
| 17:18 | gtrak | oh yea, that works |
| 17:18 | jtoy | what is #() ? |
| 17:19 | gtrak | &(fn inscrutable [] (.getClass inscrutable)) |
| 17:19 | lazybot | ⇒ #<sandbox7529$eval10280$inscrutable__10281 sandbox7529$eval10280$inscrutable__10281@45a218> |
| 17:19 | jtoy | &(#()) |
| 17:19 | lazybot | ⇒ () |
| 17:19 | amalloy | ,'#() |
| 17:19 | clojurebot | (fn* [] ()) |
| 17:19 | TimMc | jtoy: It's the fastest way of getting a function you don't care about. |
| 17:20 | TimMc | s/getting/defining/ |
| 17:20 | tmciver | TimMc: don't you care about *all* your functions? :) |
| 17:26 | gtrak | though if you're referencing it by a symbol, you could just give back the name of the symbol.. |
| 17:27 | gtrak | &(fn inscrutable [] (name inscrutable)) |
| 17:27 | lazybot | ⇒ #<sandbox7529$eval10319$inscrutable__10320 sandbox7529$eval10319$inscrutable__10320@14ed89a> |
| 17:27 | gtrak | &(fn inscrutable [] (name 'inscrutable)) |
| 17:27 | lazybot | ⇒ #<sandbox7529$eval10328$inscrutable__10329 sandbox7529$eval10328$inscrutable__10329@d40bb0> |
| 17:27 | gtrak | &(fn inscrutable [] (symbol inscrutable)) |
| 17:27 | lazybot | ⇒ #<sandbox7529$eval10344$inscrutable__10345 sandbox7529$eval10344$inscrutable__10345@8c7267> |
| 17:27 | gtrak | grr! |
| 17:28 | emezeske | &((fn inscrutable [] (name 'inscrutable))) |
| 17:28 | lazybot | ⇒ "inscrutable" |
| 17:28 | muhoo | interesting, lazybot doesn't allow (defn foo [] ) but it allows (fn foo [] ) ? |
| 17:28 | emezeske | &(name 'inscrutable) |
| 17:28 | lazybot | ⇒ "inscrutable" |
| 17:28 | emezeske | muhoo: lazybot doesn't let you def things |
| 17:28 | brehaut | lazybot doesnt allow def (because it lets you munge a shared resource) |
| 17:29 | gtrak | emezeske: oh, duh |
| 17:30 | emezeske | gtrak: ^_^ |
| 17:32 | nDuff | ...it would, at least, prevent the restrictions on def and such from being needed. |
| 17:32 | muhoo | what about startup time? |
| 17:33 | muhoo | oh, copy, got it. |
| 17:33 | nDuff | muhoo: very cheap if it's done right. Make the image small enough that it can all be cached in RAM, pure copy-on-write so nothing on disk has to be changed on reset, snapshot with all the software you want in the VM already running (REPL already attached to a virtual "serial port"), and there's not much to it. |
| 17:35 | gtrak | &((fn inscrutable [] (.getClass inscrutable))) |
| 17:35 | lazybot | ⇒ sandbox7529$eval10369$inscrutable__10370 |
| 17:37 | drguildo | has anyone used proguard on a clojure jar? |
| 17:37 | muhoo | drguildo: i think the clojure android guys have |
| 17:37 | drguildo | i'm getting a ExceptionInInitializerError |
| 17:38 | muhoo | time to get back to more practical work. like soon. |
| 17:39 | mwillhite | anyone familiar with clj-time? |
| 17:39 | emezeske | muhoo: As someone else who had to go through a period like that, I can anecdotally say that it pays off in the long run :) |
| 17:39 | mwillhite | It seems from-sql-date should be in the 0.4.2 release, but clojure throws up on it |
| 17:40 | joegallo | mwillhite: perhaps if you ask your question, then people who can answer it will pipe up |
| 17:40 | joegallo | beat me to it :) |
| 17:40 | emezeske | muhoo: I had to beat my head against quoting for a long while, and then take a break, and then beat my head against it some more |
| 17:40 | dnolen | ibdknox: did you get to try master? |
| 17:41 | mwillhite | :) |
| 17:41 | mwillhite | still always good advice |
| 17:41 | michaelr` | so is hiccup relatively slow or i'm doing something bad in my code? |
| 17:42 | emezeske | michaelr`: I've found hiccup to be very fast myself (although our use cases could differ) |
| 17:42 | dnolen | from O'Reilly themselves on CLJS book - https://twitter.com/oreillymedia/status/205006393604976641 |
| 17:42 | mwillhite | when I try including that function like this in my namespace (ns ... (:use [clj-time.coerce :only (from-sql-data)]) |
| 17:42 | Raynes | So there is going to be a ClojureScript book? |
| 17:42 | mwillhite | I get the following error: CompilerException java.lang.RuntimeException: Unable to resolve symbol: from-sql-date in this context, compiling:(NO_SOURCE_PATH:1) |
| 17:42 | Raynes | Already? |
| 17:42 | mwillhite | any ideas? |
| 17:43 | hiredman | michaelr`: it sort of depends, last I checked hiccup pregenerates as much html as it can, but if it cannot figure it out at compile time it will do the generation at runtime |
| 17:43 | mwillhite | the change was committed prior to the latest push to clojars |
| 17:43 | michaelr` | hmm |
| 17:44 | michaelr` | we have to go deeper ;) |
| 17:49 | dnolen | Raynes: why not? I wonder who's working on it |
| 17:49 | Raynes | dnolen: Because it's way, way, way too much of a moving target. |
| 17:49 | Raynes | What is our currently release? 0.2? |
| 17:50 | dnolen | Raynes: stuff underneath is moving, not the external api. |
| 17:50 | Raynes | *shrug* |
| 17:51 | mebaran151 | michaelr`: I've found hiccup a lot faster than the old erb snippets I was used to |
| 17:56 | rplevy | it |
| 17:56 | rplevy | it is very odd that they would not have publically announced it |
| 17:56 | rplevy | an Aug 2012 release? |
| 17:57 | rplevy | and a twitter response as first mention? |
| 17:57 | rplevy | maybe a viral marketing technique haha |
| 17:57 | fil512 | question for you smart people |
| 17:58 | fil512 | testing, namespace, privacy |
| 17:58 | rplevy | whoever is working on it is being very secretive too, weird |
| 17:58 | fil512 | to encapsulate, I want to use defn- |
| 17:58 | fil512 | To keep ns clean, I put my tests in a seeparate namespace |
| 17:58 | fil512 | And I use "use" to import the functions under test |
| 17:58 | gtrak | fil512: you know defn- doesn't really protect anything right? |
| 17:59 | fil512 | But now how do I test the "private" methods? |
| 17:59 | gtrak | (#'ns/function args) |
| 17:59 | fil512 | When I tried to call a "defn-" function, I got an IllegalStateException |
| 18:00 | fil512 | Is that how most ppl write tests? |
| 18:00 | gtrak | fil512: you can get to the var and call it from there |
| 18:00 | Chousuke | only for defn- functions I suppose |
| 18:00 | rplevy | fil512: there's a great idea in Joy of Clojure |
| 18:00 | rplevy | create an impl ns |
| 18:00 | rplevy | the chapter with that in it is one of the free ones if you don't have the book but I recommend the book |
| 18:00 | fil512 | I have the book |
| 18:01 | fil512 | I just discovered defn- from reading this book and that is what prompted my question |
| 18:01 | tremolo | fil512: you can use the @#'my.stuff/myvar form |
| 18:01 | rplevy | so the idea to recap is you don't need to make your non-public functions private, just refer the vars from a non-API ns |
| 18:01 | Chousuke | I think defn- is mostly there to prevent anyone from accidentally using your function |
| 18:01 | rplevy | problem solved |
| 18:01 | Chousuke | you shouldn't use it too much |
| 18:02 | rplevy | Chousuke: it is for being declarative about your API |
| 18:02 | Chousuke | declarative? :/ |
| 18:02 | rplevy | I think so |
| 18:02 | rplevy | in my humble opinion |
| 18:02 | emezeske | Chousuke: defn- == "Don't use this function, it's liable to change, and isn't part of the public api" |
| 18:03 | Chousuke | I would use it for some small helper functions that don't really need to get tested but are not public API either. |
| 18:03 | rplevy | emezeske: exactly what I'm saying |
| 18:03 | gtrak | rplevy: if you want a declarative api, maybe use 'declare' too much :-) |
| 18:03 | fil512 | so I split my ns into two ns? one "public" and the other "private?" |
| 18:03 | Chousuke | emezeske: defn doesn't imply the opposite either, though. |
| 18:03 | rplevy | I prefer (defn ^:private ... |
| 18:03 | emezeske | Chousuke: It does to me... |
| 18:04 | rplevy | because you can use it with def, defmacro, etc |
| 18:04 | Chousuke | emezeske: public API is what you document it to be |
| 18:04 | Chousuke | defn implies nothing |
| 18:04 | rplevy | defn to me does imply public api, unless you are not saying that the ns is part of your api |
| 18:04 | emezeske | Chousuke: Right, and the API is documented by metadata |
| 18:04 | emezeske | Chousuke: If you don't mark something as :private, it will get used. |
| 18:05 | tremolo | fil512: just to recap, if you have a private method "defn- bar" in the "foo" ns, you should be able to get to it form your tests with @#'foo/bar |
| 18:05 | tremolo | *from |
| 18:05 | hiredman | even if you mark it as private I will use it |
| 18:05 | rplevy | emezeske: that is by far the consensus in the community too |
| 18:05 | emezeske | hiredman: hahaha |
| 18:05 | ivan | is conjing arbitrary keys to a record undefined behavior? or supported? |
| 18:05 | Chousuke | emezeske: you might not be able to mark it as private if you use it within your own namespaces, even if it's not intended as public API |
| 18:05 | hiredman | I don't care how you've documented you api, what accessors you've declared or whatever |
| 18:05 | hiredman | if I need it I will use |
| 18:06 | hiredman | it |
| 18:06 | fil512 | I feel like I'm hearing two different approaches: one use defn- and then for testing use @#'foo/bar to get at it, the other is to split my namespace into two namespaces, one public one private and handle it that way--is that correct? |
| 18:06 | emezeske | hiredman: oh, I hear you. The point is, though, if I break backwards compat on a :private var, you can't complain. Or, you can, but I won't listen :) |
| 18:06 | hiredman | and curse the name of anyone or thing that makes it harder to do |
| 18:06 | trptcolin | i thought the preferred way was to cut & paste code from project to project |
| 18:06 | trptcolin | :trollface: |
| 18:06 | hiredman | trptcolin: if I need to |
| 18:06 | Chousuke | fil512: either works, it depends on what you need |
| 18:07 | trptcolin | hiredman: ditto |
| 18:07 | fil512 | which option is more common? |
| 18:07 | Chousuke | if you have just a couple defn- functions you can just circumvent the "encapsulation" (there is none, in reality) and test it |
| 18:07 | tremolo | fil512: if you're just testing, the @#'foo/bar approach is fine. in fact, it's recommended in the clojure/core style guide |
| 18:07 | Chousuke | otherwise, you might want a namespace that you document as "private" |
| 18:07 | technomancy | fil512: my approach is to mark internal defns with ^:internal metadata |
| 18:07 | hiredman | https://github.com/hiredman/clojurebot/blob/424732436c34de48ca29f04a4f2f7a6ea02b613a/src/hiredman/triples.clj#L29 |
| 18:08 | technomancy | it doesn't do anything to the compiler, but it communicates to the reader |
| 18:08 | fil512 | the @#'foo/bar option looks messy |
| 18:08 | fil512 | I like the two namespace option |
| 18:08 | fil512 | are there conventions to indicate which namespaces are public and which private? |
| 18:08 | emezeske | I like technomancy's approach. |
| 18:09 | rplevy | hiredman: I think it's fine to violate API if you do it with self-awareness of this fact, and that is only possibly by having that distinction |
| 18:10 | fil512 | guess not |
| 18:10 | fil512 | well gtg. |
| 18:10 | fil512 | thanks for your help! |
| 18:10 | Chousuke | I like technomancy's approach too |
| 18:10 | Chousuke | you can't prevent anyone from using your private functions, so why complicate things for yourself :P |
| 18:11 | rplevy | I like that idea |
| 18:11 | hiredman | rplevy: *shrug* |
| 18:11 | technomancy | I hope it takes off so that doc tools know to ignore internal functions. |
| 18:13 | rplevy | I also augment fogus's impl ns idea by marking internal ns with ^:impl. "internal" is probably better, both for ns and for vars |
| 18:15 | dwierenga | can anyone recommend a blog entry or something on how to use the repl to speed up development? everyone seems to rave about how much it helps and i just don't get *how*. i feel like i'm missing something fundamental that is just obvious to others and isn't to me... |
| 18:17 | Chousuke | dwierenga: write a function, test the function in the repl immediately, and if it works, write more functions :p |
| 18:18 | gtrak | dwierenga: it's really helpful just to try stuff, in emacs you can C-x e and it'll send the last form behind the cursor to the repl |
| 18:18 | Chousuke | you can also define whatever temporary variables you need at any time, eg. a vector of test input |
| 18:18 | dwierenga | Chousuke: ok... but i don't get how that's dramatically superior to just running your code.. |
| 18:18 | Chousuke | you don't need to put it in the source file, though a common thing to do is to have some code inside a comment form |
| 18:18 | Chousuke | dwierenga: it's faster and more flexible. |
| 18:19 | Chousuke | you can also affect the behaviour of a running application with the repl |
| 18:19 | technomancy | replaca's talk on Flow at the first conj might be a good starting point |
| 18:19 | Chousuke | that's not possible with compile and run style development |
| 18:20 | dwierenga | gtrak: oh.. i use gvim on windows. haven't managed to get vim hooked up to the repl |
| 18:20 | gtrak | that'll probably help, until you do, you're limited to copy/paste |
| 18:21 | gtrak | dwierenga: you should watch the game of life screencast maybe? it's a good example |
| 18:22 | gtrak | http://www.youtube.com/watch?v=lgsAztXDuH0 |
| 18:22 | dwierenga | gtrak: will do, thanks! |
| 18:29 | dwierenga | gtrak: ok, yeah.. that's spiffiness i don't currently have. |
| 18:30 | gtrak | he made the return vals show up inline, but the normal setup just shows it in the emacs minibuffer |
| 18:30 | mwillhite | exit |
| 18:37 | rlb | gfredericks: not sure keep-indexed can (easily) do what I want after all -- in this case, I want to find the index of the last item that's less then the previous item, if there is one. |
| 18:38 | rlb | s/then/than/ |
| 18:42 | rplevy | I think putting :aot in a deploy profile is probably the best solution to avoiding AOT woes during development, rather than running lein clean all the time |
| 18:42 | technomancy | clojure.tools.logging doesn't let you set the level at runtime, does it? |
| 18:42 | technomancy | rplevy: yes, definitely |
| 18:44 | technomancy | because it can't be implemented consistently across some of the annoying backends? |
| 18:45 | technomancy | java the albatross =\ |
| 18:46 | McMartin | I miss tail call elimination every day |
| 18:48 | rplevy | technomancy: thanks, I find this to be much cleaner. btw, in preview-4 I got errors running :prep-tasks ["clean"], but I didn't look into it much, probably something I was doing wrong. |
| 18:49 | technomancy | rplevy: hm; can you open an issue? |
| 18:49 | rplevy | ok I will do that |
| 18:50 | technomancy | I haven't tried customizing prep-tasks, but I can't think of a reason it shouldn't work |
| 18:53 | amalloy | rlb: i think you want partition |
| 18:54 | amalloy | &(let [coll '(1 3 2 5 4 7)] (keep-indexed (fn [i [a b]] (when (< a b) (inc i))) coll)) |
| 18:54 | lazybot | java.lang.UnsupportedOperationException: nth not supported on this type: Long |
| 18:55 | amalloy | &(let [coll '(1 3 2 5 4 7)] (last (keep-indexed (fn [i [a b]] (when (< a b) (inc i))) (partition 2 1 coll)))) |
| 18:55 | lazybot | ⇒ 5 |
| 19:03 | dnolen | another boost to satisfies? lands in CLJS master - the perf hit for calling fn through to protocol fn gets ever smaller. |
| 19:09 | ieure | Hmm. |
| 19:09 | ieure | So in this Compojure route |
| 19:09 | ieure | I have (parse-stream (reader (:body req))) |
| 19:09 | ieure | Using [cheshire.core :only [parse-stream parse-string]] [clojure.java.io :only [reader]] |
| 19:09 | ieure | This always returns null. |
| 19:09 | ieure | Seems wrong. Has anyone gotten this to work before? |
| 19:10 | dakrone | ieure: try (parse-stream (input-stream (reader (:body req)))) |
| 19:10 | nDuff | My routes which need to refer to the body look like so: (PUT "/wherever" [:as {body :body}] ...) |
| 19:10 | technomancy | or parse-string on slurping the body |
| 19:12 | ieure | dakrone, java.lang.IllegalArgumentException: Cannot open <#<BufferedReader java.io.BufferedReader@3668ad91>> as an InputStream. |
| 19:12 | ieure | Er |
| 19:12 | ieure | My fault on that |
| 19:12 | ieure | Probably |
| 19:12 | ieure | What I see in the request is :body #<HttpInput org.eclipse.jetty.server.HttpInput@65012945> |
| 19:12 | dakrone | ieure: are you using clj-http? |
| 19:12 | ieure | HttpInput is a subclass of InputStream already |
| 19:13 | carllerche | so… this may sound insane, but is there a way to hook into the byte code loading of clojure.core functions? |
| 19:13 | cjz | what is the ^ in (def ^:dynamic x 1) |
| 19:13 | ieure | dakrone, No. |
| 19:13 | ieure | cjz, What's the name of the character, or what does it mean to Clojure? |
| 19:13 | cjz | what does it mean to Clojure |
| 19:13 | ieure | cjz, It's a reader macro |
| 19:14 | ieure | cjz, http://clojure.org/reader#The%20Reader--Macro%20characters |
| 19:15 | dakrone | ieure: cheshire should work fine on BufferedReaders itself: https://github.com/dakrone/cheshire/blob/master/test/cheshire/test/core.clj#L122 does the reader need to be opened? |
| 19:15 | McMartin | Is there a way to get a byte-based input stream out of a string without ducking down to Java? input-stream seems to insist on treating the string as a file/URL. |
| 19:15 | raek | ieure: readers are for text, input-streams are for binary data |
| 19:15 | cjz | thank you ieure |
| 19:15 | ieure | cjz, You |
| 19:15 | ieure | *You're welcome |
| 19:16 | raek | you can turn an input-stream into a readed, but not the other way around |
| 19:16 | raek | *reader |
| 19:16 | McMartin | raek: Right. In Java you can however turn a String into a byte[] by handing it an encoding, and then build an InputStream around that |
| 19:16 | McMartin | I can obviously do that with .. in Clojure, but is there a Clojure-native way of doing it? |
| 19:17 | raek | McMartin: yes, using the java api |
| 19:17 | raek | via interop |
| 19:17 | ieure | dakrone, Does not appear to be correct; (parse-stream (:body req)) -> java.lang.ClassCastException: org.eclipse.jetty.server.HttpInput cannot be cast to java.io.Reader |
| 19:17 | raek | (ByteArrayInputStream. (.getBytes some-string "UTF-8)) |
| 19:17 | McMartin | raek: Right, that's the solution I ended up using, was curious if I could do it without interop (since you don't need it for the other) |
| 19:18 | McMartin | I actually used input-stream there instead of ByteArrayInputStream. and it worked, though that might be more reflective |
| 19:18 | raek | yeah, that should work too |
| 19:18 | dakrone | ieure: and (with-open [rdr (reader (:body req))] (parse-stream rdr)) doesn't work? |
| 19:19 | raek | input-stream is mostly sugar for calling the correct method to acquire the stream (for example .getInputStream on a socket) and wrapping the stream in a BufferedInputStream |
| 19:19 | ieure | technomancy, (parse-string (slurp (:body req))) doesn't error out, but it returns null. |
| 19:19 | raek | its primary purpose is to eliminate most of the boilerplate code you need to write in java |
| 19:20 | ieure | lul |
| 19:20 | dakrone | ieure: what is (slurp (:body req)) returning then? is it an actual string? just 'null'? |
| 19:20 | raek | clojure.java.io does not abstract away java io |
| 19:21 | technomancy | ieure: better check to make sure req is what you think it is then |
| 19:21 | ieure | technomancy, I did. |
| 19:21 | ieure | :body #<HttpInput org.eclipse.jetty.server.HttpInput@798a6dd4> |
| 19:21 | ieure | :content-length 28 |
| 19:22 | technomancy | how about just (slurp (:body req)) |
| 19:23 | amalloy | i'm hoping for "null // 21 character comments" |
| 19:24 | tmciver | reconnecting to a previously-connected-to swank session and running (ns-publics *ns*) shows my previously-defined vars. But when I try to evaluate one, I get #<Unbound Unbound: #'my-ns/my-var>. How do I re-bind them? |
| 19:25 | ieure | technomancy, https://gist.github.com/d0944ab7cc5c198c6166 |
| 19:25 | ieure | I don't think I'm crazy here. |
| 19:26 | ieure | There's a (log/debug req) above that let form |
| 19:26 | technomancy | looks like an empty body |
| 19:26 | technomancy | I wonder if :content-length includes HTTP headers |
| 19:26 | amalloy | i have to say, it looks like the input is empty and someone is lying about content-length |
| 19:26 | amalloy | technomancy: it shouldn't |
| 19:27 | ieure | technomancy, amalloy, I'm just using curl to send this request |
| 19:27 | ieure | curl --trace-ascii shows it sending 28 bytes of body |
| 19:27 | technomancy | there's no good logging library for Java that allows you to set the level at runtime is there? |
| 19:28 | technomancy | giving up on clojure.tools.logging, thought I'd ask before I give up and just call println after checking *level* |
| 19:28 | ieure | Okay so |
| 19:28 | ieure | For some reason |
| 19:28 | ieure | Omitting the content-type makes it all blow up |
| 19:28 | emezeske | technomancy: I consistently feel like java has made logging a bigger ordeal than it needs to be |
| 19:28 | dakrone | technomancy: we set it dynamically with log4j |
| 19:29 | technomancy | dakrone: is it an ordeal? |
| 19:30 | dakrone | technomancy: see pm |
| 19:31 | technomancy | thanks dakrone |
| 19:31 | technomancy | the equivalent in j.u.Logging is a pit of despair |
| 19:44 | kwertii | technomancy: is there a better way to add a lein-git-dependency to the project than using :source-paths on its src/ dir in Lein 2? |
| 19:45 | technomancy | there's not really any good way to do dependencies using git (in any language) |
| 19:45 | technomancy | I mean there's checkout dependencies, but that's different |
| 19:46 | kwertii | right.. I'm looking at the lein-git-deps plugin, which does mostly what I need (except for recursive dependencies) |
| 19:46 | kwertii | Ruby Bundler is very nice as far as Git deps go |
| 19:46 | technomancy | not according to the maintainers =\ |
| 19:46 | kwertii | heh. I never maintained it, just used it, and never ran into any issues |
| 19:47 | kwertii | I can imagine it must be a pain |
| 19:47 | tmciver | I see now that my unbound var issue is only with one of the vars - the server returned by the run-jetty function. I did not pass {:join? false} so the call did not return (and the var not bound to the symbol), which is why I killed slime in the first place. |
| 19:47 | hiredman | calling ruby bundler "nice" is something that is sure yo get you sighed at |
| 19:47 | hiredman | to |
| 19:48 | kwertii | hiredman: I suppose "nice" is a relative term. It's nicer than what we were all doing before bundler, which was trying to maintain a DLL Hell-esque systemwide mess of gems or hacked together custom versioning solutions. |
| 19:49 | kwertii | I am frequently faced with a case where some bugfix or new feature I need exists in a Git master branch or on somebody's fork, but hasn't been packaged up. If the maintainer isn't really into the project, it's sometimes months before it gets released |
| 19:50 | technomancy | using git for dependencies is really only appropriate during development |
| 19:50 | technomancy | that's what checkout deps are for |
| 19:50 | hiredman | ditch or fork |
| 19:51 | technomancy | if you have to deploy with an unreleased change, you need to cut your own release |
| 19:51 | technomancy | |
| 19:52 | kwertii | What's the etiquette for that? fork it and push my own foo-prime release to clojars? |
| 19:52 | emezeske | kwertii: If you're just using it locally, you can just "lein install" it, without pushing to clojars |
| 19:53 | hiredman | kwertii: clojars will namespace non-canonical forks (aslong as the canonical version is there already) |
| 19:53 | technomancy | if you have your own private repo it's better to publish there |
| 19:53 | kwertii | hiredman: interesting. didn't know that. that sounds perfect |
| 19:53 | technomancy | but it's not necessary |
| 19:53 | hiredman | maven has group-ids and project-ids, lein typically keeps them the same, but they don't have to be |
| 19:54 | hiredman | it is also pretty easy to run your own maven repo |
| 19:54 | hiredman | you can just copy the relevent bits of your .m2 to s3 |
| 19:55 | hiredman | if the library is written in clojure you can even just rewrite particular functions and redefine them |
| 19:56 | kwertii | having this information out there would probably help a lot of people and increase our general library update velocity. is this written up anywhere? if not, I'll write it up now |
| 19:58 | jtoy | so i just want to confirm ,for keyword arguments in clojure: http://stuartsierra.com/2010/01/15/keyword-arguments-in-clojure (defn foo [a b & options] (let [opts (apply hash-map options)] ….. is the recommended way? |
| 19:59 | hiredman | jtoy: you are kidding right? |
| 19:59 | jtoy | hiredman: im a clojure newb, |
| 19:59 | hiredman | jtoy: have you read what you just linked to? |
| 19:59 | jtoy | yes |
| 19:59 | hiredman | try again |
| 19:59 | jtoy | he said the first example is preferred |
| 20:00 | kwertii | So to push a non-mainline release of some already published library, I edit pom.xml and change the group id? or will it autodetect that? |
| 20:00 | jtoy | hiredman: he says his blog post is wrong |
| 20:00 | technomancy | kwertii: try `lein help deploying` |
| 20:00 | kwertii | technomancy: thanks |
| 20:03 | jtoy | ? |
| 20:09 | TimMc | jtoy: I don't know what hiredman is trying to say. I mean, I happen to disagree with stuart, but that is what stuart is saying. |
| 20:10 | jtoy | TimMc: what way to do you recommend? I don't want to write several different versions of the function, i want to use something like a vector and set default args |
| 20:13 | kwertii | added instructions on deploying forks to my fork of lein-git-deps README. Thanks guys. |
| 20:16 | TimMc | jtoy: It turns out to be annoying to call such functions with a map of options. apply doesn't work on maps the way one might hope. |
| 20:17 | emezeske | jtoy: I'm pretty sure the most common idiom, if you really want to do that, is (defn f [a b c & {:keys [x y z]}] ...), or so |
| 20:18 | emezeske | jtoy: I agree with TimMc, though, in that it's pretty annoying. I generally prefer just passing a map in. |
| 20:19 | jtoy | emezeske: do you guys know a good blog page that explains that ? jstu so i can understand exactly how it works |
| 20:20 | emezeske | jtoy: I don't unfortunately. |
| 20:20 | jtoy | k,thx |
| 20:22 | emezeske | jtoy: Maybe this is helpful? Or at least gives you some more things to google: http://stackoverflow.com/questions/3337888/clojure-named-arguments |
| 20:22 | jtoy | emezeske: awesome! |
| 20:24 | McMartin | I got a lot of mileage out of map bindings but that's not quite what you're looking for here |
| 20:24 | McMartin | Ooh, destructured rest |
| 20:28 | jtoy | so for their example: (defn blah [& {:keys [key1 key2 key3]}] (str key1 key2 key3)) to set default values would I just do (let final_key1 (if (nil? key1) "default value" key1)) and do that for every variable or is there a better way? |
| 20:29 | McMartin | Better was is later int he article: |
| 20:29 | emezeske | jtoy: You want to use :or I think |
| 20:30 | McMartin | Yeah |
| 20:30 | McMartin | Also, if-let is better than (let [foo (if (nil? exp) 'default exp)]... |
| 20:31 | emezeske | &((fn [& {:keys [a b c] :or {c 42}}] [a b c]) :a 1 :b 2) |
| 20:31 | lazybot | ⇒ [1 2 42] |
| 20:32 | emezeske | jtoy: ^ |
| 20:36 | jtoy | emezeske: cool, can I set multiple items with or like that? that seems like the best way to set everything up |
| 20:37 | emezeske | jtoy: Yep! |
| 20:37 | emezeske | &((fn [& {:keys [a b c] :or {c 42 d 100}}] [a b c]) :a 1 :b 2) |
| 20:37 | lazybot | ⇒ [1 2 42] |
| 20:37 | emezeske | &((fn [& {:keys [a b c] :or {c 42 d 100}}] [a b c d]) :a 1 :b 2) |
| 20:37 | lazybot | java.lang.RuntimeException: Unable to resolve symbol: d in this context |
| 20:38 | emezeske | &((fn [& {:keys [a b c d] :or {c 42 d 100}}] [a b c d]) :a 1 :b 2) |
| 20:38 | lazybot | ⇒ [1 2 42 100] |
| 20:38 | emezeske | There we go |
| 21:36 | timvisher | hey all |
| 21:36 | timvisher | what mode is it that gets me the function argument possibilities in the mini-buffer in emacs? |
| 21:36 | timvisher | mine seems to work 50/50 but i don't know how to debug because i'm not even sure what it is |
| 21:40 | gfredericks | light-table-mode |
| 21:42 | arohner | timvisher: slime-mode |
| 22:03 | danlarkin | greetings humans |
| 22:04 | danlarkin | I just pushed https://github.com/danlarkin/clabango |
| 22:04 | amalloy | timvisher: eldoc-mode |
| 22:05 | timvisher | amalloy: Yes! thank you so much |
| 22:05 | timvisher | now i just need to track down why it seems to randomly enable and disable itself |
| 22:05 | foxdonut | danlarkin: no docs? |
| 22:05 | danlarkin | foxdonut: well, there are tests :) |
| 22:05 | danlarkin | I know, terrible answer |
| 22:06 | danlarkin | no, no docs yet |
| 22:07 | foxdonut | danlarkin: I know, writing docs is no fun, but if you want to get people interested.. you need at least an example on the front page so that people might decide "hmm, I want to learn more about this library.." |
| 22:08 | foxdonut | my 2c anyway. |
| 22:08 | danlarkin | you're right |
| 22:09 | danlarkin | maybe a brownie will write docs for me :) |
| 22:10 | foxdonut | heh |
| 22:34 | Kowboy | so, i have a good question |
| 22:35 | Kowboy | is it possible, in a test case, to mock a function called by the function you are testing? |
| 22:35 | Kowboy | how would this be done? |
| 22:36 | Kowboy | so, the func I am testing is ns1/func1 and it calls ns2/func2 internally |
| 22:36 | metellus | Kowboy: with binding |
| 22:36 | Kowboy | I want to mock ns2/func2 |
| 22:37 | metellus | (binding [func2 mocked-func2] (func1 a b)) |
| 22:37 | brehaut | that only works for dynamic vars though |
| 22:37 | metellus | I knew I was missing something |
| 22:37 | Kowboy | crap |
| 22:38 | metellus | sorry |
| 22:38 | technomancy | use with-redefs |
| 22:39 | technomancy | or Rodney Leonard Stubbs: https://github.com/technomancy/rodney-leonard-stubbs |
| 22:39 | brehaut | technomancy: your libs have the best names |
| 22:39 | technomancy | "He was the Thomas Edison of handing a dude his ass." |
| 22:40 | Kowboy | technomancy, looking at this lein bug about proxy settings |
| 22:40 | technomancy | http://achewood.com/index.php?date=01272006 |
| 22:40 | technomancy | Kowboy: oh, great |
| 22:40 | Kowboy | was hoping to mock up classpath/get-proxy-settings |
| 22:41 | Kowboy | since System.setEnv() doesn't exist |
| 22:41 | Raynes | https://www.refheap.com/paste/2834 Oh my God oh my God oh my God! Light table code on refheap! |
| 22:41 | clojurebot | sharing code between client and server is not as simple or great as it sounds: http://blog.ianbicking.org/2011/03/30/js-on-server-and-client-is-not-a-big-deal/ |
| 22:42 | gfredericks | technomancy: that library makes me really want to make other libs with namespace of rodney.* or rodney.leonard.* |
| 22:42 | technomancy | gfredericks: http://clojars.org/groups/robert |
| 22:42 | McMartin | I hope the Rodney Leonard Stubbs library is for ripping the entire middles out of functions. |
| 22:43 | technomancy | Kowboy: with-redefs is your best bet there |
| 22:44 | Kowboy | I'll give it a shot |
| 22:44 | gfredericks | technomancy: I assume you've applied for the .robert TLD |
| 22:44 | gfredericks | if anybody else gets it first sue'em |
| 22:44 | Kowboy | here is one case where the JVM doesn't let you create the side-effect |
| 22:49 | technomancy | "Listen, man. You know how I agreed to stop calling the police about your animatronic Nativity scene? I got a favor to ask." <3 achewood |
| 22:50 | gfredericks | technomancy: please write a library that makes us all prolific readers |
| 22:50 | brehaut | just dont write a library that makes me have to read stephenson |
| 22:51 | technomancy | brehaut: I think liebke covered that one? |
| 22:51 | brehaut | haha |
| 22:51 | brehaut | maybe he did |
| 23:01 | amalloy | oh, is avout a reference to anathem? i didn't see the relevance |
| 23:07 | Kowboy | technomancy, I'm assuming the right way to do this is to reuse classpath/get-proxy-settings and adding those to the jvm-args inside of eval/get-jvm-args |
| 23:08 | Kowboy | as -Dhttp.proxyHost=foo |
| 23:08 | Kowboy | etc. |
| 23:08 | technomancy | Kowboy: yeah, that's the idea |
| 23:08 | Kowboy | OK, I think I have it then, just need to test |
| 23:10 | Kowboy | (with-redefs [classpath/get-proxy-settings (constantly {:host "foo.com" :port "8080"})] ....) |
| 23:10 | Kowboy | seems to work |
| 23:12 | Kowboy | unit test passes! Now to install a build of lein2 and test it manually |
| 23:12 | technomancy | you should be able to just run bin/lein test |
| 23:12 | technomancy | provided you've bootstrapped your checkout |
| 23:16 | Kowboy | well I launched the repl, but forgot I don't have a proxy setting. DOH! |
| 23:17 | Kowboy | best place to test this would be at work, where they have a super insane firewall |
| 23:17 | technomancy | yeah, it's always hard to find people to test the proxy features =) |
| 23:18 | Kowboy | I think I complained about proxy features before |
| 23:18 | Kowboy | something about the downloading of lein's own deps |
| 23:19 | eggsby | woah flask in light table, you rule ibdknox |
| 23:20 | Kowboy | ah, it was lein plugin install that didn't use proxy settings |
| 23:20 | Kowboy | fixed 4 months ago |
| 23:20 | Kowboy | but yeah, I got hit by that one |
| 23:21 | Kowboy | so, would you prefer if I use rodney for mocking (classpath/get-proxy-settings)??? |
| 23:21 | lazybot | Kowboy: How could that be wrong? |
| 23:22 | Kowboy | did I confuse lazybot? |
| 23:22 | brehaut | i dont think so?? |
| 23:22 | lazybot | brehaut: What are you, crazy? Of course not! |
| 23:23 | amalloy | i think lazybot gave you a pretty good answer tbh |
| 23:25 | technomancy | Kowboy: no, if with-redefs works then that's simpler |
| 23:25 | technomancy | no need to pull in a library for this |
| 23:25 | Kowboy | ok |
| 23:50 | Kowboy | technomancy, I've pushed to my fork, but I'll test it tomorrow before I send you a pull |
| 23:51 | technomancy | Kowboy: great; thanks! |
| 23:57 | Kowboy | ok, I |
| 23:58 | Kowboy | I'm out, see ya later |