2013-10-03
| 00:08 | akurilin | bitemyapp, ping. What's a good way of temporarily suppressing blackwater logging? Say you know you have a piece of logic that's going to be tremendously spammy and you want to avoid logging it. |
| 00:09 | akurilin | bitemyapp, would be neat if you could kind of "with-redefs" it for that one call |
| 00:19 | indigo | akurilin: You could do it the MongoDB way |
| 00:19 | indigo | Use a random number and only log it 0.1% of the time ;) |
| 00:20 | akurilin | indigo, is that for real? |
| 00:20 | akurilin | I'm very gullible. |
| 00:20 | bitemyapp | ddellacosta: hrm. |
| 00:20 | bitemyapp | ddellacosta: wrong clj-time version it sounds like. |
| 00:20 | bitemyapp | ddellacosta: I'm probably using a newer version of clj-time than you in the library. |
| 00:20 | coventry | akurilin: http://www.youtube.com/watch?v=b2F-DItXtZs |
| 00:21 | bitemyapp | akurilin: good question. |
| 00:21 | indigo | akurilin: https://github.com/mongodb/mongo-java-driver/blob/1d2e6faa80aeb5287a26d0348f18f4b51d566759/src/main/com/mongodb/ConnectionStatus.java#L213 |
| 00:21 | bitemyapp | akurilin: robert.hooke has a function for running a function without its decorators. |
| 00:21 | bitemyapp | akurilin: you would use that and it will suppress the logging behavior. |
| 00:21 | akurilin | coventry, oh yeah that one is great :) |
| 00:21 | indigo | Looks like they fixed it in a later commit though |
| 00:21 | akurilin | bitemyapp, does the name come to mind? |
| 00:22 | akurilin | indigo, was that a prank? |
| 00:22 | bitemyapp | akurilin: (with-hooks-disabled exec-raw |
| 00:22 | bitemyapp | akurilin: no that mongo code was for real. |
| 00:22 | bitemyapp | akurilin: this sounds like another thing to add to Blackwater :) |
| 00:22 | bitemyapp | ddellacosta: sorry I couldn't respond in a more timely fashion, I'm at Clojure Community Night |
| 00:23 | indigo | akurilin: Nope, for real |
| 00:23 | indigo | Although it seems like they changed it after they got a lot of heat for it ;) |
| 00:23 | akurilin | indigo, what is the scenario that would be useful? |
| 00:24 | indigo | akurilin: If you had to handle errors on web scale |
| 00:24 | akurilin | bitemyapp, man, I gotta make it to one of these events at some point, they're pretty close to where we are :( |
| 00:24 | akurilin | indigo, I see, makes sense then :) |
| 00:24 | indigo | :D |
| 00:24 | akurilin | Interestingly enough, is Mongo still huge these days, or is the infatuation finally over? |
| 00:25 | akurilin | Entire companies are still built on it to this day (*ahem* Parse *ahem*) |
| 00:25 | bitemyapp | akurilin: it's still around. I think some of the enthusiasm has calmed down. |
| 00:25 | indigo | I think it's not "as cool" anymore |
| 00:25 | bitemyapp | Clownshoes data store. |
| 00:25 | indigo | Still better than writing a custom ORM to convert MySQL into an EAV data store |
| 00:25 | akurilin | I think at the 20th "Why we moved from Mongo to PG" HN post, people got the hint. |
| 00:25 | bitemyapp | http://preview.getprismatic.com/story/1380766936960?share=true |
| 00:25 | bitemyapp | akurilin: lol, I hope so. |
| 00:26 | frozenlock | akurilin: Just realized this week that my mongo instance was just taking more and more space, without ever giving it back, even when I delete the data :( |
| 00:26 | bitemyapp | indigo: I use Datomic, thus side-stepping the EAV problem :) |
| 00:26 | indigo | bitemyapp: I use PHP, thus side-stepping the sane programming environment problem |
| 00:26 | akurilin | bitemyapp, heh that's a good point. |
| 00:26 | indigo | (only at work though) |
| 00:26 | akurilin | Need a PG plugin for edn. |
| 00:27 | bitemyapp | Integrating things into PG is...not a job I want. |
| 00:28 | akurilin | Yeah, whatever they're doing seems to be working for the product, I'm happy letting them do their thing without too much wordly influence. |
| 00:28 | akurilin | Although 9.3 did sorta support json |
| 00:28 | akurilin | half a decade after the format became ubiquitous |
| 00:30 | akurilin | Wait so Robert Hooke isn't a person? |
| 00:30 | akurilin | I thought it was a dude on Github who named libraries after himself. |
| 00:30 | akurilin | Nvm :) |
| 00:32 | akurilin | bitemyapp, I'll try what you suggested, thanks! |
| 00:32 | TEttinger | bitemyapp, do you work at prismatic? |
| 00:33 | TEttinger | and what is PG? |
| 00:35 | bitemyapp | TEttinger: gods no. There's a community night here and I'm presenting soon. |
| 00:35 | TEttinger | yay |
| 00:35 | bitemyapp | alexbaranosky and ztellman are presenting too |
| 00:35 | TEttinger | yay |
| 00:35 | bitemyapp | lightning talks, buncha people. |
| 00:35 | TEttinger | is it being filmed? |
| 00:35 | bitemyapp | were it not for that, they wouldn't let riff-raff like me talk. |
| 00:36 | bitemyapp | TEttinger: yes. |
| 00:51 | muhoo | ~pg |
| 00:51 | clojurebot | Pardon? |
| 00:51 | muhoo | what is pg? postgres? |
| 00:51 | indigo | Postgres |
| 00:51 | indigo | Not Paul Graham :P |
| 00:52 | indigo | Also good luck on your talk, bitemyapp |
| 00:52 | akurilin | gl. Links to talk afterwards plz :) |
| 01:05 | muhoo | ~pg is postgres, an sql database |
| 01:05 | clojurebot | In Ordnung |
| 01:05 | muhoo | ~pg |
| 01:05 | clojurebot | pg is postgres, an sql database |
| 01:06 | muhoo | ~robert hooke |
| 01:06 | clojurebot | Excuse me? |
| 01:06 | ddellacosta | haha |
| 01:06 | muhoo | ~robert hooke is a library for adding hooks to functions |
| 01:06 | clojurebot | Ack. Ack. |
| 01:06 | muhoo | ~robert hooke |
| 01:06 | clojurebot | robert hooke is a library for adding hooks to functions |
| 01:07 | muhoo | nice, it handles spaces |
| 01:07 | ddellacosta | bitemyapp: good luck on talk! |
| 01:07 | muhoo | ~life |
| 01:07 | clojurebot | life is life ... nanananana |
| 01:08 | muhoo | ~life is very short, and there's no time, for fussing and fighting, my friend. |
| 01:08 | clojurebot | In Ordnung |
| 01:08 | ddellacosta | "Life? Don't talk to me about life!" |
| 01:12 | centaur | Life sucks. Code more. |
| 01:25 | andyfingerhut | If you use :pre or :post conditions in your Clojure functions, and use them to test type conditions like (set? arg), is there any variant or configuration of that such that you can see the value of 'arg' that failed the assertion, or is that just gone unless you re-run? |
| 01:34 | chare | I'M BACK |
| 01:34 | chare | alive |
| 01:34 | chare | talking |
| 01:34 | chare | you can't stop me |
| 01:43 | nightfly | chord I'm assuming? |
| 01:48 | coventry | andyfingerhut: There is no built-in facility for that. You just get an assert. https://github.com/clojure/clojure/blob/master/src/clj/clojure/core.clj#L4130 |
| 01:50 | andyfingerhut | coventry: That is what I guessed, but hoping I was wrong. I suppose it is straightforward to do a precondition with a custom throw containing data if one wants. Postcondition maybe not so easily, but preconditions are. |
| 02:07 | ivan | right1: bin/lein uses -XX:+TieredCompilation -XX:TieredStopAtLevel=1 while bin/lein.bat does not |
| 02:34 | akurilin | I'm not familiar with the subject at all, maybe you guys know. Is it possible to send out multiple separate select queries as one single batch from JDBC? |
| 02:35 | akurilin | I could spam the DB with a bunch of futures, but that involves opening a bunch of connections rather than 1 |
| 02:43 | akurilin | Ok apparently you can't do that. TIL. The way to go would be futures or stored procedure, depending on CPU optimization strategy. |
| 02:44 | ddellacosta | akurilin: why do you need to close the connection? |
| 02:44 | ddellacosta | akurilin: also, what about a connection pool? |
| 02:45 | akurilin | *using rather than opening, I should have said |
| 02:45 | ddellacosta | ah |
| 02:45 | akurilin | my only concern was hitting the connection cap |
| 02:46 | akurilin | the problem is obviously that sending out a hundred requests to a DB will probably lead to some serious thrashing before I even get to worry about connection $ |
| 02:46 | akurilin | # |
| 02:46 | akurilin | supposedly 2x connections per core |
| 02:46 | akurilin | is the sweet spot |
| 02:46 | ddellacosta | yeah, looks like this may be dependent on which DB you are using: http://www.postgresql.org/message-id/411615F9.1040904@opencloud.com |
| 02:46 | akurilin | PG in my case |
| 02:52 | ddellacosta | YES I HAVE CONQUERED COMPLEX ltree QUERIES IN POSTGRESQL! That is all |
| 02:53 | dcunit3d | anyone used much incanter? |
| 02:53 | ddellacosta | now I have to make it all work in Clojure w/clojure.java.jdbc. |
| 02:54 | dcunit3d | i'm trying to implement a neural network, but crashing out because of heap size. |
| 03:32 | pepijndevos | refheap 500's |
| 03:33 | pepijndevos | now I need another pastebin |
| 03:34 | augustl | pepijndevos: there's this thing called gitbook or something like that :) |
| 03:38 | bitemyapp | Raynes: ^^ look dude, I'm not the only one. |
| 03:38 | bitemyapp | Raynes: it's 505'ing for pepijndevos too. |
| 03:38 | bitemyapp | 500'ing I mean, sorry. |
| 03:40 | Raynes | bitemyapp: You weren't the only one in the first place. There was someone this morning. |
| 03:40 | Raynes | bitemyapp, pepijndevos: I've restarted the server. |
| 03:40 | bitemyapp | Raynes: danke schon. |
| 03:41 | pepijndevos | ty |
| 03:41 | Raynes | bitemyapp: I'd be pretty surprised if it fixes anything. |
| 03:41 | bitemyapp | Raynes: that fixed it for me. |
| 03:41 | bitemyapp | pepijndevos: ? |
| 03:42 | pepijndevos | yup, works |
| 03:44 | TEttinger | ##(apply str (repeat 2000 " ")) |
| 03:44 | lazybot | ⇒ " ... |
| 03:45 | TEttinger | hm, shouldn't that have gone to refheap? |
| 03:46 | hyPiRion | ,(apply str (repeat 2000 " ")) |
| 03:46 | clojurebot | " ... |
| 03:46 | hyPiRion | &(apply str (repeat 2000 " ")) |
| 03:46 | lazybot | ⇒ " ... |
| 03:46 | TEttinger | it's doing it on quakenet-hosted bots too |
| 03:47 | TEttinger | my roguebot has been up for a few days, maybe I should restart it? |
| 03:48 | TEttinger | https://www.refheap.com/16011 fake greek generator load for everyone? |
| 03:58 | dcunit3d | so i'm running into some problems with binding vars - gist here - https://gist.github.com/6806317 |
| 03:58 | dcunit3d | trying to run incanter.charts/heat-map, which prompts for a function that takes [x y] |
| 03:59 | ro_st | use different arg names in draw-digits |
| 03:59 | dcunit3d | ro_st: k, let me try that |
| 03:59 | ro_st | (binding [sizex in-sizex] …) |
| 03:59 | dcunit3d | ro_st: also, i'm trying to compile this with lein uberjar |
| 04:00 | TEttinger | dcunit3d: (:gen-class) in the ns? |
| 04:00 | TEttinger | :aot and :main given the ns of the file? |
| 04:02 | dcunit3d | TEttinger: not in handwritten-digits.draw, but in handwritten-digits.core, which requires the draw namespace |
| 04:05 | zeroem | so, if I'm understanding the docs right, there's currently no way to add public members to a class (via gen-class) in clojure? |
| 04:05 | sm0ke | zeroem: what about state ? |
| 04:06 | zeroem | it's not clear that the contents of state are exposed as public members |
| 04:06 | klrr | can someone link me to an explanation of "reduce", i did not understand the docs neither could i read the source? |
| 04:08 | dcunit3d | it's still not binding the vars appropriately |
| 04:08 | TEttinger | klrr, it's a doozy. it's very important, I'll try to find a good explanation |
| 04:08 | klrr | thanks! |
| 04:08 | dcunit3d | forgot to declare data as dynamic |
| 04:09 | TEttinger | klrr: http://www.learningclojure.com/2010/08/reduce-not-scary.html |
| 04:09 | sm0ke | klrr: ,(reduce (partial + 0) [1 2 3 4]) |
| 04:09 | TEttinger | ,(reduce + [1 2 3 4]) |
| 04:09 | clojurebot | 10 |
| 04:09 | sm0ke | whats wrong with the bot |
| 04:10 | TEttinger | you need ##(str "## to eval inline") |
| 04:10 | sm0ke | i suck |
| 04:10 | TEttinger | uh oh |
| 04:10 | TEttinger | sm0ke, it's a key part of swearjure, that's the only reason I know + defaults to + 0 |
| 04:11 | klrr | i presume partial makes a function like the ones in haskell? |
| 04:11 | sm0ke | hmm does reduce also takes a starting argument? |
| 04:11 | TEttinger | indeed. it often needs one |
| 04:11 | zeroem | sm0ke: optionally |
| 04:11 | zeroem | ,(doc reduce) |
| 04:11 | clojurebot | "([f coll] [f val coll]); f should be a function of 2 arguments. If val is not supplied, returns the result of applying f to the first 2 items in coll, then applying f to that result and the 3rd item, etc. If coll contains no items, f must accept no arguments as well, and reduce returns the result of calling f with no arguments. If coll has only 1 item, it is returned and f is not called. If val i... |
| 04:11 | sm0ke | aha ##(reduce + 4 [1 2 3 4]) |
| 04:11 | lazybot | ⇒ 14 |
| 04:12 | sm0ke | what about left vs right? |
| 04:12 | TEttinger | sm0ke: ? |
| 04:12 | zeroem | sm0ke: after the first run, the first argument is the collector |
| 04:12 | sm0ke | TEttinger: you often have reducel reducer in other functional langs |
| 04:13 | TEttinger | oh yes |
| 04:13 | TEttinger | foldl and foldr in haskell |
| 04:13 | sm0ke | some times a function isnt idempotent |
| 04:13 | sm0ke | and idempotency is not somethng for which you take a pill |
| 04:13 | TEttinger | if your idempotency lasts more than 4 hours... |
| 04:13 | zeroem | ,(reduce (fn [a b] (prn a b) (+ a b)) [1 2 3 4]) |
| 04:13 | clojurebot | 1 2\n3 3\n6 4\n10 |
| 04:14 | sm0ke | so does clojure have righ and left reduce concepts as well? |
| 04:14 | TEttinger | I think it just has reduce in core, but there may be other contrib libs |
| 04:15 | TEttinger | normally you don't reduce over infinite lazy things, so you only need the one that does finite IIRC |
| 04:15 | bitemyapp | ddellacosta: added a down top-layer to my futon. <3 |
| 04:16 | sm0ke | hmm i dont buy that |
| 04:16 | ddellacosta | bitemyapp: nice. :-) |
| 04:16 | TEttinger | either foldl or foldr is meant to be used on infinite seqs IIRC |
| 04:16 | bitemyapp | I want to slumber for weeks in this bed |
| 04:16 | bitemyapp | rip van clojure. |
| 04:16 | ddellacosta | bitemyapp: do you actually do the thing where you put it away every day? |
| 04:16 | bitemyapp | ddellacosta: no, but I give 'er a good shake-n-beat every weekend. |
| 04:17 | sm0ke | i found this http://stackoverflow.com/questions/16800255/how-do-we-do-both-left-and-right-folds-in-clojure |
| 04:17 | ddellacosta | bitemyapp: probably just as good. Not that I have any clue…heh |
| 04:17 | ddellacosta | the funny thing is, I don't have any Japanese-style furniture anywhere here. Kinda wish I did actually. |
| 04:18 | ddellacosta | bitemyapp: except for my toilet. |
| 04:20 | bitemyapp | ddellacosta: I've heard those are legendary. |
| 04:20 | TEttinger | don't japanese toilets have tons of bells and whistles? |
| 04:22 | andyfingerhut | I hope not. I prefer a little peace and quiet around that time :-) |
| 04:22 | ddellacosta | Mine doesn't do this, but I was chatting with a friend today about the toilet I used in a fancy scotch bar last weekend--when you approached it, the lid raised automatically and British marches or something started playing at you |
| 04:22 | sm0ke | fu**ing zeromq arggh |
| 04:23 | ddellacosta | mine merely has nice nether-regions cleaning features. That's all I need, but it will be hard to leave that behind if I ever leave... |
| 04:23 | sm0ke | what is this toiletjure? |
| 04:23 | sm0ke | :D |
| 04:24 | ddellacosta | sm0ke: sorry, back to your regularly scheduled programming-language-related discussion. ;-) |
| 04:24 | ddellacosta | I should try to build a Japanese-toilet Clojure API, I've heard there are a lot people waiting to use it |
| 04:24 | sm0ke | ddellacosta: i am learning clojure thats why i ask regularly |
| 04:25 | sm0ke | once i know my shit..i dont talk much |
| 04:25 | sm0ke | :D |
| 04:25 | ddellacosta | sm0ke: badum-bum *symbol crash* |
| 04:27 | vmarcinko | noob question - has any library surfaced over time as de-facto standard way to do logging in clojure, or that's still in the air - maybe some use java api directly to access slf4j, some log4j etc? |
| 04:28 | TEttinger | vmarcinko, an excellent question, and one that comes up a lot |
| 04:28 | TEttinger | I have no idea, I don't do logging |
| 04:28 | vmarcinko | ?? |
| 04:28 | lazybot | vmarcinko: What are you, crazy? Of course not! |
| 04:28 | s4muel | vmarcinko: https://github.com/ptaoussanis/timbre has worked well for me |
| 04:30 | sm0ke | and i though tools.logging was the de facto |
| 04:31 | ddellacosta | vmarcinko: yeah, I've used timbre in one project and it's pretty good, but in my day-to-day job we simply have a logback.xml file + clojure/tools.logging |
| 04:32 | ddellacosta | I've had some trouble in the past using timbre to configure logging. Part of the problem seems to be what a holy mess a lot of Java logging is, so if you are doing a lot of Java interop (or using libs which do a lot of Java interop) then it can be a pain. |
| 04:33 | ddellacosta | but, that could also just be my ignorance--I'm a relatively n00b when it comes to Java logging |
| 04:33 | bitemyapp | vmarcinko: timbre is common, a lot of people will just kick stuff directly to a thin wrapper around a java logger. |
| 04:33 | vmarcinko | i just came from java land, and it's true, there is a mess there, but it seems slf4j (and logback udnerneath) is mostly used nowadays |
| 04:34 | bitemyapp | vmarcinko: I mostly either use timbre, stdout, or a distributed logging service. |
| 04:34 | vmarcinko | i mostly wanted to hear opinisons about tools.logging, but not much mentioning it here? |
| 04:34 | pyrtsa | sm0ke: About right folds in Clojure, the StackOverflow commenter vemv stated correctly that you can achieve the laziness of right folds with `reduced`. |
| 04:35 | pyrtsa | ,(reduce #(if-not %2 (reduced %2) %2) true (concat [false] (repeat true))) |
| 04:35 | clojurebot | false |
| 04:35 | pyrtsa | ,(reduce #(and %1 %2) true (concat [false] (repeat true))) |
| 04:35 | pyrtsa | (times out) |
| 04:35 | clojurebot | Execution Timed Out |
| 04:35 | ddellacosta | vmarcinko: I mean, like I said, we use that plus xml config, and it does us alright--I don't have complaints. If you want something more sophisticated (sending to a logging server) I would look into what bitemyapp was suggesting. |
| 04:35 | ddellacosta | timbre has nice extendability for that kind of stuff, if I recall correctly |
| 04:37 | ddellacosta | I mean, it's kinda like, do you want to go "the Java way" or do it in Clojure. tools.logging is a bit more the Java way" |
| 04:37 | ddellacosta | *"the Java way" |
| 04:37 | vmarcinko | ddellacosta: ah Ok, thanx.. |
| 04:38 | bitemyapp | ddellacosta: I'm actually considering making a very simple core.async based logging library for Clojure |
| 04:38 | bitemyapp | ddellacosta: with backends for ElasticSearch, flat files, stdout, Scribe, etc. |
| 04:39 | sm0ke | pyrtsa: wtf how come this doesnt shot circuits? (reduce #(and %1 %2) true (concat [false] (repeat true))) |
| 04:39 | pyrtsa | sm0ke: It does, but only within that anonymous function. It doesn't short circuit the reduction itself. |
| 04:40 | bitemyapp | ddellacosta: I think my talk went well. At least 2 or 3 people said their companies needed Simonides :) |
| 04:40 | pyrtsa | (And the short circuiting within #(and %1 %2) is kind of dull, there's zero savings from the evaluation of `%2`.) :) |
| 04:40 | ddellacosta | bitemyapp: nice! That's super cool. |
| 04:40 | ddellacosta | just starting to get some breathing room now, will check it out ASAP. |
| 04:41 | bitemyapp | ddellacosta: not much to look at yet. the hackathon was fucking crazy. |
| 04:41 | bitemyapp | ddellacosta: it'll be more complete and open sourced in a week or two |
| 04:41 | ddellacosta | how did it all go, btw.? The last week was insane for me, so I was basically not even looking at my IRC window |
| 04:41 | ddellacosta | bitemyapp: ah, okay |
| 04:41 | bitemyapp | I'm taking a bit of a breather, things have been intense lately and I have some work I'd like to do with blackwater and bulwark. |
| 04:42 | bitemyapp | ddellacosta: did you see what I said earlier about clj-time versions in blackwater? |
| 04:43 | ddellacosta | ah, yeah, thanks. Unfortunately, there is something else going on, as I am only including the same version of clj-time that you are in blackwater (0.6.0?) and I've checked my deps tree already…it's confusing |
| 04:43 | bitemyapp | ddellacosta: can you please file an issue with a small repro within or described? |
| 04:44 | bitemyapp | I need to write documentation for akurilin's thing too |
| 04:44 | ddellacosta | bitemyapp: I will have to go back and try to debug it again. I just ended up powering through it without logging, but I wish I could have gotten it working. |
| 04:44 | bitemyapp | and note that you can shut off the hooks within a scope for blackwater. |
| 04:44 | ddellacosta | bitemyapp: will do--but let me make sure I don't have something strange going on with my app first. I suspect it is something weird in my project.clj file. Does it matter that I'd be including it in a dev profile only? Shouldn't right? |
| 04:44 | bitemyapp | ddellacosta: oh that's no good. I'm sorry you ran into something. Please get an issue back to me. :) |
| 04:45 | ddellacosta | bitemyapp: I'll definitely let you know what I figure out. :-) |
| 04:45 | bitemyapp | Much 'preciated. |
| 04:49 | CommandBot | Greetings! Send me a PM and I'll echo it back to you. If it contains the word 'die', I'll die as a bonus! |
| 05:04 | ddellacosta | what is a CommandBot |
| 05:07 | bitemyapp | ddellacosta: dunno, some bot that goes around |
| 05:09 | ddellacosta | huh |
| 05:14 | chare | I started reading this http://www.arcsynthesis.org/gltut/Basics/Tut01%20Making%20Shaders.html |
| 05:14 | chare | you guys mad at me for that? |
| 05:28 | Apage43 | oh gods |
| 05:28 | Apage43 | you're back |
| 05:31 | chare | Apage43 did you make progress in learning how starcraft 2 does pathfinding |
| 05:45 | borkdude | last monday I discovered that for support when and lets per binding, super useful |
| 05:45 | borkdude | didn't need it before, but when I did, was happy to find it supported it |
| 05:46 | mpenet | chare: look for A* probably, then do your homework on that. |
| 05:47 | chare | mpenet: already knew that part |
| 06:18 | dcunit3d | exit |
| 06:18 | borkdude | Programmers know the benefits of everything and the tradeoffs of nothing. -Rich Hickey |
| 06:47 | glosoli | hey, I have a string form db which holds filename, I somehow need to properly get it's extension so I would know if it can be handled with embed tag (pdf) or not any ideas ? |
| 06:55 | sm0ke | are there any ml libraries for clojure? |
| 06:55 | sm0ke | i couldnt find anything by googling "Machine Learning Clojure" |
| 07:16 | sm0ke | i can find a function to check if a channel is open in core.async? |
| 07:16 | sm0ke | cant* |
| 07:28 | mpenet | there isn't one as far as I know, you can either check for nil when you take, or try/catch when putting. |
| 07:33 | sm0ke | mpenet: yes got it thanks |
| 07:33 | silasdavis | i have the function (comp key first :data). Sometimes (:data foo) is nil |
| 07:33 | silasdavis | what's the neatest way to have the whole function return nil in that case? |
| 07:43 | mpenet | ,(doc some->) |
| 07:43 | clojurebot | "([expr & forms]); When expr is not nil, threads it into the first form (via ->), and when that result is not nil, through the next etc" |
| 07:43 | mpenet | something like #(some-> % :data first key) |
| 08:13 | silasdavis | ah yeah i'd forgotten about that |
| 08:14 | silasdavis | opted for (comp first first :data) |
| 08:14 | silasdavis | but less intelligible |
| 08:36 | Morgawr | is it possible to create some kind of deadlock (or livelock) by nesting a swap! call inside another swap! ? |
| 08:49 | sm0ke | Morgawr: Buhahahaha..exactly what i was asking a few days ago |
| 08:49 | sm0ke | Morgawr: but you are doing swap! for the same atom again or deifferent one? |
| 08:50 | Morgawr | sm0ke: it's more like a theoretical question, I haven't had this happen yet but I want to understand how it works |
| 08:50 | Morgawr | as far as I know swap! is a test-and-set! repeated until it succeeds |
| 08:51 | Morgawr | and I was thinking, if I swap! atom a and inside I swap! atom b |
| 08:51 | Morgawr | and then something else swaps b and then inside swaps a |
| 08:53 | sm0ke | i guess that could happen swap if nothing more than a function call first |
| 09:06 | glosoli | when would it be better to use re-seq over re-find ? |
| 09:12 | `cbp | you can just use re-seq always since re-seq is pretty much a lazy seq of re-finds |
| 09:13 | `cbp | or use re-find instead of (first (re-seq.. |
| 10:11 | lgs32a | i have written a library, feedback would be very welcome: https://github.com/lgrapenthin/state-node |
| 10:27 | SrPx | Hey, what is the complexity of equality test? Is it O(n) or O(1)? |
| 10:31 | opqdonut | SrPx: clojure's = is a deep true equality, unlike java's = |
| 10:31 | opqdonut | ,(= (list 1 2 3) (map inc (list 0 1 2))) |
| 10:31 | clojurebot | true |
| 10:31 | opqdonut | so I guess that would be "O(n)" in your parlance |
| 10:32 | mpenet | hmm it probably uses hashCode for collections |
| 10:32 | opqdonut | please also note that = ignores differences between sequence types |
| 10:32 | opqdonut | ,(= [1 2 3] (list 1 2 3)) |
| 10:32 | clojurebot | true |
| 10:33 | opqdonut | mpenet: I wouldn't be so sure |
| 10:33 | mpenet | ,(.hashCode (list 1 2 3)) |
| 10:33 | clojurebot | 30817 |
| 10:33 | mpenet | ,(.hashCode [1 2 3]) |
| 10:33 | clojurebot | 30817 |
| 10:33 | opqdonut | let's see. = is just a wrapper for clojure.lang.Util/equiv |
| 10:33 | SrPx | opqdonut: so it is not O(1)? |
| 10:34 | opqdonut | and equiv just calls pcequiv for collections |
| 10:34 | opqdonut | which calls the equiv method in IPersistentCollection |
| 10:34 | SrPx | mpenet: oh, cool! Really cool. That was my wonder, if it keep a tag with a hash in order to be O(1). Nice! |
| 10:36 | opqdonut | which in turn calls ASeq.equiv, which does not look at hashCode |
| 10:36 | opqdonut | https://github.com/clojure/clojure/blob/master/src/jvm/clojure/lang/ASeq.java |
| 10:36 | mpenet | sad :/ |
| 10:36 | stuartsierra | SrPx: Hashes are just an optimization to quickly determine that 2 things are *not* equal. |
| 10:36 | SrPx | stayes and you can be almost sure they are not equal when the test fails so actually deep testing should almost never happen anyway |
| 10:36 | opqdonut | and maintaining the hashCode inside every clojure data structure would make things more complicated and possibly less efficient |
| 10:36 | SrPx | stuartsierra: * |
| 10:37 | opqdonut | oh, ASeq actually does memoize the hashCode |
| 10:37 | opqdonut | but doesn't compute it incrementally |
| 10:37 | SrPx | opqdonut: why? I incremental hashing could be a fast operation |
| 10:37 | opqdonut | incremental hashing for e.g. a treemap is harder |
| 10:37 | SrPx | opqdonut: wow |
| 10:38 | opqdonut | also for a sequence with access to both ends |
| 10:38 | opqdonut | (e.g. vector) |
| 10:38 | stuartsierra | You also get help from persistent data structures, e.g. (let [a (list 1 2 3), b (cons 4 a)] (identical? a (rest b))) |
| 10:39 | stuartsierra | ,(let [a (list 1 2 3), b (cons 4 a)] (identical? a (rest b))) |
| 10:39 | clojurebot | true |
| 10:39 | opqdonut | only for lists, really, the characteristics of vectors and maps are more subtle |
| 10:41 | opqdonut | ,(let [a (zipmap (range 100) (range 100)) b (assoc a :c 1) c (dissoc b :c)] [(= a c) (identical? a c)]) |
| 10:41 | clojurebot | [true false] |
| 10:41 | stuartsierra | sure |
| 10:56 | wakeup | hi |
| 10:57 | wakeup | I am getting a NullPointerException when compiling a file. Any ideas how I could pin point closer to the problem, E.g. manually compile a specific file? |
| 11:03 | Foxboron | wakeup: try read the stack-trace |
| 11:03 | Foxboron | you usually gets something that could resemble a line number and a file name that should help you pinpoint the error |
| 11:04 | wakeup | Foxboron: Like a said, a NullPointerException, right at the top of an arbitrary file... |
| 11:04 | wakeup | it's rather unhelpful |
| 11:05 | Foxboron | wakeup: yeah, welcome to the world of clojrue debugging :) |
| 11:05 | wakeup | and I should note that all these files do evaluate correctly, and work. |
| 11:05 | Foxboron | clojure* |
| 11:05 | Pupnik | wakeup: you could load a particular file in the repl? |
| 11:05 | oholiab | is it possible to toggle off printing or return values in the repl? |
| 11:06 | wakeup | Pupnik: using what operator specifically? |
| 11:07 | Pupnik | wakeup: I normally use ctrl-alt-s in eclipse, I don't know how to do it normally |
| 11:08 | wakeup | nrepl-eval-buffer? |
| 11:08 | Pupnik | http://clojuredocs.org/clojure_core/clojure.core/compile will this do what you want? |
| 11:08 | wakeup | I tried using load but I don't know where it's searching for files, it doesnt find any |
| 11:09 | wakeup | ah I think I got it |
| 11:10 | wakeup | ok I can load and compile the file in questions |
| 11:11 | wakeup | but lein barfs |
| 11:11 | wakeup | not |
| 11:11 | wakeup | what the fk |
| 11:11 | wakeup | to hell.. |
| 11:11 | wakeup | probably some bad bytecode caches |
| 11:11 | wakeup | tis a hard problem we had this in CL for a long time too |
| 11:13 | asabil | Hi |
| 11:19 | mdrogalis | asabil: Hello. |
| 11:28 | wakeup | is there a way to get the project directory? |
| 11:28 | wakeup | e.g. using some leinigen magic? |
| 11:29 | wakeup | I have a file in the root of my project directory that I want to slurp at compile time. |
| 11:29 | wakeup | This only works partially since leinigen can't find it (nrepl can) |
| 11:29 | llasram | wakeup: Put it in resources/ and use `io/resources` |
| 11:30 | wakeup | Thanks llasram |
| 11:30 | llasram | er, `io/resource` |
| 11:30 | llasram | Although, what do you mean by "at compile time"? |
| 11:31 | wakeup | llasram: The file has to be read once, when the project is compiled. |
| 11:32 | wakeup | E.g. I have (let [foo (slurp file)] (defmacro ... |
| 11:33 | llasram | wakeup: Is this something where you expect to ship the input file in your distribution JARs and re-process it on each application startup? |
| 11:33 | wakeup | no |
| 11:33 | llasram | Or something you'd like to do once when building a distribution archive? |
| 11:33 | wakeup | yes kind of |
| 11:34 | llasram | The former is more common, and is what you'll get with the code you've described so-far |
| 11:34 | wakeup | No it's like I said: I need to read a file at compile time. |
| 11:35 | llasram | Yes, but there's no real separate compile-time in Clojure |
| 11:35 | wakeup | of course there is. |
| 11:35 | llasram | If you AOT the code you've describe above, it'll AOT code the code to read the file, not the results of reading thefile |
| 11:35 | wakeup | What's AOT? |
| 11:36 | vijaykiran | Ahead of Time compilation - http://clojure.org/compilation |
| 11:36 | llasram | Each form is read, macro-expanded, compiled, then run. But (a) those steps happen to each individual top-level form in sequence, and (b) typically happen from source each time you start your application |
| 11:37 | wakeup | What I have learned so far: CLojure tries to be a lisp, so it has LOAD and COMPILE, and they kind of work like expected. Which is that you can compile a macro or function before calling it. Ergo, stuff you do during compilation is "compile-time". |
| 11:37 | wakeup | AWhen I do java -jar MYAPP it will not recompile the source will it? |
| 11:37 | llasram | Unless you enable AOT compilation, it will |
| 11:38 | llasram | And even if you do enable AOT compliation, the generated code will just contain pre-compiled versions of static initializers to run your top-level forms. Not compiled results of evaluating those forms. |
| 11:39 | wakeup | Let me try to disprove that statement. |
| 11:39 | llasram | ok |
| 11:40 | wakeup | Ok you are right, that is insane... |
| 11:41 | wakeup | how do I enable this AOT compilation thing? |
| 11:41 | wakeup | Does clojure has something like EVAL-WHEN? |
| 11:42 | ToxicFrog | What does "EVAL-WHEN" do? |
| 11:42 | wakeup | It's a special form which lets you control the times at which forms will be evaluated. |
| 11:42 | wakeup | (in CL) |
| 11:43 | wakeup | eg load/top-level/compile |
| 11:43 | wakeup | But back to my problem: I need a way to slurp a file ONCE at build time. |
| 11:44 | llasram | wakeup: If you slurp it during macroexpansion and AOT-compile, you'll get something like the results you want |
| 11:46 | llasram | There's no EVAL-WHEN. I really have no idea what it would look like for Clojure |
| 11:46 | llasram | wakeup: Are you building an application or a library? |
| 11:46 | wakeup | aplication |
| 11:47 | llasram | Ok. I was checking because AOT is generally inappropriate for libraries, but is reasonable as a deployment optimization for applications |
| 11:47 | llasram | So yeah -- slurp your file during macro-expansion and enable AOT. That should get the effect you're trying to achieve |
| 11:50 | vmarcinko | hi, noob here who just started using "tools.logging"... I can see that by default (logging/info "My text" myArg1 "followed by" arg2) injects space between arguments, which i don't find wanted sometimes.. Is this default behaviour or some setting somewhere is set that way? Actually, i think println behaves same way... |
| 11:50 | wakeup | llasram: seems to work for my current intents and purposes, thanks for your help |
| 11:50 | llasram | wakeup: np |
| 11:51 | llasram | vmarcinko: Yeah, it works that way because that's how `println` does. You can either wrap the message in a call to `str` to first do un-spaced string concatenation, or use the `infof` `format`-style versions |
| 11:52 | vmarcinko | llasram: thanx a bunch |
| 11:52 | vmarcinko | like (infof "This is my argument: %s" arg) ? |
| 11:53 | wakeup | but I am still getting that weird nullpointer exception when doing lein run |
| 11:53 | llasram | vmarcinko: If it works, then yes :-) |
| 11:53 | wakeup | I can circumvent it by doinf load + compile on that file... |
| 11:54 | wakeup | so I am still stcuck with the problem that lein can not find my project root? |
| 11:54 | llasram | wakeup: Can you produce a minimum reproducing project example? |
| 11:56 | wakeup | hmm might be entirely unrelated...# |
| 11:59 | wakeup | llasram: not really, I don't know what causes it. |
| 11:59 | wakeup | I though it to be the slurp, but that's not it... |
| 11:59 | wakeup | and as compile load work just fine I don't even know how to pinpoint it |
| 12:00 | llasram | wakeup: Is the Compiler losing the line information? I thought most of those bugs had been fixed, but might still happen sometimes... |
| 12:00 | llasram | Because each top-level form happens separately, |
| 12:01 | llasram | "happens" -> is macro-expanded, compiled, and evaluated |
| 12:01 | wakeup | llasram: The line is the (ns ...) form. |
| 12:01 | wakeup | Not very telling. |
| 12:01 | llasram | You can try adding top-level `println`s to see how far it gets in the file before bailing out |
| 12:03 | seangrov` | ,(doc ffirst) |
| 12:03 | clojurebot | "([x]); Same as (first (first x))" |
| 12:03 | wakeup | lol! |
| 12:03 | seangrov` | silasdavis: ^^ |
| 12:03 | wakeup | You guys got caar :) |
| 12:03 | wakeup | ,(doc frest) |
| 12:03 | clojurebot | Cool story bro. |
| 12:03 | wakeup | I didn't think so. |
| 12:04 | llasram | ,(doc fnext) |
| 12:04 | clojurebot | "([x]); Same as (first (next x))" |
| 12:04 | wakeup | ,(doc next) |
| 12:04 | clojurebot | "([coll]); Returns a seq of the items after the first. Calls seq on its argument. If there are no more items, returns nil." |
| 12:04 | llasram | So we've got `cadr` too :-p |
| 12:05 | seangrov` | Sadly, no caaaddadddr :( |
| 12:05 | llasram | haha |
| 12:05 | llasram | Just use tools.macros and a Clojure version of the LoL dynamic ca*d*r macro |
| 12:06 | vmarcinko | i doubt this is possible, but no hurt in asking... Is there some way to specify for some value to print itself differently then as per default...In my case I have a function that returns a map, and don't ask me why, but I would like this map to be printed by default only at first nesting level, and not deeper. |
| 12:06 | seangrov` | llasram: You're right, it must be done |
| 12:07 | llasram | vmarcinko: Well, you have two options |
| 12:07 | llasram | (1) If you just need it printed that way here, just write a function to print the map that way and explicitly call it |
| 12:07 | wakeup | llasram: I wonder what Mr. Hoyte would have to say about clojure =) |
| 12:08 | dgrnbrg_ | Does anyone have a link to some complete example code using core.cache with atoms or refs? |
| 12:08 | wakeup | as for me, I am a big critic when it comes to clj, but I have to admit, I can get stuff done. |
| 12:09 | llasram | vmarcinko: (2) If the map has some separate type identity, then you add metadata for the :type key, then implement the `print-method` multimethod for the chosen :type value (usually a symbol or keyword) |
| 12:10 | llasram | wakeup: We only have 1 namespace, so it must be only half as powerful as CL |
| 12:10 | vmarcinko | llasram: thanx, i think I'll choose second option |
| 12:15 | utkarsh | Why does this match fail "(match "hi" (x :guard :string?) x" fail with "IllegalArgumentException No matching clause: h"? |
| 12:15 | wakeup | How do I get the IOException class interned? I thought that was included in clojure.java.io ? |
| 12:15 | utkarsh | "IllegalArgumentException No matching clause: hi"* |
| 12:15 | wakeup | llasram: I do agree whith his (entirely practical) argument for the Lisp-2 design. |
| 12:16 | utkarsh | (I'm using core.match) |
| 12:16 | ToxicFrog | wakeup: what argument is that? |
| 12:17 | llasram | utkarsh: I'm no expert on core.match, but it looks like it's always trying to match the match argument as sequence |
| 12:18 | wakeup | ToxicFrog: Are you familiar with variable capture? |
| 12:18 | utkarsh | llasram: found the problem, was supposed to be "string?" instead of ":string?" :) |
| 12:18 | technomancy | variable capture doesn't happen in clojure |
| 12:18 | llasram | wakeup: IOException is a Java class in the `java.io` package, so you'll need to :import/import it if you need to directly reference it |
| 12:19 | technomancy | well, unintentional CL-style symbol capture |
| 12:19 | sm0ke | hey good fellas, can a core.async channel also overflow and drop messages? |
| 12:20 | ToxicFrog | wakeup: not by that name |
| 12:20 | xeqi | sm0ke: if you use a dropping-buffer or sliding-buffer |
| 12:21 | sm0ke | xeqi:so a (chan) doesnt crash until the ram id filled? |
| 12:21 | wakeup | technomancy: I noticed that it throws an errer when you try do expand to a defn with a plain symbol as parameter. |
| 12:22 | technomancy | wakeup: right; forcing use of auto-gensym prevents unintentional symbol capture without making it completely impossible. |
| 12:22 | wakeup | ToxicFrog: Basically in a Lisp-2 we can do (when foo is a function): (let ((foo :bar)) (foo foo)) |
| 12:23 | xeqi | sm0ke: when the chan is full it "blocks" the producer |
| 12:23 | nathanic | sm0ke: a normal (chan) will block the writer until a reader consumes the value, so you can't overflow it |
| 12:23 | technomancy | none of the wacky scheme-isms where you need two macro systems (an easy-to-use one and a powerful one) but none of the pitfalls of CL's error-prone system |
| 12:23 | wakeup | ToxicFrog: So there are two seperate namesaces for two seperate appliances of symbols (functions/macros and values) |
| 12:24 | wakeup | technomancy: It's ok you don't have to persuade me. |
| 12:24 | seangrov` | Anyone using hiccup-alike syntax know how I can reproduce <script defer src="..."></script> ? |
| 12:24 | sm0ke | xeqi: nathanic: so does that mean that for thousand unconsumed messages i will habe 1000 goroutines hanging around? |
| 12:24 | wakeup | ToxicFrog: The downside of that seperation is the #'function syntax, the upside is that you can to think only 50% as hard whenever you bind a symbol. |
| 12:24 | seangrov` | I'm not sure how to include the defer attribute that doesn't have and value |
| 12:24 | sm0ke | if i am doing (go (>! c 1)) that is |
| 12:25 | wakeup | ToxicFrog: Which happens especially often when writing macros. |
| 12:25 | nathanic | sm0ke: you won't get to 1000 messages, because after message 1 the writer process will be blocked |
| 12:25 | ToxicFrog | wakeup: (let ((foo :bar)) (foo foo)) -- personally, I don't consider that a feature; it is vile. |
| 12:26 | nathanic | sm0ke: then (ideally) a reading process will consume the value, and then the writer will wake up, able to proceed and write another value |
| 12:26 | wakeup | ToxicFrog: doesn't matter, thousands of programs have shown that it is very preferable in practice |
| 12:27 | sm0ke | nathanic: for all that you are assuming i have a sigle producer |
| 12:27 | sm0ke | nathanic: i was asking what is i issue writes on channel inside a go block? |
| 12:28 | wakeup | ToxicFrog: That's the beauty of this issue: Anyone would instinctly despise that approach (why would a lisp seperate data and code, after all the key concept is data = code). |
| 12:28 | sm0ke | then i will have that many number of go routines waiting right? |
| 12:28 | mpenet | seangrov`: isnt' defer=true equivalent? |
| 12:28 | wakeup | ToxicFrog: Programming practice has shown the opposite though, so that is a proff that aesthetics isn't everything. |
| 12:29 | technomancy | careful with all that hand-waving; you'll sprain your wrist |
| 12:30 | seangrov` | mpenet: It looks like it might be? Hard to tell :P |
| 12:30 | seangrov` | I'll give that a try, we'll see if the site blows up later I suppose |
| 12:30 | technomancy | I mean if we're going to go with anectodal evidence, lisp-2 makes higher-order functions in elisp so cumbersome that basically no one even bothers |
| 12:30 | klrr_ | may i ask a queston regarding the (nth) function? |
| 12:30 | klrr_ | regarding its design |
| 12:31 | xeqi | sm0ke: yes |
| 12:31 | sm0ke | thanks! xeqi |
| 12:31 | wakeup | technomancy: can you give an example? I am not upo to date with elisp. |
| 12:32 | sm0ke | xeqi: i am finding my self replacing a lot of atoms in my code with channels, do you think this is a more concrete design ? |
| 12:33 | llasram | klrr_: Easier to just ask :-) |
| 12:33 | technomancy | wakeup: the fact that you can't operate on functions "immediately" but have to translate them to and from values means you won't bother for something simple |
| 12:34 | klrr_ | well, i got very limited experience in lisp, and non clojure experience , but why does clojure make same problem as racket? when you read "(nth '(...) n)" you dont care a single bit of the list itself, you care firstly about which element you want to take right? i think this is missdesign tbh, but there may be a explanation |
| 12:34 | technomancy | like (transform (apply-partially #'some-thingy) x y) <- it's not just the #' syntax; transform has to call funcall to actually use its argument |
| 12:34 | wakeup | technomancy: I assume you mean (function sym) or #'sym? |
| 12:34 | sm0ke | i guess i was actually emulating a channel with an (def a (atom [])) and (swap! a rest).. |
| 12:35 | llasram | klrr_: Hmm, I don't follow. Could you give a more detailed example of what you mean? |
| 12:35 | xeqi | sm0ke: I'm split on the share nothing architecture easily done with channels vs smart shared state done with atoms |
| 12:35 | technomancy | so typically transform ends up as a macro |
| 12:35 | klrr_ | llasram: sure give me a sec |
| 12:35 | technomancy | which means you can't use *it* in a higher-order way either |
| 12:36 | wakeup | technomancy: That doesn't make any sense. If there is any diference between (foo bar) and (funcall foo bar) it is explicity. |
| 12:36 | technomancy | it's boilerplate |
| 12:36 | wakeup | technomancy: no it's not, it's a distinction |
| 12:36 | nDuff | klrr_: is it the order of arguments you're referring to? |
| 12:37 | klrr_ | yes |
| 12:37 | nDuff | klrr_: there's convention around collection functions' argument ordering, relied on by macros like ->> |
| 12:37 | llasram | ,(doc nth) |
| 12:37 | clojurebot | "([coll index] [coll index not-found]); Returns the value at the index. get returns nil if index out of bounds, nth throws an exception unless not-found is supplied. nth also works for strings, Java arrays, regex Matchers and Lists, and, in O(n) time, for sequences." |
| 12:37 | nDuff | klrr_: nth follows that convention by putting the collection first. |
| 12:37 | klrr_ | what is easiest to read. this: "(nth '(1 2 23 2 3 123 12 4 124 324 234 2) 3)" or this "(nth 3 '(1 21 312 31 13 321 123))"? |
| 12:37 | klrr_ | putting collection first seems like missdesign, or is there any compelling argument for it? |
| 12:37 | nDuff | klrr_: (->> coll ... (filter ...) (nth 3)) |
| 12:37 | technomancy | wakeup: it means functions aren't really first-class. you can't treat them like regular values; you always need to shift them to and from the functional ghetto. |
| 12:38 | Pupnik | i thought collection was first because clojure needs it to be first so it can dispatch on type correctly |
| 12:38 | wakeup | technomancy: It sound's like you don't see any of the upsides of function/value seperated namespaces. If that is the case, then of course there is no sense in arguing about the trade-off. |
| 12:38 | llasram | nDuff: Wouldn't that be more that `nth` breaks that convention by being a collection function which puts the collection first? :-) |
| 12:38 | nDuff | ...oooh. |
| 12:38 | llasram | klrr_: No idea. It's bugged me too. It does seem like the argument order should be reversed |
| 12:38 | nDuff | That's actually right. |
| 12:38 | technomancy | wakeup: sure |
| 12:38 | wakeup | technomancy: buzzword hyperbole. you have no idea what you are talking about. |
| 12:38 | llasram | boo |
| 12:39 | llasram | ~gentleman |
| 12:39 | clojurebot | Huh? |
| 12:39 | llasram | man, I do that every time |
| 12:39 | klrr_ | well, gtg :P sry to ask questions that should be asked when yhou are experienced with the language |
| 12:39 | llasram | ~gentlemen |
| 12:39 | clojurebot | You can't fight in here. This is the war room. |
| 12:40 | wakeup | I don't have to add anything. technomancy just invalidated him/her/self |
| 12:40 | technomancy | I've written a lot of elisp. it isn't pretty. |
| 12:40 | technomancy | but I'll drop it. |
| 12:40 | wakeup | I agree, elisp isn't pretty |
| 12:40 | llasram | (inc technomancy) |
| 12:40 | lazybot | ⇒ 80 |
| 12:40 | llasram | For both being right and being the better human :-) |
| 12:44 | sm0ke | is walking dead an oxymoron? |
| 12:46 | nDuff | wakeup: you make a point that (let ((foo :bar)) (foo foo)) (with a foo fn in its own namespace) is a thing you *can* write in a LISP-2, but I can't imagine under what circumstances it would be a good idea. |
| 12:47 | ToBeReplaced | nDuff: me too |
| 12:48 | amalloy | nDuff: i dunno about you, but i sometimes name locals "name", and then later try to call name on something else |
| 12:49 | amalloy | i don't think lisp-2 is the solution, but it's a class of hard-to-notice bugs i wouldn't have to deal with |
| 12:50 | technomancy | you wouldn't need much beyond local inference to catch that |
| 12:50 | ToBeReplaced | amalloy: for better or worse, i just don't allow shadowing... seems better to just use name-str or tag |
| 12:51 | TimMc | Seems like a tooling problem. :-) |
| 12:51 | amalloy | ToBeReplaced: i'm not telling you about this because i find it impossible to write good code and need solutions. i'm bringing it up as a problem lisp-1 has that lisp-2 doesn't |
| 12:51 | TimMc | "Watch out dude, you just shadowed a var with a local." |
| 12:51 | amalloy | that there are solutions to it within lisp-2 isn't really germane |
| 12:51 | technomancy | TimMc: the other problem is that you'd catch the error in the repl before you bothered to run a full type-check |
| 12:52 | ToBeReplaced | yeah, i know, i'm suggesting that "this is a problem you have to deal with in lisp 1" is a bad argument because even if you are in lisp 2, you probably shouldn't write code that way |
| 12:52 | amalloy | i don't think that's true |
| 12:53 | amalloy | but it's a reasonable point of view |
| 12:54 | xeqi | technomancy: did you like types before your ocaml stuff? |
| 12:54 | rhg135 | I was wrong, you can write horrid clojure without macros |
| 12:55 | Morgawr | now that the channel is more active... I'll ask again, is it possible to get into a deadlock/livelock/whatever when using nested swap! functions (of different atoms) |
| 12:55 | Morgawr | like nesting them in concurrent statements in the inverted order (similar to classic deadlocks when dealing with multiple nested locks in other languages) |
| 12:55 | technomancy | xeqi: I didn't really like it in Mirah because inference only worked on locals, which meant the longer your methods were, the more bang-for-buck you got from the inference, which lead to bad code |
| 12:56 | technomancy | xeqi: there are a few places it's awkward in ocaml; mostly around serialization so far. but I've written less than 1kloc still. |
| 12:57 | xeqi | technomancy: have you checked out property based checking yet? |
| 12:57 | technomancy | no, I haven't |
| 12:57 | dublindan | I'm playing with pedestal, Does anybody know how I would convert a single-function ring middleware (eg wrap-foo) to pedestals interceptors? |
| 12:58 | `cbp | dublindan: there is a #pedestal channel in case you haven't asked there yet :-) |
| 12:59 | ToBeReplaced | dublindan: i think there's a `handler` interceptor in io.pedestal.service.interceptor |
| 12:59 | seangrov` | Is friend the standard way to integrate with *external* oauth endpoints? For example, if I want to implement gmail authentication in my app |
| 12:59 | TimMc | Morgawr: I'd ask you to provide an example of what you're talking about, but I guess that would be the point, wouldn't it... |
| 13:00 | dublindan | `cbp: thanks, I'll check there :) |
| 13:00 | indigo | Morgawr: I was debugging a weird race condition with clauth; it involved two atoms |
| 13:00 | TimMc | Morgawr: Deadlock should be impossible (since there are no locks) but livelock... |
| 13:00 | indigo | I don't know whether that is the fault of the two atoms though |
| 13:00 | seangrov` | It looks like it might be... |
| 13:01 | indigo | Still can't make heads or tails of it |
| 13:01 | TimMc | seangrov`: Bear in mind that using OAuth for authentication (instead of authorization) is tricky business. |
| 13:01 | TimMc | Anywhere the spec says SHOULD or RECOMMENDED, read it as MUST. |
| 13:02 | Morgawr | TimMc & indigo: I don't have an actual example (because I can't quite come up with one), it's more of a theoretical question... I'm always concerned when using atoms (as one should always be when dealing with concurrency) and try to make sure I don't cause race conditions and issues |
| 13:02 | Morgawr | from what I can tell, swap! is implemented as a repeated test-and-set! |
| 13:02 | seangrov` | TimMc: heh, I'm porting the final bit of our rails app to clojure today, and that involved about ~20 Oauth integrations we've done over the past year |
| 13:02 | Morgawr | however I was wondering if the outer swap on atom a repeats until swap on atom b (inner) succeeds.. and then the same happens when another thread works on swap! atom b and swap! atom a (inner) |
| 13:02 | TimMc | &(let [a (atom 0)] (swap! a (fn [_] (swap! a inc)))) |
| 13:03 | lazybot | Execution Timed Out! |
| 13:03 | TimMc | Welp. |
| 13:03 | seangrov` | The rails code is pretty messy, but works more or less. Nervous about porting it, but everything else has ported so smoothyl, I'm optimistic |
| 13:03 | TimMc | But yeah, I think friend is what people use. |
| 13:04 | jonasen | dnolen: ping |
| 13:04 | TimMc | Morgawr: I think you could get into deadlock, yes. |
| 13:04 | seangrov` | Looks like it does quite a bit more than what I need, but I'll give it a god |
| 13:04 | ToBeReplaced | i think the community is ready for friend to get ripped apart |
| 13:05 | seangrov` | jonasen: Would love to see a button on refheap, "Run in cljsfiddle" :) |
| 13:05 | Morgawr | TimMc: I guess I should come up with more testing and see if I can provide a real example.. it just worries me a bit that I haven't seen this mentioned before |
| 13:05 | jonasen | seangrov`: heh |
| 13:05 | Morgawr | (or maybe I haven't checked deep enough on the internet) |
| 13:05 | ToBeReplaced | i'd like to see parallel dev moving on pedestal interceptors to get away from exceptions as control flow and the like |
| 13:06 | rasmusto | ,(and 't nil) |
| 13:06 | clojurebot | nil |
| 13:06 | jonasen | seangrov`: you have been working on the cljs compiler, maybe can shed some light on this: https://www.refheap.com/19212 |
| 13:07 | gfredericks | has anybody made a clojure lib for immutable PRNGs? |
| 13:07 | jonasen | cljs/-compile is stateful, is that necessary? |
| 13:07 | cark | Q: i can't print to the nrepl repl from a thread, I tried rebinding *out* but it still doesn't work, is there a solution to that ? (used to work fine with slime) |
| 13:08 | cark | tests are working from the repl, but not from compiled files |
| 13:08 | gfredericks | cark: try bound-fn? |
| 13:08 | cark | gfredericks: mhh how let me check that one =) |
| 13:08 | cark | -how |
| 13:09 | ToBeReplaced | TIL: bound-fn |
| 13:09 | seangrov` | jonasen: Looking for where the state is modified now... |
| 13:10 | gfredericks | (.start (Thread. (bound-fn [] (println 42)))) |
| 13:10 | seangrov` | What's in ana/*cljs-ns* at that point? |
| 13:10 | seangrov` | I'll load up a repl and try this out too |
| 13:10 | cark | gfredericks: it works, tho it doesn't make sense at all, shoul be the same as (let [o *out*] (Thread. (binding [*out |
| 13:11 | cark | * o] ... |
| 13:11 | gfredericks | cark: I think nrepl uses other vars too |
| 13:11 | cark | oh I see |
| 13:11 | gfredericks | so bound-fn covers everything |
| 13:11 | cark | gfredericks: thanks ! |
| 13:11 | gfredericks | no idea what the rest is though |
| 13:12 | cark | now let's hope this won't mess my ring thingie |
| 13:12 | llasram | cark: Also, in your example you're only re-binding *out* for the scope of creating the runable you pass to Thread. E.g., not for the scope of actually *running* in the thread |
| 13:13 | llasram | s,E.g.,I.e., ;; Latin! |
| 13:13 | cark | llasram: actually i forgot the # in front of binding |
| 13:13 | llasram | Oh, ok :-) |
| 13:13 | cark | that's the trouble when typing stuf in irc real fast =) |
| 13:14 | seangrov` | Damn, still can't paste to refheap |
| 13:14 | seangrov` | jonasen: https://gist.github.com/sgrove/63a57d2056d0b444cd5d |
| 13:14 | seangrov` | Working off of master |
| 13:15 | jonasen | seangrov`: note that in the second case I require clojure.set :as s and not clojure.string :as s |
| 13:15 | seangrov` | Ah, sorry |
| 13:15 | seangrov` | Ok, yes, I can reproduce that |
| 13:16 | Morgawr | http://www.morgawr.eu/p/1380818608.png okay, interesting, I'm not getting any deadlocks/livelocks or issues with this case of nested swaps... might be a very naive test that doesn't mean much (more complex stuff might be troublesome, idk) |
| 13:16 | Morgawr | but yeah, at least this works |
| 13:17 | dark_element | Is there any way to clojure.test tests in parallel ? |
| 13:18 | jonasen | seangrov`: the stacktrace points to https://github.com/clojure/clojurescript/blob/master/src/clj/cljs/analyzer.clj#L717 |
| 13:18 | dark_element | to run* |
| 13:19 | cark | gfredericks: hah won't work for a ring hanler, i guess it's due to jetty creating more threads |
| 13:23 | wakeup | This compilation NullPointerException is really bugging me. |
| 13:24 | wakeup | It happens when I require a specific namespace, but the namespace in questions isn't different to other namespaces in any way. |
| 13:24 | wakeup | and like I said, loading and compiling manually works just fine. |
| 13:24 | seangrov` | jonasen: Yeah, looking at the state after running the analyze step, a 'foo namespace is created in clojure-land, and (ns-aliases 'foo) => {s #<Namespace clojure.string>} |
| 13:25 | wakeup | I'd love to post a minmal reproduction, but I don't see what's peculiar about this case... |
| 13:26 | jonasen | maybe a call to http://clojure.github.io/clojure/clojure.core-api.html#clojure.core/ns-unalias right before would fix the issue |
| 13:26 | seangrov` | jonasen: I wonder if there's an alternative, or if the analyzer should destroy the namespaces its created |
| 13:26 | Morgawr | https://twitter.com/Daverecruit/status/385784111098363905 :D |
| 13:27 | jonasen | seangrov`: I think the only reason for that piece of code is to allow ::foo/bar forms |
| 13:27 | seangrov` | Yeah |
| 13:29 | nDuff | Morgawr: Nice. |
| 13:29 | indigo | wakeup: Maybe you're mixing in runtime information somewhere |
| 13:29 | Morgawr | just found it on my tweet feed, thought somebody might be interested |
| 13:29 | wakeup | indigo: Found it |
| 13:29 | indigo | wakeup: What was the issue |
| 13:29 | wakeup | indigo: I was redefining send, apparently lein didn't like that. |
| 13:29 | indigo | Ah |
| 13:30 | silasdavis | is there an function (f nil) = () |
| 13:30 | wakeup | indigo: But still imho this is a bug, if now only for the nullpointer exeption |
| 13:30 | nDuff | ...which reminds me -- anyone in the Chicago area recommend a local recruiter to talk to? I've got good contacts here in Austin, but planning a move in April. |
| 13:30 | silasdavis | but (f x) = x |
| 13:30 | technomancy | silasdavis: (let [f (partial apply list)] (f nil)) |
| 13:30 | indigo | wakeup: Time to file a lein issue I guess |
| 13:30 | technomancy | oh |
| 13:31 | rasmusto | silasdavis: see fnil |
| 13:31 | xeqi | (map (fnil identity '()) [nil 1 2]) |
| 13:31 | xeqi | &(map (fnil identity '()) [nil 1 2]) |
| 13:31 | lazybot | ⇒ (() 1 2) |
| 13:31 | wakeup | indigo: can you point me to some place I can easily file one? I am not too involved with the clojure community. |
| 13:32 | llasram | wakeup: Do you have a reproducing example? I'm having trouble envisioning how this would be a Leiningen bug |
| 13:32 | wakeup | llasram: I will try to produce one right now. |
| 13:32 | llasram | ok |
| 13:32 | llasram | cool |
| 13:33 | gfredericks | send help, I am about to implement the mersenne twister in clojure |
| 13:36 | wakeup | llasram: apparently not as easy as I thought. |
| 13:38 | wakeup | ah got it |
| 13:39 | wakeup | llasram: if you want I'll zip up the project and up it somewhere. |
| 13:39 | wakeup | for some reason I have to do lein uberjar to trigger the error on the minimal repro, but it is the error. |
| 13:40 | llasram | wakeup: Yeah, go ahead and toss it up somewhere |
| 13:40 | indigo | wakeup: If it's a leiningen bug, file it on GitHub at https://github.com/technomancy/leiningen |
| 13:42 | slpsys | hey, potentially dumb question: is there a clojure-idiomatic way to get the namespace of the calling function, or would i have to drop into java reflection? |
| 13:42 | wakeup | llasram: http://www.math.uni-bonn.de/people/max/foo.zip |
| 13:42 | llasram | foo! |
| 13:42 | wakeup | foo :) |
| 13:42 | wakeup | lein uberjar triggers the error for me |
| 13:43 | wakeup | "Warning: specified :main without including it in :aot. " |
| 13:44 | wakeup | I think that's the reason why it doesn't on lein run with the example |
| 13:44 | `cbp | slpsys: if the function comes from a bar you can get the ns from the meta, like ##(-> #'conj meta :ns) |
| 13:44 | lazybot | ⇒ #<Namespace clojure.core> |
| 13:45 | `cbp | s/bar/var |
| 13:47 | llasram | wakeup: Depending on your leiningen version, it may not be doing AOT for :main -- there was a bug for one release where it not only warned it was deprecated, but actually didn't do it :-) |
| 13:47 | wakeup | Doesn't matter in this case afaik |
| 13:48 | llasram | But when you uberjar, it does AOT for everything, because that's in the :uberjar profile |
| 13:48 | wakeup | anyways I just upgraded my lein to rle out some old bug |
| 13:48 | llasram | Oh, ok |
| 13:48 | wakeup | have you tried the example? It really is minimal (4 Loc or so) |
| 13:49 | llasram | I have, and I vaguely recall seeing it before actually |
| 13:49 | coventry | wakeup: How do you generate the NPE from that? (require 'foo.namespace) works fine for me in nrepl and "lein repl". |
| 13:49 | llasram | Trying to dredge up from swap... |
| 13:49 | wakeup | coventry: try lein uberjar |
| 13:49 | indigo | Lots of warnings |
| 13:49 | indigo | And then a NPE |
| 13:49 | wakeup | llasram: me too, right when I started messing around with clojure. Was quite frustrating ;) |
| 13:50 | coventry | Yep, that works |
| 13:50 | coventry | (i.e., generates a NPE.) |
| 13:50 | wakeup | ;) |
| 13:50 | wakeup | success :P |
| 13:51 | coventry | FWIW, (ns foo.namespace (:refer-clojure :exclude [send])) fixes the problem. |
| 13:53 | indigo | Clojure debugging is definitely a weak point |
| 13:53 | indigo | But I'm sure that there's work being done on improving it |
| 13:53 | wakeup | agree, but also agree that it can be approved |
| 13:53 | technomancy | sounds like http://dev.clojure.org/jira/browse/CLJ-1241 |
| 13:54 | wakeup | since Java has exceptions, you guys can at least get rid of the java stack traces,´ |
| 13:54 | technomancy | love the last comment on that one btw. really makes me want to report more bugs. |
| 13:54 | bitemyapp | seangrov`: were you at the meetup last night? I missed you. |
| 13:54 | llasram | Ah, yes, that's exactly it |
| 13:55 | bitemyapp | Saw a bunch of others though. Rohner, Tellman, etc. :) |
| 13:55 | indigo | technomancy: Sarcasm? ;P |
| 13:55 | wakeup | yeah thats it |
| 13:55 | technomancy | indigo: sarcasm about Jira? inconceivable! |
| 13:55 | wakeup | what does hickey mean by triage guidelines? |
| 13:56 | technomancy | wakeup: ugh who knows |
| 13:56 | coventry | technomancy: Where are the triage guidelines documented? I would really like to get this bug fixed, but I see similar bugs having languished for years. http://dev.clojure.org/jira/browse/CLJ-1275 |
| 13:56 | technomancy | there are very specific steps for contirbuting to clojure which are understood by like two and a half people total |
| 13:56 | coventry | Well, at least a yea. |
| 13:57 | wakeup | :) |
| 13:57 | indigo | We need some Clojure JIRA janitors |
| 13:57 | xeqi | indigo: alex miller has been doing stuff in that area recently |
| 13:57 | technomancy | maybe it's gotten better since I tried last, but I've basically given up on pushing upstream |
| 13:57 | xeqi | I kinda read the last comment as directed at him |
| 13:57 | indigo | technomancy: Yikes. |
| 13:58 | rasmusto | every month or so I run into a problem at work that I want to apply core.logic on, is this normal? |
| 13:58 | wakeup | if it makes you feel better, we have these issues too in the CL community... |
| 13:58 | wakeup | try to get the implementors agree on something! :) |
| 13:58 | technomancy | heh |
| 13:58 | wakeup | they are all nice and awesome people, but this stuff is just hard |
| 13:59 | wakeup | Have any of you guys tried ABCL? |
| 13:59 | wakeup | I wonder how it performs |
| 14:00 | wakeup | Because that is the thing I'd have recommended to my client instead of clojure if anything. |
| 14:02 | wakeup | By the way, before I forget, I have a question about clojure concurrency |
| 14:02 | wakeup | (very foreighn to me, I am used to locks and stuff) |
| 14:03 | wakeup | When I have two concurrent (dosync (something-impure) (ref-set x)) blocks, will I be in trouble? |
| 14:04 | technomancy | wakeup: the impure thing needs to be idempotent |
| 14:04 | bitemyapp | idempotence is a really nice property to understand and embrace when it's available |
| 14:05 | bitemyapp | I try to make my message propagation stuff idempotent as often as possible. Makes life so much better. |
| 14:05 | technomancy | I think the docs say dosync can't contain any side-effects apart from alter/commute/ref-set, but idempotent ones are OK. |
| 14:05 | wakeup | hmm I would love not to worry about what impure-stuff does |
| 14:05 | wakeup | as it opens an sqlite database and writes to it. |
| 14:05 | bitemyapp | don't do that. |
| 14:06 | technomancy | the important thing to remember is that transactions will retry |
| 14:06 | wakeup | How would I go about evaluating (impure-stuff) atomically? |
| 14:06 | danlentz | technomancy: regarding the use of +style+ naming… I understand that the norm is for values to be immutable and the CL style naming convention does not jive in that respect, but I think that it is still a helpful convention in the sense that it clearly distinguishes the var as not a _function_. This is in particular useful given closure's lisp-1 namespace. Are there other reasons why you'd consider it to be bad style? |
| 14:06 | technomancy | wakeup: sorta-hacky thing to do is to queue the write up in an agent; it will only fire if the transaction succeeds |
| 14:06 | technomancy | but it's still not atomic; the transaction won't fail if the db write fails |
| 14:07 | wakeup | E.g. I don't care in which order multiple calls to impure-stuff are evaluated, but they may not overlap. |
| 14:07 | bitemyapp | danlentz: it's bad style. |
| 14:07 | wakeup | So as far as I can tell, I am looking for a lock |
| 14:07 | bitemyapp | wakeup: no, you're looking for better code. |
| 14:07 | technomancy | danlentz: at the very least people will look at you funny like you put your parens on their own line |
| 14:08 | bitemyapp | if somebody submitted me a PR with +nomenclature+ I would reject it out of hand. |
| 14:08 | seangrov` | bitemyapp: Yeah, saw your talk, was well done - looking forward to you fleshing it out more |
| 14:08 | technomancy | danlentz: usually a var having a name that is not a verb/property is enough |
| 14:09 | seangrov` | I left probably around 10 or so, didn't get to mingle too much |
| 14:09 | bitemyapp | seangrov`: ahh, that's why. I'm glad the talk wasn't terrible. :) |
| 14:09 | wakeup | bitemyapp: Then how do I make (jdbc/execute! spec [query key value]) thread-safe? |
| 14:09 | coventry | It appears that the official triage guidelines are here: http://dev.clojure.org/display/design/JIRA+workflow+update just after the huge flow diagram. |
| 14:10 | bitemyapp | wakeup: back it up. What are you trying to do? |
| 14:10 | danlentz | is there some other convention more appropriate to visally distinguish special symbols that are intended to be essentially well known global values so as to distinguish from the rest of the flotsam and jetsam? |
| 14:10 | bitemyapp | wakeup: just in an abstract sense. |
| 14:10 | bitemyapp | danlentz: all named vars are global in Clojure. Only local bindings are local. |
| 14:11 | wakeup | bitemyapp: Some code writes to a file, it gets called concurrently, I want the file-writes to happen atomically |
| 14:11 | bitemyapp | danlentz: there's *nomenclature* for dynamic vars, which is intended to be a warning. |
| 14:11 | wakeup | bitemyapp: e.g. usually I'd have a lock which must be held to do the file writing. |
| 14:11 | bitemyapp | wakeup: how serious is this code? |
| 14:11 | wakeup | it's a simplified example. |
| 14:12 | bitemyapp | wakeup: also, the earlier suggestion to use an agent was apropos: http://lethain.com/a-couple-of-clojure-agent-examples/ |
| 14:12 | wakeup | since you asked for once. |
| 14:12 | technomancy | wakeup: you can through an agent or j.u.c queue |
| 14:12 | technomancy | *you can serialize |
| 14:12 | technomancy | but not in a way that causes the transactions to fail |
| 14:12 | bitemyapp | wakeup: I think it would be educational to write code that breaks first (races), and then fix it. But for this sort of thing, use an agent or a queue. |
| 14:12 | bitemyapp | wakeup: stop resorting to locks. You can do better than that. |
| 14:13 | technomancy | trying to make the STM atomic with things that aren't refs is really, really hard |
| 14:13 | wakeup | bitemyapp: how can I resort to locks, clojure doesn't have any |
| 14:13 | danlentz | of course. but some values are distinguished in that they are special static constants. e.g., a node-id of the machine. Or in my case a group of associated bit mask values +ub4+. +ub8+, +ub16+ +ub32+, +ub648+ |
| 14:13 | TimMc | wakeup: clojure.core/locking |
| 14:13 | wakeup | nooo! |
| 14:13 | wakeup | ;) |
| 14:13 | bitemyapp | wakeup: lol, that's patently not true. I'm just trying to get you to work smarter. |
| 14:13 | technomancy | wakeup: https://groups.google.com/forum/#!topic/clojure/VhIwdJvgLyg <- possibly relevant |
| 14:14 | TimMc | Just saying that it *does* have locks. |
| 14:14 | TimMc | (NOt saying that you should use them.) |
| 14:14 | danlentz | these are definitely not intended to be construed as dynamoc vars |
| 14:14 | wakeup | TimMc: Yes thank you. My bad. |
| 14:14 | technomancy | danlentz: so you're worried about people mistaking ub4 for a function? |
| 14:14 | technomancy | that seems very unlikely |
| 14:15 | bitemyapp | danlentz: you realize that when people switch from a lisp-2 to a lisp-1, they don't suddenly attempt to (blah) everything right? |
| 14:15 | bitemyapp | danlentz: you're looking for guard rails that you don't need. |
| 14:15 | bitemyapp | chill out. |
| 14:15 | bitemyapp | use typed clojure if you're that worried about having a dumb. |
| 14:15 | wakeup | I think agents are what I am looking for. |
| 14:16 | technomancy | danlentz: besides, if you type "(ub4 " in your clojure source file, emacs won't display arglists in the minibuffer, which makes it pretty clear =) |
| 14:16 | danlentz | i dunno. It seems expressive and clear in its intent to me. I'm not sue how one can endorse *earmufs* while flat out rejectiong this type of naming |
| 14:16 | indigo | Yay, ordered a Clojure mug |
| 14:16 | wakeup | agents are just automagic locks arent they? |
| 14:16 | technomancy | earmuffs are about sending a clear message that your normal scoping rules don't apply. dynamic scope is a lot more error-prone than lexical scope. |
| 14:17 | bitemyapp | wakeup: no they aren't, but they're useful for serializing writes to a resource. |
| 14:17 | technomancy | wakeup: agents are at their core a reference type like refs. but because they're convenient they get used for a bunch of other things too. |
| 14:17 | danlentz | no i'm looking to have them easily accessible by +-TAB key sequence for autocomplete |
| 14:17 | bitemyapp | danlentz: you're not some kind of antediluvian lisper are you? you're down with lexical scope too right? |
| 14:17 | danlentz | and visually distinguished when used in the body of some code |
| 14:18 | danlentz | :) |
| 14:18 | bitemyapp | danlentz: stop trying to be a special snowflake and just write some Clojure code. |
| 14:18 | bitemyapp | danlentz: Clojure Clojure, not danlentz Clojure. |
| 14:18 | llasram | bitemyapp: breathe? |
| 14:18 | bitemyapp | llasram: I am breathing. this is zen instruction. |
| 14:19 | rasmusto | *snowflake* |
| 14:19 | coventry | http://dhammatalks.org/Archive/y2013/130426_The_Wrong_Uses_of_Right.mp3 :-) |
| 14:19 | danlentz | thanks for that. I'm enjoying clojure. my background is in common-lisp, where we also have conventions, but in general i've found that the reasonng behind them to be more lucid than fear of snowflakees |
| 14:20 | bitemyapp | danlentz: I'm one of the other Common Lispers here. |
| 14:21 | bitemyapp | danlentz: I learned faster and became a better Clojure programmer when I forgot what I knew and just learned Clojure. |
| 14:21 | llasram | danlentz: If I'm following what you're trying to do, I think a more typical approach in Clojure would be to put all of these values in their own namespace which you then :require :as some single-letter alias. Then you get `u/b4` etc |
| 14:21 | danlentz | Common-Lisp tends to foster independent minded thinking as a whole…. Clojure is a very different approach to language design. |
| 14:21 | bitemyapp | ^^ what llasram says is solid, but again, you can learn this stuff if you just write Clojure. |
| 14:21 | mtp | you can only learn how to use a tool by picking it up and playing with it |
| 14:21 | mtp | book learning only goes so far |
| 14:22 | danlentz | llasram: ah. good idea. that is a reasonble solution. |
| 14:22 | llasram | mtp: For programming languages I find reading lots of code written the language helps at least as much. And reading the language implementation |
| 14:22 | mtp | llasram that would be "immersion" |
| 14:22 | mtp | which is part of picking the tool up |
| 14:22 | llasram | agreement -- achieved! :-) |
| 14:23 | zoldar | as soon as I switch to clojure-mode in emacs, shift-c is treated as ctrl. In every other major mode it just outputs a capital c. I've tried disabling all the minor modes but it didn't change anything. That may be the cause of that binding change? |
| 14:23 | zoldar | what* |
| 14:23 | TimMc | mtp: That includes bandsaws. :-D |
| 14:23 | mtp | TimMc don't touch the bandsaw until you've gotten the hang of the screwdriver! |
| 14:24 | zeroem | zoldar: do you have any other packages installed? I just fired up emacs+paredit+clojure-mode and shift-c works fine |
| 14:24 | TimMc | s/ until you've gotten the hang of the screwdriver!// |
| 14:24 | danlentz | yes I am not having too hard of a time for the most part. It took a bunch of years before i could work in CL productively. I'm getting things done in clojure after a few weeks. |
| 14:25 | zoldar | zeroem: yes I have, but I've also tried disabling paredit-mode as well as other minor modes to narrow the issue down to clojure-mode being enabled |
| 14:25 | danlentz | llasram: solid advice. |
| 14:26 | `cbp | async code is hard! |
| 14:26 | indigo | .. let's go shopping! |
| 14:26 | ToxicFrog | wakeup: that doesn't follow; there are other ways to avoid symbol capture (autogensym) and one could just as easily argue that thousands of programs have shown the value of convenient higher-order functions ergo lisp-2 is a dead end. |
| 14:28 | ToxicFrog | wakeup: also, to clarify, the bit I think is vile is not avoiding symbol capture, it's code where you use the same name to mean different things in the same scope depending on whether it's in car or cdr position. That's going to be confusing whether you're a lisp-2 or not. |
| 14:28 | danlentz | I also like <name> convention for certain situations… I guess that might potentially provokee a lynch mob… :) |
| 14:29 | ToxicFrog | Or, as nDuff said, "it is a thing you *can* write but I can't imagine under what circumstances it would be a good idea" |
| 14:30 | zoldar | here's my .emacs file contents: https://gist.github.com/zoldar/6814115 |
| 14:30 | wakeup | ToxicFrog: 1) which complicates the macro system, 2) higher order functons are not inconvenient in CL, 3) trust me its not confusing. |
| 14:30 | technomancy | zoldar: try bisecting it, I guess |
| 14:30 | wakeup | ToxicFrog: Think about why clojure needs autogensyms in the first place |
| 14:34 | seangrov` | zoldar: How does the js indentation look with your settings? The default emacs indentation for js is horrific |
| 14:35 | klrr_ | is it possible to have private functions in a namespace? |
| 14:35 | TimMc | gfredericks: (def rand (constantly 17)) |
| 14:35 | seangrov` | Looks like it might not support comma-first var listings... |
| 14:35 | hiredman | klrr_: yes, but private is silly |
| 14:35 | TimMc | klrr_: Sure, just put ^:private in front of the name. |
| 14:35 | klrr_ | okey |
| 14:35 | klrr_ | thanks :) |
| 14:35 | TimMc | People can still get to it easily, though. |
| 14:35 | wakeup | Maybe I can save some thinking/work, Question: is jdbc/execute! thread safe? |
| 14:35 | danlentz | wakeup: absolutely. lisp1 is my least favorite aspect of clojure. Anyone i've known who works in lisp2 for a reasonable period of time tends to become fond of it. |
| 14:35 | klrr_ | TimMc: how you mean? |
| 14:35 | klrr_ | hiredman: why is it silly? |
| 14:35 | TimMc | klrr_: It's better to make everything public and then just document what's part of the API. |
| 14:36 | technomancy | I've worked in lisp-2 for a long time; I thought it was fine until I tried a lisp-1. |
| 14:36 | danlentz | there are many things I lile quite a bit though so its not a complaint. |
| 14:36 | technomancy | mostly because I didn't understand non-trivial HOFs |
| 14:36 | klrr_ | okey, i dont see why it's silly to hide unecessary bindings, it seems logical to me in fact since then there is more likely to be less name-clashing |
| 14:36 | wakeup | danlentz: I have to admit though, that my clojure style takes big advantage of Lisp1. I do a lot of let&lambda oop ;) |
| 14:37 | TimMc | klrr_: Since most users of your namespace will use :require, not :use, there won't be clashing. |
| 14:37 | technomancy | klrr_: it's very valuable to signal which parts of a namespace are implementation details. definitely not silly. |
| 14:37 | technomancy | avoiding name-clashing is not a good reason though |
| 14:37 | TimMc | (:require [clojure.string :as str]) then str/join etc. |
| 14:38 | klrr_ | technomancy: i didnt say it was silly i asked why it was silly |
| 14:38 | danlentz | you are free to bind functions to symbol-values as well as symbol-function in CL, giving you Effective lisp-1 whenever and wherever you want it. |
| 14:38 | TimMc | technomancy, do you still ues ^:internal? |
| 14:38 | klrr_ | TimMc: okey sounds lgoical |
| 14:38 | technomancy | klrr_: yeah, I was responding to hiredman's assertion |
| 14:38 | wakeup | danlentz: hehe good point |
| 14:38 | klrr_ | ok |
| 14:38 | technomancy | TimMc: yes, if for some reason I can't make it private |
| 14:39 | TimMc | Ah, so you use both. |
| 14:39 | wakeup | https://github.com/clojure/java.jdbc/blob/master/src/main/clojure/clojure/java/jdbc.clj#L651 |
| 14:39 | wakeup | thread safe or not? |
| 14:39 | cark | anybody managed to print to the nrepl repl from a ring handler ? |
| 14:40 | technomancy | TimMc: you can have functions which are internal to a lib but still need to be used outside a given namespace |
| 14:40 | danlentz | CL is big on giving the programmer freedom, almost to the point of a logicl extrame. Its perhaps the bratest beauty of CL and aleo a major factor of its demise |
| 14:40 | ToxicFrog | wakeup: I'm willing to accept the existence of a small amount of complication in the macro system if the tradeoff is significantly reduced complication in the language proper. |
| 14:40 | technomancy | freedom to choose between seventeen equality predicates =) |
| 14:41 | danlentz | CL is whatever you envision it to be. |
| 14:41 | wakeup | ToxicFrog: CL is the #1 programmable programming language |
| 14:41 | TimMc | Whereas Clojure is opinionated. |
| 14:41 | wakeup | technomancy: Oh yeah? Hwere is EQ in clojure? |
| 14:41 | technomancy | wakeup: clojure.core/identical? basically |
| 14:42 | wakeup | basically? |
| 14:42 | danlentz | yeah, not the prettiest part of the language, that. |
| 14:42 | danlentz | Clojure skates the issue b/c everything is a value |
| 14:42 | technomancy | wakeup: I'm not sure if the semantics are the same for numerics |
| 14:42 | wakeup | This = operator is VERY fishy. |
| 14:42 | technomancy | wakeup: clojure.core/= is basically baker's EGAL with some corner-cutting to make laziness less cumbersome |
| 14:43 | wakeup | and I fear for the day when I will need EQ and don't have it |
| 14:43 | tbaldrid_ | wakeup: why won't identical? work for you? |
| 14:43 | wakeup | and I think I will use a lock, until somebody explains to me, why waiting on each other is worse then fighting for a resource. |
| 14:43 | tbaldrid_ | wakeup: that being said, I've used Clojure for years, never needed anything but = except for performance (very rare) |
| 14:43 | danlentz | If it were necessary to handle the same use cases, you'd find that there is an extremely good reason to acknowledge the subtle gradations of equality and appreciated the ability to express precisely the one appropriate to a given scenario. |
| 14:44 | wakeup | danlentz: I like you. You manage to express my thoughts properly ;) |
| 14:44 | gfredericks | TimMc: my first try at naming it is 'four' |
| 14:45 | TimMc | snrk |
| 14:45 | danlentz | of course, immutable values do not pose difficulty. Henry baker wrote a few pears on all of this. I think one was called "equal-riights for mutable valuees" or some such |
| 14:45 | technomancy | clojurebot: egal? |
| 14:45 | clojurebot | egal is http://home.pipeline.com/~hbaker1/ObjectIdentity.html |
| 14:45 | technomancy | clojurebot: botsnack |
| 14:45 | clojurebot | thanks; that was delicious. (nom nom nom) |
| 14:45 | danlentz | heh :) |
| 14:45 | TimMc | Of course, = and memoize and conj do not play well together. |
| 14:46 | danlentz | clojurebot is friendlier than minion :) |
| 14:46 | tbaldridge | wakeup: locks are fine....until you need more than one to be locked at a time. That's when all hell breaks loose. |
| 14:46 | technomancy | danlentz: you caught him on a good day. usually he says he'd rather have chocolate. |
| 14:46 | simon__ | hi |
| 14:46 | simon__ | is there some project on the way to make ring work for asynchronous serving of requests, e.g. with core.async? |
| 14:47 | tbaldridge | one of these days I want to write something like Rich's ant test, and then run analysis about how often work is retried. My guess is that is's very, very low. |
| 14:47 | wakeup | tbaldridge: I know this sounds cocky, but I am genuinely good with locks. Mainly because I try to avoid them. |
| 14:47 | bitemyapp | tbaldridge: cgrand has done some work on this. |
| 14:47 | bitemyapp | tbaldridge: did you see the MegaRef library he wrote? |
| 14:47 | wakeup | but thsi agent/ref stuff doesn't make sense to me, none of those seem to do what I need. |
| 14:47 | tbaldridge | simon__: can't be done with ring. Look into Pedestal, or http-kit for something else. |
| 14:47 | danlentz | i'm good with locks as long as they are accompanied by cream-cheese |
| 14:47 | bitemyapp | simon__: Ring is an interface, not an implementation. |
| 14:48 | bitemyapp | simon__: Jetty is synchronous thread per request and is the default in most Ring apps, but you can use http-kit with ring to make it asynchronous. |
| 14:48 | bitemyapp | tbaldridge: wtf are you talking about. |
| 14:48 | wakeup | What I know 100%: I don't want anything to compete for anything right now. So STM seems off. |
| 14:48 | danlentz | and possibly pumpernickel bagels |
| 14:49 | bitemyapp | simon__: without changing your app much if at all, I might add. |
| 14:49 | simon__ | bitemyapp: well but it won't invoke the ring handler on send! as the documentation says.. .which as tbaldridge points out is inherit in the ring model of handler functions |
| 14:49 | bitemyapp | tbaldridge: what you just said is very incorrect and misleading. Please don't do that. |
| 14:49 | TimMc | &(let [m (memoize conj)] [(m [1 2 3] 4), (m (list 1 2 3) 4)]) |
| 14:49 | lazybot | ⇒ [[1 2 3 4] [1 2 3 4]] |
| 14:49 | tbaldridge | wakeup: things will always compete, and at the core, locks are just CAS ops, so...why not go lower leven and just use CAS? |
| 14:49 | bitemyapp | simon__: if you want async Ring, use http-kit. |
| 14:50 | simon__ | bitemyapp: look into the documentation of http-kit it says ring handlers won't be invoked on async send! |
| 14:50 | technomancy | tbaldridge: also, referring to it as just "pedestal" is kinda misleading too since most of pedestal is completely unrelated. |
| 14:50 | tbaldridge | bitemyapp: how does http-kit get around tieing up a thread for each request? How does it work with existing ring handlers? |
| 14:50 | rasmusto | TimMc: :o, sneqy sneqy |
| 14:50 | tbaldridge | (inc simon__) |
| 14:50 | lazybot | ⇒ 1 |
| 14:50 | wakeup | tbaldridge: how is a lock competing? |
| 14:50 | ToxicFrog | Death to locks, message passing supremacy~ |
| 14:51 | bitemyapp | wakeup: you're not that good with locks. Stop using locks. |
| 14:51 | bitemyapp | wakeup: locks don't compose either. |
| 14:51 | simon__ | ain't there some way to make the ring "idea" work with a channel model? |
| 14:51 | tbaldridge | wakeup: two things lock, one will wait. Competing for the same shared resource. |
| 14:51 | ToxicFrog | wakeup: if you have multiple threads trying to access the same lock-protected resource, this is called lock contention and consists of all the threads in competition to see who gets the lock next. |
| 14:51 | bitemyapp | simon__: what is it you want actually? |
| 14:51 | danlentz | locks swim upstream in the channel when they go to spawn…. ok i'll sotp. |
| 14:52 | bitemyapp | tbaldridge: it works with existing Ring handlers. Ring request handlers are just functions that receive a request and return a response. |
| 14:52 | tbaldridge | simon__: look into Pedestal's "interceptor" library. It's designed to work in async situations. |
| 14:52 | tbaldridge | bitemyapp: so if I want to pause execution in the middle of a handler? |
| 14:52 | bitemyapp | simon__: you don't need Pedestal or its interceptor library if you just want async. |
| 14:52 | simon__ | bitemyapp: I want to program a rest api that will ask a remote db and maybe some service and then answer a request, and I thought maybe there is something on the way that might help me avoid tying a thread to each connection |
| 14:52 | bitemyapp | simon__: in that case, you just need async. |
| 14:53 | bitemyapp | simon__: try http-kit. |
| 14:53 | wakeup | How do I "make a lock"? (Besides (java.util.ArrayList.)) |
| 14:53 | bitemyapp | tbaldridge: Things that don't matter in actual web apps #49503 |
| 14:54 | bitemyapp | tbaldridge: async in web apps is generally about resource contention and not backing up threads on I/O while handling many concurrent requests. http-kit serves that need and doesn't require rewriting your entire app in terms of a batshit web framework disconnected from reality. |
| 14:54 | tbaldridge | bitemyapp: but that's not what I asked. My original statement was that ring (and by that I meant the ring model) does not support async. You must keep a thread tied to the request call stack during the length of the request. |
| 14:54 | technomancy | wakeup: if you don't have an existing object to lock on, sometimes people just do (def lock (Object.)) |
| 14:54 | bitemyapp | tbaldridge: I would also appreciate it if you didn't mischaracterize the nature of Ring and how it works as if it was somehow fundamentally synchronous when it is *NOT*. |
| 14:54 | technomancy | (locking lock ...) |
| 14:55 | tbaldridge | bitemyapp: lol, what about comp isn't synchronous? |
| 14:55 | wakeup | technomancy: thank you |
| 14:55 | tbaldridge | bitemyapp: the entire ring system is based on the idea of chained functions. That by definition is synchronous. |
| 14:55 | technomancy | wakeup: np |
| 14:55 | llasram | wakeup: To further clarify, on the JVM, all objects have their own "intrinsic" or "monitor" lock |
| 14:56 | llasram | /Java Concurrency in Practice/ notes that "In retrospect, this design decision was probably a bad one." |
| 14:56 | wakeup | llasram: Yeah I just read that, I just wondered what the idomatic way to make a lock was. |
| 14:56 | llasram | Ah, ok |
| 14:56 | llasram | cool |
| 14:57 | wakeup | since I don't really have a shared statastructure |
| 14:57 | gfredericks | unchecked-multiply doesn't work on boxed numbers |
| 14:58 | TimMc | bitemyapp: We recently introduced (locking ...) into a project at work, but it's only there to make sure that two threads on the same node don't try to grab the same expensive network lock. |
| 14:58 | bitemyapp | TimMc: I'm not saying never use locks, just that they just should be used far less often than people typically think. That's an interesting use-case. |
| 14:59 | tbaldridge | (inc bitemyapp) |
| 14:59 | lazybot | ⇒ 2 |
| 15:01 | bitemyapp | The problem with locks is cultural, not technical. There's a "when all you have is a hammer" problem in managing coordination and concurrency in most other language communities so they usually don't really know any better. |
| 15:04 | wakeup | bitemyapp: I agree to some extent, but with clojure it's the opposite problem. I am now using refs where it doesn't make sense, just becuase otherwise would be non-idomatic. |
| 15:06 | wakeup | E.g. I am big fan of thread safe queues. But they can't be applied to most concurrency problems efficiently. |
| 15:06 | technomancy | llasram: huh; what's the rationale for the regrets? just the overhead/clutteredness? |
| 15:08 | llasram | technomancy: Oh, it apparently puts constraints on JVM implementation object layout. You always need to be prepared to summon up a new lock for any object |
| 15:08 | technomancy | makes sense |
| 15:09 | technomancy | don't mind it from a user perspective, but it feels a bit wasteful |
| 15:10 | zoldar | the offending part seems to be this: https://gist.github.com/zoldar/6814745 . I've tried commenting one local-set-key call or the other but it seems that any use of that form causes change of shift+c behavior... why? |
| 15:10 | technomancy | zoldar: you want (kbd "C-,") |
| 15:11 | mdrogalis | tbaldridge: You still cooking up the next macros video? |
| 15:11 | tbaldridge | mdrogalis: yeah, hopefully sometime this week, I keep getting sidetracked by life/side projects |
| 15:12 | mdrogalis | tbaldridge: No rush. Life happens. :) |
| 15:12 | zoldar | technomancy: thanks. Suppose I'll have to read up on what local-set-key does actually |
| 15:13 | technomancy | zoldar: the binding syntax is kinda historical cruft |
| 15:13 | ucb | is there an nrepl middleware to compile the buffer you're working on automatically? |
| 15:13 | ucb | if not, is it a terrible idea? |
| 15:14 | technomancy | ucb: it's a bad idea to do it in a way that doesn't involve your editor IMO |
| 15:14 | technomancy | if you put it in an after-save-hook in emacs you'll at least get to see compilation errors immediately |
| 15:14 | technomancy | and have hyperlinked error messages you can jump to |
| 15:14 | ucb | right |
| 15:15 | ucb | I'm sort of thinking of it to aid some form of autofix ala eclipse |
| 15:15 | ucb | I wrote a simple thing that relies on flymake (https://github.com/ulises/quickfix-mode) but it's not great |
| 15:16 | technomancy | huh; cool |
| 15:16 | ucb | I thought that if you had an nrepl middleware telling you things like "function foo can't be found" |
| 15:16 | ucb | then you can hook into that and provide quickfixes |
| 15:16 | ucb | but maybe it's all just a bad joke |
| 15:16 | ucb | also, that quickfix "mode" is super-incomplete and you can probably see |
| 15:17 | technomancy | you mean you want to simplify error messages server-side so you have less work to do on the elisp side? |
| 15:17 | ucb | indeed |
| 15:17 | ucb | ideally the hard work would be done server-side and the elisp bit would be just look up of things |
| 15:18 | technomancy | ucb: curious if you've seen https://github.com/technomancy/nrepl-discover ? |
| 15:18 | technomancy | it is somewhat related |
| 15:18 | ucb | huh, I've obviously not thought it through very well |
| 15:18 | technomancy | a more general approach, but I think you could fit your quickfix idea into it |
| 15:20 | ucb | thanks for that technomancy |
| 15:21 | technomancy | ucb: it's just an idea I had. I think it's pretty promising, but so far no one else does, for reasons I have been unable to determine. |
| 15:22 | technomancy | maybe I'm just bad at splaining |
| 15:23 | ucb | hmm |
| 15:23 | ucb | I think I'm failing to grok this |
| 15:27 | technomancy | it's just a way to implement more logic server-side so that clients (which need to be re-implemented for each editor) can remain small and dumb |
| 15:28 | technomancy | because I don't like writing elisp |
| 15:29 | ucb | oh, right |
| 15:29 | seangrov` | Love that there's oauth-clj and also clj-oauth :P |
| 15:29 | llasram | If they show up to the same party they're going to be so embarrassed |
| 15:29 | ucb | so you effectively write tiny code on your editor, just entry points on the server to be executed? |
| 15:30 | bitemyapp | seangrov`: there's clauth and a fork of clauth too. |
| 15:31 | technomancy | ucb: basically; you agree upon some minimal set of operations to support client side. as long as you can implement what you need in terms of those operations, the logic can be all in one place. |
| 15:31 | seangrov` | bitemyapp: Nah, I think I'll go with clj-oauth-clj |
| 15:31 | bitemyapp | seangrov`: clj-authjure is a much better name. |
| 15:31 | mdrogalis | oauth-clj-oauth |
| 15:31 | mdrogalis | Just to complete it. D: |
| 15:32 | llasram | [clj-oauth-clj/clj-oauth-clj "0.1.0-SNAPSHOT"] |
| 15:32 | bitemyapp | mdrogalis: so. AOP. |
| 15:32 | seangrov` | Break all the conventions! |
| 15:32 | mdrogalis | bitemyapp: Yes? |
| 15:32 | ucb | technomancy: makes sense |
| 15:32 | bitemyapp | mdrogalis: you know slingshot right? |
| 15:32 | bitemyapp | mdrogalis: what about "aspect selectors" with a binding scope? |
| 15:32 | ucb | technomancy: what I'm wondering is how much support from nrepl do I really need for quickfix |
| 15:32 | mdrogalis | bitemyapp: I do. |
| 15:32 | technomancy | just be thankful that the combinatorics of this question don't include "*jure" |
| 15:32 | mdrogalis | I'm not sure what that means. |
| 15:33 | zoldar | seangrov`: did you mean something like "var foo = bar\n, baz = baf;" ? |
| 15:33 | bitemyapp | mdrogalis: so, you have named aspects wrapping an fn |
| 15:33 | ucb | technomancy: in principle I could just have flycheck/flymake checkers for clojure and latch on to that |
| 15:33 | seangrov` | Ah, for christ's sake... there's also clj-oauth2 |
| 15:33 | mdrogalis | In Slingshot? |
| 15:33 | bitemyapp | mdrogalis: some are pre, some are post. Whatever. But they all have names. |
| 15:33 | bitemyapp | mdrogalis: no, Slingshot was intended to merely be an example. |
| 15:33 | bitemyapp | mdrogalis: I mean with hooke and Dire. |
| 15:33 | seangrov` | zoldar: Yeah |
| 15:33 | mdrogalis | Oh, alright. Yeah, I follow. |
| 15:33 | bitemyapp | mdrogalis: so you could have an aspect that is :log-fn :pre right? |
| 15:34 | technomancy | ucb: practically speaking ... I don't know. if no one else uses nrepl-discover then it's probably a dead end. |
| 15:34 | mdrogalis | bitemyapp: Sure. |
| 15:34 | bitemyapp | mdrogalis: so you slap all the aspects on the fn, but you want to be able to have a binding scope that selects arbitrary subsets of them. |
| 15:34 | ucb | technomancy: after all, the simplest case of "function foo is undefined" is sorted with a template ala (defn foo […] …) |
| 15:34 | bitemyapp | mdrogalis: that's all. Just something I'm thinking about. robert.hooke has a basic version of this with the disabling thingy. |
| 15:34 | zoldar | seangrov`: Indeed it doesn't support this but I didn't see it yet to be honest. Not that I'm a hardcore js dev... but what's reasoning behing putting comma first ? |
| 15:34 | mdrogalis | bitemyapp: I think that'd be swell. |
| 15:34 | ucb | technomancy: right. I probably need to think about this a little bit more because what I thought would be "easy" turns out to be not that easy (on first inspection) |
| 15:35 | technomancy | ucb: right; if you can frame it in terms of edits to be made, that could work. not sure. |
| 15:35 | seangrov` | zoldar: It'll make you less likely to go insane in the long run, you instantly see where you've forgotten a comma. |
| 15:35 | mdrogalis | bitemyapp: It would be nice to have a scope where none of the aspects are active. |
| 15:35 | mdrogalis | I've needed that on occassion. |
| 15:36 | ucb | technomancy: that's the thing. Missing declarations are likely solved by adding their definitions to the file even with some form of yasnippet type of action |
| 15:36 | llasram | seangrov`, zoldar: or added an extra, since JS doesn't allow terminal commas after the last entry in arrays or objects |
| 15:36 | zoldar | seangrov`: ah, ok |
| 15:36 | ucb | technomancy: the other question, more quickfix specific, is whether there are any other kinds of issues that can be solved with the aid of quickfix |
| 15:36 | ucb | technomancy: and the ultimate hidden agenda is to get some form of quick shortcuts to usual operations ala eclipse in emacs … for clojure |
| 15:37 | technomancy | ucb: yeah, that's probably the more interesting question. what kinds of problems can it solve |
| 15:37 | ucb | /because I'm lazy like that/ |
| 15:37 | ucb | technomancy: indeed. Although I suspect there's merit in convenience shortcuts. |
| 15:38 | technomancy | ucb: nrepl-discover.el actually creates proper M-x commands you can rebind |
| 15:38 | ucb | technomancy: however I'm starting to feel like the most common type of fix will be edit operations, e.g. if you require a ns that doesn't exist, you'd add the file with just an ns directive |
| 15:38 | ucb | technomancy: now I'll have to take a look at nrepl-discover :) |
| 15:38 | technomancy | ucb: it's pretty short at least =) |
| 15:39 | ucb | technomancy: awesome |
| 15:39 | technomancy | the hard part is defining the operations you want everyone to support |
| 15:39 | mdrogalis | bitemyapp: The thing to really make Dire complete, IMO, is to have a spot in the project.clj file that turns sets of hooks on and off on a per-profile basis. |
| 15:39 | mdrogalis | I'll get to it someday. |
| 15:39 | ucb | technomancy: this is where I'm failing to grok how nrepl-discover would help |
| 15:39 | technomancy | mdrogalis: just :hooks in a profile? |
| 15:40 | technomancy | mdrogalis: oh, nm; in-project hooks |
| 15:40 | ucb | technomancy: in my head, your editor would be trying to compile the file/buffer you're working on with a certain frequency. Then your editor would be informed of the errors, if any, and it's your editor's responsibility to make the fix |
| 15:40 | bitemyapp | mdrogalis: that would be nice too, but I kinda want to feed my inner Common Lisper with runtime scoping of the aspects. :P |
| 15:40 | bitemyapp | ie, MOAR POWER |
| 15:41 | mdrogalis | technomancy: It tried, it ended up not being the solution because for some tricky loading reason. |
| 15:41 | technomancy | ucb: decouple the "when" from the "fixing" |
| 15:41 | technomancy | ucb: they're totally different concerns |
| 15:41 | mdrogalis | bitemyapp: I don't see why you can't have both. |
| 15:41 | technomancy | I don't want to send code over until I save, personally. |
| 15:41 | technomancy | which is easy with a hook. but I still want the fixy stuff |
| 15:41 | ucb | technomancy: indeed. My comment was more like there's little server-side work to do. I mean, other than "try to compile foo.clj" and "return the result of the attempt" |
| 15:42 | bitemyapp | mdrogalis: you most certainly can, just saying where my head-space is. |
| 15:42 | ucb | technomancy: yes. The compile-on-save is probably the sanest option |
| 15:42 | mdrogalis | bitemyapp: I'd take it as a PR. :P |
| 15:42 | technomancy | ucb: the translation of compilation error -> set of edits to perform is what I was thinking |
| 15:43 | ucb | technomancy: I see. I thought nrepl-discover was more useful the other way |
| 15:43 | mdrogalis | I've been wanting to request it as core.conditions for a long time, but I'm not sure if it's a universally good idea anyhow. |
| 15:43 | ucb | technomancy: like editor sends message "foo" and the server does some computation for "foo" |
| 15:44 | technomancy | ucb: oh, right. yes, it can provide that too, already. |
| 15:44 | technomancy | the translation is the server-side work you'd have to implement by writing a defn with :nrepl/op metadata. |
| 15:44 | ucb | technomancy: my comment was related to my confusion. I thought nrepl-discover only did editor -> server side work sort of traffic |
| 15:45 | technomancy | huh, maybe that's why no one else is using it =) |
| 15:46 | ucb | heh |
| 15:46 | technomancy | https://github.com/technomancy/nrepl-discover/blob/master/Proposal.md <- "Argument types" describes how nrepl-discover clients would construct in-editor commands; "Responses" describes the actions which would be returned to the client when the command is invoked. |
| 15:47 | llasram | technomancy: I want to use it! Just so many projects, so little time, etc |
| 15:49 | ucb | technomancy: thanks for the conversation, it's been helpful |
| 15:50 | technomancy | ucb: np. it might not be quite what you need, but maybe it'll at least get you thinking in new and interesting directions =) |
| 15:50 | ucb | technomancy: definitely |
| 15:53 | akurilin | Is there anything in the ring toolset for dealing with different Accept values? Do most people just handle branching by hand in each handler, perhaps defaulting to one MIME type? |
| 15:54 | bitemyapp | akurilin: http://yogthos.net/blog/30-Making+services+with+Liberator |
| 15:55 | akurilin | Hm, let's say you're happy without Liberator? |
| 15:56 | bitemyapp | akurilin: write a middleware or wrapper for your handler fns. |
| 15:56 | bitemyapp | akurilin: I think Prismatic did something like this, not that it's open source. |
| 15:57 | akurilin | bitemyapp, okie dokie |
| 15:57 | bitemyapp | akurilin: if it were me, I'd make my handlers multimethods. :) |
| 15:57 | bitemyapp | but I'm crazy. |
| 15:57 | akurilin | is the best way to use multimethods to avoid using multimethods, or is that macros only? :P |
| 15:58 | bitemyapp | that's just macros. |
| 15:58 | bitemyapp | multimethods are simpler than protocols. |
| 15:58 | ucb | <3 multimethods |
| 15:59 | bitemyapp | ucb: We can be friends. |
| 15:59 | bitemyapp | tbaldridge: multimethods are awesome. |
| 16:00 | tbaldridge | bitemyapp: I prefer OOP personally, easier to write patterns with them. Have you tried writing GOF patterns with multimethods? |
| 16:01 | tbaldridge | </troll> |
| 16:02 | bitemyapp | tbaldridge: I've put my behavior with my state and identity, and clearly I need to mash more behavior on top of the state and identity to fix my broken code. |
| 16:02 | bitemyapp | lets inherit from a bunch of classes that have nothing to do with what I'm doing so my code can subtly break later. |
| 16:03 | ucb | everybody likes a good inheritance |
| 16:03 | ucb | esp. from a rich uncle |
| 16:04 | akurilin | Do most people stick to underscores in file name in lein projects? I think you can get away with dashes for static resources, but it sounds reasonable to normalize everything to just one way of doing it |
| 16:05 | gfredericks | TimMc: https://github.com/fredericksgary/four |
| 16:05 | akurilin | Hm I guess it doesn't matter too much for statics |
| 16:08 | bitemyapp | akurilin: file names use underscores. |
| 16:08 | bitemyapp | gfredericks: wait what |
| 16:09 | bitemyapp | gfredericks: is this to work around the synchronized methods in java.util.Random? |
| 16:10 | gfredericks | no it doesn't use java.util.Random at all |
| 16:10 | gfredericks | at least none of that code does |
| 16:11 | gfredericks | it's a haskell-style stateless PRNG |
| 16:11 | gfredericks | it generates longs about as fast as rand-int generates integers |
| 16:11 | bitemyapp | that's my point -_-' |
| 16:12 | bitemyapp | gfredericks: anyway, thanks for making that. How certain are you of the implementation? |
| 16:12 | gfredericks | oh but I mean the point is not performance |
| 16:12 | gfredericks | I'm 30% certain that I tried to mimic the java.util.Random code |
| 16:13 | gfredericks | it doesn't do what my JVM's Random does, but I don't know that my JVM's Random is the same as the java code I went off of |
| 16:13 | gfredericks | in any case, the point is immutability |
| 16:14 | gfredericks | and I haven't seen that in clojure yet |
| 16:14 | bitemyapp | gfredericks: very cool. Thanks for making this :) |
| 16:14 | bitemyapp | gfredericks: this could potentially solve some thread contention issues I've seen in the past. |
| 16:14 | danlentz | at the risk of belaboring the point, and not likely I think to be a popular idea, but wouldn't it be useful to have an earmuff-style naming convention for bindings (sorry vars) that represent shared state? i.e. <ref> or =atom= for example? |
| 16:15 | gfredericks | danlentz: I don't hate the idea, but I think reference types are often called out by the use of @, deref, or the various mutating functions |
| 16:15 | bitemyapp | danlentz: if you write Clojure, you'll find out when and why things are the way are. |
| 16:15 | gfredericks | I would do it if ten other people did. |
| 16:16 | bitemyapp | earmuffs are reserved for dynamic vars ;_; |
| 16:16 | bitemyapp | there's even warnings if you give a var earmuffs and it's not dynamic. |
| 16:16 | danlentz | or -local- for lexical bindings 'injected' via macros ("anaphoric" varyables in the terminology of paul grahamm) |
| 16:16 | danlentz | yes, earmuffs are |
| 16:17 | danlentz | *earmufs* |
| 16:17 | bitemyapp | danlentz: would it be a lot to ask that you just write some Clojure code? |
| 16:17 | gfredericks | danlentz: I like &foo for anaphoric variables |
| 16:18 | danlentz | bitemyapp: not at all. If there's something specific you need me to write I'll take a look at it. |
| 16:19 | bitemyapp | danlentz: my point is that proposals are best informed by experience. |
| 16:19 | bitemyapp | especially if you can swing leaving the CL at the door. |
| 16:23 | danlentz | i'm really sorry there is some clear intolerance for my questions. It is not intended to cause this. I am simpley interested in, at minimum, learning more about the thought process that underlies closures conventions. I can clearly see what they are I am just exploring the degree of flexibility one might have in one's own practices without being at risk of bad stylee. |
| 16:23 | bitemyapp | danlentz: it's not, it's just that it's a better use of your time if you just learn Clojure |
| 16:23 | bitemyapp | danlentz: you can learn Clojure's conventions by writing Clojure. |
| 16:24 | bitemyapp | danlentz: and reading peoples' code. |
| 16:24 | tbaldridge | danlentz: np, some people (including myself) just get snippy sometimes. That being said, I see the argument against this to be the same argument against hungarian notation. And in general the response is probably YAGNI |
| 16:25 | bitemyapp | danlentz: I'm with tbaldridge. YAGNI. |
| 16:25 | danlentz | and in the course of doing so it is unreasonable to develop questions related to subjects as intangible as naming conventions? |
| 16:26 | bitemyapp | it's not productive when you're new. |
| 16:26 | coventry | There are so many more challenging things to explore. |
| 16:26 | bitemyapp | you don't walk into a Kung Fu dojo for your first time ever and start making suggestions on their training protocol. |
| 16:30 | danlentz | i see. I will refrain from discussing the matter further and hope it hash not been overly disruptive to this forum. |
| 16:32 | melipone | hello! In which package can I find the signum function to get the sign of a number? |
| 16:33 | hyPiRion | Math |
| 16:33 | llasram | melipone: ##(map #(Math/signum %) [-1 0 1]) |
| 16:33 | lazybot | java.lang.IllegalArgumentException: No matching method found: signum |
| 16:33 | llasram | heh |
| 16:33 | hyPiRion | java.lang.Math, sir |
| 16:33 | hyPiRion | well |
| 16:34 | hyPiRion | ,(map #(Math/sign %) [-1.0 0.0 1.0]) |
| 16:34 | clojurebot | #<CompilerException java.lang.IllegalArgumentException: No matching method: sign, compiling:(NO_SOURCE_PATH:0:0)> |
| 16:34 | melipone | I have to import it? |
| 16:34 | hyPiRion | ,(map #(Math/signum %) [-1.0 0.0 1.0]) |
| 16:34 | clojurebot | (-1.0 0.0 1.0) |
| 16:34 | hyPiRion | Only accept doubles. |
| 16:34 | gfredericks | using my rand-long versus clojure.core/rand-int from 20 different threads at the same time is over 4 times faster |
| 16:34 | llasram | hyPiRion: No substitutes! |
| 16:35 | llasram | The boxing must be preventing autoconversion |
| 16:35 | llasram | Or... something |
| 16:35 | coventry | ,(map #(Long/signum %) [-1 0 1]) |
| 16:35 | clojurebot | (-1 0 1) |
| 16:35 | llasram | Weird. I feel like I don't usually have that much trouble w/ Math static methods |
| 16:36 | llasram | (inc coventry) |
| 16:36 | lazybot | ⇒ 1 |
| 16:39 | akurilin | Do people generally avoid setting defaults for functions in the destructuring and opt to do that with (or) in an internal let form, or does that make no real differencer? |
| 16:39 | akurilin | *function params |
| 16:40 | bitemyapp | akurilin: up to preference, I would assume. |
| 16:40 | ucb | akurilin: I normally set the defaults while restructuring; that way the nrepl completion thing shows me the default values without having to inspect the source |
| 16:41 | bitemyapp | ucb: that's a good reason. |
| 16:41 | akurilin | ucb, as in, the nrepl completion thing looks at function params including the destructuring syntax? |
| 16:42 | ucb | akurilin: normally yes |
| 16:42 | akurilin | hmm I wonder if I get any of this in fireplace |
| 16:42 | bbloom | (inc destructuring) |
| 16:42 | lazybot | ⇒ 1 |
| 16:42 | ucb | heh |
| 16:43 | akurilin | Man I need to make a small wiki for all these questions because they must have been asked about x1000 before. |
| 16:43 | nathanic | akurilin: I believe you can get it in the shift-K docstring thing in fireplace, but not as-you-type in the status bar like in SLIMV |
| 16:43 | bitemyapp | (inc destructuring) |
| 16:43 | lazybot | ⇒ 2 |
| 16:44 | bitemyapp | akurilin: a Clojure wiki is one of my to-do list projects :P |
| 16:44 | rhg135 | hey ppl, i have a dynamically generated dom, is the ideal format a read only zipper whi feels like a hack? |
| 16:44 | ucb | somebody please take away this keyboard from me |
| 16:44 | ucb | I just wrote this predicate to filter a collection of things: (comp not deref :valid) |
| 16:45 | yeoj___ | Hi, I'm just getting started |
| 16:45 | rhg135 | i mean in effect i'm passing a function that throws an exception as make-node arg |
| 16:45 | akurilin | bitemyapp, I'd like this to be kind of FAQ style, but it's also really hard to make that easily accessible for a very large amount of entries. Maybe simple fuzzy searching is good enough to find what you're looking for? |
| 16:45 | akurilin | bitemyapp, you're the elastic search dude here. |
| 16:45 | ucb | akurilin: are you going to host/run the service? |
| 16:46 | yeoj___ | trying toget a better workflow, when i get a error such as "wrong number of args to persistent array map" on a reload form... how do i know what lines to look towards? I'm new to REPL based development. |
| 16:46 | yeoj___ | (maybe it's a vim fireplace thing) |
| 16:46 | akurilin | ucb, well yeah, I guess it'd have to be on github somewhere for hosting simplicity |
| 16:46 | bitemyapp | akurilin: yeah I'd planned on using ES. |
| 16:46 | ucb | akurilin: I don't think GH has search for wikis? |
| 16:46 | bitemyapp | akurilin: nah, I planned on writing the wiki in Clojure + ElasticSearch. |
| 16:47 | akurilin | we'll have bitemyapp pony up 5 bucks/mo on a DO box |
| 16:47 | bitemyapp | no github. |
| 16:47 | bitemyapp | Yep @ DO box, lol. |
| 16:47 | coventry | yeoj___: I generally (use 'clojure.repl) in the repl, and look at the traceback with (pst). The stack frames which refer to my code are probably where the error lies. |
| 16:47 | akurilin | compete with minecraft servers for CPU |
| 16:47 | akurilin | :P |
| 16:47 | bitemyapp | akurilin: I think minecraft servers are usually on dedis. |
| 16:48 | bitemyapp | or at least, they're s'posed to be. |
| 16:48 | akurilin | bitemyapp, is the perf/buck just not there in the cloud? |
| 16:48 | bitemyapp | akurilin: not really, no. |
| 16:48 | bitemyapp | I've tried to run MC servers on VPSes before. Ends in tears. |
| 16:48 | akurilin | I don't know if DO is "cloud" or "VPS", always confused about the difference. |
| 16:48 | yeoj___ | coventry: ah, ok. so i just evaluated (pst) and i have some more interesting information. I'll study this more. |
| 16:48 | yeoj___ | coventry: thanks for the tip. |
| 16:48 | bitemyapp | akurilin: there's not a meaningful distinction between cloud and VPS unless you're thinking of amazon-style services like S3. |
| 16:49 | bitemyapp | ucb: I already know ES really well. |
| 16:49 | bitemyapp | ucb: and ES has search, is there a search plugin for cloudant? |
| 16:49 | ucb | bitemyapp: absolutely, that's why I suggested it :) |
| 16:49 | ucb | bitemyapp: but if you know ES very well, etc. might as well stick to that |
| 16:50 | ucb | bitemyapp: I was just suggesting so that you don't have to run the service, etc. |
| 16:50 | bitemyapp | ucb: it's not that big of a win though. I'm pretty close to writing my own ES client. |
| 16:51 | coventry | yeoj___: Once you have a hypothesis for which form is causing the error, wrap it or its constituents in clojure.tools.trace/trace. There's a brief tutorial on the usage of trace which I can't find at the moment, but which is worth going through. |
| 16:51 | ucb | what's the best way of testing a private fn? |
| 16:51 | akurilin | bitemyapp, do you store selmer templates inside or outside the .jar? |
| 16:51 | bitemyapp | ucb: hack the forcefield and test it. |
| 16:52 | ucb | bitemyapp: heh and how? |
| 16:52 | bitemyapp | akurilin: ./resources/templates or ./src/ns/templates/ |
| 16:52 | akurilin | bitemyapp, so you need to repackage the uberjar every time, yes? |
| 16:52 | bitemyapp | ucb: http://stackoverflow.com/questions/9113387/explanation-about-symbols-and-vars-and-their-differences-in-clojure |
| 16:53 | bitemyapp | akurilin: yeah but I push the static assets like css/js/images separately. |
| 16:53 | bitemyapp | into a static directory that nginx fronts. |
| 16:53 | akurilin | bitemyapp, ah so you have a higher-priority location directive for those? |
| 16:54 | akurilin | bitemyapp, or I guess you just need a more specific location than what you're using to proxy the request |
| 16:54 | ucb | bitemyapp: naughty |
| 16:54 | bitemyapp | ucb: I'm all about naughty Clojure. |
| 16:55 | bitemyapp | akurilin: nginx location directive. |
| 16:55 | ucb | INORITE |
| 16:56 | akurilin | bitemyapp, that's a good idea, I'll do that |
| 16:56 | yeoj___ | coventry: awesome, thanks so much. |
| 16:56 | yeoj___ | coventry: i'll try to find the tutorial. I have so much to learn... |
| 16:56 | akurilin | probably no point in moving selmer templates outside of the project, they don't necessarily make much sense on their own |
| 16:57 | bitemyapp | akurilin: right. |
| 16:57 | bitemyapp | I feel like I should be charging consulting rates or extracting a labor-value in exchange for this. |
| 16:58 | bitemyapp | ucb: to speak to the general pattern, private is metadata on a var. Anything that wipes/forgets the metadata bypasses that. |
| 16:59 | ucb | bitemyapp: yeah, I now know that thanks to you and that SO post. Thanks! |
| 16:59 | coventry | yeoj___: Here it is: https://github.com/timvisher/what-does-tools-trace-do/blob/master/src/what_does_tools_trace_do/core.clj |
| 17:00 | technomancy | danlentz: FWIW I use http://marmalade-repo.org/packages/idle-highlight-mode to easily spot locals |
| 17:01 | technomancy | that's a good fit for local tooling that everyone can opt into on an individual basis |
| 17:01 | seangrov` | Oauth is always so unpleasant |
| 17:02 | bitemyapp | seangrov`: I recently did a bunch of OAuth stuff in Python. I was considering writing a provider for Ring apps. |
| 17:02 | bitemyapp | It would end up being pretty similar to Bulwark really. |
| 17:03 | bitemyapp | same concept of passing fns to the middleware. |
| 17:03 | seangrov` | bitemyapp: I authenticate with google/gmail's oauth, but all the others I just need to go through the oauth dance to get their tokens so I can make api calls |
| 17:03 | bitemyapp | so you need a client, not a provider. |
| 17:03 | seangrov` | Yeah |
| 17:04 | seangrov` | Looking through the libraries, trying to figure out how to get them to work, it hasn't been plesaant |
| 17:04 | seangrov` | Our rails app does a good job of it, but it's literally four sub-classes deep of specific integrations overriding methods, etc. |
| 17:05 | seangrov` | It'll feel good to get it into straight-forward clojure, but the start has been slow |
| 17:08 | sandwichmaker | seangrov`: do you just need to get to the point of calling the GoogleAPI for docs or something like that? |
| 17:09 | bitemyapp | wisdom from nrepl --- You're bound to be unhappy if you optimize everything. -Donald Knuth |
| 17:13 | technomancy | bitemyapp: dude, you haven't replaced the default nrepl connect messages yet? |
| 17:14 | technomancy | bitemyapp: get on this level: http://p.hagelb.org/nrepl-words.el.html |
| 17:15 | bitemyapp | technomancy: hahahaha. No not yet. I'm considering setting nrepl-words-of-inspiration to a dump of Zen quotes. |
| 17:15 | technomancy | I really don't like the defaults |
| 17:15 | technomancy | they're supposed to be actually inspirational |
| 17:16 | technomancy | at least they added back in "take this repl brother, may it serve you well" |
| 17:16 | technomancy | hm; I guess that's sexist |
| 17:16 | bitemyapp | why did it get remov---oh. |
| 17:16 | vmarcinko | hi all. i have a case where i want objects of various types to get printed equaly if they contain my custom meta data. I succeded with print-emthod dispatch which works on :type metadata, but I need pprint to behave the same. How can i dispatch pprint printing to my custom printer that will recognize the object by that special meta-data stored. Is that possible for pprint? |
| 17:16 | seangrov` | sandwichmaker: More or less, but for quite a few services, and for lots of users, so the whole web flow needs to be there |
| 17:16 | bitemyapp | technomancy: make it trotskyite and change brother to comrade. |
| 17:17 | rasmusto | "now when did you last let [your heart decide?]" |
| 17:17 | seangrov` | I like comrade, sounds good to me |
| 17:17 | TEttinger | ##(repeatedly 2000 #(rand-nth [1 2 3 4 5 \space])) ;; anyone know why lazybots are still not able to use refheap? |
| 17:17 | lazybot | ⇒ (4 2 \space 2 5 4 2 4 2 \space 5 4 5 3 5 1 3 3 4 5 3 5 2 \space 2 \space 3 \space 5 1 1 5 5 4 4 2 1 \space 2 5 \space 5 5 \space 1 3 \space 1 1 3 2 5 5 \space \space 2 1 \space 3 3 \space 2 4 \space \space \space \space 1 2 2 \space \space 2 4 5 5 5 \space 5 3 2 \space 4 \space 5 2 \space \space... |
| 17:17 | technomancy | bitemyapp: not so much "adde back" as "made nrepl.el" match slime |
| 17:18 | sandwichmaker | seangrov`: I am still babbling in Clojure but I have code running reading spreadsheets cells from GoogleDocs in Clojure if you need a starting point |
| 17:18 | technomancy | rasmusto: IllegalArgumentException let requires an even number of forms in binding vector |
| 17:18 | rasmusto | technomancy: ,(< 3) |
| 17:18 | vmarcinko | in other words, is there some example of overriding default pprint behaviour for some objects (in my case dispatch should be based upon my meta data)? |
| 17:19 | TEttinger | vmarcinko, I'm sure they all use .toString |
| 17:19 | TEttinger | hm maybe pprint doesn't |
| 17:20 | amalloy | TEttinger: lazybot does refheap overlong responses. i'm not sure why he didn't in this case |
| 17:20 | seangrov` | sandwichmaker: Yeah, that might be nice, would love to see how you setup the initial oauth authentication |
| 17:20 | vmarcinko | quick googling doesn't give me some custom pprint dispatch example |
| 17:20 | TEttinger | amalloy, I know, I maintain a lazybot. I have a plugin that dumps quotes to refheap |
| 17:20 | TEttinger | right now it dumps ... instead of the refheap link |
| 17:21 | amalloy | ask Raynes; maybe the refheap api has changed since the lazybot client was written? |
| 17:21 | amalloy | TEttinger: perhaps by "still" you meant "no longer"? your original question was confusing |
| 17:22 | Raynes | Hm. |
| 17:22 | TEttinger | amalloy, it still doesn't work because it didn't last night |
| 17:22 | Raynes | That's certainly strange. |
| 17:22 | TEttinger | indeed, Raynes! |
| 17:22 | Raynes | bitemyapp and some others were having issues with refheap last night so I restarted the server. |
| 17:22 | TEttinger | I kinda thought once the 500 errors stoppped it would be fixed |
| 17:23 | TEttinger | want me to restart my lazybot? |
| 17:23 | Raynes | Oh dear, looks like there are some mongo-related issues. |
| 17:23 | Raynes | No, this is a refheap issue. |
| 17:23 | TEttinger | clojure needs its own database, rich should get on that :P |
| 17:24 | tbaldridge | TEttinger: he did, it's call datomic. |
| 17:24 | seangrov` | snap |
| 17:24 | TEttinger | tbaldridge, hence the :P |
| 17:24 | tbaldridge | ah |
| 17:25 | rasmusto | ,:P |
| 17:25 | clojurebot | :P |
| 17:25 | seangrov` | hah |
| 17:27 | TEttinger | ,(let [ಠ_ರೃ #(println "Oh my.")] (ಠ_ರೃ)) |
| 17:27 | clojurebot | Oh my.\n |
| 17:28 | seangrov` | Gotta love the range of valid var names |
| 17:29 | ro_st | anyone used cemerick/austin ? |
| 17:31 | bitemyapp | ro_st: tons o' people. |
| 17:31 | ro_st | a brepl is certainly not the same as a jvm repl |
| 17:31 | ro_st | it's pretty good though. it's in that uncanny valley area |
| 17:32 | akurilin | Someone mentioned that there's middleware out there that will guess content type based on the ring response type + whether mime type is set already. Is that correct? If not I'll just write one. |
| 17:33 | TEttinger | Raynes, it's back |
| 17:33 | TEttinger | ,(clojure.string/join " "(repeatedly 200(fn [](apply str(concat [(rand-nth ["rh""s""z""t""k""ch""n""th""m""p""b""l""g""phth"])](take(+ 2(* 2(rand-int 2)))(interleave(repeatedly #(rand-nth ["a""a""o""e""i""o""au""oi""ou""eo"]))(repeatedly #(rand-nth ["s""p""t""ch""n""m""b""g""st""rst""rt""sp""rk""f""x""sh""ng"]))))[(rand-nth ["os""is""us""um""eum""ium""iam""us""um""es""anes""eros""or""ophon""on""otron"])]))))) |
| 17:33 | clojurebot | "nangum rhishus neomanes bobotron chasinos zertesanes thiberos morstus benameros letes gisaurtus chauxophon tosus teomor mourstepon kaurkus pourstos serkus zeomertes noporkium rhasteros koisharstiam loistipium kastus laxeoshis lipaustotron sanorkium phtherkus kirtipos saurtanes goses sonobus rhortimum pemauxos gemum noniam nesaungus zomaungor rharkeongus noinon rhougophon gasengiam beomarkiam posp... |
| 17:33 | TEttinger | nope |
| 17:33 | TEttinger | that was clojurebot... |
| 17:33 | mtp | whoa |
| 17:33 | mtp | that's awesome |
| 17:33 | ro_st | bitemyapp: have you used it? |
| 17:33 | TEttinger | ##(clojure.string/join " "(repeatedly 200(fn [](apply str(concat [(rand-nth ["rh""s""z""t""k""ch""n""th""m""p""b""l""g""phth"])](take(+ 2(* 2(rand-int 2)))(interleave(repeatedly #(rand-nth ["a""a""o""e""i""o""au""oi""ou""eo"]))(repeatedly #(rand-nth ["s""p""t""ch""n""m""b""g""st""rst""rt""sp""rk""f""x""sh""ng"]))))[(rand-nth ["os""is""us""um""eum""ium""iam""us""um""es""anes""eros""or""ophon""on""otron"])]))))) |
| 17:33 | lazybot | ⇒ "thigixeum nospostes moubus baurstor techon zogoingum thateum lengeros rhourkobotron zanefeum sorkobiam bishausperos thasheosus narkoupus mostoirkeum pongopophon kaushatum netum lougon phthoibeocheros phthoufus phthipoiseum tartos phtheostium nimos nospeofor taurtoph... https://www.refheap.com/19371 |
| 17:34 | TEttinger | refheap is back it seems |
| 17:34 | Raynes | TEttinger: amalloy and I just fixed it. |
| 17:34 | TEttinger | thanks |
| 17:34 | Raynes | It was weird mongodb crap. |
| 17:34 | ro_st | i seem to have come right |
| 17:34 | Raynes | 4Clojure is down at the moment though. He's working on bringing that back up now. |
| 17:34 | llasram | TEttinger: creating a botnet w/ DGA-based C&C? |
| 17:35 | TEttinger | don't know what those are! |
| 17:35 | llasram | Nice cover |
| 17:35 | llasram | Niiice cover |
| 17:35 | TEttinger | I only have one bot, plus another one that calls the other one, plus another one that outputs multiple lines per message |
| 17:35 | TEttinger | so maybe |
| 17:36 | sandwichmaker | seangrov`: It is a quick cut&paste of partial code, so there maybe non-relevant imports or dependencies for an example case and even simpler ways to do it (this was my first encounter with OAuth), it was a lot of documents open with partial information that I was trying to understand, hope it helps a little: https://gist.github.com/andresvalenciano/6817014 |
| 17:39 | seangrov` | sandwichmaker: Got it, thank you very much |
| 17:40 | yeoj___ | if i change my :dependencies in my project.clj does that warrent a repl restart? Is there any quicker way to do it? |
| 17:41 | llasram | yeoj___: https://github.com/pallet/alembic |
| 17:42 | yeoj___ | llasram: thanks |
| 17:50 | bbloom | :-( http://www.nist.gov/dads/?utm_source=feedburner&utm_medium=feed&utm_campaign=Feed%3A+jesse-lifestream+(Jesse+Ruffin's+LifeStream) |
| 17:50 | bbloom | anyone got a mirror of the Dictionary of Algorithms and Data Structures ? |
| 17:51 | bbloom | i guess this is the real URL: http://www.nist.gov/dads/ |
| 17:53 | Raynes | TEttinger: Refheap is down purposely at the moment./ |
| 17:53 | xeqi | Raynes: :( |
| 17:56 | TEttinger | bbloom: http://web.archive.org/web/20130922223431/http://xlinux.nist.gov/dads// |
| 17:56 | bbloom | thanks! |
| 17:56 | seangrov` | DerGuteMoritz: Is clj-oauth2 still supported/alive? |
| 17:57 | rasmusto | bbloom: looks like its here permanently? http://fastar.org/dads/ |
| 17:58 | DerGuteMoritz | seangrov`: not quite, I'm back in Scheme land right now |
| 17:58 | seangrov` | DerGuteMoritz: Do you recommend I avoid it? |
| 17:59 | DerGuteMoritz | seangrov`: it was also the first thing I ever did in Clojure so it's not the most idiomatic code in the world :-) |
| 17:59 | DerGuteMoritz | seangrov`: dunno, it should work at least with Facebook's flavor of oauth2 |
| 17:59 | seangrov` | Looks like there isn't really a general oauth1.0a/2.0 client in clojure then |
| 17:59 | DerGuteMoritz | OAuth 2.0 is way too fuzzy to implement in a general fashion |
| 17:59 | seangrov` | DerGuteMoritz: Thanks for being straightforward about it, very much appreciate it |
| 18:00 | DerGuteMoritz | and there are way too many drafts implemented in the wild |
| 18:00 | DerGuteMoritz | seangrov`: no prob! |
| 18:00 | seangrov` | DerGuteMoritz: Yeah, we've integrated with ~15 or so |
| 18:00 | DerGuteMoritz | it's crazy |
| 18:00 | seangrov` | But all in ruby land, not clojure yet |
| 18:01 | DerGuteMoritz | wow, not bad |
| 18:01 | jjido | ah, is that why I couldn't wrap my head around it |
| 18:01 | DerGuteMoritz | I bet it's not pretty |
| 18:01 | seangrov` | DerGuteMoritz: Not even slightly. |
| 18:01 | DerGuteMoritz | heh |
| 18:02 | DerGuteMoritz | seangrov`: your nick rings a bell, did we meet in #chicken before? |
| 18:02 | seangrov` | DerGuteMoritz: Yeah, I wrote the opengl wrapper/engine-ish thing a few years back |
| 18:02 | DerGuteMoritz | ah right! |
| 18:04 | DerGuteMoritz | from OpenGL to OAuth 2.0 |
| 18:04 | seangrov` | Yeah, neither are very pretty, thinking about it |
| 18:04 | DerGuteMoritz | heh, gotta avoid things with an O |
| 18:04 | seangrov` | Haha, that could be the lesson here, possibly |
| 18:05 | seangrov` | Are you working on production stuff with Chicken? |
| 18:05 | DerGuteMoritz | Oracle, OOP, Ostriches |
| 18:05 | DerGuteMoritz | yeah |
| 18:05 | DerGuteMoritz | we're using it on mobile platforms |
| 18:06 | seangrov` | DerGuteMoritz: Natively? That was originally my goal with Chicken, actually |
| 18:06 | DerGuteMoritz | that way we can use the same business and network protocol logic on both Android and iOS |
| 18:07 | DerGuteMoritz | yep, natively |
| 18:07 | seangrov` | Impressive! |
| 18:07 | DerGuteMoritz | we actually hired Felix Winkelmann :-) |
| 18:08 | DerGuteMoritz | it's pretty cool indeed |
| 18:08 | jjido | does it compile to C? |
| 18:08 | DerGuteMoritz | we'll release the toolchain we built when we're done with the project |
| 18:08 | DerGuteMoritz | jjido: yes |
| 18:08 | DerGuteMoritz | but it also has an interpreter |
| 18:09 | DerGuteMoritz | so we can have a repl on the device, too |
| 18:09 | DerGuteMoritz | remote repl, that is |
| 18:10 | jjido | you mean the server commands the device? |
| 18:10 | DerGuteMoritz | no I mean we can connect a repl to the app in development while it is running on the device and change sthings on the fly |
| 18:11 | jjido | isn't that the same? Only you limit it to dev time |
| 18:11 | seangrov` | jjido: Kind of, but sounds like the intent is a little bit different |
| 18:12 | DerGuteMoritz | oh yeah I thought by "server" you implied automated remote control or something |
| 18:12 | seangrov` | More like using slime to update code from the repl and explore the state interactively |
| 18:12 | DerGuteMoritz | right, what seangrov` says |
| 18:13 | jjido | DerGuteMoritz: ok |
| 18:13 | DerGuteMoritz | seangrov`: will you be at EuroClojure? |
| 18:14 | technomancy | DerGuteMoritz: what size distributables can you get down to? |
| 18:14 | DerGuteMoritz | technomancy: depends on what you link in, of course |
| 18:14 | technomancy | sure, but what's the minimum chicken overhead? |
| 18:14 | mtp | it's lower with eggbeaters! |
| 18:15 | DerGuteMoritz | technomancy: we haven't expored the limits, yet. I guess you can get down to about 3M |
| 18:16 | technomancy | cool |
| 18:16 | DerGuteMoritz | but for production you could also kick out the interpreter and stuff |
| 18:16 | seangrov` | DerGuteMoritz: Nah, just got back from Europe, went for JSconf |
| 18:16 | DerGuteMoritz | seangrov`: ah too bad, could have met up then :-) |
| 18:16 | seangrov` | Won't be doing that again... definitely EuroClojure next time, it looks much, much better |
| 18:16 | seangrov` | Ah, you're in Berlin? |
| 18:17 | DerGuteMoritz | no, but in Germany |
| 18:17 | DerGuteMoritz | and I will be at EuroClojure, yeah |
| 18:17 | seangrov` | Next year then :) |
| 18:18 | DerGuteMoritz | cool! |
| 18:18 | DerGuteMoritz | where was jsconf? |
| 18:18 | seangrov` | Berlin |
| 18:20 | DerGuteMoritz | of course, of course |
| 18:34 | Raynes | Refheap is back now. We had some pretty big mongodb issues (these things run on a 32 bit system, and it appears we outgrew our single mongodb instance which serviced both refheap and 4clojure). Please let me know if refheap misbehaves. <- bitemyapp TEttinger. |
| 18:34 | seangrov` | Thanks Raynes |
| 18:45 | Apage43 | ugh databases |
| 18:46 | bitemyapp | Apage43: 'tis yer jerb :P |
| 18:51 | tbaldridge | Raynes: I always loved that aspect of mongo. It runs great if you run it on the right hardware and with the right config. If not...well then screw you. |
| 18:52 | Raynes | I have no complaints about mongo int his case. |
| 18:52 | noonian | tbaldridge: lol, I'm pretty sure I'm dealing with the latter scenario |
| 18:52 | Raynes | int his* |
| 18:52 | Raynes | ... |
| 18:52 | `cbp | mongo on 32 bit is silly |
| 18:52 | Raynes | in this* |
| 18:52 | ruzu | you wouldn't respect it if it were so easy |
| 18:52 | Raynes | The problem is that we've got a 32 bit machine that we don't really have time to upgrade to 64 bit. |
| 18:52 | TEttinger | thanks Raynes |
| 18:53 | Raynes | We have so much stuff running on this machine that I'd frankly rather hop in front of a moving bus than deal with migrating it all. |
| 18:53 | Raynes | :P |
| 18:55 | arrdem | Raynes: HAH I WAS RIGHT |
| 18:55 | Raynes | Well, Kyle Kingsbury is right. Databases suck. |
| 19:01 | devn | ha |
| 19:03 | bitemyapp | ucb: your company is hosting Seajure tonight :) |
| 19:04 | ucb | bitemyapp: yeah, I think that's a regular thing? maybe? |
| 19:04 | ucb | shame I'm not there |
| 19:04 | bitemyapp | ucb: I'm not in Seattle, wouldn't know. Going to the SF meetup tonight. |
| 19:04 | ucb | cool |
| 19:06 | ucb | I might go to the FOREVER ALONE one tonight |
| 19:07 | technomancy | ucb: it's here every other month |
| 19:07 | ucb | technomancy: :) |
| 19:08 | chare | I hate you all so much |
| 19:09 | `cbp | make <3 not starcraft |
| 19:09 | chare | http://www.arcsynthesis.org/gltut/Basics/Tutorial%2002.html |
| 19:09 | chare | I am reading that |
| 19:09 | arrdem | (inc `cbp) |
| 19:09 | lazybot | ⇒ 1 |
| 19:09 | chare | you can't stop me |
| 19:11 | chare | what projects are you working on `cbp |
| 19:11 | `cbp | need to know only |
| 19:12 | mtp | oh did chord come back |
| 19:12 | chare | i'm not chord |
| 19:12 | arrdem | mtp: yep he did |
| 19:12 | mtp | i can tell because someone visible on my screen is talking about starcraft |
| 19:12 | chare | mtp I started reading http://www.arcsynthesis.org/gltut/Basics/Tutorial%2002.html |
| 19:12 | chare | so i'm not dedicated to only starcraft |
| 19:13 | chare | therefore i'm not chord |
| 19:13 | mtp | so how about that government shutdown |
| 19:13 | arrdem | mtp: the part where murder is legal now? |
| 19:14 | chare | how do we stop asshole nsa |
| 19:14 | TEttinger | pretty sure hank won't be able to catch heisenberg now, since the DEA is shut down |
| 19:14 | mtp | idk, i hear they're still operating well enough to arrest people and start federal criminal proceedings |
| 19:15 | nDuff | mtp: http://www.popehat.com/2013/10/01/tales-from-another-shutdown/ may be of interest to you (day in the life of a federal prosecution during the last shutdown) |
| 19:15 | nDuff | s/prosecution/prosecutor/ |
| 19:15 | mtp | nDuff thanks |
| 19:22 | wakeup` | ok guys |
| 19:22 | chare | who here is super cool |
| 19:22 | wakeup` | I have tested it: java.jdbc/execute! is NOT thread safe. |
| 19:23 | tbaldridge | wakeup`: how so? |
| 19:24 | wakeup` | tbaldridge: Threw a lot of concurrent execute!'s at the same |
| 19:24 | wakeup` | database and it threw "database locked"" exceptions. |
| 19:24 | technomancy | wakeup`: probably depends on the underlying DB driver |
| 19:24 | tbaldridge | that's a DB or SQL driver issue, java.jdbc |
| 19:24 | tbaldridge | *not java.jdbc |
| 19:25 | tbaldridge | SQL servers are full of locks throw too much at it and that sort of stuff happens. |
| 19:26 | chare | don't use mysql |
| 19:26 | chare | use postgresql |
| 19:26 | wakeup` | I use a lock to make it thread-safe ;) |
| 19:26 | chare | problem solved |
| 19:26 | wakeup` | I am using sqlite :D |
| 19:26 | technomancy | sqlite's jdbc adapter is junk =\ |
| 19:26 | wakeup` | it is |
| 19:27 | wakeup` | but it seems to work |
| 19:27 | wakeup` | I only ran into debugging difficulties because it caused segfaults on bad usage |
| 19:27 | wakeup` | pretty good start in the day when your jvm segfaults. |
| 19:29 | chare | why would you be using sqlite |
| 19:29 | wakeup` | I don't decide those things |
| 19:29 | wakeup` | I just implement |
| 19:29 | seangrov` | Damnit, I killed by *nrepl* buffer on accident - can I get it back without re-running nrepl-jack-in? |
| 19:30 | technomancy | seangrov`: M-x nrepl |
| 19:30 | technomancy | you can find the port in target/repl-port |
| 19:30 | wakeup` | chare: why do you think I am programming clojure? |
| 19:30 | wakeup` | ;) |
| 19:30 | chare | girlfriend cheated on you is that why? |
| 19:31 | wakeup` | (I am unfamiliar with clojure, that's all guys) |
| 19:31 | bitemyapp | wakeup`: chare is a troll, ignore him. |
| 19:31 | bitemyapp | technomancy: ahem ^^ |
| 19:32 | seangrov` | technomancy: I have to agree with bitemyapp |
| 19:32 | technomancy | chare: I don't want to mute you again; maybe you could give me a reason not to? |
| 19:32 | mtp | he isn't even a particularly good troll |
| 19:32 | chare | unmute my original account like i asked |
| 19:33 | mtp | shut up |
| 19:33 | seangrov` | technomancy: That worked, thank you! |
| 19:33 | mtp | that's not how you get unbanned |
| 19:33 | wakeup` | oh lol |
| 19:33 | seangrov` | Didn't know about the target/repl-port |
| 19:33 | technomancy | chare: I don't understand; why would I do that? |
| 19:33 | wakeup` | I thought I was framed as a troll again |
| 19:33 | mtp | technomancy he asked so obviously you have to do it |
| 19:33 | seangrov` | (inc technomancy) |
| 19:33 | lazybot | ⇒ 81 |
| 19:34 | AimHere | If you unmute his other nick, then you won't have to unmute this one. Bargain! |
| 19:34 | AimHere | No wait, other thing |
| 19:34 | mtp | i say we unmute his other nick and set a /different/ mode |
| 19:34 | mtp | but i'm not a good enough troll to have gotten ops yet |
| 19:35 | wakeup` | you just gotta be locked into renegade radio right now |
| 19:36 | wakeup` | icide in the mix |
| 19:38 | chare | lets talk about making a clojure project together |
| 19:38 | wakeup` | chare: how much do you pay? |
| 19:39 | @technomancy | no funny business |
| 19:40 | seangrov` | hahaha |
| 19:40 | chare | no mute me please |
| 19:40 | mtp | let's all rewrite clojure in python |
| 19:40 | mtp | and then port the stack to luajit |
| 19:40 | @technomancy | don't say anything stupid and I won't have to |
| 19:41 | wakeup` | chare: may I suggest you a really good OT irc channel? |
| 19:41 | ruzu | [18:08] <mtp> also, i like pie |
| 19:42 | mtp | ruzu that is a false allegation |
| 19:42 | mtp | i prefer scones |
| 19:46 | chare | question what does glGenVertexArrays do in this program: https://bitbucket.org/alfonse/gltut/src/1d1479cc7027f1e32c5adff748f3b296f1931d84/Tut%2001%20Hello%20Triangle/tut1.cpp?at=default |
| 19:47 | bitemyapp | SF meetup got canceled :( |
| 19:48 | bitemyapp | Was anybody here planning on going? |
| 20:18 | logic_prog | dnolen: is core.logic basically an optimization of http://www.cs.trincoll.edu/~ram/cpsc352/notes/unification.html ? What is there to core.logic besids unification? |
| 20:24 | Raynes | bitemyapp: Did nvd3 end up helping you guys? |
| 20:31 | chare | how do I explain to people the big difference between lisp, scheme, clojure, racket, etc... |
| 20:32 | bbloom | you mean like how do you convince people that they aren't all just the same language with a lot of parentehsis? |
| 20:32 | bbloom | "if scheme and common lisp are the same language, then so are C and javascript" |
| 20:37 | chare | bbloom: what exactly are the critical differences between lisp, scheme, clojure, racket |
| 20:40 | bbloom | chare: that's a big question |
| 20:40 | bbloom | chare: http://c2.com/cgi/wiki?LispSchemeDifferences |
| 20:41 | bbloom | http://clojure.org/rationale |
| 20:41 | bbloom | that should get you started |
| 21:01 | hiredman | I think you read that wrong |
| 21:01 | seangrov` | hiredman: Oh, sure, but I was wondering if I could make it work |
| 21:02 | hiredman | "if (two very different languages like) scheme and common lisp are the same language, then so are (two other very different languages) C and javascript" |
| 21:03 | hiredman | I would say c and js are very different at every level, where scheme and cl are very similar on a number of levels |
| 21:03 | hiredman | so I doubt you can make that work |
| 21:04 | hyPiRion | Well, C and Javacript have quite different paradigms compared to scheme and cl |
| 21:04 | hiredman | the main thing c and js have in common are curly braces |
| 21:04 | hyPiRion | and their lack of namespaces |
| 21:05 | hiredman | those must be the two features a language requires to become ubiquitous |
| 21:06 | coventry | brainfuck is fairly ubiquitous, I guess. |
| 21:07 | hyPiRion | Swearjure too |
| 21:19 | frozenlock | Could someone explain to me what I'm doing wrong here? .... |
| 21:19 | frozenlock | (try (/ 1 0) (catch Exception e (str e))) ----> catch the exception |
| 21:19 | frozenlock | (try (throw (Exception. "some funny exception") (catch Exception e (str e)))) ----> doesn't catch it |
| 21:19 | frozenlock | Errrr |
| 21:19 | frozenlock | nvm |
| 21:20 | `cbp | :-) |
| 21:23 | chare | hello |
| 21:24 | rhg135 | goodbye |
| 21:46 | bitemyapp | Raynes: gf3 could answer better than I, I think we were too frustrated and harried to use nvd3 properly. Might be able to better appreciate it with the luxury of having more than ~48 hours to go through things. |
| 22:37 | chare_ | I am back |
| 22:49 | muhoo | i am front |
| 23:15 | frozenlock | Is there a way to use a field method on the result of (.getField some-class "some-field") ? |
| 23:16 | frozenlock | For example, (.toString some-class/some-field) |
| 23:20 | `cbp | frozenlock: is that not working for you? :P |
| 23:21 | `cbp | ,(.toString Boolean/TRUE) |
| 23:21 | clojurebot | "true" |
| 23:21 | `cbp | Im not sure what you're asking :P |
| 23:22 | frozenlock | Ok, so if I do the .getField, I get somehting like this in my REPL: #<Field public static final .... |
| 23:22 | frozenlock | But if I type some-class/some-field, I get.. well, the field :p |
| 23:23 | chare_ | `cbp work on starcraft clone game please |
| 23:24 | frozenlock | ,(.getField Boolean "TRUE") |
| 23:24 | clojurebot | #<Field public static final java.lang.Boolean java.lang.Boolean.TRUE> |
| 23:24 | frozenlock | ,Boolean/true |
| 23:24 | clojurebot | #<CompilerException java.lang.RuntimeException: Unable to find static field: true in class java.lang.Boolean, compiling:(NO_SOURCE_PATH:0:0)> |
| 23:24 | frozenlock | ,Boolean/TRUE |
| 23:24 | clojurebot | true |
| 23:25 | `cbp | frozenlock: that's because getField returns a Field object |
| 23:25 | `cbp | http://docs.oracle.com/javase/1.4.2/docs/api/java/lang/Class.html#getField(java.lang.String) |
| 23:26 | xeqi | ,(.get (.getField Boolean "TRUE") Boolean) |
| 23:26 | clojurebot | true |
| 23:26 | frozenlock | Oh |
| 23:26 | frozenlock | Let me try that... |
| 23:27 | frozenlock | Well, sonofabitch :p |
| 23:27 | frozenlock | It works! Thanks :D |
| 23:41 | dobry-den | How can you export a ClojureScript function so that you just call it by its function name in the browser? |
| 23:41 | dobry-den | hello() instead of myns.hello() |
| 23:43 | amalloy | xeqi: also ##(.get (.getField Boolean "TRUE") nil) |
| 23:43 | lazybot | java.lang.SecurityException: You tripped the alarm! clojail.testers.ClojailWrapper@17f0667 is bad! |
| 23:43 | amalloy | whut |
| 23:43 | amalloy | reflection, i guess? yeah, lazybot disallows that, but the error message kinda sucks |
| 23:43 | amalloy | ,(.get (.getField Boolean "TRUE") nil) |
| 23:43 | clojurebot | true |
| 23:44 | mullr | dorby-den: can you do something like (set! (.-hello window) myns.hello) ? |
| 23:45 | mullr | you might need to add myns.hello to a list of exports so it doesn't get mangled / removed by the closure optimizer |
| 23:46 | frozenlock | amalloy: I'm confused by 'nil'... aren't we trying to get a field from nil in this case? |
| 23:46 | amalloy | frozenlock: a static field |
| 23:47 | amalloy | it doesn't live on an object, it lives in the class |
| 23:47 | amalloy | so there's no instance needed for the .get, once you have the handle already |
| 23:48 | frozenlock | Interesting. Is the .get still the most economical way to get it? |
| 23:48 | xeqi | "economical" ? |
| 23:48 | frozenlock | well, the simpliest |
| 23:49 | frozenlock | simplest |
| 23:49 | amalloy | i mean, obviously not, (Boolean/TRUE) is |
| 23:50 | frozenlock | Err, yeah, but once you have the field using getField :p |
| 23:55 | ddellacosta | dobry-den: you use export, like (defn ^:export my-fn [] …) then you call it like name.space.my_fn() |
| 23:56 | ddellacosta | dobry-den: oh sorry, you were asking without namespace? It's not possible I don't think, although I guess you could attach it to the window like mullr suggests…but I don't think it needs to be in exports does it? |
| 23:58 | ddellacosta | if it is set as a property on the window then will it still get mangled by the clojure compiler? Guess it's something to test |