#clojure logs

2014-05-30

00:06l1xhi guys
00:07l1xwhat is the best way of type hinting the return value, i have seen two versions of placing the type
00:07l1xa, right after the defn b, before the param vector
00:08l1xseems both working
00:13l1xi guess it is just a matter of style
00:24mangeIt seems that putting it on the args vector also lets you hint different arities differently.
00:29l1xyes that is true
00:32hellofunkanyone in here using Heroku?
00:33beamsoi have used heroku before
00:33ddellacostahellofunk: I have used Heroku + Clojure
00:33ddellacostahellofunk: do you have a related question?
00:33hellofunkI'm trying to figure out the best workflow for development that doesn't involve me having to push to git every little change.
00:33hellofunkOr,
00:34beamsorun your app locally using foreman
00:34hellofunkperhaps a way to just do the dev locally without having to tear down and restart the web server
00:34hellofunkif I make a change to a route, it is not reflected even locally unless I stop and restart the lein run process
00:34hellofunki.e. a reload doesn't do it
00:34hellofunker, refresh of pahge
00:35beamsousing 'lein ring server'?
00:35hellofunkso i'm using the lein run -m option, not advisable?
00:35hellofunkthat's in the Heroku tutorials
00:37beamsoi use the lein-ring plugin
00:37hellofunkok let me read up on that
00:38beamsoi need to check if it will allow for the changing of a route
00:40technomancyhellofunk: you should do development from a repl
00:40technomancyhellofunk: do `lein new heroku myapp` and work from there; it should pick up changes to your routes on reload
00:41technomancylein run only makes sense if you won't be making changes
00:41beamsothe lein-ring plugin will let you add routes on the fly
00:41technomancylein-ring doesn't make much sense for heroku deploys
00:42beamsotrue. i meant for running stuff locally.
00:42hellofunktechnomany ideally i'd like to be able to compile the clj source and have it reflected immediately in my running web process. if I have the repl going this would do it?
00:43technomancyhellofunk: definitely
00:43hellofunkis it "lein repl" or "lein run lein repl" as the latter is noted in the Heroku docs, what is the difference?
00:44hellofunkoh sorry, just "lein repl" not "heroku run lein repl"
00:44technomancyyou need them both
00:44technomancyone is for local dev and one is for testing things remotely
00:45technomancy(replace lein repl with editor integration if you like; from this perspective they're the same)
00:45hellofunkso for local dev, I do lein repl and it reports this: nREPL server started on port 58360 on host 127.0.0.1
00:45hellofunkhowever visiting localhost:58360 does not make a connection
00:46technomancybasically the -main function starts the web server, so once the repl is running, call that function and you're good to go
00:46hellofunkI can connect via emacs fine
00:46hellofunkhow do i view the web page I am working on?
00:46technomancyrun (-main 5000)
00:47hellofunktechnomancy this is typed at a terminal prompt, not a repl? sorry for these newbie confusions
00:47Jaoodhellofunk: your open port of 58360 is for the nrepl not the web server
00:48technomancyhellofunk: the -main function of your program should start a web server; if you used the `lein new heroku myapp` template, then it will
00:48technomancyso in a repl you would require your main namespace, switch to it, and run that function
00:49hellofunkok, let me try
00:54hellofunkso cider doesn't automatically create the repl port, you must do that independently with lein, right? and then use cider to connect to the port lein provides.
00:55Jaoodhellofunk: you can connect to a running repl from cider, I usually prefer that
00:56hellofunkok folks, i got this puppy fed and bathed. it's working and smiling now, ready to be petted.
00:56technomancyhellofunk: cider-jack-in launches a repl server
00:57Jaooderr what technomancy said :P
00:58hellofunktechnomancy on this type of setup, what is the best way to do a simple password protect on a page similar to a .htaccess on Apache?
01:00technomancyhellofunk: you can write a route or a middleware that checks http basic auth
01:00hellofunkok
01:00hellofunksimilar to how the repl/ works over http?
01:00technomancyyeah you can reuse the same http basic auth stuff for that
01:00hellofunkword!
01:09hellofunkthis default heroku template is certainly less intimidating than the compojure template
01:29hellofunkis it possible to put a newline inside a pr or pr-str, etc
01:29beamso,(pr-str "foo\nbar")
01:29clojurebot"\"foo\\nbar\""
01:30beamsoi need to look at my local docs. don't mind me.
01:34hellofunkbeamso no problem i figured out my issue
01:34beamsocool
02:09hellofunkddellacosta how is your OAuth2 for Friend different than the OAuth2 built into Friend?
02:09hellofunkit came up in a clojars search
02:09ddellacostahellofunk: there is oauth2 built into friend?
02:09hellofunkhttp://friend-demo.herokuapp.com/
02:10hellofunkWell, at least it supports OAuth2 with GitHub, maybe yours does more?
02:10ddellacostahellofunk: that uses my lib
02:10hellofunkah, well that explains it
02:11ddellacostahellofunk: and actually is kind of old, gotta update that and make a PR
02:11hellofunkis OAuth2 basically a competitor of OpenID?
02:11ddellacostatold cemerick I would a while back...d'oh
02:11ddellacostahellofunk: er, actually no, since OAuth2 is technically an authorization protocol, and OpenID is for authentication
02:11hellofunkI see Google supports both OAuth2 and OpenID
02:12ddellacostahellofunk: although sadly everyone uses oauth2 as authn these days
02:12hellofunkoh really? is using OpenID (which Friend is mostly providing) a bad idea?
02:13dbaschhellofunk: it’s not a bad idea, it depends on what you’re using it for
02:13dbaschopenid can be used in place of a user/password sign-in for a web app, for example
02:13hellofunkI've been tasked with setting a basic page that allows users to login via Google and Facebook
02:13dbaschyou can delegate the authentication to google or facebook via openid
02:14dbaschif you need to access google or facebook information on behalf of the user, then that’s what oauth is for
02:14ddellacostaI would argue using openid for authentication is arguably a better idea than using oauth2, since it is actually an authentication protocol by design
02:14hellofunkFriend doesn't explicitly mention Facebook in its OpenID list but FB does not support it
02:14hellofunksorry, FB *does* support it
02:40resolve-this.
02:56luxbockI'd like to add :source-paths for the dev profile in Leiningen for a project I've already been working on for a while
02:56luxbockis there a lein command/plugin that will create the path/files for me after I add the :source-paths option in my profiles.clj or should I just do it by hand?
03:10resolve-thisHello everyone, I'm having a hard time understanding a weird behavior in parameter metadata.
03:10resolve-thisI'm defining a function as (defn my-fn [^{:something #'another-fn} p1 ] ...)
03:10resolve-thisWhen I retrieve p1's metadata by going through something like (-> (meta #'my-fn) (:argslist) (first) (first) (:something))
03:11resolve-thisThe result is not #'the-ns/another-fn but "(var another-fn)" of type .........
03:11resolve-this clojure.lang.Cons!
03:11resolve-thisBut if I go through this process in the REPL, things work as expected
03:11resolve-thisany clues about what am I doing wrong that's causing this?
03:14amalloymetadata on arglists is probably not evaluated, since the arglists themselves aren't evaluated
03:15resolve-thishmmm
03:16resolve-thisand it works on the repl because the repl evaluates my var usage?
03:19amalloyi dunno, i don't understand what you're saying about "if i do x it doesn't work, but if i do x in the repl it doesn't"
03:21resolve-thiser, what I'm saying is that if I run the code in the repl, it works.
03:21resolve-thisbut when running in the context of a ring app, that's the behavior I'm getting
03:33resolve-this_amalloy: anyway, seems like you're right, metadata in parameters does not seem to be evaluated
05:02kralnamaste
05:12ddellacostakral: howdy
05:22bob2hm, well that was a surprise ending for -social
05:49josteink /msg NickServ identify Maliks41
05:49josteinkwell bugget
05:50Pandachipsbetter change that :)
05:50josteinkaha
06:07kralddellacosta: your surname sounds italian :)
06:08ddellacostakral: it is indeed! I am American but my father's family is originally from Italy.
06:09kralddellacosta: and you live in Tokyo? :D
06:09ddellacostakral: yeah, ha, complicated. :-)
06:09ddellacostakral: you are in Italy?
06:09kralddellacosta: yep, Vicenza, near Venice.
06:10ddellacostakral: very nice. I am embarrassed to say I have not yet been to Italy. :-(
06:10ddellacostakral: it's high on the list though.
06:11ddellacostakral: would love to know if I still have distant relatives there
06:11kralddellacosta: della costa is quite a common surname afaik
06:12kralso it's highly possible :)
06:12ddellacostakral: really? It's quite uncommon in the U.S. But it makes sense that it would be common in Italy, since the meaning seems so general
06:13phillordone of the joys of biology is that you will have distant relative in Italy, and every other country as well!
06:14kralphillord: :)
06:14ddellacostaphillord: haha, very funny. ;-)
06:15ddellacostaphillord: let's say...less distant than in most other countries, and more distant than my relatives in the U.S.
06:15kralddellacosta: anyway, here is a map of Italy with statistics about "Della Costa": http://bit.ly/1nzPCxu
06:15phillordFinding them may be a little bit more challenging
06:15ddellacostakral: wow, thanks!!
06:16kralddellacosta: yw
06:16ddellacostakral: neat, it has an American map too
06:17hellofunkddellacosta looking at the source to the Friend demo, I see a lot of ring requests getting destructered against keywords that don't seem to normally be there, like :demo and :context, any idea what that might be?
06:18ddellacostahellofunk: can you give me a link to a specific line or lines?
06:19hellofunkstarting with this: https://github.com/cemerick/friend-demo/blob/master/src/clj/cemerick/friend_demo/openid.clj
06:19hellofunkin the route, it calls functions in this on the request: https://github.com/cemerick/friend-demo/blob/master/src/clj/cemerick/friend_demo/misc.clj
06:20hellofunkhere, line 28 forexample https://github.com/cemerick/friend-demo/blob/master/src/clj/cemerick/friend_demo/misc.clj#L28
06:21hellofunkhere's another one where :demo is pulled out: https://github.com/cemerick/friend-demo/blob/master/src/clj/cemerick/friend_demo/misc.clj#L19
06:21cemerickhellofunk: it's just application metadata, added to all requests here: https://github.com/cemerick/friend-demo/blob/master/src/clj/cemerick/friend_demo.clj#L64
06:22ddellacostacemerick, and correct me if I'm wrong, but context is via compojure's context? https://github.com/weavejester/compojure/blob/master/src/compojure/core.clj#L164-L176
06:22cemerickddellacosta: correct
06:22ddellacostahellofunk: ^
06:22hellofunkinteresting
06:24hellofunkthis library looks like just what I needed. i assume it's getting its tired kicked nicely in production?
06:24hellofunk*tires
06:44ddellacostahellofunk: were you talking about friend? I think it's gotten a fair bit of tire kicking
07:31noncomis there a way in clojure for a function to get the outer form of the callsite?
07:32noncomexample: https://www.refheap.com/86106
07:33agarmanhttp://clojure.github.io/clojure/clojure.reflect-api.html
07:34noncomwhoa, that's a whole of a lot!
07:34agarmanI haven't used that before, so I'm reading through it as well.
07:35noncomi feel like clojure will soon become self-aware
07:42agarman,(defmacro cur-fn [] `(-> (Throwable.) .getStackTrace first .getClassName)
07:42clojurebot#<RuntimeException java.lang.RuntimeException: EOF while reading>
07:42agarman,(defmacro cur-fn [] `(-> (Throwable.) .getStackTrace first .getClassName))
07:42clojurebot#'sandbox/cur-fn
07:42agarman,(defn foo [] (println (cur-fn)))
07:42clojurebot#'sandbox/foo
07:42agarman(foo)
07:42agarman,(foo)
07:42clojurebotsandbox$foo\n
07:43agarmanthat's a horribly performing way to get the name
07:43agarman,(defn bar [] (println (cur-fn))
07:43clojurebot#<RuntimeException java.lang.RuntimeException: EOF while reading>
07:43agarman,(defn bar [] (println (cur-fn)))
07:43clojurebot#'sandbox/bar
07:44agarman,(bar)
07:44clojurebotsandbox$bar\n
07:51lcnhelp
07:51agarmanlcn: what's up?
07:55noncomagarman: cool :)
07:59TimMcnoncom: Is this for a logging fn?
08:00noncomTimMc: yeah, that was the intended use
08:07noncomTimMc: do you maybe have any prososals for that?
08:08phillordHmm, everytime I try to submit a bug report on core.logic it says "session expires" no matter how long ago I logged in
08:09noncomis it on jira?
08:09phillordyes
08:10phillordwell, the bug isn't -- haven't managed to submit it yet:-)
08:10phillordah
08:10phillordthird time lucky
08:10noncomjira - no wonder then
08:10noncomthis is just the way it works
08:11cab_hey folks
08:11noncomyou could first file a bug on jira so that they fix this and you be able to file a bug on core.logic
08:11noncomcab_: hey, how is it going?
08:11phillordnow I've marked a small issue as major, because that's the default -- ah well
08:12TimMcnoncom: Not really any other good ideas, but I do have another hack you can use: If you use a macro and it emits an anonymous fn, that fn's classname includes the enclosing fn's name...
08:12Guest6187great, I'm dabbling in Clojure using Lighttable
08:12TimMc&(class ((fn some-name [] #())))
08:12lazybot⇒ sandbox5671$eval12039$some_name__12040$fn__12041
08:13TimMc...which also "looks past" any intervening fn layers.
08:14Glenjaminisn't that essentially the same as using the relfect api in a macro?
08:14noncomTimMc: hah, another neat thing :)
08:14Glenjaminerm, the throwable trick in a macro even
08:14Guest6187Can I ask you guys a quick question? How do I undef a symbol? I defined a variable named min and shadowed the fn from clojure.core-
08:14Glenjaminie. it doesn't matter if its slowish because it happens at build time
08:16TimMcGlenjamin: Not quite. What if you had this? (defn top-level [] (map (fn intervening [] (callsite?)) ...))
08:16Glenjaminah, i see
08:16TimMcI think callsite? would pick up the intervening fn, but not top-level.
08:16Glenjaminyeah
08:17TimMcnoncom: ...but it's even hackier than the stack trace approach.
08:18noncomwell, it's a fun challenge to find the hackiest hack hackever! :D
09:46TimMcnoncom: (defn toplevel [] (println (:line (meta (def __foo__))))) and then read in the source file and backtrack to the start of the defn form and grab the symbol.
09:47TimMc(Sometimes I scare myself.)
09:48TimMcOK, time for some best practices instead of worst practices. Is there a tool I can use to find all expressions in tail position that match a certain pattern?
09:48TimMc(I'd like to find any place where I'm relying on (log/error ...) to return a nil.)
09:54TimMcDoes https://github.com/clojure/tools.analyzer just not have any docs?
09:59ambrosebsTimMc: are you looking for something in particular?
10:02TimMcI was hoping to see a usage example in the README at least, or even better a listing of the basic tools that are provided by the project.
10:02TimMcs/or even better/and\/or/
10:03kandinskiis there anything like (apply f args) but for macros?
10:03TimMcIt's less important now; I've realized that looking for tail-position forms is actually a tricky task in and of itself.
10:05TimMc(For instance, I'd want to look for things at the end of catch and finally forms, but also the last form in a try form *before* catch or finally.
10:05TimMc)
10:06mmitchellanyone know how to tell lein ring uberwar to _not_ include the clojure source files?
10:09mmitchellAhh, AOT?
10:10TimMcI think that will still include them.
10:10TimMcYou might be able to use a filter...
10:11ambrosebsTimMc: sure. You probably want tools.analyzer.jvm. The main entry point is analyze. https://github.com/clojure/tools.analyzer.jvm/blob/master/src/main/clojure/clojure/tools/analyzer/jvm.clj#L446
10:11TimMcmmitchell: :uberjar-exclusions
10:11ambrosebsplay around with at the REPL like: (analyze '(+ 1 2))
10:11TimMcambrosebs: Cool, thanks!
10:12ambrosebsbut before you start
10:12ambrosebs..
10:12ambrosebs{:user { :injections [(set! *print-level* 10) (set! *print-length* 10)]}} }
10:13ambrosebsput that in your profiles.clj
10:13TimMcheh
10:13ambrosebsor gradually inspect the output like
10:13ambrosebs(-> (analyze '(+ 1 2)) keys)
10:13TimMcYeah, that's the kind of stuff I'd like to see in the README.
10:13ambrosebs(-> (analyze '(+ 1 2)) :fn keys)
10:14ambrosebsyea
10:14ambrosebsit's pretty easy to pick up as a consumer
10:14TimMc(I'd write some docs and send a PR, but... yeah.)
10:14mmitchellTimMc: ok thanks, going to try that!
10:14TimMcmmitchell: You might need to add ^:append or something so you don't stomp on the existing values, not sure.
10:14gfredericksTimMc: why don't we have a bot that turns PRs into tickets w/ patches?
10:15TimMcgfredericks: !
10:15gfredericksand auto-closes them
10:15TimMcGood idea.
10:16gfredericksthen the project maintainers can have their own bots that turn tickets+patches into PRs so they can click "merge"
10:16TimMcBots for everyone!
10:17gfrederickswe don't need to argue about what tools we're using; we have computers, we can use whatever we want
10:17ambrosebsTimMc: open a wiki page
10:17TimMcambrosebs: For now though, this suffices: grep '/((fatal|error|warn|info|debug|trace)f?|logp?)' -P -nr --include=*.clj --color=always -A 3 -B 3 . | less -R
10:18TimMcI don't think the wiki is a good idea.
10:18gfrederickswhile you smart people are here, I've been thinking about static typie things ever since reading that two year old fight that rhickey had on reddit
10:18TimMcThere are very few piecs of documentation that shouldn't be versioned with the code.
10:20gfredericksin particular using the motivating thought that anything I know about the code, I should be able to communicate to the computer; I was wondering whether it would be useful to have some sort of open system of documenting "things I know about the code", for various tools to hook into for the purpose of reasoning/optimizing/whatever
10:21gfrederickssuch that you could be able to say things about your code without having the burden of needing a guarantee that a tool understands them
10:21bbloomgfredericks: things to say == logical propositions?
10:21gfrederickse.g., I could flag a function as pure, just because I wanted to, and if a type-checker or optimizer or something can take advantage of that, then cool, and if not I can still say it
10:21gfredericksbbloom: yeah
10:22gfredericksI feel like a traditionally understood static type system is more restricted than what I'm imagining
10:22bbloomgfredericks: yeah, what you're describing is related to theorem provers
10:23bbloomin theory, you don't actually need to prove the theorems you've postulated
10:23bbloomer theory is the wrong word
10:23bbloomsubstitute "i guess you don't actually have to...."
10:24bbloomthe big problems here are of motivation, maintenance, usefulness, etc
10:24bbloomeven formulating properties to write down, without actually proving them, can be quite difficult
10:24gfredericksat worst it would just serve as documentation for other programmers
10:25gfredericksif it's an open system we don't have to design it correctly up front?
10:25bbloomum, i wouldn't go that far :-P
10:25gfredericksthus my question mark :)
10:26gfrederickss/design it correctly/figure out all the things that can be said/
10:26bbloomif you have logical propositions, you can't actually do anything useful with them without interpreting them using a particular logic
10:26gfredericksthe things you do with them don't have to be strictly formalized; they could turn into warnings, e.g., based on heuristics
10:26bbloomand so if you just kinda ad-hoc make statements & then try to extract value from them later, you're going to get wildly inconsistent value judgements for those propositions as you add/remove/change logical operations
10:27bbloomso there's on going research in to extensible theorem provers and the like
10:27bbloombut you really need to make sure you design the fundamentals well: you need a good strong logic theory with good computational properties
10:28gfredericksI feel like I'm capable of asserting what types my function accepts/returns without answering these questions :)
10:28bbloomif you're interested in this, i suggest you make an attempt to learn Coq or Twelf or one of the other popular theorem provers
10:28gfredericksI'm in the middle of idris
10:29hyPiRiongfredericks: Is that like, the deepest you can go into a programming language? If you're in the middle of the forest, any step you take leads you back out.
10:29gfrederickshyPiRion: yes.
10:30gfrederickss/I'm capable of/I should be capable of/
10:30bbloomhyPiRion: heh, awesome
10:31gfredericksthis is probably the kind of thing ohpauleez was talking about @clojurewest 1.5 years ago isn't it; I missed that talk
10:32ohpauleezmy ears are ringing :) hitting the scrollback
10:32cbp,(System/getProperty "java.version")
10:32clojurebot#<SecurityException java.lang.SecurityException: denied>
10:33hyPiRiongfredericks: maybe? I just did that joke because someone recently told me that I'm currently in the middle of the forest of RRB-trees.
10:33ohpauleezIt's pretty close to what I was talking about!
10:34ohpauleezWhat has me interested in this area lately is Amazon's wide adoption of Lamport's TLA+ for their distributed systems
10:35gfredericksoh that rings a very small bell
10:35ohpauleezIn practice, I've seen ROI for capturing just a few subsystems with something like Alloy, and using generative testing for the system as a whole
10:35ohpauleezas you get into distributed systems, that's where the current approaches fall apart
10:35gfredericksI've been using test.check IRL at the integration level a lot lately
10:36ohpauleezTLA+ is potentially one answer, and simulation testing is potentially another
10:36ohpauleezexactly, test.check and test.generative is great at that level
10:36gfrederickstest.check wasn't really designed for it; I've had to bend it a bit
10:36ohpauleezRegardless, I still think there's a generic notion of "specification" that can be interpretted, combined, and processed by many systems
10:37ohpauleezI have specs that run in Alloy and core.logic
10:37gfredericksohpauleez: what sort of API for writing specs?
10:37gfredericksI was imagining just throwing metadata on things
10:39ohpauleezbbloom is right though, specs/assertions/logical invariants are mostly meaningless until you have a larger system to run them. You're either looking at SAT solvers that find missing/invalid cases, or you're looking at time-clock based provers that push the system off of the state machine
10:39ohpauleezgfredericks: The talk at Clojure west used maps to capture specs. An old version is still public: https://github.com/ohpauleez/sterling
10:40ohpauleezhttps://github.com/ohpauleez/sterling/blob/master/src/sterling/example/filesystem/fs_sterling.clj
10:41ohpauleezthere's an example of hitting Alloy (back then, it was still strings), but the API in a privat version matches closely to test.check
10:41gfrederickscool
10:41ohpauleezHere's the full spec as a value: https://github.com/ohpauleez/sterling/blob/master/src/sterling/example.clj
10:41ohpauleezfrom there you can generate checked versions, contracts, tests, generators, examples, etc
10:41ohpauleezthat
10:42ohpauleezthat's the power of a (logical) specification
10:43ohpauleezit's a point at which you can derive all other subsystems/results. bbloom and I learned some portions of Z in school. While I understood the math/notation, the system is obtuse and large
10:43ohpauleezI grasped Alloy in a weekend, and in a month could use it effectively
10:43bbloomohpauleez: i don't recall doing any Z in school
10:43ohpauleezAs I said, I'm not digging into TLA+
10:44bbloomohpauleez: i never did any theorem proving at all really :-P
10:44ohpauleezbbloom: 202, I think? Req Spec and Validation
10:44gfredericksooh do we get to accuse people of learning things in school?
10:44gfredericksTimMc and I learned mumps in school
10:44bbloomohpauleez: maybe? i kinda tuned out my entire computer science education
10:48gfredericksbbloom: ohpauleez: well thanks guys -- knowing that I'm (of course) not being original will help me think about other things :)
10:49ohpauleezgfredericks: Ping me if you want me to take a look at anything, or you're looking for texts. I can certainly help steer you clear of some long dark alleyways
10:49ohpauleez:)
10:50gfredericksha will do
11:07scapeis there a difference between #^ and ^ for hints?
11:08cbp#^ is old and I don't know if it works anymore
11:08cbpit probably does i guess
11:08scapeit seems to
11:08scapeokay
11:17gfredericksdoes anybody frequently see (in cider) "Variable binding depth exceeds max-specpdl-size" when trying to eval stuff?
11:21ambrosebstpope: is it my fault if I :exclude or rebind clojure.core vars that fireplace assumes is in scope?
11:42jonasengfredericks: i've seen that error. Never really figured out where it came from. Something with the ns form if I'm not mistaken
11:43gfredericksjonasen yeah I got it to work correctly after commenting an (in-ns ...) expression higher up o_O
12:16technomancygfredericks: max-specpdl-size refers to the stack
12:17technomancyit's just MACLISP-ese for a stack overflow
12:31cbphrm why is stuff like assert-args private?
12:32mmitchellHow can i get "lein ring" to inject servlet-request and servlet-request to the request map? I've seen this before, just can't remember how it's done.
12:32arrdemcbp: because argument validation is lame?
12:33cbparrdem: that's just like, your opinion man
12:33cbp:-P
12:33ohpauleezcbp: You don't want to use :pre and :post?
12:33ohpauleezare you in an anon function?
12:34cbpohpauleez: yea
12:35ohpauleezcbp: https://groups.google.com/forum/#!topic/clojure/em68MIYWDjQ
12:36ohpauleezYou could always just wallhack it and pull it out into your own util ns, copy-paste, or submit a patch to tools.macro
12:37cbpOh well, it's not that needed
12:37ohpauleezcool cool
12:41ohpauleezcbp: You still just might do a (def assert-args #'core/assert-args) if you want a quick and dirty way to get at it to get the job done
12:41cbpohpauleez: yep :-)
12:43jcrossley3mmitchell: ultimately that happens via ring.util.servlet: https://github.com/ring-clojure/ring/blob/master/ring-servlet/src/ring/util/servlet.clj#L60
12:43jcrossley3probably after deploying the result of 'lein ring war' to a servlet container
12:47rasmustojcrossley3: Tolkien reference?
12:48jcrossley3rasmusto: sure! :)
12:48mmitchelljcrossley3: ok cool, but how can i get that working locally with "lein ring server"? Do I just need to setup my own function for running an embedded jetty?
12:52jcrossley3mmitchell: 'lein ring server' runs an embedded jetty but doesn't wrap the handler in a servlet
12:54mmitchellahh right
12:55mmitchellso i have to wrap my handler somehow?
12:55mmitchellahh! must be this? https://github.com/ring-clojure/ring/blob/master/ring-servlet/src/ring/util/servlet.clj#L131
12:55jcrossley3mmitchell: yes
12:56mmitchelljcrossley3: thanks!
12:56jcrossley3np
12:59benkayhttp://lethain.com/a-couple-of-clojure-agent-examples/ << does this really do what it says on the tin, with regards to writing to a single file in a multithreaded context?
13:01gfredericksbenkay: I believe so
13:03ohpauleezbenkay: I would use mapv instead of those doall maps, if you're going to snag some of the code
13:03ohpauleezand obviously, those anon funcs can just be the function itself
13:03ohpauleezie: (mapv deref agets)
13:04ohpauleezI also might (def dispatch (comp send-off agent)), and use that instead
13:04benkaythanks, folks
13:15featureenvyQuestion: I have a vector of points in x y z coordinates (e.g. [1 0 0 3 2 2] where [1 0 0] is one point and [3 2 2] is the other). Now I want to move the points by one in X direction (result should be [2 0 0 4 2 2]). What is the best way to do this in Clojure?
13:17dbaschfeatureenvy: first off, I would partition 3 your vector into actual points, if you need to treat them as individual things
13:17dbasch,(partition 3 [1 0 0 3 2 2])
13:17clojurebot((1 0 0) (3 2 2))
13:18dbaschand then map a function that increases the nth coordinate
13:18dbaschbut that’s for cleanliness
13:21dbasche.g.
13:21dbasch,(map (fn [[x y z]] [(inc x) y z]) '((1 0 0) (3 2 2)))
13:21clojurebot([2 0 0] [4 2 2])
13:21cbpI would remodel points too. to be maps {:x .. :y .. :z ..}
13:21featureenvydbasch: Thanks! I seem to always forget the existance of partition. :)
13:22featureenvycbp: I thought about that, but in the end I will need them as a single vector again thanks to WebGL.
13:23cbpNothing wrong with having an interface layer that just turns those maps into vectors imho.
13:26featureenvyIn my case I have only one function that generates the points and pushes them directly to WebGL, I won't even touch them anymore. I kinda hope I don't have to add one more indirection.
13:27cbpokies
13:27devnhmmm, this future of programming business sounds interesting
13:27devn(strangeloop session)
13:42seancorfielddevn: yeah, some tough choices on the pre-conf stuff
13:43seancorfieldmy colleague and i went for Powered by JavaScript in the end as being more relevant to our work but several of the workshops look like fun, as well as the Future of Programming day...
13:44Glenjamini worry with things like powered by javascript what the intended audience is
13:52seancorfieldGlenjamin: in what way?
13:52seancorfieldI think it's an interesting space - even tho' I despise JS itself
13:53whilois nikita prokopov from datascript fame here?
13:54Glenjaminseancorfield: in that i'm unsure if its aimed at JS lover, JS haters, beginners, intermediates or advanced users
13:56Jabberzso is H2 still the preferred embedded Java DB of choice for clojure.java.jdbc?
13:57Glenjaminbah, can't decide if i should go to strangeloop
13:57Glenjaminor something more directly work related that doesn't involve travelling to america
13:59hiredmanI tend to prefer derby, when I have tried using H2 I always run in to concurrency related issues, h2 seems to default to single threaded use, and I am always too rushed to figure out which all knobs I have to fiddle to get it to not throw exceptions when I try to insert from multiple threads
14:02Jabberzhiredman: ah, thanks for the feedback on that. I notice a lot of examples tend towards sqlite, which I have been burned back in the day on concurrency with as well
14:12seancorfieldGlenjamin: I suspect the PbyJS day will have something for everyone on that spectrum :) I'm going because I'm interested in SPAs and we're using ClojureScript / Om at work, and I want to learn more about the ecosystem, even tho' I "hate" JS :)
14:12Glenjamininteresting, maybe i will give it a go then
14:13seancorfieldas for traveling to the USA, I can't speak to that - I have never traveled overseas for a conference - but my past two times at Strange Loop have been the best conferences I've attended in a decade or so...
14:13Glenjamini currently do loads of JS including Node.js at work, and don't mind the language really
14:14Glenjaminif you stick to functions and values its fine, not that many people actually do that
14:18winkNot exactly sure what you would use in a programming language besides functions and values
14:18winkor do you mean objects? :P
14:18Glenjaminyes
14:19Glenjaminand javascript's weird prototype/new/this stuff
14:20technomancyseems like the ecosystem can force your hand in situations like that
14:20Glenjaminto an extent, yeah
14:20Glenjaminthe node module ecosystem has been converging on functions and streams, so its not too bad
14:21Glenjaminbut often i go into the guts of a lib and its lots of messy heavy-indent long functions
14:33Frozenlo`Oh boy... 'java.io.FileNotFoundException: Could not locate cljs/analyzer__init.class'
14:36mmitchelltechnomancy: is it possible to override an existing leiningen plugin task with :aliases? I thought this was possible at one point but I can't seem to get it to work now.
14:37technomancymmitchell: it should work
14:41mmitchelltechnomancy: ok good. I want to use the "lein ring" plugin, but only the uberwar task. Everyone on our team is already using "lein ring server" to start the dev server, but now we need to customize jetty a bit. So I want to alias "ring server" with my own task.
14:41mmitchellI have this set in my project.clj file :aliases {"ring server" ["run" "-m" "dev-server/start-server"]} -- does that look OK?
14:42technomancymmitchell: ah, you can't alias subtasks
14:42mmitchelloh i see
14:56amalloytechnomancy: presumably it's more accurate to say that you can only alias tasks: "ring" is a task, and "server" is an argument it accepts
14:56technomancyamalloy: this is an also-true superset, yeah
15:06erlishow to debug with emacs cider
15:07benkayany notion on what "clojure.core$agent cannot be cast to clojure.lang.Agent" means? i'm baffled by the $agent terminology
15:07erlisNSA
15:08cbpbenkay: maybe you just passed the fn agent where it was expecting an actual agent?
15:08cbp,agent
15:08clojurebot#<core$agent clojure.core$agent@9e5972>
15:08erlisanyone, how can I debug a function call with emacs cider?
15:08erlis,debug
15:08clojurebot#<CompilerException java.lang.RuntimeException: Unable to resolve symbol: debug in this context, compiling:(NO_SOURCE_PATH:0:0)>
15:08cbp,(send agent (fn []))
15:08clojurebot#<ClassCastException java.lang.ClassCastException: clojure.core$agent cannot be cast to clojure.lang.Agent>
15:09erlis, (+ 1 2)
15:09clojurebot3
15:09benkaycbp: (class *my-agent*) returns clojure.Lang.Agent
15:09erliswow I didn't know I have a REPL here
15:09stuartsierrabenkay: `agent` is a function in Clojure. You're probably using that where you think you have a local variable named `agent`.
15:10benkayyup, thanks stuartsierra
15:14amalloyerlis: the question you're asking is way too vague. just repeating it won't get you a better answer. try explaining what you mean by "debug a function call"
15:15erlisamalloy: I want to see step by step
15:28TimMcerlis: "Debug a function call" could mean many things.
15:31erlisjust want to see step by step the execution of a function
15:31erliswith the REPL I can invoke a function and see the result
15:32erlisresult is wrong, I would like to see the values step by step, maybe is not possible
15:32erlisI remember someone showed me a library (trace) or similar
15:32erlisprobably I can use something like this
15:33erlishmmmm https://github.com/clojure-emacs/cider-tracing
15:42yotsoverlis: I have heard that it should be possible to put breakpoints in clojure code and use a debugger with counterclockwise. Have not tried it myself.
15:42stuartsierraerlis: True step-by-step debugging in Clojure requires a JVM debugger, which works just fine but will not integrate with CIDER/Emacs.
15:42stuartsierraJSwat is a free JVM debugger known to work with Clojure.
15:43erlisI see, I don't require true step-by-step, but at least visualize, I think I can use the cider-tracing package
15:43stuartsierraThere's also tools.trace, https://github.com/clojure/tools.trace
15:44erlisstuartsierra: That can help too thanks!
15:46jcromartiehow do I connect to a Leiningen project from Light Table?
15:47cbpctrl+space -> connect I think
15:47jcromartieFrom the connection bar, I can select a project.clj, and it does nothing.
15:47jcromartieFrom a project.clj I can Cmd + Shift + Enter, and it says "Connecting" forever
15:47jcromartiemy project is fine
15:48jcromartielatest version of Light Table
15:48jcromartierelatively simple project.clj which can be run by Leiningen just fine
15:48RaynesIt's clearly a philosophical message. It's about how we're all going through our lives, trying to connect with other people.
15:48RaynesWe are "Connecting..." forever.
15:49jcromartiebeautiful
15:49arrdemRaynes: I have some spare glue if you want it... plenty to go around
16:12PigDudewhat might trigger this reflection warning? "reference to field getPath on java.lang.Object can't be resolved." the line it refers to is a function docstring?
16:14rhg135hmm
16:14dbaschPigDude: refheap?
16:15PigDudedbasch: https://www.refheap.com/17d783212ba59852473c6bd3f
16:16dbaschPigDude: getPath is a method on File that something must be calling
16:16PigDudeoh ok, then it must be coming from cljx?
16:16PigDudeit happens earlier in the compilation process than other warnings
16:17PigDudemy tests don't touch the filesystem
16:17PigDude(apart from loading clojure code)
16:17dbaschbut all those functions look file-y to me
16:18PigDudethe log store backend can be file-based, right now it is working with localstorage, in-memory storage, and sql (korma)
16:18PigDudeif i were testing a filesystem backend then i might expect that but the code has no io calls right now except for the korma backend
16:19dbaschso is there a getPath somewhere in your core?
16:19dbasch*code?
16:19PigDudenot at all
16:20PigDudeah, yea, the message is coming from cljx
16:21PigDudehttps://github.com/lynaghk/cljx/blob/master/src/cljx/core.clj#L73
16:22PigDudethanks dbasch
16:22dbaschnp
16:34arrdemhum... ideas for testing a code emitter besides just evaling the output and ensuring that the result is the same as clojure.core/eval gives?
16:39augustlarrdem: made me think of Scheme implemented in miniKanren http://2013.flatmap.no/danwill.html :)
16:41arrdemaugustl: I mean automated proof that they must eval to equivalent results would be sweet too :P
16:42augustlaround 0:45:00 :)
16:43arrdemaugustl: I'll check it out in a minute
16:49shaunanyone here use clojurescript router, Secretary?
16:50amalloy~anyone
16:50clojurebotanyone is anybody
16:50amalloyi hate you, clojurebot
16:50augustlwhat, you mean there's something that isn't compojure around? :)
16:51amalloyshaun: the point is: whatever your real question is, you don't need to wait for someone to say "yes, i use secretary" before you can ask it
16:52shaunI find client-side routing confusing, not sure how to connect the "secretary/dispatch!" function to the page events
16:52shaunsurely I don't need to use goog.History
16:59lduroshi, new to clojure, I just installed leiningen with cider, which shows: CIDER 0.7.0snapshot (package: 20140530.419) (Java 1.7.0_55, Clojure 1.5.1, nREPL 0.2.3)
16:59lduroswhen I do (1 2 3) looking at clojure in action, I get the following error:
16:59ldurosClassCastException java.lang.Long cannot be cast to clojure.lang.IFn user/eval564 (NO_SOURCE_FILE:1)
17:00gfredericks,(1 2 3)
17:00clojurebot#<ClassCastException java.lang.ClassCastException: java.lang.Long cannot be cast to clojure.lang.IFn>
17:00ldurosIsn't (1 2 3) a valid list?
17:00gfredericks^ it's not just you
17:00gfrederickslduros: sort of
17:00ldurosso why is the example in clojure in action showing the following first example: (1 2 3 4) which can contain items of any type
17:00hiredmanlduros: it is a list as data, but as code lisp treats lists as function application
17:01hiredmanif you don't evaluate it as code, it is a valid list
17:01hiredman,'(1 2 3 4)
17:01clojurebot(1 2 3 4)
17:01lduroshmm, ok
17:01gfrederickssome things in lisp/clojure syntax mean the same thing as code or data -- but other things are treated differently
17:01ldurosok, got it, they are not examples intended to be tried as is, ok
17:19l1xhey guys how can i swap an atom that is a string?
17:20dbasch,(swap! (atom "") str "hello")
17:20clojurebot"hello"
17:20cbpl1x: wat
17:21hiredmanl1x: atoms are atoms, strings are strings, atoms being a refence type can point to or hold a string
17:21hiredmanbut an atom cannot be a string
17:21l1xdbasch: thanks
17:37fifosineIf I have an atom in a web application that is mutated with the swap! function via a post method, how are the changes persisted? Even when I restart my server, I still see the changes. How is this possible?
17:38hiredmanfifosine: it isn't, so you aren't seeing what you think you are seeing
17:38l1xdbasch: is there a way to replace the content of an atom instead of keep adding stuff to it?
17:38fifosinehiredman: How am I seeing what I'm seeing?
17:39turbofaill1x: reset!
17:39hiredmanfifosine: you aren't, you are seeing something else, most likely I think you aren't actually restarting your server
17:40l1xturbofail: could you shoot me an example?
17:41turbofail~(let [a (atom 0)] (reset! a "foo") @a)
17:41clojurebotNo entiendo
17:41fifosinehiredman: Here's my start and stop server code http://pastebin.com/HK4i98c2, does it look like atoms should reset?
17:41turbofail,(let [a (atom 0)] (reset! a "foo") @a)
17:41clojurebot"foo"
17:42hiredmanfifosine: you aren't actually restarting the jvm
17:42hiredmanfifosine: you are restarting some server code running in the jvm, so of the course the atom just stays in memory between runs
17:42fifosinehiredman: Ok, good to know then
17:44KeithPMhello all, is anyone running Session?
17:44amalloyl1x: most of the time if you want to use reset! it's because you're using the atom wrong to begin with. it's not unheard of, but it should be rare
17:46l1xamalloy: ok so what is the best way of rebinding a variable ? just use a closure?
17:47arrdemtbaldridge: you mentioned in your tools.analyzer talk when you demo'd the partial evaluator that you didn't think it would yield any meaningful improvement. is there a reason for that comment or just because your partial wasn't very aggressive?
17:48tbaldridgearrdem: that and the JVM is already insanely good at optimization. So stuff like constant folding is pretty much pointless, the JVM does that already
17:49dbaschl1x: what do you mean by rebinding a variable? you have an atom that points to a value, you can apply an arbitrary function to that value and replace the old value with the result
17:50l1xi just would like to have a while loop and swap the atom by every iteration but instead of keep adding to it i want to replace the content, reset! does that
17:50l1xi was wondering if recur would be better suited for this
17:50dbaschl1x: are you sure you need an atom then?
17:50l1xno, i dont need an atom :)
17:50gtrakl1x: or reduce.
17:51arrdemtbaldridge: mmk. suggestions for an app I could try to load for tree shaking tests? I'm curious how much I'll be able to throw out realistically.
17:53tbaldridgearrdem: you could probably go with just about any library and use an example from it. But to start with you'd probably want something pretty basic...
17:54tbaldridgeare you planning to do tree shaking of clojure.core? If so you can probably just do a simple factorial function and confirm that the output of the compiler is just a few calls to clojure.lang.RT
17:56arrdemtbaldridge: yeah I'll shoot for that first.
17:57arrdemtbaldridge: I'm just wondering whether the loading approach I take now will even allow me to analyze the clojure core the way I look at other namespaces. I think I'll have to force oxcart to reload the clojure core for analysis because otherwise it's already loaded in the runtime and the eval/load replacement I provide won't be invoked on it.
18:01kliphis it possible to add a docstring to each arity of a multiple arity defn?
18:01arrdemkliph: no, arities are simply methods and only the containing class has a docstring.
18:01hiredmanno
18:01kliphk thanks
18:03kliphso any docstring in the defn would have to describe the multiple arity-ness
18:03arrdemshould document all arities, yes.
18:05Morgawrhttp://jackschaedler.github.io/goya/ just stumbled upon this, it's pretty cool
18:05Morgawrwould love to have something like this inside LightTable for example, as a plugin
18:08amalloykliph: after all, nobody could look up the doc for a particular arity, right? you can't write (doc foo 2) or whatever
18:08amalloythere's only one place to put the docstring, so it all has to go there
18:09{blake}soap-clj...is that what we have for SOAP in Clojure?
18:10kliphamalloy: yeah my next question was going to be, how would I find the docstring for both arities :)
18:11dbaschsoap :(
18:12{blake}dbasch, It says so little, and so much...
18:15beepbeep_Can anyone tell me whats the difference between these two functions? https://gist.github.com/aaronmu/4c025dee6c26b8394c67
18:16beepbeep_bottom one doesnt work, cant figure it out :(
18:17aperiodicbeepbeep_: the second one could be trying to (apply nil ...), which causes an NPE
18:17hiredmanbeepbeep_: define "doesn't work"
18:17{blake}So, is it felt that there's nothing to be gained from SOAP, or it's just not a high priority for...anyone...yet.
18:18aperiodicbeepbeep_: or possibly message would be unhappy to be handed nil
18:18hiredmanaperiodic: he could have run out of heap right there
18:18broquaint{blake}: That was my understanding of things when I last looked.
18:18hiredmanaperiodic: his disk could be full
18:18hiredmanetc etc etc
18:18beepbeep_aperiodic an npe is exactly what happens
18:19beepbeep_I still don't understand why though
18:19cbp,(apply nil)
18:19clojurebot#<ArityException clojure.lang.ArityException: Wrong number of args (1) passed to: core/apply>
18:19hiredmanbeepbeep_: pastebin the whole stacktrace
18:19aperiodichiredman: given that the difference is that method can be nil a lot more easily in the second one, that's probably the issue
18:19{blake}broquaint, lol, which? That there's no point to doing it at all? Or "Well, we'd like to have it but we can get around the lack for now"?
18:19arohnerhas anyone gotten quil to work w/ an nrepl workflow? when I re-eval the quil namespace, the second sketch window opens up with size 0x0
18:20hiredmanbeepbeep_: the stacktrace will tell you where exactly the error happens
18:20broquaint{blake}: The latter :)
18:20{blake}broquaint, thanks!
18:21beepbeep_hiredman, I'm using LightTable to try out clojure, I'm not getting a stack trace in this case :(
18:21dbaschbeepbeep_: the first one fails if both method and message are nil, the second fails if *just* method is nil
18:21hiredmanbeepbeep_: if lighttable is hiding useful information like stacktraces I would recommend not using it
18:21beepbeep_hiredman, it usually does not.
18:22dbaschbeepbeep_: so you probably have cases in which method is nil but message is not
18:22beepbeep_okay, I'm gonna try to provide a better paste
18:22hiredmanbeepbeep_: then it sounds like a bug in lighttable
18:22beepbeep_because this aint making sense
18:22beepbeep_gimme a sec :)
18:23amalloybeepbeep_: i mean, the first version figures out which function to call, and then calls it; the second version blindly attempts a call to method even if it doesn't exist
18:23beepbeep_yeah, I get that
18:23beepbeep_I'm providing a message
18:23beepbeep_sec, providing better gist.
18:23amalloyuh huh. that's why it doesn't work. you're trying to call the method instead
18:24beepbeep_uh-oh
18:24beepbeep_ofcourse.
18:24beepbeep_superblind :(
18:25arrdem(doc cond->)
18:25clojurebot"([expr & clauses]); Takes an expression and a set of test/form pairs. Threads expr (via ->) through each form for which the corresponding test expression is true. Note that, unlike cond branching, cond-> threading does not short circuit after the first true test expression."
18:25amalloybut uh, this clojure code looks like you're trying to reinvent ruby. better to leave idioms from an old language behind and figure out how things are done in the one you're learning
18:25beepbeep_amalloy, that's exactly what it is, well yeah no, I'm reinventing cheap object system like java's.
18:26beepbeep_it's an exercise
18:26beepbeep_no worries.
18:26beepbeep_https://leanpub.com/fp-oo
18:26tbaldridgebeepbeep_: if you want a cheap object system, just use deftype
18:26amalloyand my experience re: light table is that most of the time when i hear about it it's when someone says "how come x doesn't work?" "x works fine" "oh well it doesn't work in light table"
18:27tbaldridge(inc amalloy)
18:27lazybot⇒ 115
18:27tbaldridgesame experience here
18:28beepbeep_tbaldridge, I'm not actually going to use this, as said, it's an exercise.
18:28dbaschwell, light table is still not close to a 1.0 release
18:29dbaschit’s pretty good for what it is but nobody should expect emacs
18:29arrdemdbasch: unfortunately we have emacs and therefore expect the same.
18:29arrdemdbasch: I backed LT and have been consistently disappointed with the beta for exactly that reason.
18:30dbascharrdem: the instant gratification generation :P
18:30amalloywell, that's silly. don't expect emacs. if you want emacs, just use emacs
18:30amalloynow, i think it's reasonable to expect a clojure evaluator that evaluates clojure correctly
18:30cbpit's been really slow moving lately, i think they switched to this new aurora thing
18:31dbaschamalloy: I’d definitely expect that from something that called itself a 1.0 version
18:32beepbeep_cbp, yeah, think so too, read some blog posts from author, looks like he's fully going for aurora
18:32arrdemdbasch: it's not that I expect ibdknox to be able to turn out emacs overnight, it's that until LT >= emacs I have no reason to switch.
18:32dbascharrdem: yeah, and I doubt anyone would switch from emacs to LT anyway
18:33arrdemdbasch: now that I'm entrenched with an erc config and org mode I probably wouldn't anyway, but it'd be nice to have a serious alternative I liked.
18:33dbascharrdem: LT would be for people who’d laugh at you for using emacs and call you old :)
18:33arrdemdbasch: hey now I need something to make my node_js# classmates shut up about atom :P
18:34amalloydbasch: you can't just call yourself 0.x and absolve yourself of all expectations. people *paid money* for light table, with an "estimated delivery" of last May. they wanted a clojure environment that's got more bells and whistles than a repl, but it's not even as correct as a repl
18:35dbaschamalloy: technically people backed the project, they didn’t pay for the product
18:35dbaschmany people don’t grasp the concept of kickstarter, which is indeed a problem for expectations
18:37whodidthismaybe one day we can have lt repl working on cljs again
18:37arrdemhonestly the reason I was interested in LT in the first place was the instarepl and code blocks. for now code blocks have been dropped and were actually a suggested GSoC project (dunno if it got picked up) but I think that some of the "rethinking the editor" stuff that Chris talked about is interesting if and only if editors and IDEs haven't changed a ton in a long time.
18:38hipsterslapfightnever try LT with node.js if you think it has clojure problems :v
18:38amalloydbasch: i mean, kickstarter is supposed to be for things that you can actually produce and just need money for. not things that you kinda hope that if you had some money you could maybe do. for example, the TOS says: Project Creators are required to fulfill all rewards of their successful fundraising campaigns or refund any Backer whose reward they do not or cannot fulfill.
18:39amalloycan he really give you a license to the finished product "light table", if you think a 1.0 should be able to correctly evaluate clojure code, and he does not have a product that can do that? all he can give you is access to a beta that doesn't really work
18:39beepbeep_well, thanks for the help guys! gn
18:39dbaschamalloy: I agree, and if enough people were unhappy he should issue some refunds
18:39dbaschbut clearly it must be good enough for many people who use it and don’t complain
18:40whodidthisinline eval and watches
18:40arrdemthat or nobody has actually switched to using it as a primary editor due to frustrations which they haven't bothered to voice in the presence of compelling alternatives like Emacs or Sublime.
18:41dbaschif I had backed it and I wasn’t happy, I’d say it
18:41arrdemwhich in fairness I doubt given that the mailing list is still active.
18:42dbaschbut I normally don’t expect much out of kickstarter stuff, I was just happy to receive my parallela over a year behind schedule
18:43tbaldridgepersonally I think LT suffers from feature creep. Originally it was just going to be an interactive extensible editor. These days it's a node.js/webkit monstrosity that is trying to "fix programming"
18:44arrdem2nd system maybe?
18:44technomancyI'm sympathetic to not wanting to build just an editor; much better to make an environment with everything you'd need to build an editor
18:44amalloydbasch: sure, i haven't backed anything on kickstarter myself. but the thing is, you're *entitled* to expect something, because the TOS says they agree to give you what you paid for. it is not a charity, it is a contract
18:44technomancythat said I have no idea what they're actually doing
18:45p_ltbaldridge: what's worse is how it reacts to certain keys, showing how much it is an embedded build of chrome...
18:45technomancyand browsers are generally huge piles of hacks upon hacks
18:45hipsterslapfightp_l: yeah even atom does a better job of that
18:45hipsterslapfightand with the new react editor atom might become useful
18:46p_lat least they fixed some annoying dependency problem in LT, I didn't have to patch DLLs last time I tried it
18:46tbaldridgewhen I saw this talk I thought "oh wow, this project is really out in the weeds now..." (http://www.infoq.com/presentations/reimagining-software)
18:47tbaldridgeThis sort of thing (visual programming) has been tried who knows how many times before and it always ends up in the same place....the weeds
18:48technomancyit works well for teaching kids =)
18:48tbaldridgesure, but it's practically useless for "real" programming :-)
18:50{blake}VAST and Parts worked pretty well.
19:09whilodnolen_: i think https://github.com/clojure/clojurescript/blob/master/src/cljs/cljs/reader.cljs#L547 and https://github.com/clojure/clojurescript/blob/master/src/cljs/cljs/reader.cljs#L552 should be declared ^:dynamic (?)
19:10whiloi am rebinding them, which works, but i currently get warnings
19:12amalloyi don't think you should be rebinding them at all, whilo. there's https://github.com/clojure/clojurescript/blob/master/src/cljs/cljs/reader.cljs#L567-L579 if you want to add new reader tags
19:13whiloamalloy: i know, but i need a "clean" reader which reads tagged literals as normal clojure datastructures, so i can hash them with sha-1 in a code-agnostic manner
19:13whiloimo it should work like clojure.edn or if i remember correctly tools.reader, which allows to pass in functions for tags and default-case
19:14whilothese two vars are shared mutable state over the whole runtime
19:16whiloi select-keys the default-tags to rebind, which could still break if somebody would register a new tagged reader for #inst for instance: https://github.com/ghubber/hasch/blob/master/src/cljs/hasch/platform.cljs#L16
19:17whiloit is a bit hacky
19:18whilothis is the corresponding clojure.edn reader: https://github.com/ghubber/hasch/blob/master/src/clj/hasch/platform.clj#L12
19:19amalloyyou want to run md5 against clojure source code literals? what's your plan for things with no guaranteed ordering, like maps?
19:19whiloi padd them, so the hash is the same for commutative datastructures like maps and sets
19:19whilowith xor
19:20whilohttps://github.com/ghubber/hasch/blob/master/src/cljx/hasch/benc.cljx#L33
19:23nbeloglazovarohner, when playing with quil you usually don't reload whole namespace, but rather reload only specific changed functions. For example you modified 'draw' function and you reload only it. This way new window will not be created on each reload
19:24whiloamalloy: not sure about it, i basically need it for cross-platform integrity of data, so i had to do this. if this is complicated or wrong, please point out any flaws
19:33lwmhi folks, has anyone used core.typed and what do they make of it?
19:34dbasch~anyone
19:34clojurebotJust a heads up, you're more likely to get some help if you ask the question you really want the answer to, instead of "does anyone ..."
19:34cbpI've heard it becomes unwieldy for large projects and still needs polish
19:35dbaschI’ve seen examples of projects that use it (imo) unnecessarily
19:36cbpdbasch: what kind of projects should use core.typed?
19:37dbaschcbp: the first thing that comes to my mind are things like crypto / security
19:37dbaschbut that’s probably just an opinion
19:37lwmprojects with people who like type annotations?
19:38cbpyou can type annotate in the comments like arrdem :-D
19:38technomancyprojects for which the cost of shipping an update is unreasonably high maybe
19:38dbaschI was thinking of cases where you want to pay a significant price upfront to avoid runtime errors
19:38cbpdocstrings*
19:38dbaschfor things like webapps runtime errors are usually no big deal
19:38dbaschbut you wouldn’t want a bitcoin client to blow up in the middle of a transaction
19:39lwmah, that makes a lot of sense
19:39cbpwouldnt something like quickcheck be a bit better for that?
19:40hiredmanI want core.typed to be just another thing that I can use to assist in ensuring the correctness of code, like tests, informal reasoning, etc
19:40hiredmanbut it still feels too heavy weight to be one tool among many
19:40dbaschI agree with hiredman
19:42hiredmanI have been fiddling with an implementation of the raft consensus algorithm, and consensus is something you generally *really* want to work correctly
19:43hiredmanI was thinking about annoting it with core.typed, but the cost/benefit seems to high, I would benefit much more from generative testing and using a history checker like knossos
19:45lwmooh didn't know about 'generative testing'
19:45tufttest.check is great fun
19:45lwmdo you think projects run away from dynamic languages like clojure when they can't afford run time errors in their applications?
19:46hiredmanare there any projects like that?
19:47hiredmanI imagine most projects just go with the skillset they have I guess
19:48lwmwell, the bitcoin transaction example above
19:49hiredmanyeah, but did that stop people from doing bitcoin websites in php?
19:49lwmha ... well. a website is one thing
19:50lwmI suppose you are right, skill set and problem domain and all that
19:50dbaschthere’s even a heavily used bitcoin library written in js
19:51dbaschand exchanges that were hacked because they used non-transactional databases for transactions
19:51tufti'm more drawn to prismatic's schema than core.typed
19:51tuftruntime vs static i know, but similar purpose otherwise
19:54caternhttp://stackoverflow.com/questions/2493996/hidden-features-of-clojure
19:54caternthis persistent queue thing, is there a nice way to create it now?
19:54caternnicer*
19:55hiredmannope
19:55hiredmanwhich is too bad
19:55hiredmanthey are very nice
19:55caternis there a reason?
19:56hiredmanhttp://dev.clojure.org/jira/browse/CLJ-976
19:56technomancyprobably because it's difficult to say "queuefish" with a straight face
19:56caternand, say I want a mutable queue, would the best thing be to put PersistentQueue in an atom? or something else?
19:57catern(or ref or agent or whatever)
19:57technomancyhaha; "This needs more time."
19:58{blake}Couldn't you just macro it up, if you wanted it?
19:58caternman, I don't care about read syntax, I just want to write empty-queue instead of what it currently is
19:58technomancyyou can't apply patches too quickly or they won't respect you in the morning
19:58hiredmancatern: depends what you are doing with it, java.util.concurrent has a number of mutable queues
19:58pjstadigtechnomancy: it doesn't need more discussion, or design, just time
19:59technomancypjstadig: like an aged cheese
19:59pjstadigtechnomancy: a fine wine
19:59caternhiredman: are there nice clojure interfaces to them?
19:59caternnice-looking I mean
19:59pjstadigcatern: (ThisIsMyClass. some args)
20:00hiredmancatern: interop is nice
20:00technomancyprobably there'd be a literal for it if j.u.c. didn't exist
20:00technomancyclojurebot: java.util.concurrent?
20:00clojurebotjava.util.concurrent is "When I find myself in times of trouble / Prof. Doug Lea comes to me / Coding lines of wisdom / j.u.c."
20:00hiredmantechnomancy: nah, they are very different
20:00pjstadighaha
20:00pjstadigclojurebot: nice
20:01clojurebotExcuse me?
20:01pjstadigclojurebot: i said nice
20:01clojurebotExcuse me?
20:01technomancyhiredman: well for better or worse, people would probably use persistent ones when they weren't appropriate if not for juc
20:01pjstadigwhatev
20:01technomancypjstadig: it's pronounced "botsnack"
20:01pjstadig~botsmack
20:01clojurebotOwww!
20:03lwmhaaa clojurebot is winning
20:13caternquestion, what is the CIDER repl autocompleting when I press tab to get java.util.concurrent.Callable? It doesn't autocomplete java.util.concurrent.LinkedBlockingQueue
20:13catern-doesn't
20:14technomancyit does both for me
20:14caterninteresting, any idea what the problem might be?
20:15technomancyI have an older version of cider
20:15technomancyit's not the most stable piece of software
20:29kenrestivonrepl.el 4evar
20:31pjstadigtechnomancy: did you fix imenu in the newer version of cider? it's broken in 0.6.0
20:31akurilinI swear to gosh, every 3 I'm bitten in the ass by ring returning an html file as BufferedInputStream only when making an uberjar
20:31akurilinthis is my life's nemesis
20:32amalloykenrestivo: slime 2010. get on my level
20:32kenrestivohaha, it would take me a *long* time to get on your leve
20:32technomancypjstadig: still on 0.4.0
20:32p_l... jesus, what old versions D:
20:32pjstadigtechnomancy: it's fixed in master though and your name's all over it
20:33technomancymy name?
20:33kenrestivohuh, 0.1.8 nrepl.el here. works great. :-P
20:33pjstadiggit blame
20:33technomancyI haven't touched cider since 2013
20:33technomancyexcept for maybe in an experimental branch
20:37Bronsaamalloy: I raise you with a 2009 slime.
20:38p_l... is that one old enough to be pre-slime-fancy.el?
20:38amalloynice
20:38technomancyI don't think it's possible to go further back
20:38kenrestivoi wonder if there'll be a market for celebrity endorsements. "cider! used by technomancy!" (insert picture of phil smiling and holding a package of cider)
20:38technomancyoh, nope. swank-clojure started in april of 2008.
20:38technomancywow
20:38p_lluddites, all of you :D
20:39kenrestivoi'd imagine swank/slime was the first
20:39pjstadiginferior-lisp
20:39technomancyit predates clojure.core
20:40amalloywait what?
20:40amalloythere's some code in clojure going back to 2006, isn't there? was that all in java?
20:40technomancy(clojure/create-ns 'swank)
20:40amalloyor was clojure around, but too loosely-packed to be put into a namespace
20:40pjstadigoooh it was just clojure back then right?
20:40p_l"2013-11-17" <--- not recently updated slime...
20:40amalloyhuh. i had no idea
20:41Bronsaamalloy: I remember a boot.clj rather than core.clj
20:41pjstadigclojure used to compile namespaces differently before you needed at least two segments
20:41kenrestivoi remember rich saying he worked on clojure for 2 years before it was released. i guess that was 2008
20:41amalloythat i've heard of, Bronsa. i hadn't heard about the namespace "clojure"
20:43pjstadighey, remember when leiningen used to copy all your dependencies into a 'lib' dir?
20:46work_opanybody familiar with play-clj? getting an error about no class def for openal even though its installed
20:54pjstadighttps://github.com/clojure/clojure/commit/3d1daab442b6f6067d5f2fff066bdcee60f9379a
21:08technomancypjstadig: man those were the days
21:24fifosineTo anyone who is familiar with hiccup: what's going on at l16, "[:p user]" in http://pastebin.com/c06hKZP8? I can't figure out what the purpose of this vector is.
21:25cbp`fifosine: a <p> html tag with whatever user is inside
21:26fifosinecbp`: I don't see the p tag in the resulting html page, though. If I change :p to :h1 or if I change user to any string, I see no change in the source.
21:26fifosineSo I don't understand what it does
21:27cbp`It's sorrounded by an if-let, if (session/get :user) is nil or false it will not return that vector
21:28cbp`it will return (link-to ..)
21:28fifosinecbp`: Ah! Okay, missed that :p Should I assume that the result of the if-let is conj'd onto content?
21:29cbp`the result of the if-let is passed as a first argument to "base"
21:29fifosineand then content is the second?
21:29cbp`yes
21:29fifosineBut function base only takes one argument
21:29cbp`no, it takes any number of arguments , that's what the & means
21:30fifosineOh! I thought that meant optional parameter
21:30fifosine& means a list of args?
21:30lazybotjava.lang.RuntimeException: Unable to resolve symbol: means in this context
21:30cbp`it takes any number of arguments and groups them in a seq called content
21:30fifosinegot it
21:30fifosinethanks cbp`
21:30cbp`np
21:35Lajjlacbp`, what is your opinion on the objective-who?
21:57jumblemuddle&(+ 1 1)
21:57lazybot⇒ 2
21:57jumblemuddleWow, I'm impressed.
22:06eraserhd,(clojure.string/split "\n" #"\n")
22:06clojurebot[]
22:06eraserhd^^ *sigh*
22:08cbp`eraserhd: ?
23:00jumblemuddle&(println "Hello, World")
23:00lazybot⇒ Hello, World nil