2013-03-16
| 00:00 | yedi | that's all good an well, but I want my app to work locally as well |
| 00:00 | yedi | so I want to be able to set the properties locally |
| 00:02 | jeremyheiler | yedi: Are you using lein? |
| 00:02 | yedi | to deploy to beanstalk, yes |
| 00:02 | yedi | to do everythinf* |
| 00:03 | jeremyheiler | If you're using lein to run the application locally, I *think* you can set :jvm-opts in your project.clj to set -D options. |
| 00:03 | tyler__ | is there a clojure lib for running popular shell commands like `ls` `ps` etc but not from the shell, a native clojure version of it |
| 00:05 | ToxicFrog | I have caused the best error |
| 00:05 | ToxicFrog | 2013-03-16 00:06:08,544 ERROR - (nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil) |
| 00:06 | tyler__ | heh |
| 00:06 | jeremyheiler | tyler__: Well, you could use fs to emulate ls. |
| 00:06 | amalloy | tyler__: you want conch, by Raynes |
| 00:06 | jeremyheiler | tyler__: Actually, there is fs.core/list-dir |
| 00:07 | tyler__ | Raynes makes some good stuff |
| 00:07 | Raynes | amalloy: He said specifically a native Clojure version of it though, so fs is what he wants in this case. |
| 00:07 | Raynes | http://github.com/Raynes/fs |
| 00:07 | Raynes | tyler__: ^ |
| 00:07 | amalloy | oh. i filtered that, because it's a crazy thing to want |
| 00:07 | tyler__ | what im *really* looking for is anything that outputs datastructures |
| 00:07 | tyler__ | it cnabe java |
| 00:07 | Raynes | lol |
| 00:07 | tyler__ | can be* |
| 00:08 | amalloy | nobody is going to reimplement an operating system in clojure |
| 00:08 | tyler__ | seems like an honest ambition if someone were to do it |
| 00:08 | tyler__ | heh |
| 00:09 | yedi | jeremyheiler: -D options? |
| 00:09 | jeremyheiler | tyler__: You're trollin' |
| 00:09 | jeremyheiler | lol |
| 00:09 | tyler__ | im not saying they *should* |
| 00:09 | tyler__ | im just saying i would cheer them if they did |
| 00:09 | jeremyheiler | yedi: Read up on java command line -D |
| 00:09 | amalloy | you'll just get the lisp-curse version of an operating system |
| 00:09 | amalloy | "all these other lisp operating systems are kinda okay, but they're missing feature X and do Y in a really weird way, i'll just write my own" |
| 00:10 | jeremyheiler | yedi: Better yet, just type "java" in a terminal and it explains it. |
| 00:10 | yedi | oh cool, thanks jeremyheiler |
| 00:11 | tyler__ | im trying to build a system that talks to a server over ssh to get a bunch of meta about the server, right now im using standard shell commands to get data, but each one of them has their own output format |
| 00:11 | tyler__ | and its a pain in the ass |
| 00:12 | jeremyheiler | yedi: np |
| 00:12 | tyler__ | i found a good awk script that converts column output to json |
| 00:13 | tyler__ | but ls is pesudocolumns |
| 00:13 | tyler__ | heh |
| 00:13 | jeremyheiler | tyler__: Welcome to unix :-) |
| 00:13 | tyler__ | jeremyheiler: which is why i said a clojure os wouldn't be so bad |
| 00:39 | technomancy | so... for syme. I want to set up DNS entries for instances so you can do `ssh syme@technomancy.syme.in` |
| 00:39 | technomancy | but the problem is there isn't a 1:1 mapping from usernames to instances |
| 00:39 | technomancy | I could launch a bunch of instances |
| 00:40 | technomancy | so the question is: is it worth subdividing it so that you have to do something like `ssh syme@technomancy.3.syme.in` so they can all be addressed? or should the DNS names only be set up for one instance per user? |
| 00:59 | jetkoten | hi all |
| 01:43 | yunfan | nice , i am in lispcn-2013-beijing |
| 01:44 | yunfan | people all talk clojure |
| 03:13 | xorola | Hi guys, what are plans for improving clojure documentation? does anybody thought/discussed about it? |
| 03:22 | john2x | any getting started tutorial for lib-noir? or would webnoir.org's tutorial be viable? |
| 03:45 | mjc | or perhaps luminus |
| 05:04 | maio | technomancy: is it useful to have multiple active instances? |
| 05:09 | maio | technomancy: btw what about project.user.syme.in? |
| 05:32 | mpenet | anyone knows how to type a merged map of 2 other possible types in core.typed (if that's possible)? |
| 05:34 | mpenet | ex a merge of (HMap {:a '1}) (HMap {:a '2}) where these 2 are aliased, so if possible avoiding repetitions |
| 05:38 | mindbender1 | how can I get cljsc to copy my js lib to the public directory and update deps.js(main.js) to point to it rather than point to it's orginal location which is not available to the webserver? |
| 05:39 | mindbender1 | I'm hoping someone understands |
| 06:59 | tdignan | In the clojure repl, how do I enter a tab for purely aesthetic/indentation purposes? |
| 07:12 | pepijndevos | tdignan, you can't? Maybe by not using readline? I don't know. |
| 07:39 | tdignan | pepijndevos: ah, interesting |
| 07:42 | tdignan | clojure -r works |
| 07:42 | tdignan | but if I run 'clojure' or 'lein repl' |
| 07:42 | tdignan | the tab goes straight to completion |
| 09:12 | ravster | morning, all |
| 09:14 | skelternet | (send-off ravster (top morning)) |
| 09:15 | john2x | compojure, ring newbie here. how do I assign a ring handler with compojure's GET macro? |
| 09:17 | ravster | john2x: (GET "uri" [] handler) |
| 09:17 | ravster | I nearly always just send the entire request object to the handler. |
| 09:19 | john2x | ohh cool, thanks. I was doing it with (handler). |
| 09:21 | john2x | hmm but then how do I pass the arguments from a uri like "/user/:id"? |
| 09:21 | john2x | I'm geting ArityException with (GET "/user/:id" [id] handler) |
| 09:21 | ravster | https://github.com/weavejester/compojure/wiki/Routes-In-Detail |
| 09:22 | ravster | john2x: do you have wrap-params? |
| 09:22 | ravster | and what are the arguments your handler is expecting? |
| 09:23 | john2x | ravster: no wrap-params (yet. not sure when i'd use it). handler is (defn handler [request id] …) |
| 09:39 | john2x | ah so it get's included in (:params request). cool |
| 09:42 | mpenet | ambrosebs: Hi, could you have a look at this gist, it something I didn't manage to express so far. I am probably missing something obvious https://gist.github.com/mpenet/5175786 |
| 09:42 | mpenet | |
| 09:44 | ambrosebs | mpenet: you want to express a type that has an :a but not a :b? |
| 09:45 | ambrosebs | I guess that would solve it |
| 09:47 | ambrosebs | mpenet: Something like (U (HMap {:a 1} :without [:b]) (HMap {:b 2} :without [:a]) '{:a 1 :b 2}) would be nice |
| 09:47 | ambrosebs | The reason I don't have this currently is that this is sort of half assed row polymorphism, which I would like to fully support. |
| 09:49 | mpenet | not really, it can have a key :b but if it's the case it must match the contraint |
| 09:49 | mpenet | I will have to wrap this in another type I think |
| 09:49 | ambrosebs | Wait, is :b optional? |
| 09:49 | mpenet | I would like to only allow {:a 1} {:b 2} or {:a 1, :b 2}, but not {:a 0 :b 4} or {:d 234} |
| 09:50 | mpenet | yes |
| 09:51 | mpenet | the use case is for a korma'isn library, where I want statements (maps) to only allow certain clauses (also maps) |
| 09:52 | mpenet | right now I use an union, it's fine if the user only supply maps with keys that are typed, but not if some unknown key creeps in |
| 09:52 | ambrosebs | Yes, it's not possible currently to express this. Specifically the third case is a subtype of '{:a 1} which has no constraint on :b. |
| 09:53 | mpenet | right, no big deal, worse case scenario I'll use macros, or just copy paste some code :) |
| 09:54 | ambrosebs | mpenet: yes, this is a classic case for row polymorphism. |
| 09:55 | mpenet | I have to read about that! Thanks for the help. |
| 09:56 | ambrosebs | mpenet: Now that I think about it, this is a fatal flaw of :optional. |
| 09:57 | ambrosebs | well it's not unsound, but it's not very useful. |
| 09:57 | augustl | portland! Gonna be gooood.. |
| 09:58 | torn | hi there, i've installed the latest java jdk 1.7, and leiningen, and created a new lein project |
| 09:59 | torn | when i do 'lein repl' it downloads a bunch of jars into my .m2 repository but then dies with "java.lang.RuntimeException: Unable to resolve symbol: defn in this context2 |
| 09:59 | torn | -2* |
| 09:59 | torn | any ideas? |
| 10:00 | mpenet | ambrosebs: I will have to use optional anyway I think, some statements have clauses that are required and some optional, I will have to make some tradeoffs, I have to run now, but I will try this later today/tonight |
| 10:01 | torn | I do get a few maven errors - Could not find artifact slingshot:slingshot:pom:0.10.2 in central, cheshire:pom:3.1.0, clojure-complete:jar:0.2.1, cd-client:jar:0.3.4, clj-http:jar:0.3.5 |
| 10:01 | augustl | torn: you didn't change anything in the output of "lein new"? |
| 10:01 | torn | nope nothing changes |
| 10:01 | torn | changed* |
| 10:01 | ambrosebs | mpenet: sure, be aware :optional keys may not be of the type stated in the :optional map. |
| 10:01 | augustl | tomoj: lein -v? |
| 10:02 | augustl | err, torn |
| 10:02 | torn | Leiningen 2.0.0-preview10 on Java 1.7.0_17 Java HotSpot(TM) 64-Bit Server VM |
| 10:02 | mpenet | ambrosebs: noted |
| 10:03 | torn | i'm thinking maybe maven central doesn't have the jar versions that my version of leiningen wants to download? |
| 10:03 | augustl | torn: that's not the latest version, but still weird :) |
| 10:03 | torn | I installed it using 'Chocolatey' package manager for windows |
| 10:04 | torn | what is the latest version? |
| 10:04 | torn | i can try a lein upgraade |
| 10:06 | augustl | tomoj: 2.0.0 |
| 10:07 | torn | without the -preview10 i guess |
| 10:07 | torn | hmm gives me a 403 when I try to self-install to 2.0.0 |
| 10:10 | augustl | I've never used leiningen on windows so I should probably shut up ;) |
| 10:13 | torn | hmm ok i've uninstalled chocolately package manager |
| 10:13 | torn | and installed lein by hand using the lein.bat file |
| 10:14 | torn | cleared out my m2 repo also |
| 10:14 | torn | this time 'lein repl' has no dependency issues with maven, but i still get the "Unable to resolve symbol: defn in this context" issue |
| 10:15 | augustl | seems like clojure.core isn't loaded properly (wild guess) |
| 10:16 | torn | ah it seems the version of lein installed with chocolately didn't make the project properly |
| 10:16 | torn | or, aha! maybe calling my project 'clojure' was a bad idea (tm) |
| 10:17 | yedi | why is paredit indenting this all wierd: https://gist.github.com/yedi/5176574 |
| 10:17 | torn | anyone here use Light Table IDE? |
| 10:18 | augustl | torn: ah :) |
| 10:19 | augustl | and leiningen by default creates yourproject.core :) |
| 10:19 | torn | yup |
| 10:19 | yedi | oh whoops, updated: https://gist.github.com/yedi/5176574 |
| 10:19 | hyPiRion | torn: yeah, that's fixed by technomancy/leiningen#1017, so that bug will be gone by 2.1.0 |
| 10:19 | lazybot | lein new should reject projects named "clojure" -- https://github.com/technomancy/leiningen/issues/1017 is closed |
| 10:19 | hyPiRion | heh |
| 10:19 | augustl | any early birds in Portland wanna meet up for some food? |
| 10:20 | torn | closed 21 days ago, i guess the version installed with chocolately didn't have that fix in |
| 10:20 | torn | ok repl seems to work |
| 10:20 | torn | now I need to get my head around light table, see if i can run a repl in that |
| 10:30 | torn | anyone here run lein-light with light table? |
| 10:31 | yedi | does anyone have experience setting up RDS with elastic beanstalk |
| 10:31 | yedi | i'm having issues figuring out how I should be going about it |
| 10:35 | yedi | slightly related question: will running lein beanstalk deploy update the app on beanstalk? or will it terminate and redeploy? |
| 11:02 | torn | oh man light table is pretty neat |
| 11:21 | technomancy | maio: heh; missed you last night. so yeah, I think there's really no reason you can't re-use instances; better to manually bootstrap an existing instance for a new project than wait for a new one to boot. |
| 11:22 | technomancy | maio: OTOH, do we enforce this limitation? if not then we have to be clever and fall back to the IP if someone launches a second instance without halting the first. |
| 11:22 | technomancy | the problem with username.project.syme.in is that project is multi-segmented |
| 11:23 | technomancy | so it'd have to be technomancy.technomancy.syme.syme.in which is even more annoying than the IP =) |
| 11:24 | Pure-Loulou | .(#((first '(and a b)) % %2) false true) |
| 11:24 | technomancy | I guess we could assume each user is not going to hack on multiple forks of a project I guess |
| 11:24 | Pure-Loulou | why this returns true? any help? |
| 11:24 | clojurebot | A bug report (or other request for help) has three parts: What you did; what you expected to happen; what happened instead. If any of those three are missing, it's awfully hard to help you. |
| 11:25 | hyPiRion | Pure-Loulou: '(and a b) is a list with three symbols, and symbols are IFns |
| 11:26 | Pure-Loulou | IFns? |
| 11:26 | hyPiRion | ,('and false true) |
| 11:26 | clojurebot | true |
| 11:26 | hyPiRion | ,('and {'and :hello} true) |
| 11:26 | clojurebot | :hello |
| 11:26 | hyPiRion | So they are like keywords, maps, sets and vectors |
| 11:26 | hyPiRion | you can call them with functions |
| 11:26 | hyPiRion | /s/with/as/ |
| 11:26 | Pure-Loulou | ,(#((eval (first '(and a b))) % %2) false true) |
| 11:26 | clojurebot | #<Exception java.lang.Exception: SANBOX DENIED> |
| 11:27 | Pure-Loulou | how to wright this so it works? |
| 11:28 | hyPiRion | You could do (eval (list (first '(and a b)) false true)) |
| 11:28 | hyPiRion | since and is a macro, you cannot use it as a function itself |
| 11:28 | Pure-Loulou | ok:) thx |
| 11:45 | thorwil | with a nrepl server provided by immutant, a (use 'midje.repl) in user leads to: FileNotFoundException project.clj (No such file or directory) java.io.FileInputStream.open (FileInputStream.java:-2) |
| 11:45 | thorwil | (trying to follow https://github.com/marick/Midje/wiki/Repl-tools) |
| 11:47 | hyPiRion | thorwil: Are you using leiningen for project management? |
| 11:47 | thorwil | hyPiRion: yes |
| 11:51 | thorwil | so far i relied on "lein midje" if i wanted to run all tests, otherwise relying on midje-check-fact-near-point |
| 11:51 | jonasac | #(fn %) => #(fn &%) is it possible ? |
| 11:52 | thorwil | but now "lein midje" fails to resolve a dependency, while "lein immutant run" works fine. so i'm investigating how to run all tests from nrepl |
| 11:54 | thorwil | and fail to find a way to make load-facts available :/ |
| 12:01 | jcrossley3 | thorwil: it's possible that midje is making some assumptions about the current working directory of the jvm |
| 12:02 | jcrossley3 | try 'lein immutant run' after cd'ing to the directory containing your project.clj |
| 12:03 | piranha | octagon: hi? :) |
| 12:03 | octagon | piranha: hey! how's it going? |
| 12:03 | thorwil | jcrossley3: that's already the case. i never run it from any other dir |
| 12:04 | piranha | octagon: well, still haven't figured out problem with state not updating in the middle of change |
| 12:04 | piranha | octagon: that's actually what I wanted to ask, if you had a chance to look at it :)) |
| 12:04 | jcrossley3 | thorwil: hmm. what version of midje? is this a public app i can clone and try? |
| 12:05 | octagon | piranha: i did "make" but i didn't get anything but js files |
| 12:05 | thorwil | jcrossley3: just updated to midje 1.5.0 |
| 12:05 | octagon | piranha: i'd like to be able to experiment with the actual app live |
| 12:05 | piranha | octagon: if you open 'build/index.html', it opens it in browser |
| 12:05 | octagon | piranha: oh ok, cool |
| 12:05 | piranha | 'make' is just shortcut for me to not type 'lein cljsbuild auto main' |
| 12:06 | thorwil | jcrossley3: https://github.com/thorwil/tlog but i just *now* pushed the changes to project.clj |
| 12:06 | octagon | piranha: i think your problem is maybe related to creating cells out of order, which is a weird issue i've run into in my own apps |
| 12:07 | piranha | octagon: oh... not sure, I really was a bit lost in traceback there, it's still a bit hard to debug clojurescript |
| 12:07 | octagon | piranha: like i've found that especially with formula cells, the dependencies don't get set up correctly if the cells they depend on don't exist when they're created |
| 12:07 | piranha | octagon: ah, but in this case it shouldn't be a dependency, it's just assignment to cell somewhere in a function |
| 12:08 | octagon | piranha: it's because when you create a formula it's trying to set up the dependency graph ranks, and if dependencies don't exist then weirdness might result |
| 12:08 | piranha | hm, doesn't look like a case to me |
| 12:08 | maio | technomancy: oh yeah good point about the hostname - i missed that. but yeah I think we could assume that person wouldn't work on different forks |
| 12:20 | technomancy | maio: yeah, sounds good. as long as it can fall back to showing the IP when a specific instance has its subdomain deregistered we'd be good |
| 12:20 | Glenjamin | Hi guys, does anyone know if there's a non-trivial compojure app that's open-sourced? |
| 12:20 | Glenjamin | I'm trying to get started but the examples I can find are quite light |
| 12:20 | technomancy | Glenjamin: oh yeah absolutely; funny you should ask: https://syme.herokuapp.com |
| 12:20 | technomancy | well... it's still on the simple side. but quite useful =) |
| 12:21 | technomancy | Glenjamin: the biggest OSS compojure app is Clojars |
| 12:22 | Glenjamin | i'm mostly trying to figure out how much logic to put in the def-routes definition vs spinning out functions, where to put things, and how to test effectively without running every case end-to-end |
| 12:22 | maio | technomancy: btw what are you using these hostnames for? why not just IP? |
| 12:24 | maio | technomancy: btw here is the status page I'm working on - http://maio.cz/tmp/syme/Screen%20Shot%202013-03-16%20at%205.23.04%20PM.png |
| 12:44 | mye | What's the canonical way to join to longs and get the bigint that represents? Do I have to join up the individual bytes? (New to JVM bit twiddling..) |
| 12:53 | Guest76401 | hello |
| 12:53 | Guest76401 | Is it okay if I pose a begginer macro question? |
| 12:54 | Guest76401 | I want to make a macro that returns a function. |
| 12:54 | Guest76401 | This is what I've got: |
| 12:55 | Guest76401 | (defmacro rotate-base [code] |
| 12:55 | Guest76401 | `(fn [piece] |
| 12:55 | Guest76401 | (let [s (dec (count piece))] |
| 12:55 | Guest76401 | (map #(let [[x y] %] ~code) piece)))) |
| 12:55 | Guest76401 | |
| 12:55 | Guest76401 | (rotate-base '(list y (- s x))) |
| 12:55 | Guest76401 | This does not work. Why? |
| 12:57 | momomomomo | Guest76401: That's a terrible way to ask for help haha. Paste your code into a http://gist.github.com/ and explain where you think it might be failing |
| 12:58 | xeqi | Guest76401: hmm, looks like what you want could just be a function |
| 12:58 | Guest76401 | Thank you momo... |
| 12:58 | xeqi | well, almost |
| 12:59 | Guest76401 | xeqi: the reason for macro is that i've got diffrent code snippets |
| 13:01 | Guest76401 | https://gist.github.com/anonymous/5177314 |
| 13:02 | tomoj | "explain where you think it might be failing" -- "Can't use qualified name as parameter" ? |
| 13:03 | arcatan | Guest76401: you can look at what that expands into with (macroexpand '(rotate-base '(list y (- s x)))) |
| 13:03 | Guest76401 | yes i have tried macroexpand |
| 13:04 | Guest76401 | (macroexpand-1 '(rotate-base (list y (- s x)))) |
| 13:04 | Guest76401 | (clojure.core/fn [user/piece] (clojure.core/let [user/s (clojure.core/dec (clojure.core/count user/piece))] (clojure |
| 13:04 | Guest76401 | e/map (fn* [p1__1__2__auto__] (clojure.core/let [[user/x user/y] p1__1__2__auto__] (list y (- s x)))) user/piece))) |
| 13:04 | momomomomo | Guest76401: Try editing the gist you've created. It's hard to parse code in an irc client. |
| 13:04 | arcatan | Guest76401: piece becomes user/piece, but that's not what you want. you'll want it to have a new unique name i.e. use gensym. rename piece to #piece |
| 13:04 | arcatan | Guest76401: sorry, piece -> piece# |
| 13:05 | Guest76401 | ok thanks arcatan |
| 13:05 | tomoj | basically you're trying to do something evil (unhygienically bind x/y, letting them leak out into the code the macro-user writes) and clojure is preventing you |
| 13:05 | arcatan | also listen to tomoj :) |
| 13:05 | Guest76401 | momo... thank you for the comments i will ask question in a better way in the future |
| 13:06 | Guest76401 | thanks arcatan and tomoj, will try/read about it |
| 13:06 | tomoj | consider writing it as a higher order function instead of a macro |
| 13:06 | tomoj | perhaps: (defn base-rotater [f] (fn [piece] (let [s (dec (count piece))] (map (fn [[x y]] (f s x y)) piece)))) |
| 13:07 | Guest76401 | yes i did higher-order function previously, just thought macro was the way to do things |
| 13:07 | tomoj | (base-rotater (fn [s x y] (list y (- s x)))) |
| 13:08 | SegFaultAX | Guest76401: As a rule of thumb: if it can be written as a function, write it as a function. Try to stave off converting it to a macro unless you're absolutely sure that's what you want. |
| 13:08 | SegFaultAX | I also happen to think tomoj's curried approach is nicer. |
| 13:10 | Guest76401 | ok |
| 13:11 | Guest76401 | Im new to macros but have done functional-programming previously, thought macros was the thing to do often. |
| 13:11 | Guest76401 | I'm finished with this question, I have learned somethings :). |
| 13:12 | SegFaultAX | Guest76401: I think most people would agree that macros aren't usually the first thing you should jump to. But sometimes they are absolutely perfect for what you're trying to do. |
| 13:12 | Guest76401 | ok |
| 13:12 | SegFaultAX | Guest76401: While you're learning, it might be useful to adopt the previously mentioned guiding principle of defaulting to functions as much as possible. |
| 13:12 | Guest76401 | yea |
| 13:12 | tomoj | maybe there is a function Duration -> Int which tells you the number of consecutive heads you need to see from a fair coin to say "OK, I really need a macro" given the amount of time you're been learning clojure |
| 13:13 | drorbemet | Hi, what does a cross behind a name of a liningen plugin mean exactly? |
| 13:13 | Guest76401 | tomoj: ok |
| 13:14 | SegFaultAX | drorbemet: What do you mean? |
| 13:14 | drorbemet | e.g. lein-autotest† Start Lazytest's ... @ https://github.com/technomancy/leiningen/wiki/Plugins |
| 13:15 | xeqi | drorbemet: "Plugins marked with † have not been confirmed to work with Leiningen 2." from the top of the page |
| 13:16 | SegFaultAX | drorbemet: It says it right at the top |
| 13:16 | drorbemet | Ah, thanks :-) |
| 13:16 | drorbemet | Now I saw it too .. |
| 13:22 | drorbemet | Actually I am looking for the current way to do TDD with automatic execution on change of the source code. There are so many projects to choose from: expectations, Midj, speclj, lein-autotest, lein-autoexpect ... I want to configure Eclipse and Emacs for "autotest". |
| 13:24 | drorbemet | I am trying to get expectations and lein-expectations to run with Eclipse under Windows but I still havn't figured out the configuration. |
| 13:24 | drorbemet | sorry I meant lein-autoexpect |
| 13:24 | clojure-new | Hello, i'm getting "Warning: profile :base not found." with lein from git, how can i fix it? |
| 13:25 | hyPiRion | clojure-new: Ignore it for now |
| 13:25 | hyPiRion | or use 2.0.0 until we've released 2.1.0 :) |
| 13:25 | clojure-new | hyPiRion: Ok. :) |
| 13:26 | hyPiRion | It should be out by tuesday-wednesday |
| 13:30 | lynaghk | drorbemet: the latest version of lein-midje has autotest built into it---you can just run "lein midje :autotest" and you'll get automatic source reloading and test execution |
| 13:32 | drorbemet | Oh, that's great! Then I'll take that. Thanks for the hint :-) |
| 13:41 | SegFaultAX | lynaghk: I hadn't looked at midje very closely until you brought it up. (I've been using clojure.test up til now). Midje looks pretty sweet. |
| 13:50 | ToxicFrog | So, I have a macro with a type annotation on some of its arguments. |
| 13:50 | ToxicFrog | But it will still happily be called on the wrong things. |
| 13:50 | ToxicFrog | What is the appropriate way to add type checking to the macro? Just (assert) that the types are correct? |
| 13:51 | mpenet | ambroseb_: is there a way to express a native java array of X (with All) to handle "[LSomething;" or do I need to fallback to Ljava.lang.Object ? |
| 13:53 | mpenet | seems convoluted, I will use Ljava.lang.Object + Any in the Fn body for now |
| 13:55 | mpenet | or better pass something sequential to this function and kill some ugly in the process |
| 13:55 | ambroseb_ | mpenet: use (Array Something) |
| 13:56 | ambroseb_ | Does LObject actually work? |
| 13:56 | mpenet | I didn't try yet, still drafting |
| 13:56 | mpenet | oh I missed Array |
| 13:57 | ambroseb_ | mpenet: There's (Array wr), (Array2 w r), and (ReadOnlyArray r), which is an alias for (Array2 Nothing r) |
| 13:57 | ambroseb_ | It's a solution to array covariance while preserving static soundness. |
| 13:58 | mpenet | nice |
| 13:58 | ambroseb_ | eg. use ReadOnlyArray when you have a generic action on arrays. |
| 13:58 | tomoj | ToxicFrog: what happens when you don't assert and they pass the wrong thing? |
| 13:58 | ambroseb_ | mpenet: I'm hoping to elaborate on that idea in a paper I'm coauthoring. |
| 13:59 | ambroseb_ | "Hey, array covariance doesn't have to suck" |
| 13:59 | OneFourSeven | Ambrose, you were in GSOC 2012? |
| 14:00 | ambroseb_ | OneFourSeven: Yes. |
| 14:00 | mpenet | ambroseb_: for my map issue of earlier, since I never have more than 2 or 3 clauses possible, I think ll just create multiple arities with intersections I think, listing the possible combos |
| 14:03 | ambroseb_ | mpenet: Ah, yes that's probably the correct strategy. |
| 14:03 | ambroseb_ | mpenet: But the most specific clauses go first. ie. {:a 1 :b 2} |
| 14:03 | mpenet | right |
| 14:03 | ambroseb_ | Good thinking :) |
| 14:03 | mpenet | :) learning! |
| 14:04 | rebcabin | why doesn't (-> [1 2 3] reverse (partial apply vector)) produce [3 2 1}? instead seems to produce (partial apply vector) |
| 14:04 | ambroseb_ | If it works out, please post the solution as a response to my google group post. |
| 14:05 | mpenet | Will do. I am typing another libary first, it's way smaller and I need to play a bit with All, but I'll go back to the other one later or tomorrow latest. |
| 14:07 | bbloom | rebcabin: you're doing (partial (reverse [1 2 3]) apply vector) |
| 14:07 | bbloom | ,(macroexpand '(-> [1 2 3] reverse (partial apply vector)) |
| 14:07 | bbloom | ) |
| 14:07 | clojurebot | #<RuntimeException java.lang.RuntimeException: EOF while reading> |
| 14:08 | bbloom | ,(macroexpand '(-> [1 2 3] reverse (partial apply vector))) |
| 14:08 | clojurebot | (partial (clojure.core/-> [1 2 3] reverse) apply vector) |
| 14:08 | bbloom | rebcabin: try ##(macroexpand '(->> [1 2 3] reverse (partial apply vector))) |
| 14:08 | lazybot | ⇒ (partial apply vector (clojure.core/->> [1 2 3] reverse)) |
| 14:09 | rebcabin | ahh, i see |
| 14:10 | rebcabin | thanks bbloom and clojurebot |
| 14:11 | bbloom | rebcabin: lazybot helped out too :-P i can never remember which meta characters ,&## go to which bot |
| 14:12 | rebcabin | (let [f (partial apply vector)] (-> [1 2 3] reverse f)) ; closer to my erroneous expectation |
| 14:12 | ambroseb_ | If anyone missed it, there's a new core.typed mailing list https://groups.google.com/forum/?fromgroups#!forum/clojure-core-typed |
| 14:20 | tyler__ | ohpauleez: you're a portland guy?! |
| 14:20 | ohpauleez | tyler__: I am now, mmhmm |
| 14:21 | ohpauleez | Previously I've lived in Boston, Philly, NYC, San Francisco and Eugene, OR |
| 14:21 | ohpauleez | I grew up in NH |
| 14:21 | tyler__ | ohpauleez: oh nice we should have you hang out sometime. I work at Little Bird out of PIE we are converting to a clojure stack |
| 14:21 | ohpauleez | tyler__: I'm a PIE mentor |
| 14:21 | tyler__ | ohpauleez: nice |
| 14:21 | ohpauleez | always more than happy to help with a Clojure migration |
| 14:21 | ohpauleez | :) |
| 14:22 | ohpauleez | I really enjoyed the Little Bird demo during demo day |
| 14:22 | tyler__ | thnx, heh yeah Marshall knows how to give a presentation |
| 14:22 | ohpauleez | tyler__: You guys were in Rails before? Or Python? |
| 14:23 | tyler__ | ohpauleez: ruby, not rails. i hate rails |
| 14:23 | tyler__ | we are still half ruby |
| 14:23 | tyler__ | we have a services model with a message queue |
| 14:23 | tyler__ | so its about half ruby services, half clojure services now |
| 14:23 | ohpauleez | tyler__: Ah yes, very common. That's what I was just about to say |
| 14:23 | tyler__ | maybe still more ruby than clojure |
| 14:24 | ohpauleez | we should totally meet up for beer/coffee. And definitely let me know if you guys need any advice on anything |
| 14:24 | ohpauleez | I've done the startup thing for awhile now ;) |
| 14:25 | tyler__ | ohpauleez: you going to clojurewest? (if going? (meet you me)) |
| 14:26 | ohpauleez | tyler__: I'll be there; Speaking Monday just before Rich |
| 14:26 | tyler__ | woot |
| 14:26 | ohpauleez | http://clojurewest.org/sessions#degrandis |
| 14:29 | ToxicFrog | tomoj: the macro runs just fine and I get really confusing errors at runtime because someone passed in a string rather than a regex. |
| 14:30 | torn | i'm teaching myself clojure, current playing around with namespaces |
| 14:30 | torn | is (str (ns-name *ns*)) a common thing to do? |
| 14:30 | torn | or is there a shorthand to get the name of the current namespace, for when I'm creating namespaced symbols or keywords |
| 14:34 | amalloy | torn: not very common, no. namespaced symbols are very rarely needed, and namespaced keywords are fairly rare as well as being easier to get another way |
| 14:34 | tyler__ | ,(namespace ::foo) |
| 14:34 | clojurebot | "sandbox" |
| 14:34 | amalloy | try: ::foo, for the keyword foo in the current namespace |
| 14:37 | tyler__ | ,(dir sandbox) |
| 14:37 | clojurebot | nil |
| 14:37 | tyler__ | heh |
| 14:38 | TimMc | ,(-> dir var meta :added) |
| 14:38 | clojurebot | nil |
| 14:40 | torn | yep i saw ::foo does the current ns |
| 14:40 | torn | i guess there's no equivalent for ''foo |
| 14:40 | torn | I'd have to (symbol (str (ns-name *ns*)) "foo") |
| 14:41 | mindbender1 | I've written a js source that extends closure and I want to make the compiler copy this file to :output-dir as it does with cljs source and jarred sources |
| 14:41 | torn | although why i'd want to, i have no idea -- I don't really know what symbols are used for yet - am guessing dynamic evaluation or something |
| 14:41 | mindbender1 | is this currently possible? |
| 14:44 | tomoj | ToxicFrog: then, yeah. normally in clojure you just let the user figure out the confusing errors, because they wrote incorrect code so it's their fault :). but asserting in some cases to make debugging easier is appropriate. especially at macro-time since you don't really have to worry about slowing things down with checks |
| 14:45 | tyler__ | ohpauleez: we are considering utilizing clojurescript but one of our concerns that that, thus far, our frotn end guys have been mostly html css wizards with no real CompSci concepts. So if we migrate to clojurescript we are feaful we might lock ourselves out of good front end people |
| 14:45 | tyler__ | s/that that/is that/ |
| 14:46 | ohpauleez | tyler__: That hasn't been my experience nor Kevin Lynagh's experience |
| 14:47 | mindbender1 | tyler__: it doesn'tstop your frontend guys from doing their painting job |
| 14:47 | ohpauleez | great front end people still cook up baller HTML and CSS - CLJS frees them from having to muck with JS's idiosyncrasies and allows engineers to more easily jump in on the client side |
| 14:47 | tyler__ | they do a lot of the app logic stuff too |
| 14:47 | tyler__ | to animate the dom and such |
| 14:47 | ohpauleez | I think you'd find you'd start questioning more where things get done |
| 14:47 | tyler__ | ah |
| 14:48 | tomoj | meaning, what, we get more work and the frontend guys get less? |
| 14:48 | ohpauleez | CLJS also doesn't exclude the use of JS. I think more people just realize it's easier to express what they want in CLJS once it's in place |
| 14:48 | tomoj | s/guys/people/ |
| 14:48 | tyler__ | (inc tomoj) |
| 14:48 | lazybot | ⇒ 6 |
| 14:48 | ToxicFrog | tomoj: yeah, that's what I'm after here - I'd rather have a compile-time error because they used the macro incorrectly than get a runtime error much, much later with an unclear origin |
| 14:49 | ohpauleez | tyler__: all in all, it comes down to your team, your culture, and the goals of your project |
| 14:49 | ohpauleez | Clojure and CLJS aren't always the best tools for the job - but they are pretty amazing tools |
| 14:50 | antares_ | Neocons 1.1 is released: http://blog.clojurewerkz.org/blog/2013/03/16/neocons-1-dot-1-0-is-released/, plans for the future: http://blog.clojurewerkz.org/blog/2013/03/16/the-future-of-neocons/ |
| 14:50 | tyler__ | if i can mix cljs and vanilla js pretty easilly that could solve our dilemma |
| 14:51 | wjlroe | does anyone know if there's an equivalent of lein-ring (with namespace reloading in development) for aleph? |
| 14:51 | torn | anyone here find Light Table's line selection / instarepl cursor stuff messes up sometimes? |
| 14:51 | mindbender1 | I find cljs is best suited for data manipulation on the client |
| 14:52 | ohpauleez | tyler__: It's very easy to mix |
| 14:52 | mindbender1 | the view is best left for an oo framework like closure |
| 14:52 | ohpauleez | the one caveat is advanced compilation - if you use it on your CLJS, you're going to need an externs file |
| 14:52 | tyler__ | mindbender1: i can see how a clojure system could be good for data manipulation ;) |
| 14:53 | tomoj | mindbender1: something about the view is inherently suited to an oo framework like closure? or just cljs view libraries aren't there yet? |
| 14:54 | mindbender1 | even Rich Hickey said that |
| 14:54 | tomoj | the former? |
| 14:54 | mindbender1 | you can't touch a mouse so there's an object |
| 14:55 | torn | does idiomatic clojure use camelCase or underscores or dashes for variable / function naming? |
| 14:55 | tomoj | where'd rich talk about this? |
| 14:55 | wjlroe | torn: dashes |
| 14:55 | mindbender1 | simplemadeeasy |
| 14:55 | tomoj | thanks |
| 14:55 | ohpauleez | mindbender1: I'm skeptical of the claims you're making - it is *very* dependent on the type of application you are creating |
| 14:55 | tomoj | seems obvious you need identities, obviously wrong (to me) that OO is well-suited |
| 14:56 | tomoj | inherently |
| 14:56 | torn | wjlroe: ty - even for function names? |
| 14:56 | wjlroe | torn: yup |
| 14:56 | mindbender1 | I'm not. you only need to show me solid examples |
| 14:56 | tyler__ | torn: dash all the things |
| 14:56 | ohpauleez | ie: perhaps you want to make transitions on the UI, like you would make transitions in data. In which case a Pub/Sub // pipeline // event system is what you want |
| 14:56 | egghead | just made it into portland for clj-west :) |
| 14:56 | torn | having done a lot of js recently, dashes in things scare me haha |
| 14:56 | egghead | lol torn |
| 14:56 | ohpauleez | and surely functional approaches to those systems are concise and easy to use |
| 14:56 | torn | but i guess dashes by themselves aren't s-expressions so it's all good |
| 14:57 | tyler__ | having done a lot of js lately, js scares me |
| 14:57 | egghead | torn: that's the problem with infix! |
| 14:57 | torn | meh js isn't that bad once you get around the prototypal inheritance and closures and function invocation |
| 14:57 | egghead | did you mean foo minus bar or to have a ref named foo-bar :) |
| 14:57 | mindbender1 | I find I just have to embrace both ways of thinking |
| 14:57 | ohpauleez | egghead: Welcome to PDX! |
| 14:57 | egghead | cheers ohpauleez, using the heck out of your guide |
| 14:58 | ohpauleez | egghead: Please do. Everyone should feel free to ping me with questions, requests, etc |
| 14:58 | tyler__ | egghead: welcome to town |
| 14:58 | tyler__ | ohpauleez: damn u beat me |
| 14:58 | ohpauleez | I literally live a stone's throw from the venue |
| 14:58 | ohpauleez | Just me and Fred Armisen, drinking beers |
| 14:58 | torn | PDX? |
| 14:58 | tyler__ | ohpauleez: did you see them filiming grim there last week? |
| 14:58 | ohpauleez | torn: Portland, OR |
| 14:59 | tyler__ | y i no can type |
| 14:59 | ohpauleez | tyler__: They shoot Grim all over the place, and it totally messes everything all up haha |
| 14:59 | ohpauleez | they shut down my entire block like a month ago |
| 14:59 | tyler__ | heh |
| 14:59 | ohpauleez | which ultimately meant, my dog had no where to shit |
| 14:59 | ohpauleez | haha |
| 15:21 | clojure-new | (sql/with-connection (db-connection) (sql/with-query-results results ["select * from bla"] results)) |
| 15:21 | clojure-new | This code produces: java.sql.SQLException: You can't operate on a closed ResultSet!!! |
| 15:22 | clojure-new | clojure.java.jdbc -- sql |
| 15:22 | clojure-new | What's wrong with it? |
| 15:22 | gfredericks | clojure-new: with-query-results |
| 15:22 | gfredericks | it expects you to fully process the resultset before returning |
| 15:22 | gfredericks | vec is the easiest way to do that |
| 15:23 | gfredericks | so return (vec results) instead of results |
| 15:23 | gfredericks | results is a lazy sequence that reads from the ResultSet as needed |
| 15:23 | clojure-new | gfredericks: Yay, thanks! |
| 15:23 | clojure-new | It works now. |
| 15:23 | gfredericks | so you can't realize it out of the w-q-r scope |
| 15:24 | antares_ | clojure-new: if you need some background on that lazy sequences stuff: http://clojure-doc.org/articles/language/laziness.html |
| 15:24 | clojure-new | antares_: Thank you, i'll read it. |
| 15:33 | tomoj | is query the replacement for deprecated with-query-results? |
| 15:38 | gfredericks | oh wqr is deprecated too? what are the resultset-openness semantics of the new function? |
| 15:54 | mpenet | jimduey: Did you use TFn already? I am trying to create an heterogenous type "fn" for Sequential, failing so far |
| 16:12 | jimduey | Not yet. I'm off trying to figure co vs contra-variant. |
| 16:12 | jimduey | mpenet: ^ |
| 16:13 | mpenet | jimduey: I think I may have found a bug, or that could just be me misusing it. |
| 16:13 | tyler__ | how do i do something like '(+ 1 num) but actually interpolate the value of num into there? |
| 16:16 | hyPiRion | tyler__: `(+ 1 ~num) |
| 16:16 | hyPiRion | ,(let [num 10] `(+ 1 ~num)) |
| 16:16 | clojurebot | (clojure.core/+ 1 10) |
| 16:16 | tyler__ | hyPiRion: thanks, still getting the macro-y stuff down |
| 16:16 | hyPiRion | Well, that will namespace the symbols too. |
| 16:28 | tyler__ | is parallelism directly proportional to concurrency on the JVM since threads run on different cores? |
| 16:34 | ohpauleez | tyler__: Not necessarily |
| 16:34 | ohpauleez | bbloom: shall we do this again? ^^ |
| 16:34 | bbloom | ohpauleez: heh. dammit. i guess i need to write that blog post |
| 16:35 | tyler__ | bbloom: that sounds like a good blog post |
| 16:35 | ohpauleez | We just need to create a blog: "Things we've said in #clojure that need to be properly archived" |
| 16:35 | tyler__ | speaking of which i just wrote: http://tyler808.wordpress.com/2013/03/16/its-time-for-a-new-unix/ |
| 16:35 | ohpauleez | tyler__: Since it seems like you have a general idea, I'll give you the quick and dirty |
| 16:36 | bbloom | tyler__: http://clojure-log.n01se.net/date/2013-02-26.html#16:17 |
| 16:36 | tyler__ | irclogasblog.tumblr.com |
| 16:36 | tyler__ | heh |
| 16:36 | tyler__ | that actually is a proper blog: "web log" |
| 16:37 | tyler__ | literally |
| 16:37 | ohpauleez | concurrency is just handling/doing more than one thing at the same time, potentially swapping between things. Parallelism is *actually* doing multiple things at exactly the same time. In the most precise definition, it comes in two flavors: data parallelism and task parallelism. |
| 16:38 | hyPiRion | http://clojure-log.n01se.net/date/2012-12-17.html#22:30 <- my proudest moment in this channel |
| 16:38 | ohpauleez | dp - you're doing a single task, in parallel across some chunk of data |
| 16:38 | ohpauleez | that's the most common |
| 16:38 | ohpauleez | tp - you're doing a bunch of different tasks in parallel, most likely on the same pool of data |
| 16:38 | llasram | hyPiRion: It was something to be proud of :-) |
| 16:38 | ohpauleez | then there are some analogies: dinner parties, schools and classrooms |
| 16:39 | hyPiRion | hehe |
| 16:39 | tyler__ | i get the difference between the two, i was asking does the amount of parallelism go up as concurrency goes up |
| 16:39 | ohpauleez | on the JVM, you could do async concurrency, of you could use OS-level threads. Assuming you have an SMP kernel, those threads will hit different cores, but that's not always a promise |
| 16:39 | tyler__ | or you you top out at a certain point |
| 16:40 | ohpauleez | oh no, the JCM will hit all cores if it's able to |
| 16:40 | ohpauleez | JVM |
| 16:40 | tyler__ | like if i have 4 cores and 5 threads is the fifth thread considered "parallel"? |
| 16:40 | bbloom | dammit ohpauleez! stop bringing up data vs task parallelism! didn't we agree that this was orthogonal!? |
| 16:40 | ohpauleez | hahaha |
| 16:40 | antares_ | tyler__: only if your CPU supports hyperthreading (core i7 all do, I think) |
| 16:40 | ohpauleez | I still feel it's important |
| 16:41 | ohpauleez | tyler__: core+virtual cores are a hard limit on true parallelism for anything |
| 16:41 | antares_ | tyler__: if not, then no. But you are bound by hardware, not JVM limitations most of the time. |
| 16:41 | ohpauleez | so you can have as many concurrent things going as you like |
| 16:41 | ohpauleez | but you are capped on true parallel things |
| 16:42 | antares_ | hey ohpauleez |
| 16:42 | ohpauleez | bbiab |
| 16:43 | tyler__ | so why even discuss parallelism vs concurency if parallelism is just a function of concurrency + # of cores |
| 16:44 | ohpauleez | tyler__: Because we have distributed systems, GPUs, etc |
| 16:44 | antares_ | tyler__: for example, because not all runtimes provide parallelism (CRuby, CPython do not) and not all of them do it equally well |
| 16:44 | tyler__ | yeah but we all use java here amiright? ;) |
| 16:44 | antares_ | GPUs are also a factor, too. Currently JVM won't use GPUs but there is a project that (hopefully) will make that possible in the next few years. |
| 16:45 | tyler__ | antares_: ah, gpu is like a cpu on your graphics card right? im not much of a hardware guy |
| 16:45 | antares_ | tyler__: more or less |
| 16:46 | bbloom | hyPiRion: nice. |
| 16:47 | gfredericks | how's the weather in portland? |
| 16:47 | tyler__ | hyPiRion: wow thats amazing, i am not worthy |
| 16:48 | tyler__ | gfredericks: its been nice, a little overcast today but its been sunny |
| 16:48 | tyler__ | its finally getting warmer |
| 16:48 | hyPiRion | tyler__: It's not so difficult, really. It's just a lot of trial and error |
| 16:48 | hyPiRion | You should've seen my history with lazybot before I made it work |
| 16:48 | gfredericks | tyler__: man these forecasted temperatures are so high... |
| 16:49 | tyler__ | actually next week looks kinda shite according to google now |
| 16:50 | gfredericks | shite == wet? |
| 16:50 | tyler__ | and colder |
| 16:50 | gfredericks | it's 30 here |
| 16:50 | tyler__ | last week we had the door open because it was so hot |
| 16:51 | gfredericks | well now I know not to pack my scarf |
| 16:51 | hyPiRion | tyler__: wow, you Americans and your weather |
| 16:51 | tyler__ | hyPiRion: how is weather an american thing? |
| 16:52 | hyPiRion | tyler__: Mostly because the only time I hear about weather from another country, it's America :] |
| 16:52 | tyler__ | correlation not causation ;) |
| 16:53 | hyPiRion | tyler__: Well, I meant it as in "Dang, you guys are lucky with the weather", not as in "talking about weather is an American thing" |
| 16:53 | gfredericks | hyPiRion: our lake just thawed |
| 16:54 | tyler__ | hyPiRion: aaaah i understand |
| 16:54 | hyPiRion | gfredericks: Where are you from? |
| 16:54 | tyler__ | hyPiRion: "american weather" is not a thing we have a huge landmass with hugely different climates |
| 16:55 | tyler__ | last week i learned that all of the UK is about the size of Oregon heh |
| 16:55 | gfredericks | hyPiRion: Chicago |
| 16:55 | hyPiRion | tyler__: yeah, I know. I'm extrapolating based on one datapoint :p |
| 16:56 | clojure-new | We have weather in Russia too! Sometimes it's a pain. |
| 16:56 | clojure-new | -7C ATM. |
| 16:56 | gfredericks | clojure-new: is it a single kind of weather? |
| 16:56 | gfredericks | in all of russia? |
| 16:57 | bbloom | tyler__: i just checked wikipedia. oregon is slightly larger, heh |
| 16:57 | amalloy | gfredericks: in small countries like that, that's not uncommon |
| 16:57 | antares_ | gfredericks: standardized by the government, too |
| 16:57 | gfredericks | haha |
| 16:57 | bbloom | UK: 243,610 km^2 vs OR: 255,026 km^2 |
| 16:58 | hyPiRion | gfredericks: Wow, I just realized Chicago is on about the same latitude as Madrid |
| 16:58 | gfredericks | europe is falsly north |
| 16:58 | clojure-new | bbloom: RUSSIA: 17,075,400 km2 vs UK: 243,610 km^2 vs OR: 255,026 km^2 |
| 16:59 | clojure-new | 17,075,400 km2 of weather. |
| 16:59 | tyler__ | russia is a country though, not a provence/state |
| 16:59 | gfredericks | all of it the same |
| 16:59 | gfredericks | and all of it in metric |
| 16:59 | tyler__ | is the US the last place to refuse to use metric? |
| 17:00 | antares_ | tyler__: not at all. it is accompanied by burma, see. |
| 17:00 | gfredericks | a coalition of the willing |
| 17:01 | gfredericks | man I'm already old enough to be muttering political innuendo that the youth will not understand |
| 17:02 | amalloy | tyler__: there are like three other countries, with a combined GDP of like $10/year |
| 17:02 | tyler__ | heh |
| 17:02 | amalloy | as i recall |
| 17:03 | drewc | and of course, the speed is measured in knots |
| 17:04 | hyPiRion | Oh, I like that |
| 17:04 | hyPiRion | "three clicks from here" |
| 17:04 | gfredericks | man I have no idea how we measure the speed of my apartment |
| 17:04 | drewc | gfredericks: I think they have already been invented, they are called 'miles' |
| 17:04 | gfredericks | will have to ask the landlord |
| 17:05 | technomancy | gfredericks: it's called a flat |
| 17:05 | gfredericks | technomancy: I guess that helps it be more aerodynamic? |
| 17:05 | technomancy | now you're catching on |
| 17:05 | drewc | (or often "land mile" or even "statute mile") |
| 17:05 | tyler__ | gfredericks: around 1125kph |
| 17:05 | tyler__ | gfredericks: http://geography.about.com/library/faq/blqzearthspin.htm |
| 17:05 | tyler__ | heh |
| 17:05 | clojurebot | No entiendo |
| 17:06 | Frozenlock | technomancy: as a mechanical engineer, I want to express how much I hate you for not using metric. |
| 17:06 | gfredericks | I wonder if velocity is a torsor |
| 17:06 | arrdem | (inc Frozenlock) |
| 17:06 | lazybot | ⇒ 2 |
| 17:06 | hyPiRion | Frozenlock: You read technomancy wrong :) |
| 17:06 | technomancy | Frozenlock: what? I use metric |
| 17:06 | hyPiRion | "refuses to refuse to use metric" -> metric |
| 17:06 | Frozenlock | Oh |
| 17:06 | Frozenlock | damn |
| 17:06 | gfredericks | hyPiRion: well that's a bit of a stretch |
| 17:06 | hyPiRion | gfredericks: true |
| 17:06 | gfredericks | hyPiRion: he might just be wishy washy |
| 17:06 | Frozenlock | Double negative got me -_- |
| 17:07 | technomancy | only the language nerds are allowed to hate me (for the double negative) |
| 17:07 | gfredericks | technomancy: only fake language nerds would complain about a double negative |
| 17:07 | bbloom | technomancy: as an english major (not really) i what to express how much i hate you for using a double negative |
| 17:07 | tyler__ | i don't know nothing |
| 17:07 | bbloom | damn, typed that too slow to make the joke in time |
| 17:07 | bbloom | slowly |
| 17:07 | gfredericks | I think I remember seeing a quadruple negative in the wild once |
| 17:07 | Frozenlock | bbloom: still found it funny :) |
| 17:07 | technomancy | http://wondermark.com/434/ |
| 17:08 | tyler__ | i luled |
| 17:11 | arrdem | gfredericks: i c u trollin |
| 17:11 | Frozenlock | While we are on the news, I read somewhere that EA's lastest game was awesome, and the always-online requirement wasn't a problem, at all. |
| 17:12 | tyler__ | so i decided to take a peek at core.logic and now my brain is melting... |
| 17:12 | tyler__ | Frozenlock: are you being facetious? |
| 17:13 | arrdem | ,(str "(" (rand-nth ["inc" "dec"]) " Frozenlock)") |
| 17:13 | clojurebot | "(inc Frozenlock)" |
| 17:13 | arrdem | ,(print ",(" (rand-nth ["inc" "dec"]) " Frozenlock)") |
| 17:13 | clojurebot | ,( dec Frozenlock) |
| 17:13 | AimHere | tyler__, no. He was just reading a report of an EA press release |
| 17:13 | arrdem | bother |
| 17:14 | arrdem | ,(print (str ",(" (rand-nth ["inc" "dec"]) " Frozenlock)")) |
| 17:14 | clojurebot | ,(dec Frozenlock) |
| 17:14 | Frozenlock | You mean the 'straight answers from Lucy' one? |
| 17:14 | AimHere | &(print (str ",(" (rand-nth ["inc" "dec"]) " Frozenlock)")) |
| 17:14 | lazybot | ⇒ ,(dec Frozenlock)nil |
| 17:14 | AimHere | ,(print (str "&(" (rand-nth ["inc" "dec"]) " Frozenlock)")) |
| 17:14 | clojurebot | &(dec Frozenlock) |
| 17:15 | arrdem | so do we have to quine thi? |
| 17:15 | arrdem | *this |
| 17:15 | arrdem | clojurebot -> lazybot -> clojurebot? |
| 17:15 | AimHere | Lazybot prefixing it's output with the arrow makes me glum |
| 17:16 | AimHere | But it's probably for the best, all things considered |
| 17:19 | tyler__ | woah just found: https://github.com/jonase/kibit/ |
| 17:19 | tyler__ | that looks awesome |
| 17:20 | hyPiRion | arrdem: that's impossible by now. Clojurebot ignores lazybot now |
| 17:20 | hyPiRion | I think |
| 17:20 | hyPiRion | $timer 0:0:1 ,(println "foo") |
| 17:20 | lazybot | Timer added. |
| 17:20 | lazybot | ,(println "foo") |
| 17:20 | clojurebot | foo\n |
| 17:21 | tyler__ | or not |
| 17:21 | hyPiRion | ,(print "&(println "foo")") |
| 17:21 | clojurebot | #<CompilerException java.lang.RuntimeException: Unable to resolve symbol: foo in this context, compiling:(NO_SOURCE_PATH:0:0)> |
| 17:21 | hyPiRion | ,(print "&(println \"foo\")") |
| 17:21 | clojurebot | &(println "foo") |
| 17:21 | hyPiRion | the other way around it was |
| 17:21 | arrdem | Q_Q |
| 17:24 | Frozenlock | Anyone here using compojure could confirm if googlebot can access their site? |
| 17:24 | MikeSeth | if I do (defrecord Character ...) Clojure complains about java.lang.Character already defined. Is this because java.lang classes are imported into every namespace? |
| 17:25 | arrdem | Frozenlock: confirmed |
| 17:26 | Frozenlock | Grrr Googlebot, why u fail on me... |
| 17:29 | antares_ | MikeSeth: most likely |
| 17:30 | tomoj | (ns-unmap *ns* 'Character) |
| 17:30 | tomoj | I can't remember why I wanted :import-exclude |
| 17:30 | tomoj | didn't think of that workaround till after I forgot :( |
| 17:31 | MikeSeth | tomoj: is this a "normal" thing to do? |
| 17:31 | tomoj | I guess (:import-java :exclude [...]) |
| 17:31 | tomoj | (that's hypothetical) |
| 17:31 | tomoj | no, it's not normal |
| 17:31 | MikeSeth | hmmm |
| 17:32 | tomoj | it's rare enough for people to alter their ns map in any other way besides ns and def |
| 17:32 | tomoj | but if you really want it to be called Character, doing that at the beginning of your ns top-level wouldn't cause much real trouble afaik |
| 17:33 | tomoj | hmm |
| 17:33 | tomoj | though that will unmap the record every time after |
| 18:01 | hiredman | /win 15 |
| 18:04 | bbloom | lynaghk: i think you're gonna like what i'm cooking up in the rewrite department :-) |
| 18:11 | lynaghk | bbloom: I'd love to see it over a beer |
| 18:11 | lynaghk | bbloom: and then not over a beer, to make sure I can understand =P |
| 18:12 | bbloom | lynaghk: i'm basically porting https://code.google.com/p/kiama/wiki/Rewriting to clojure, but with a focus on operating on trees of maps |
| 18:12 | bbloom | lynaghk: it's basically a combinator library for rewriting strategies |
| 18:35 | bbloom | dnolen: i too keep finding myself wanting reduce-until |
| 18:35 | ambrosebs | mpenet: need help with TFn? |
| 18:36 | wmax | how do i retrieve all the attributes in datomic? |
| 18:36 | bbloom | dnolen: before, i've wanted left-fold-until, but now i have a case where i want fold-with-an-abort-condition, ie un-ordered |
| 18:36 | jjttjj | anyone ever use fleet for templating? are there any example apps out there? |
| 18:39 | ohpauleez | bbloom: You know you can do that right now, right? |
| 18:39 | ohpauleez | reduce supports a short circuit |
| 18:39 | bbloom | ohpauleez: how? |
| 18:39 | hiredman | ,(doc reduced) |
| 18:39 | clojurebot | "([x]); Wraps x in a way such that a reduce will terminate with the value x" |
| 18:39 | bbloom | bwha? |
| 18:39 | bbloom | 1.5? |
| 18:39 | ohpauleez | yeah |
| 18:40 | bbloom | glorious. |
| 18:40 | ohpauleez | let me dig up the example I just saw |
| 18:42 | mpenet | ambrosebs: I think I understand TFn, but this was not really the solution to my problem (still good to have learned about it). I sent you a privmsg earlier with a gist |
| 18:43 | mpenet | ambrosebs: either I misunderstand Seq* or there is a bug somewhere, more likely the former |
| 18:44 | bbloom | ohpauleez: oh. this is amazing. |
| 18:45 | ohpauleez | bbloom: It's reduce right? I was trying to dig up the code I had |
| 18:47 | bbloom | ,(reduce (fn [acc x] (let [x' (* x x)] (if (> x' 10) (reduced x') x'))) (range)) |
| 18:47 | clojurebot | 16 |
| 18:47 | bbloom | ohpauleez: there's an example |
| 18:47 | ohpauleez | Ahhh there we go! |
| 18:47 | bbloom | ohpauleez: sadly, it doesn't seem to work with `reductions :-( |
| 18:48 | ohpauleez | reduced! right |
| 18:48 | ohpauleez | it is indeed a pity |
| 18:48 | bbloom | ohpauleez: i am sooo submitting a patch to reductions.... |
| 18:48 | tomoj | we still need a reductions reducer too |
| 18:49 | ohpauleez | tomoj: What would that even look like?! |
| 18:49 | ohpauleez | haha |
| 18:49 | bbloom | well, if the reducers produces a linear reduction, it's easy, but otherwise, it could return a tree |
| 18:50 | ohpauleez | right |
| 18:50 | ohpauleez | I was just thinking, well… you could write it in terms of the current reduce and build a seq |
| 18:50 | tomoj | no |
| 18:50 | tomoj | no seqs :) |
| 18:51 | tomoj | I dunno what you mean probably |
| 18:52 | tomoj | what would return a tree? |
| 18:52 | ohpauleez | reductions in reducers, that runs non-linearly |
| 18:52 | ohpauleez | because order isn't preserved |
| 18:52 | Frozenlock | Ok googlebot is definitely trolling me. Every proxies I tried can see the site, in addition to web-sniffer.net, but not googlebot -_- |
| 18:52 | ohpauleez | which you typically want in reductions |
| 18:53 | tomoj | what reducer doesn't preserve order? |
| 18:54 | tomoj | to me that is pretty much the essence of a reducer, an order |
| 18:54 | ohpauleez | tomoj: how would you visual the results of reduction where the first three elements were reduced and the last two were, but no others |
| 18:54 | ohpauleez | visualize** |
| 18:55 | ohpauleez | … I suppose I'm thinking of fold |
| 18:55 | tomoj | ah, right, fold reductions is weirder |
| 18:55 | tomoj | folds? |
| 18:56 | tomoj | presumably you pass a combinef and reducef and you get the ordered results from the combinef as a reducer? |
| 18:57 | tomoj | can't we move the short-circuiting code into Reduced? |
| 18:58 | tomoj | instead of writing it into every reducer |
| 18:59 | tomoj | perhaps not without CPS'd reducers? |
| 19:07 | wmax | how do i get the namespace of a namespace qualified keyword |
| 19:09 | bbloom | http://dev.clojure.org/jira/browse/CLJ-1185 boom. |
| 19:09 | devn | bam |
| 19:10 | technomancy | arg; I hate it when I realize two seconds too late that I could have used paredit-convolute-sexp |
| 19:10 | devn | what does that do? |
| 19:11 | technomancy | words cannot describe it |
| 19:11 | devn | haha |
| 19:11 | devn | oh i see |
| 19:12 | devn | that's uh, very specific |
| 19:12 | wmax | why don't anyone help me |
| 19:12 | wmax | &(namespace :foo/bar) |
| 19:12 | lazybot | ⇒ "foo" |
| 19:14 | devn | wmax: isn't that what you want? |
| 19:15 | tomoj | it's very common to have seq forms where some initial subseq is distinguished and provides context for the remaining subforms |
| 19:15 | wmax | that is exactly what i want |
| 19:15 | tomoj | paredit-convolute-sexp just reorders those kinds of operators |
| 19:15 | devn | wmax: :) |
| 19:15 | devn | &*clojure-version* |
| 19:15 | lazybot | ⇒ {:major 1, :minor 4, :incremental 0, :qualifier nil} |
| 19:16 | Frozenlock | arrdem: May I ask if you are using some middleware? force-ssl, gzip, etc..? |
| 19:17 | arrdem | Frozenlock: it |
| 19:17 | arrdem | 's been a long time and that blog's codebase is still on noir.. lemme look tho |
| 19:18 | arrdem | Frozenlock: yeah stock noir opaque as always |
| 19:21 | bbloom | ohpauleez: thanks much for letting me know about `reduced... now i wonder what else i'm missing in 1.5 |
| 19:22 | ohpauleez | bbloom: totally welcome man |
| 19:23 | Frozenlock | arrdem: I just moved away from noir, thinking it might be what caused googlebot to choke :/ |
| 19:24 | gfredericks | tomoj: what's a seq form? |
| 19:24 | arrdem | Frozenlock: heh yeah I have a branch that's noir-free but it's stuck in me being too lazy to fix all the mistakes I made with my first Clojure project XP |
| 19:24 | tomoj | a form that is a seq |
| 19:24 | tomoj | probably a list |
| 19:24 | gfredericks | like (if foo bar baz)? |
| 19:24 | tomoj | yeah |
| 19:26 | bbloom | looking at the impl of clojure.lang.Reduced, it occurs to me that IDeref is like an abstract pointer on steroids |
| 19:27 | tomoj | steroids? |
| 19:27 | bbloom | i wish that there was a way to opt-in to auto-deref like vars, but still allow do-not-deref via something like #' |
| 19:27 | bbloom | but i'm not gonna think about that too much :-P |
| 19:29 | tomoj | auto-deref on invocation? or something crazier? |
| 19:29 | gfredericks | auto-deref like vars |
| 19:29 | bbloom | tomoj: on invocation is easy: implement IFn |
| 19:29 | gfredericks | you mention them and they get deref'd |
| 19:30 | tomoj | yeah, so what are you thinking? (foo bar baz) auto-derefs bar? |
| 19:30 | bbloom | yeah what gfredericks says, but it requires static knowledge |
| 19:30 | tomoj | oh, right |
| 19:30 | bbloom | the compiler knows that a name refers to a var. so for example of you refer to `inc it emits clojure.core.inc.deref() |
| 19:30 | tomoj | IFn is the "oh, actually do deref" case for vars |
| 19:30 | bbloom | but if you #'inc, then you get clojure.core.inc without the deref() |
| 19:31 | gfredericks | tomoj: wat? |
| 19:31 | bbloom | but i wish there was like a metadata hint you could put on symbols: (assert (= 5 (let [x ^:deref (delay 5)] x))) |
| 19:31 | tomoj | gfredericks: nevermind, I was confused |
| 19:31 | bbloom | or maybe ^:deref x |
| 19:31 | bbloom | and then you could get at the delay by writing: #'x |
| 19:32 | gfredericks | bbloom: for local stuff symbol macros would solve it, right? |
| 19:32 | bbloom | gfredericks: hm, i guess it would |
| 19:32 | dnolen | bbloom: you already in portland? |
| 19:33 | bbloom | dnolen: no, i get in around 8pm pacific tomorrow |
| 19:33 | bbloom | how far is the airport from the hotel / arcade? I'll head right over there |
| 19:33 | dnolen | bbloom: cool, I get there around 7:30 |
| 19:34 | bbloom | gfredericks: the reason this thought about requesting auto-deref occurs to me is b/c it would enable some lazy evaluation DSLs :-)( |
| 19:35 | gfredericks | bbloom: I think I've thought of that sort of thing as well. would definitely make code more potentially confusing though |
| 19:35 | bbloom | but i guess it can be done w/ symbol macrolets pretty straightforwardly.... so maybe ill look into that if i ever need to do something extra lazy |
| 19:37 | OneFourSeven | Do I have to worry about sql injections if I use sqlkorma? |
| 19:40 | lynaghk | bbloom: you can take the max from the airport pretty much directly to the arcade downtown---it'll be about a 40 minute ride or so. |
| 19:40 | lynaghk | (the max = light rail) |
| 19:43 | tomoj | bbloom: how about deref destructuring instead |
| 19:43 | tomoj | (let [xd (delay 5) @x xd] ..) |
| 19:43 | tomoj | hmm no room for :as |
| 19:46 | tomoj | (let [(:as @x xd) (delay 5)]) ? :( |
| 19:47 | tomoj | er, no.. |
| 19:59 | amalloy | tomoj: what about (let [^:delay x (some computation)] (if whatever (inc x) 0))? i have that written somewhere |
| 20:00 | tomoj | I think I prefer [@x (some computation)] |
| 20:00 | tomoj | but either way, no :as |
| 20:02 | tomoj | what would (if-let [^:delay x y]) mean? |
| 20:03 | hyPiRion | tomoj: what are you attempting? |
| 20:03 | hyPiRion | Seems like you're trying to reinvent dataflow variables. |
| 20:03 | tomoj | nothing very closely related to this discussion |
| 20:04 | tomoj | but yes, I am trying to reinvent dataflow variables :) |
| 20:06 | wmax | how do i html escape url strings? |
| 20:21 | tomoj | are there reducers which can't be CPS'd? |
| 20:22 | tomoj | assume the continuation will only be called once |
| 20:22 | tomoj | (or zero times) |
| 21:26 | xeqi | non-clojure, but any recommendations on places to get an ssl cert? |
| 21:34 | callahad | xeqi: Check with your registrar? Lots provide them free with registrations (or at least, gandi.net does…) |
| 21:34 | bbloom | i have forgotten how anyone gets anything done in the presence of operator overloading.... |
| 21:35 | bbloom | this scala library defines <+ and <* to mean subtly different things |
| 21:35 | bbloom | i have had to look up their meaning to differentiate them EVERY SINGLE TIME I ENCOUNTER THEM. which has been dozens of times in the past hour. i simply can not remember them b/c they have no pronounceable name or provide any hint to their meaning |
| 21:38 | tomoj | "+" and "*" had better be a hint |
| 21:38 | bbloom | <+ means "composition via deterministic choice" and <* means "unconditional linear composition" |
| 21:39 | bbloom | tomoj: if you have a nemonic, i'm all ears |
| 21:39 | hiredman | porting python code that mixes math and string concatenation, :/ |
| 21:39 | egghead | freakin' scala |
| 21:39 | egghead | hi we always eval left to right except when the operator starts with two colons |
| 21:39 | egghead | don't ask why |
| 21:40 | egghead | why does odersky hate programmers |
| 21:40 | bbloom | heh |
| 21:40 | tomoj | bbloom: + means "or", * means "and", dunno what those descriptions mean but it looks like it lines up OK |
| 21:41 | bbloom | <+ is like clojure.core/cond, <* is like clojure.core/comp |
| 21:41 | bbloom | i'm calling them choice and pipe |
| 21:42 | egghead | scala, where fn references aren't real references unless you partially apply them to some magical thing named _ |
| 21:42 | bbloom | ALL HAIL THE GREAT _ |
| 21:44 | SegFaultAX | egghead: Actually, you only need one colon to change the associativity. |
| 21:44 | egghead | oh? didn't know that |
| 21:45 | egghead | i thought for instance a :: b was a method of a but a ::: b was a method of b |
| 21:45 | SegFaultAX | egghead: The folding operators are a good example |
| 21:45 | john2x | is there a utility method to create ring requests? can't seem to find it in ring's api page. |
| 21:45 | egghead | john2x: ring mock is nice |
| 21:46 | bbloom | at least with mathematica you can FullForm[Hold[...]] to debug associativity |
| 21:46 | bbloom | with haskell & scala, you just need to wait for the compiler to give you a type error, or wait until you have a bug in production |
| 21:47 | john2x | egghead: cool thanks |
| 21:47 | SegFaultAX | bbloom: The #1 #2 and #3 things I dislike about Scala are how fricken complicated the syntax is. |
| 21:47 | SegFaultAX | bbloom: I have a really hard time getting used to it. |
| 21:48 | egghead | SegFaultAX: ya scala seems very context sensitive |
| 21:48 | egghead | stuff like if you call a method with or without parens, might work in some places but not others |
| 21:49 | bbloom | i have nothing fundamentally against infix operators, it's just that they add significant notation complexity which is extremely unwelcome while you are learning concepts. all operators should be required to map 1-to-1 with a named prefix operator/function/macro/whatever & then i should be able to OPT IN to operators as i desire the notation to tackle bigger and bigger problems with the semantics i need |
| 21:49 | SegFaultAX | egghead: Eh, that's something else. That's really more a matter of "does this class I'm working with observe the uniform access principle" |
| 21:49 | bbloom | mathematica gets that half right: you need to use FullForm to opt OUT |
| 21:49 | SegFaultAX | egghead: Most do, some don't. |
| 21:49 | egghead | uniform access principle, ya |
| 21:50 | egghead | I don't even want to even know that that is a thing but when writing scala you have to |
| 21:50 | egghead | SegFaultAX: if that's not the syntax would you say it's the semantics? |
| 21:50 | SegFaultAX | egghead: Well, omitting the parens is a nice to have when accessing properties. It is by no means a requirement, though generally idiomatic. |
| 21:50 | xeqi | john2x: ring-mock is the base one. If you also need a cookie jar you could look at my peridot or kerodon libraries |
| 21:51 | SegFaultAX | egghead: The point is you shouldn't care if the thing you're accessing is a property or a field. |
| 21:51 | egghead | SegFaultAX: but having it not be really uniform means you do have to care |
| 21:52 | SegFaultAX | egghead: Don't write shitty classes that don't follow the convention, then. ;) |
| 21:52 | egghead | I try not to write scala if I can help it, but I inherited some scala last month from another team :( |
| 21:52 | egghead | :p |
| 21:53 | bbloom | the uniform access principle is not-mega-objectionable for reads, but holy crap is it a bad idea for writes via methods named foo_= |
| 21:53 | bbloom | consider a calls representing a rectangle, if you try to do rect.right = 500 |
| 21:53 | bbloom | what happens? |
| 21:54 | bbloom | does it move the rectangle or resize it? |
| 21:54 | SegFaultAX | bbloom: I /really/ hate how overloaded the character _ is in Scala. |
| 21:54 | bbloom | even if you agree on it moving or resizing, then suddenly the order of updates matter! if you change left and right or right and width or whatever |
| 21:54 | bbloom | even if you have an immutible rectangle and left_= returns a new rectangle, these problems exist |
| 21:55 | bbloom | in fact, i'd argue that property setters is one of the dumbest ideas... ever. |
| 21:55 | SegFaultAX | bbloom: I concur. I don't know why you'd ever want a setter on a computed value. |
| 21:56 | bbloom | SegFaultAX: the only time it makes any sense is when you have a trivial converter, like if you wanted to data bind a number to a text box and needed Integer/parse with white space trimming |
| 21:56 | bbloom | but even then, you're gonna likely want to override that policy, so who says what gets to be theInteger_= |
| 21:56 | bbloom | ugh. setters. dumb idea |
| 21:58 | tomoj | interesting |
| 21:58 | ivaraasen | setters. it's what plants crave. |
| 21:59 | tomoj | you'd need a function with domain and range subsets of XxYxWxH |
| 21:59 | tomoj | er |
| 21:59 | tomoj | the products of subsets of {X,Y,W,H} I mean |
| 22:00 | tomoj | like your multidirectional dataflow graph functions |
| 22:00 | bbloom | tomoj: heh, rectangle representation is a soap box i can stand on for days |
| 22:00 | bbloom | rectangles expose so many problems with object oriented programming, it's not even funny :-P |
| 22:01 | ivaraasen | bbloom: taking an OOP course at the moment. so much silly stuff |
| 22:01 | bbloom | rectangles fundamentally have 4 fields. but what are they? left/right/top/bottom? x/y/w/h ? center-x/y, half-w/h ? |
| 22:01 | bbloom | what about representations as two points? top-left and bottom-right? |
| 22:02 | bbloom | or a center and two half widths in a size vector? |
| 22:02 | bbloom | but let's dumb the problem down: circles! they only have a position and a radius |
| 22:02 | bbloom | still, point or pair of ints? |
| 22:03 | bbloom | let's dumb it down! a Range of integers: minimum and maximum! |
| 22:03 | bbloom | oh wait, is it [min,max) or [min,max] |
| 22:03 | bbloom | this shit is hard. |
| 22:03 | bbloom | or is it min & length ? |
| 22:03 | bbloom | add some getters and setters, paper over the problem |
| 22:03 | bbloom | and suddenly range.length = 5 is a mega confusing arbitrary decision that yields signficant order of statements bugs |
| 22:05 | lynaghk | bbloom: have you seen a nice way to handle that with records in Clojure? |
| 22:05 | ivaraasen | the correct implementation of a triangle is a class inheriting from Shape, which wraps CartesianSpace<Point>, which in turn is a superior ArrayList, because I wrote it. sigh. |
| 22:06 | lynaghk | bbloom: i.e., sometimes it's natural to want to (assoc my-rect :top 1 :left 2 :bottom 5 :right 11), and other times I want to refer to width and height |
| 22:06 | bbloom | lynaghk: not really.... afterall, deftype and defrecord are slighly-less-featureful (in a good way) OOP |
| 22:06 | lynaghk | bbloom: right, so basically you need to pick one canonical basis and then use functions to get/set the others? |
| 22:06 | bbloom | this is something i've thought a bit about tho. i think that there is some sort of algebra of nouns or something yet to be discovered |
| 22:06 | tomoj | isomorphisms are lenses |
| 22:06 | lynaghk | bbloom: or go to town with constraints and macro-generated code for an IAssociative implementation |
| 22:07 | bbloom | lynaghk: but then you have the setter problem |
| 22:07 | lynaghk | bbloom, tomoj: yeah. right. are you aware of any lense implementations for Clojure records |
| 22:07 | lynaghk | (Not that I'm sure it's a good idea whatsoever) |
| 22:07 | bbloom | i'm anti lenses :-P |
| 22:07 | lynaghk | bbloom: that's why I'm thinking you should have to specify everything with constraints |
| 22:08 | lynaghk | I mean, core.logic is just SITTING THERE. |
| 22:08 | tomoj | no, I've been working on it slowly |
| 22:08 | bbloom | i spent some time studying them & decided that symbolic algebra is fundamentally superior |
| 22:08 | bbloom | constraints < algebra |
| 22:08 | tomoj | symbolic algebra? |
| 22:08 | lynaghk | bbloom: I don't know enough about your termonology to understand; do you have some references? |
| 22:09 | bbloom | lynaghk: http://en.wikipedia.org/wiki/Computer_algebra_system |
| 22:10 | tomoj | you'd write an equation for the isomorphism between x,y,w,h and (say) sw,ne ? |
| 22:10 | bbloom | the problem is that anyone who ever tries lenses or constraints or anything like that, tends to write a paper with some linear algebra & fundamentally ignores business logic domains |
| 22:11 | bbloom | tomoj: yeah, i think you could define a rectangle in terms of some algebraic relations & then the compiler could find a spanning tree of terms. every spanning tree is one possible representation |
| 22:11 | bbloom | however, i can only assume this is undecideable lol |
| 22:12 | ohpauleez | lynaghk: I'm going to jump in here |
| 22:12 | ohpauleez | I have record invariants working |
| 22:13 | lynaghk | ohpauleez: gist? |
| 22:13 | ohpauleez | a semi-working generator from Alloy, and an implementation of basic constraints from core.contracts |
| 22:13 | lynaghk | ohpauleez: that's my mantra for the over-educated inhabitants of #clojure---gists or it's not a real idea =P |
| 22:14 | lynaghk | ohpauleez: this is what you'll be talking about at Clojure/West, yeah? |
| 22:14 | ohpauleez | in my branch of core.contracts, I have a protocol with (constrain ...) |
| 22:14 | ohpauleez | lynaghk: Yeah, this is my talk on Monday |
| 22:15 | ohpauleez | my examples are all about functions, because I think more people can relate to it. But the underlying pieces also work with Records. I haven't fully solidified the API wrt records |
| 22:15 | ohpauleez | so it's subject to change |
| 22:16 | lynaghk | cool, I didn't know you had features for inline usage---I thought it was all out-of-band verification and maybe some runtime assertions |
| 22:16 | ohpauleez | it has open handlers, that act as decorators |
| 22:17 | lynaghk | ohpauleez: yeah, when I last thought about this kind of thing I wasn't sure what I wanted the API to look like---ideally for some class of relationships everything could be patched into the standard IAssoc and ILookup implementations and Just Work (tm) |
| 22:17 | ohpauleez | so it'll generate you n-versions of the thing you're spec'ing |
| 22:17 | ohpauleez | I did not take that approach |
| 22:17 | ohpauleez | and I'm with bbloom |
| 22:17 | ohpauleez | there's more power in an algebra and discrete math |
| 22:18 | bbloom | ohpauleez: i want to express my program assertions in first order logic :-P |
| 22:18 | lynaghk | ohpauleez: see my comment re: gists. |
| 22:18 | ohpauleez | lynaghk: see my response: Monday |
| 22:18 | ohpauleez | :) |
| 22:18 | lynaghk | ohpauleez: =) |
| 22:18 | bbloom | that reminds me... i need to write a README before I open source some stuff .... heh |
| 22:19 | bbloom | *shrug* sounds like a good use of my time on the flight |
| 22:19 | ohpauleez | bbloom: flying from? |
| 22:19 | bbloom | JFK |
| 22:19 | ohpauleez | ahh you're already in NYC |
| 22:20 | bbloom | yeah, since end of january |
| 22:23 | john2x | how do I write tests for my handlers that go through the routes? (instead of just passing mock requests directly to the handlers) |
| 22:24 | xeqi | john2x: pass the mock requests directly to the route functions |
| 22:26 | john2x | xeqi, hmm, by route functions, you mean those middleware wrappers? |
| 22:29 | xeqi | john2x: I was assuming you were using (defroutes some-routes ...). Then you could do (some-routes mock-request) |
| 22:29 | xeqi | if you are wrapping middleware around them then just use the handler that returns |
| 22:30 | Raynes | xeqi: You've been using laser, right? |
| 22:30 | xeqi | Raynes: I'm using it to build my screencast site |
| 22:31 | Raynes | xeqi: Good experience so far? |
| 22:32 | lynaghk | xeqi: you're building a screencast site too? |
| 22:33 | xeqi | lynaghk: yes, and eric normand did the kickstarter |
| 22:34 | xeqi | lynaghk: are you making one? |
| 22:34 | xeqi | * not that mine and his project are related, just another person I know making screencasts |
| 22:34 | lynaghk | xeqi: yeah, though not with Clojure as a topic right now |
| 22:34 | xeqi | Raynes: its been pretty good |
| 22:35 | Raynes | xeqi: Pretty good sounds horrible. |
| 22:35 | xeqi | there was some confusion about fragment vs parse-fragment, and which one worked with content, and which with remove |
| 22:35 | lynaghk | xeqi: but I'm helping a friend do one for Photoshop (retouching in a production environment) and using the same tech stack for a "personal devops" site |
| 22:35 | Raynes | xeqi: Well, parse-fragment and fragment do completely different things. |
| 22:35 | Raynes | parse-fragment just parses html into something you can pass to fragment and do work on.' |
| 22:36 | xeqi | lynaghk: I put up a sample video at http://www.clojurewebdevelopment.com/videos/friend-interactive-form to gauge interest, and based on it and in person conversations it seems like there is a small, but willing to pay market for clojure videos |
| 22:36 | Raynes | xeqi: Come to LA in April. I'm gonna give a talk at the LA Clojure meetup about it. |
| 22:36 | Raynes | ;) |
| 22:36 | xeqi | Raynes: hmm, maybe I meant nodes |
| 22:36 | lynaghk | xeqi: yeah, I'm not surprised. I might dip into it later this year; Eric Normand's kickstarter certainly validates that |
| 22:36 | Raynes | nodes is basically parse-fragment. |
| 22:37 | Raynes | It just also normalizes things. If you give it a node, it gives you back something you can pass to fragment. |
| 22:37 | Raynes | Bleh. My docs probably suck. |
| 22:37 | john2x | xeqi: ah got it. this is cool |
| 22:37 | Raynes | Feel free to suggest improvements. You have the benefit of being a guy who didn't write laer. |
| 22:37 | alandipert | i would pay for a service that forced others to watch clj videos |
| 22:37 | xeqi | Raynes: css selectors :p |
| 22:37 | technomancy | alandipert: get y combinator on the phone; I smell a market |
| 22:37 | lynaghk | alandipert: your best bet is to pay off a flight crew |
| 22:37 | Raynes | alandipert: Pretty sure that's called terrorism. |
| 22:37 | Raynes | :p |
| 22:38 | Raynes | xeqi: I meant doc improvements. :p |
| 22:38 | technomancy | Raynes: or advertising. fine line. |
| 22:38 | alandipert | ingenius ideas, all of them |
| 22:38 | egghead | nice Raynes -- will catch that laser talk :) |
| 22:38 | Raynes | But sure, css selectors could be done. |
| 22:38 | lynaghk | alandipert: when are you getting into town? |
| 22:38 | Raynes | egghead: Oh right, you're in LA aren't you? |
| 22:38 | alandipert | lynaghk, tomorrow at 2pm |
| 22:38 | egghead | mhm |
| 22:38 | egghead | visiting pdx this week but la regularly |
| 22:38 | Raynes | egghead: It's actually May that I'm talking. May 5th I think, but I might be wrong. Some day in May. |
| 22:39 | lynaghk | alandipert: okay, cool. I think I'm just going to head over to downtown and start drinking coffee with clojure friends nonstop starting tomorrow at 10am. |
| 22:40 | lynaghk | (hear that Clojure friends!?! Find me tomorrow for free coffee and tours of hipsters in their natural habitat) |
| 22:40 | lynaghk | technomancy: Public Domain is the only coffee shop I've ever been to that has an "espresso happy hour" |
| 22:41 | Raynes | egghead: Okay, May 2nd. This time for sure (I looked at the email). |
| 22:41 | Raynes | If you do come, make sure you introduce yourself to me. |
| 22:41 | egghead | cheers Raynes -- at the clj meetup? |
| 22:41 | lynaghk | technomancy: just don't order an espresso to go, or they'll get pissy at you. |
| 22:41 | dcolish | Public domain is pretty good, you should also check out Spella |
| 22:41 | Raynes | Just walk up and say "Yo, I'm Mr. Egghead." |
| 22:41 | egghead | haha lynaghk I might take you up on that :) |
| 22:42 | alandipert | lynaghk: yes excellent, i look forward to caffeinating with you |
| 22:42 | bbloom | lynaghk: i get in at 830 or so. please bring my free expresso to the arcade party, thank you :-) |
| 22:42 | lynaghk | bbloom: you forefeited it when you said, "expresso" |
| 22:43 | egghead | I've been wine tasting today in mcminnville |
| 22:43 | bbloom | lynaghk: i'd say that i'm surprised i made that typo, but i'm not really |
| 22:43 | egghead | everyone is so nice over here, i'm used to la where everyone hates everyone |
| 22:43 | egghead | expresso b/c it makes you go fast vrooom |
| 22:44 | lynaghk | egghead: yeah, that weirded me out when I moved here from North Carolina---I distinctly remember wondering why all the cars were stopping and realized it was because I was on the sidewalk *looking* across the road. |
| 22:44 | technomancy | lynaghk: I would never order espresso to go |
| 22:44 | technomancy | you have to give it your full attention immediately |
| 22:45 | lynaghk | technomancy: yeah, nor would I. Just saying, I've heard you'll get a lot of lip and/or be refused service there if you do that |
| 22:45 | technomancy | haha |
| 22:45 | technomancy | dcolish: well, proximity to the hotel is another key factor |
| 22:45 | lynaghk | technomancy: Coava Coffee on the east side (directly off the Hawthorne Bridge, basically) is also very good. |
| 22:45 | technomancy | I'm more interested in the pour overs anyway |
| 22:46 | technomancy | lynaghk: I think there's a place up here that serves their beans |
| 22:46 | egghead | I like my espresso burnt and bitter |
| 22:46 | egghead | generally I wait around 5 mins after they are pulled to drink them to make sure they don't taste right |
| 22:47 | lynaghk | egghead: it's fun to play pretentious now and again, but I wholeheartedly agree that the best way to have anything is to just have it the way you like it |
| 22:47 | lynaghk | egghead: which is why I plan on continuing to drink only sub-$10 bottles of wine, preferably in parks. |
| 22:48 | alandipert | and why i choose to drink only microwaved day-old mcdonalds coffee that i find on my desk |
| 22:48 | lynaghk | see, what's nice about Clojurians is just how damn pragmatic we are =P |
| 22:48 | bbloom | i'll be honest: i'm quite enjoying the bland black coffee that every corner deli has in NYC - it's just so much faster than waiting for someone with some skill to prepare your beverage :-P |
| 22:49 | bbloom | it means that when somebody drags my ass down to tribeca or some other rich person neighborhood, i can really enjoy a good coffee as a novelty of sorts |
| 22:49 | egghead | why bother drinking it when you can take it via drip |
| 22:49 | bbloom | egghead: where do i sign up? |
| 22:49 | dcolish | technomancy: Spella is a 1.5 blocks from Public Domain |
| 22:49 | dcolish | i highly recommend getting both |
| 22:49 | egghead | :p |
| 22:49 | dcolish | stumptown is ok |
| 22:50 | dcolish | barista is good if you get heart or verve beans |
| 22:50 | xeqi | Raynes: I was surprised by the difference in https://www.refheap.com/paste/12647 |
| 22:50 | dcolish | we take coffee a little too serious in pdx |
| 22:50 | xeqi | also that error message sucks |
| 22:50 | xeqi | though we had this discussion at one point and I got something working well enough |
| 22:50 | xeqi | besides that its been good |
| 22:52 | Raynes | xeqi: You shouldn't be calling fragment on either of those things. |
| 22:53 | Raynes | xeqi: Also, in the latest versions you can actually now just throw strings in there unescaped. You just have to call me.raynes.laser/unescaped on them. |
| 22:53 | xeqi | Raynes: its a simplified example, imagine replacements happening inside (laser/fragment ...) |
| 22:53 | Raynes | Gotcha. |
| 22:54 | Raynes | Yeah, I should probably look into why that doesn't work. It doesn't look dumb at first glance. |
| 22:54 | Raynes | Not that anything you'd ever do would be dumb. |
| 22:54 | Raynes | <3 |
| 22:54 | Raynes | xeqi: Is this happening with the latest laser? |
| 22:54 | xeqi | use case: I'm processing a page and turning it into a fragment and send it in a ring response, and then have a middleware do the laser/document with the layout |
| 22:55 | xeqi | [me.raynes/laser "0.1.21"] |
| 22:55 | xeqi | so no |
| 22:55 | xeqi | or.. untested |
| 22:55 | Raynes | Yeah, there were lots of changes in content over the last 0.x.x releases. And bugs. |
| 22:56 | Raynes | Make sure you update. The latest version is stable and not going to change from underneath you. |
| 22:56 | xeqi | $latest me.raynes/laser |
| 22:56 | Raynes | $latest me.raynes/laser |
| 22:56 | lazybot | [me.raynes/laser "1.1.1"] -- https://clojars.org/me.raynes/laser |
| 22:56 | lazybot | [me.raynes/laser "1.1.1"] -- https://clojars.org/me.raynes/laser |
| 22:56 | Raynes | !! |
| 22:56 | Raynes | o/ |
| 22:56 | hyPiRion | zing |
| 22:57 | Raynes | http://dl.dropbox.com/u/23745600/Screenshots/aOry.png Immortalized. |
| 22:58 | technomancy | dcolish: you're talking to someone from seattle =D |
| 22:58 | technomancy | but thanks; hope to try them both |
| 22:58 | Raynes | technomancy: You should come visit me. <3 |
| 22:58 | Raynes | We can have dinner and you can push lein issues at me. |
| 22:59 | dcolish | technomancy: well a big NW highfive |
| 23:01 | xeqi | john2x: how is the ring testing going? any problems? |
| 23:18 | xeqi | Raynes: ahh, html-content disappeared |
| 23:26 | xeqi | but looks like the (l/content (l/nodes ...)) works |
| 23:27 | xeqi | Raynes: looks like the example paste works fine in 1.1.1, so no more confusion for me |
| 23:38 | Raynes | xeqi: Yes, content serves both purposes now. |
| 23:43 | Rich_Morin | FYI - Light Rail notes for Portland - http://pastie.org/6578091 |
| 23:44 | technomancy | wow, pastie is still around |
| 23:45 | technomancy | I remember being in the channel when that was created in 06 |
| 23:45 | Rich_Morin | yep, and accepting donations for Josh's brother Nate. |
| 23:47 | jeremyheiler | Rich_Morin: Thanks! |