#clojure logs

2012-12-19

00:21mpanIs there an approach to making a quine other than the "program source as string literal with a hole" approach? (currently working on the 4clojure problem)
00:26lisztYou can find fixed points of your language's evaluator / compiler.
00:27mpanbut isn't that the original goal?
00:27mpansounds a bit circular
00:27mpanor am I misinterpreting?
00:29lisztThese are more like fixed points that take advantage of special cases of an interpreter.
00:31mpanI guess I was trying to ask how
00:31lisztOtherwise, your quine needs to have knowledge of itself self-embedded (otherwise, how is it going to know what to spit out?)
00:32mpanI was kind of hoping for a constructive version of a certain proof
00:32mpanwikipedia seems to suggest there's a nonconstructive one for existence
00:32lisztThe constructive proof is a "program with a hole."
00:32mpanI'm honestly not sure why that bothers me
00:34amalloympan: yes, there is a good quine of a different sort in let over lambda
00:34amalloydoesn't work in clojure because our backtick is implemented differently from CL's
00:34amalloyhttp://news.ycombinator.com/item?id=2150805
00:35mpanwhat specific properties of backtick does it expect?
00:35amalloyin a sense that's a "program as quoted literal with a hole"
00:35mpanalso, what does quote followed by unquote or quote followed by quasiquote even mean?
00:36amalloywell it expects '`(x ~y) to be read as (quote ((quote x) y)), i suspect
00:37eggheadI enjoyed the minikanren quines from friedman & byrd's strangeloop talk
00:37amalloywhereas in clojure it reads as ##''`(x ~y)
00:37lazybot⇒ (quote (clojure.core/seq (clojure.core/concat (clojure.core/list (quote clojure.core/x)) (clojure.core/list y))))
00:37mpanamalloy: can you explain that input please?
00:37eggheadhttps://github.com/webyrd/quines these guys
00:38mpanegghead: wow that's cool
00:38mpanis it searching over valid programs until it hits quines?
00:38amalloysorry, don't have the free time for a whole lesson on quoting now
00:38eggheadya mpan
00:39mpanthanks for the links you guys
00:39mpanwill look into it further
00:39eggheadthe talk is great if you haven't seen it -- http://www.infoq.com/presentations/miniKanren
00:39mpanamalloy: it's an unusual corner case, right? not something necessary for normal usage?
00:40amalloysure. clojure's backtick works fine for general use
00:40dnolenmpan: egghead: it works in Clojure now too http://github.com/namin/TAPL-in-miniKanren-cKanren-core.logic/blob/master/clojure-tapl/tapl/test/tapl/test/quines.clj
00:40eggheadwow dnolen ! very cool :)
00:42eggheadI really need to find an excuse to use core.logic at work...
00:43amalloyegghead: sneak it in starting with core.match
00:43mpanegghead: are you already using clojure at work?
00:43eggheadya mpan
00:43mpanawesome :)
00:43mpanbtw mind if I ask where?
00:44eggheadheh, sure. cj.com
00:44mpancool
00:44mpanwell thank you all
00:44mpangoing to go read those links
01:55amalloyi can't believe that the windows java installer still defaults to "install the Ask toolbar and make Ask my default search engine"
02:02Raynesamalloy: Yeah, it did that to me.
02:03amalloyi bet the guys in ##java have no idea that this is the case, and would totally welcome my reporting it to them as a bug
03:46wunkimaybe a strange question, but is it possible to get the namespace from where the function (in different ns) is called?
03:57ivanwunki: if you have the var, something like (:ns (meta #'map))
03:57ivanoh, you want to see the caller's namespace?
03:58wunkiI think it was a bad understanding on my part. When printing *ns* in the namespace of the function, the value is that of the *ns* where the function is called
03:58wunkiso that would fix my need
03:59amalloywunki: no, *ns* is the namespace at compile time
04:00ivanI'm sure there's a crazy thing that can walk up some stack frames, but maybe you just want to pass *ns* everywhere, or write a macro that passes *ns*?
04:01wunkiamalloy: ah, then I'm wrong again :)
04:01wunkiivan: yes, I will just pass the namespace on
04:02wunkithanks for the help guys
04:05roryg
04:07ro_stwhy would i be getting an AbstractMethodError when trying clojure.walk/postwalk on this map? https://www.refheap.com/paste/7715
04:08ro_stthis is a normal map, not one of datomic's lazy loading entity maps
04:15borkdudegoat moaning
04:17ivanro_st: works for me, Clojure 1.5
04:18ro_stthanks for the report, ivan
04:19noidiworks in the tryclj.com REPL as well
04:19ro_stmind pasting your dependency string from project?
04:19ro_stso i can drop it in here
04:19noidimaybe `data` doesn't contain what you think it does?
04:19ro_stahhhh hold on. that deeper {:db/id …} is still a datomic entity
04:19ro_stin memory
04:20ro_stafter adding pr-str, read-string to the threading macro, it works
04:22ro_stthanks for the sanity check, folks
04:22ivantoo bad it prints as something it's not
04:22ro_styeah. it's a special lazy-loading map
04:23ro_stlooks and acts like a map, but isn't one
04:23ivan:ps-this-lazy-map-will-blow-up-in-your-face true
04:23ro_st-grin-
05:42mindbender1anyone playing with clojurec
05:43mindbender1is it usable for system programming stuff yet
05:43wunkiivan: (defmacro some-macro [] `(some-function ~*ns*)) calls `some-function` with the namespace where the macro is used. Somehow this works.
05:45cmdrdatsibdknox: how does Light Table connect to projects? nRepl?
06:13clgvcmdrdats: you can find out by executing (loaded-libs)
06:13clgvif it is nrepl you should see it being loaded
06:58cmdrdatsclgv: cool, thanks - i'll do that
07:01cmdrdats(filter #(.contains (name %) "nrepl") (loaded-libs)) => ()
07:03clgvcmdrdats: that works. testes in CCW^^
07:03clgvI get: (clojure.tools.nrepl clojure.tools.nrepl.ack ...)
07:05cmdrdatscool - i'm curious to know how light table connects and what it's longer running goal for project connectivity is
07:05cmdrdatsI would love to see nrepl support since it's becoming quite ubiquitous
07:10clgvcmdrdats: you mean how it evaluates code.
07:10ro_sti think he means how it connects to the running jvm for a given lein project
07:12cmdrdatsclgv: as ro_st points out, yes :)
07:15clgvthats also how it evaluates code ;) :P
07:15cmdrdatsyes, true :)
07:15cmdrdatsbut I don't mind too much if it wants to do something else too
07:25cmdrdatsi also really really wish that all other clojure IDE's would implement paredit-forward-slurp-sexp, paredit-forward-barf-sexp and the backward variants…
07:25cmdrdatsmake the playing field a little more even
07:27ro_stand the parens aware selection and navigation stuff
07:28ro_stall of paredit, really. nothing major -grin-
07:28cmdrdatshehe, true
07:28cmdrdatsshould be standard fare
07:33clgvcmdrdats: huh? do you use more than one IDE for development?
07:34cmdrdatsi'm using emacs primarily, but always testing the waters
07:35cmdrdatsand giving emacs to a newbie is a very daunting task, so like to have backups for such cases
07:35cmdrdatsparedit makes emacs worth suffering through though
07:36clgvwell CCW has a lot of paredit stuff as well - probably not complete...
07:36ro_styup. you can't avoid the pain of building up the muscle memory. especially as someone used to windows text editing
07:39cmdrdatsclgv: i saw the paredit.clj for ccw - looking promising
07:40cmdrdatshttps://github.com/laurentpetit/paredit.clj/blob/master/src/paredit/core.clj
07:41cmdrdatshmm, looking at it - is :paredit-expand-right the one where it moves the paren along a form?
07:43mindbender1is there a clean way of recovering from a BindException without having to restart the repl. In my case the exception is persisting even after trying with other ports
07:47clgvcmdrdats: I only know the keyboard keys not the implementation names ;)
07:49cmdrdatsclgv: haha - ok, so do you have a keyboard key that does that? :D (ie) this => (ie this)
07:49borkdudeC-) right?
07:49borkdudeforward-slurp or smth
07:49clgvcmdrdats: humm if so I dont know ;)
07:50clgvcurrently I use a pretty limited set of those operations ;)
07:50cmdrdatsborkdude: ye, but for ccw :)
07:51cmdrdatsclgv: it changes clojure coding from carving a static blob into a completely dynamic, fluid experience…
07:51ro_stgreat way to put it
07:51ro_stit makes coding a speed of thought thing
07:52cmdrdats(let [x]) (calc) => (let [x (calc)])
07:52cmdrdatsprime example :P
07:52bosiehow would i translate this java code "string.getBytes(Charset.defaultCharset)" to clojure?
07:52bosiespecifically, the Charset.defaultCharset throws me
07:53bosiei did (.getBytes string)
07:53cmdrdatsCharset/defaultCharset ?
07:53clgvcmdrdrats: hmm gotta try that and remember it. I am already glad for paren level selection^^
07:53bosienamespace Charset is not known
07:54cmdrdatshmm, java.nio.Charset ?
07:54clgvborkdude: humm C-) does not work here
07:54ro_styou have to import it first
07:54bosie(import java.nio.charset.Charset)
07:54borkdudeclgv (paredit-forward-slurp-sexp)
07:55clgvborkdude: whats the name in the settings?
07:55bosiehmm no
07:55borkdudeclgv what settings? nm
07:56clgvborkdude: CCW "Keys" settings
07:56borkdudeclgv ah, I don't know =)
07:56cmdrdatsclgv is in ccw, borkdude in emacs, i'm guessing :)
07:56bosieso how would i call a static method on java.nio.charset.Charset? i tried Charset/defaultCharset and (.defaultCharset Charset)
07:57borkdudebosie (java.nio.charset.Charset/defaultCharset args)
07:57bosieoh
07:57bosiei see
07:57cmdrdats(.getBytes string (java.nio.charset.Charset/defaultCharset)) should work?
07:57bosiei didn't "wrap" java.nio.charset.Charset/defaultCharset as a function call
07:58bosiethanks
07:59bosiestupid me, gah.
08:02borkdudebosie at least I'm not the only one making stupid mistakes, so tnx ;)
08:04cmdrdatsnot that stupid, i can see how one would make the mistake
08:04cmdrdatsCharset/defaultCharset looks more like a constant that a method call :P
08:04borkdudecmdrdats yes of course =)
08:05clgv,java.nio.charset.Charset/defaultCharset
08:05clojurebot#<CompilerException java.lang.RuntimeException: Unable to find static field: defaultCharset in class java.nio.charset.Charset, compiling:(NO_SOURCE_PATH:0)>
08:06clgv,(java.nio.charset.Charset/defaultCharset)
08:06clojurebot#<UTF_8 UTF-8>
08:06clgvno it's a function^^
08:06borkdude"Unable to find static field. Did you mean to call a method?" helpful error messages project ;)
08:07clgv,(java.nio.charset.Charset/availableCharsets)
08:07clojurebot#<SecurityException java.lang.SecurityException: denied>
08:07clgvlol^^
08:07clgv&(java.nio.charset.Charset/availableCharsets)
08:07lazybot⇒ #<UnmodifiableSortedMap {Big5=Big5, Big5-HKSCS=Big5-HKSCS, EUC-JP=EUC-JP, EUC-KR=EUC-KR, GB18030=GB18030, GB2312=GB2312, GBK=GBK, IBM-Thai=IBM-Thai, IBM00858=IBM00858, IBM01140=IBM01140, IBM01141=IBM01141, IBM01142=IBM01142, IBM01143=IBM01143, IBM01144=IBM01144,... https://www.refheap.com/paste/7717
08:09cmdrdats:P
08:09clgv&(count (java.nio.charset.Charset/availableCharsets))
08:09lazybot⇒ 161
08:13Fauno1&(System\currentTimeMillis)
08:13lazybotjava.lang.RuntimeException: Unsupported character: \currentTimeMillis
08:13Fauno1&(System/currentTimeMillis)
08:13lazybot⇒ 1355922372489
08:16clgv&(java.util.Calendar/now)
08:16lazybotjava.lang.NoSuchFieldException: now
08:38solussdcore.logic is so cool… I need ideas for how to use it!
08:39llasramsolussd: "This is a really awesome hammer. Now I just need to find some nails..."?
08:41ejacksonsolussd: it can be used for _.0 :)
08:41solussdexactly. well, maybe more like "this is a really awesome lithium polymer battery powered screwdriver, now I just need some screws"
08:43ejacksoni know the feeling well
08:43solussdI need to find a way to sneak it into some production code at work. :)
08:46Bergle_1there exists a special hell for those who sneak new tech into prodution code.
08:46ejacksonits called 6 months time
08:50solussd:)
08:51solussdI'll pit new, un-battle-tested clojure code against anything our .net team writes any day
08:51ro_st+1
08:52cmdrdats+5
08:52solussdit's certainly possible to write bugs in clojure, but it's a lot harder- and when you do, they're much easier to find, imo.
08:53ro_stall together now: Clojure is easier to reason about
08:56noidiI find random Clojure code immensly more understandable than random Java code, because Clojure code largely consists of calls to standard library functions that we all know and love
08:56noidiwhereas in Java you'll have 20 layers of custom-built crap that's different in each project
08:57ro_sti'm going to go back to clojurebook.com over the year-end break. haven't looked at it since two weeks i spent reading it before writing a single line of code. going to be quite interesting to see how i've changed :-)
08:57solussdexactly. Clojure gives you uniform interfaces to your data- which is usually stored in something that implements IPersistentCollection. In java, each object has a proprietary interface.
08:58jballancanyone here have experience using http.async.client?
09:11borkdudejballanc only indirectly, through twitter-api :)
09:11jballancif I'm reading the source correctly, it seems to do a lot of polling, no?
09:12jballancor wait...maybe not
09:12borkdudejballanc ask neotyk whenever he is here, or on twitter
09:12jballanccool, will do :)
09:30acron^How do I select a value in a list? I have ["hello"] and I just want "hello"
09:31cark,(first ["hello"])
09:31clojurebot"hello"
09:31carknote that ["hello"] is a vector, not a list
09:31acron^sorry :)
09:31cark=)
09:32acron^perfect, thank you
09:32acron^(first (vals (select-keys params [:name]))) <- is there a nicer way to do this ?
09:33Ember-acron^: also, if you have multiple strings in a list/vector and you want to use em all as parameter for something else you can use apply
09:33ro_st(str 1 2) same as (apply str [1 2])
09:33Ember-,(str apply '("foo" "bar"))
09:33clojurebot"clojure.core$apply@fd3b2c4(\"foo\" \"bar\")"
09:33Ember-oops :)
09:33cark(get {:name "john" :id 1} :id)
09:33Ember-other way around!
09:34cark,(get {:name "john" :id 1} :id)
09:34clojurebot1
09:34Ember-,(apply str '("foo" "bar"))
09:34carkor
09:34clojurebot"foobar"
09:34cark,(:id {:name "john" :id 1})
09:34clojurebot1
09:34carkor
09:34cark,({:name "john" :id 1} :id)
09:34clojurebot1
09:36cark(first (vals (select-keys params [:name]))) there should be some hall of fame for such roundabout snipets =P
09:43augustlis it possible to delete stuff from a schema in datomic? (Read: create a new transaction with a datom that removes it). Or does the schema have to be valid for all old and new data ever added (which it wouldn't be if I "deleted" an attribute)?
09:44ro_stnot possible, because there will always be datoms that use that schema
09:44ro_stsimply stop using it in your code
09:44ro_stnot ideal, i know. we're lucky in that we get to rebuild our database and leave the crud behind, but at some point it's going to be unavoidable
09:44augustlmy system allows users to specify a schema. Seems like for now the best way to solve it is to store the schema and data as strings (via JSON or something), since I only query it via Lucene anyway.
09:45augustlas in, don't use datomic for the dynamic schema stuff, and only store "now" in lucene
09:45ro_sthappily, you can add metadata to retired schema and have your app warn when used
09:47augustlro_st: I suppose another alternative is to create completely new schemas when the user modifies the current one (by removing an old attribute, for example)
09:47ro_styou mean new databases?
09:48augustland have a datom somewhere that tells me which schemas that is the current one
09:48augustlhmm yeah I guess so :)
09:48augustlthat would mean migrating all the data too though..
09:48augustlat least the current data
09:49ro_styup. i'm currently finding out how much fun that is; i'm trying to do it programmatically by exporting data appropriate for d/transact to run
09:49ro_strunning into issues, though.
09:50augustlbut since I don't actually need to query the user made schemas with datomic (as mentioned I do that through lucene) I can just store the dynamic data as json or whatever. I just need to use it to build views showing the history of changes etc
09:50acron^^ cheers for that guys :)
09:50acron^helpful as always
09:51acron^cark: i've only been doing clojure a week so my code is pretty horrendou,s I don't doubt :P
09:51augustlro_st: thanks for the input
09:52ro_stcurious, what's your use case, augustl? what do your users put in their database?
09:52augustlro_st: it's a power user system for event agencies (conferences etc, not programmatic events), where the user can specify the fields for attendants per event
09:53augustlso a user might remove an attribute where some attendants already has data in it, but that doesn't mean deleting that attribute from the history of changes to the attendant data, etc
09:54augustlor add a new attribute at any time during an event
09:54ro_sti think you'd be far better served by marking those fields as deleted with some sort of additional metadata and filtering them out in your app code
09:55ro_staltering schemas such that you have to migrate data will be a lot more painful. i speak from experience. i currently have two Free transactors running and two nrepls and i'm iteratively producing and attempting to transact data from one to the other
09:55augustlro_st: do you have any clue how datomic handles adding new stuff to the schema "run-time", as per a users request?
09:56augustlas in, is adding attributes "slow" and should only be done in migration tasks where stuff is taken down, etc?
09:56ro_stwhy two transactors? can't have two databases with the same name. even at different points in time.
09:56ro_stadding attributes is no slower than adding 'normal' data
09:56augustlah
09:57ro_stit's just asserting facts, albeit into a special partition which is used to validate incoming data in transactions and attributes in queries
09:57ro_st:db.part/db
09:58ro_stall the processing around schema occurs when transacting or querying data that uses said schema. i don't think it's possible to assert changes to schemas that affect indexes
09:58augustlinteresting, so schema is mostly validation?
09:58ro_stat least, i know they're working on it
09:59ro_stwell, it also specifies performance critera such as indexing, and then typing and cardinality, as you know :-)
10:00ro_stfeel free to take all this with a pinch of salt. i speak more from experience than from intimate knowledge of their code :-)
10:02ro_staaaand i'm off. good luck augustl
10:02augustlthanks :)
10:04carkacron^: hehe sorry didn't mean to offend. learning is always like that =)
10:04acron^No offence taken :)
10:05cark=)
10:12jsabeaudryIs there a way to print compojure routes? (bonus points for printing parameters too)
10:14weavejesterjsabeaudry: Not currently
10:15augustlroute info as metadata on handler functions? :)
10:15weavejesterYeah, that's one approach I'm considering
10:15jsabeaudryweavejester, ok, thanks for the info
10:16weavejesterAnother is to put something on top of Compojure that's more restrictive but more transparent
11:03gfredericksis there really not a clojure.core/array?
11:03tsdhgfredericks: clojure.core has amap, aset, areduce, etc.
11:04gfredericksI want to check if something is an array
11:05tsdhgfredericks: (.isArray (class obj))
11:05gfredericksyeah I was just concluding that myself
11:05tsdh:-)
11:05gfrederickstsdh: thanks
11:05tsdhYou're welcome
11:15hyPiRionI wonder if we get 1.5.0 as a Christmas present
11:15hyPiRionor if it's a present for like, May or something.
11:24gfredericksshould korma's str-value function (convert a value into a SQL string) be a multimethod or a protocol?
11:26hyPiRiongfredericks: Will all values of same type have the same representation as a SQL string?
11:26hyPiRionIf so, then yes. Otherwise no. Protocols = dispatch on class
11:28gfrederickscurrently the function is a cond that checks map? keyword? nil? true? false? coll? :else
11:32gfredericksI guess coll? isn't easily supported with protocols or multimethods :/
11:32hyPiRionjava.util.Collection
11:33hyPiRion?
11:33hyPiRion$source coll?
11:33lazybotcoll? is http://is.gd/9uZURt
11:34hyPiRionclojure.lang.IPersistentCollection
11:37hyPiRionBut that's an interface, eh.
11:38gfredericksyou can extend a protocol to an interface
11:41clgvhyPiRion: but that should work. since `isa?` is used
11:41hyPiRiongfredericks: What happens if you extend two interfaces, and both are implemented on the object you're dispatching?
11:42hyPiRionJust pick one of them?
11:43gfrederickshyPiRion: I think it defers to the JVM dispatch semantics? which I don't understand.
11:44hyPiRionwhut
11:44gfrederickscan't you define a java method that takes a java.util.List in one declarationd an a java.util.Map in another?
11:44hyPiRionI should know this, but I don't, hmm.
11:45hyPiRiongfredericks: yeah, sure thing
11:45gfrederickshyPiRion: so I don't know what the jvm does with that
11:45hyPiRionYou can implement two interfaces with the same method name and same signature, even. That's not what protocols do though
11:46hyPiRiongfredericks: It'll statically dispatch based on type
11:46hyPiRionIt happens compile-time.
11:46gfredericksno I mean class Foo{ void bar(List x){ ... } void bar(Map x){ ... } }
11:47gfredericksbut assume I have another class ListAndMap implements List, Map {}
11:47gfredericksand then I pass that to Foo#bar
11:47hyPiRiongfredericks: Oh right
11:47gfrederickswhich definition does it call?
11:47hyPiRionYou have to specify the type then
11:47hyPiRioncast it to one of the interfaces
11:48hyPiRionotherwise Java complains, afaik
11:51clgvhyPiRion: multimethods usually complain if they cannot decide and then you need to tell it which case to prefer
11:51grc`Namespace question I think. I want to call a function held in a list. It doesn't seem to be being resolved, At the REPL > print returns core$print but (first '(print)) gives me an unqualified "print". What am I missing?
11:52clgvgrc`: `resolve`
11:52grc`clgv: Thanks
11:52clgvthough that gives you the variable and not a symbol with attached namespace
11:55hyPiRionEventually you could do backquote instead
11:55hyPiRion,(first `(print))
11:55clojurebotclojure.core/print
11:56hyPiRion,print
11:56clojurebot#<core$print clojure.core$print@28c36197>
12:14nDuffI have a method with an argument list of ^Boolean [^long tsOld, ^long tsNew, ^double secondsPerBatch], invoked from a gen-class as #^{:static true} [windowBatch [long long double] Boolean]
12:15nDuff...however, at runtime, use results in NoSuchMethodError clojure.lang.IFn$LLDO.invokePrim(JJD)Ljava/lang/Boolean;
12:16nDuff...any pointers in terms of what I'm missing?
12:17hyPiRionnDuff: I'll pop up a minimal example
12:18hyPiRionhttps://www.refheap.com/paste/7723
12:18hyPiRionI suspect you're missing the :methods part
12:19nDuffhyPiRion: Not the case, sadly.
12:19nDuffhyPiRion: My code, in context, is at https://gist.github.com/73899d73914b4da15d3d
12:21hyPiRionHmm, have you tried to put the method at the start of the :methods vector?
12:21nDuffhyPiRion: ...the exception is thrown by boundsetter.miniepl$_export_Fn_windowBatch.invoke, which wouldn't exist at all if gen-class weren't creating that method.
12:27technomancy^:this-metadata-intentionally-left-blank
12:29nDuffNot hinting the return type does indeed fix things up.
12:30technomancyI wonder if we'll get an influx of new-language-new-years-resolution folks in January
12:31gfredericksI'm gonna work through one 4clojure problem every day!
12:31hyPiRiontechnomancy: Is that common?
12:31technomancyhyPiRion: I don't know; I picked it up in November as an early new-years thing just because of a pragprog book sale =)
12:32hyPiRionIt's not a resolution then, it's curiosity :)
12:32TimMc,(-> (with-meta 'cons {:car 1 :cdr (with-meta 'cons {:car 2 :cdr (with-meta 'cons {:car 3 :cdr 'nil})})}) meta :cdr meta :car)
12:32clojurebot2
12:33technomancythe Pragmatic Programmer book recommends learning a new language every year
12:34hyPiRionWell, if I had a ton of books about programming languages, I'd say that too.
12:34technomancyhaha
12:34ejacksonyeah, they (or somebody else) upped that to one a week didn't they. Madness.
12:35hyPiRionejackson: I think 7 langs in 7 weeks was mostly to let you taste different paradigms.
12:36hyPiRionNot to learn the languages
12:36hyPiRionI killed your joke now, didn't I?
12:38gtraktechnomancy: how long does it take to learn lisp?
12:38technomancygtrak: depends on your definition of "learn" and "lisp" =)
12:39technomancyyou could probably learn lisp 1.5 in a couple weeks
12:39gtrakexactly :-), what's it mean to learn a language every year?
12:39gtrakI can probably learn enough ruby to write a web service in a week..
12:40gtrakor... I can learn more clojure... how about, 'learn a lot of things every year'
12:40technomancyyeah, the point is not to stagnate; "learn one language a year" is an audacious way of stating it but certainly not the only way
12:40technomancyit is a great way to get your point across to new developers in a punchy one-liner though!
12:41hyPiRionEspecially if you use juxt.
12:41technomancyall hail the juxt
12:41tbaldridgeand I'd put in that 1 paradigm per year is a good starting place. Study prolog, erlang, haskell, as different ways of seeing the same problem.
12:41tbaldridgeJust don't learn Java, then C#, then C++, then Python, the Ruby
12:42hyPiRiontbaldridge: Agreed. Going from C++ to Java isn't going to take a year.
12:42tbaldridgeThat's just stagnating, imo
12:42gtrakI think fads and switching all the time are a little harmful
12:42gtrakit's not useful advice to the people who need it
12:42technomancy"We play both kinds of music here; country and western." <- yeah, I know Java and C++
12:43tbaldridgeMy point is, some people say "I'm going to branch out" and then they go learn yet one more OOP language.
12:43gtrakthe alan perlis quote is better, "A language that doesn't affect the way you think about programming, is not worth knowing."
12:43tbaldridge(inc gtrak)
12:43lazybot⇒ 2
12:43hyPiRion(inc alanperlis)
12:43lazybot⇒ 1
12:43tbaldridge(map inc [gtrak alanperlis])
12:43technomancygtrak: 2 or 3 years in and you won't be a junior developer anymore; you'll be confident enough to know when your own sense of what to do should override what you read in a book =)
12:44sgeoJava might be worth learning for a hypothetical person
12:44technomancywhich is a lot like other truisms like "never use alter-var-root" and "eval is evil"
12:44sgeoSay they go from Haskell to Scheme to ... I don't know, PostScript
12:44gtraktechnomancy: I think that kind of knowledge isn't accidental... and you won't get it from passively switching frameworks/languages all the time
12:45technomancynot sure what passively switching languages means?
12:45TimMc~#19
12:45clojurebot19. A language that doesn't affect the way you think about programming, is not worth knowing. -- Alan J. Perlis
12:45sgeoIntroduction to class-based OO might be interesting to them
12:45hyPiRion,(doseq [person '[gtrak alanperlis]] (println `(~'inc ~person)))
12:45clojurebot(inc gtrak)
12:45lazybot⇒ 3
12:45clojurebot(inc alanperlis)
12:45lazybot⇒ 2
12:45tbaldridgeshowoff
12:46gtrakerr, you know... I won't feel comforted by having met his criteria... and that's what it takes to be confident about overriding what the book says. That sense of self-direction should be there a priori.
12:47gtrakjust because I used an abstract-factory pattern, it doesn't mean I'm doing good OO..
12:48gtrakpassively-switching implies there's a way to mindlessly meet the criteria, and being mindful is the right answer
12:48tbaldridgein other words: cargo cult
12:49technomancysure; that's higher-order advice
12:49eggheadvery cool 4clojure fork gfredericks
12:49sgeoWhat fork?
12:49technomancywhile it's relevant, "use critical thinking" is not really the kind of thing that necessarily belongs in a programming book
12:50eggheadsgeo: it's core.logic problems instead of general clojure problems: http://4clojure.gfredericks.com
12:50sgeoegghead, that's awesome
12:51sgeoTopics: Me
12:52sgeoErr, is it currently broken, or do I just have the wrong answer>
12:52sgeoThe latter
12:53jsabeaudry,(.putShort (java.nio.ByteBuffer/allocate 2) 0xf000)
12:53clojurebot#<IllegalArgumentException java.lang.IllegalArgumentException: Value out of range for short: 61440>
12:53jsabeaudryAny idea how I can do this while keeping the hex format?
12:53jsabeaudryIn java I beleive it would only be a cast
12:54TimMcYou mean, convert it to a signed short?
12:55eggheadsgeo: I am stuck on the second, maybe it is borken...
12:55eggheadshouldn't (run* [q] succeed) always be true so '(_.0) ?
12:56jsabeaudryTimMc, possibly, the important is to write those bytes in the bytebuffer, It seems I can .(.putChar (char 0xf000)) but that is a bit ugly
12:57ejacksonegghead: maybe _0 ?
12:58TimMcjsabeaudry: Sneaky. I forgot that the JVM had an unsigned type of the same size.
12:58eggheadah, that was it, thanks ejackson
12:58jsabeaudryTimMc, do you know how I can make a signed short out of the litteral 0xf000?
12:59technomancyman, it's weird to see people mention clojure on gnome blogs I've been reading since 2004
13:02mattmoss,(class 0xf000)
13:02clojurebotjava.lang.Long
13:02mattmoss,(let [a 0xf000] (if (< a 0x8000) a (- a 0x8000)))
13:02clojurebot28672
13:04mattmosshmm
13:04mattmoss,(let [a 0xf000] (if (< a 0x8000) a (- a 0x10000)))
13:04clojurebot-4096
13:04jsabeaudryIn java one can simply do "(short)0xf000" is there an equivalent in clojure?
13:05mattmoss(short (if (< 0xf000 0x8000) a (- a 0x10000)))
13:05mattmoss,(short (if (< 0xf000 0x8000) a (- a 0x10000)))
13:05clojurebot#<CompilerException java.lang.RuntimeException: Unable to resolve symbol: a in this context, compiling:(NO_SOURCE_PATH:0)>
13:05TimMcjsabeaudry: Doesn't that truncate in Java?
13:06TimMc&(apropos 'short)
13:06lazybotjava.lang.RuntimeException: Unable to resolve symbol: apropos in this context
13:06TimMc&(use 'clojure.repl)
13:06lazybot⇒ nil
13:06TimMc&(apropos 'short)
13:06lazybot⇒ (shorts short-array short aset-short unchecked-short shorten-url bitly-shortener shortener shorten shorten-custom shorten-isgd isgd-shortener)
13:06zerokarmaleftunchecked?
13:06mattmoss,(short (if (< 0xf000 0x8000) 0xf000 (- 0xf000 0x10000)))
13:06clojurebot-4096
13:06zerokarmaleft,(unchecked-short 0xf000)
13:06clojurebot-4096
13:07jsabeaudryohhhh
13:07mattmosswell, that's cool
13:07TimMc&(unchecked-short (int Character/MAX_VALUE))
13:07lazybot⇒ -1
13:34hyPiRion,0xffffffff
13:34clojurebot4294967295
13:34hyPiRionOh, it's parsed as a long?
13:36TimMc0xfffffffffffffffffffffffffffff
13:36TimMc,0xfffffffffffffffffffffffffffff
13:36clojurebot83076749736557242056487941267521535N
13:36TimMcOr bigger!
13:38hyPiRionWell, it's a Java wart removed at least
13:38hyPiRionint n = 0xffffffff; would make n = -1
13:41TimMcew
13:43TimMcpublic platonicint n = 0xffffffffffffff;
13:43TimMcOh for a full numeric tower...
14:06hyPiRionoh darnit
14:08hyPiRionI just realized I'm trying to create a macro, but I'm not sure what it's supposed to do or what it is supposed to get as input. The only thing I know is that my I need it somehow.
14:08hyPiRions/my//
14:11eggheadhey gfredericks I'm doing this core.logic 4clojure and I think one of them might be unsolvable
14:11eggheadproblem 41
14:11eggheadcan run* take two params or only one?
14:12eggheadshouldn't it be (run* [q] (fresh [a b] (== q [a b] ...
14:14AimHererun* can take two parameters
14:16TimMchyPiRion: Sounds like you're gonna have a bad time.
14:16amalloyegghead: (run* [a b c] (...)) is equivalent to (run* [q#] (fresh [a b c] (== q# [a b c]) (...))), iirc. something close to that, anyway
14:22hyPiRionTimMc: I figured out what I was interested in, not just let me write a doc for it so I don't forget it agani
14:22hyPiRions/not/now/
14:24alex_baranoskydoes Korma run on 1.2.1
14:25hyPiRionTimMc: https://www.refheap.com/paste/7726
14:26hyPiRionWas a bit hard to grasp the idea at first, but it looks okay now.
14:28amalloyhyPiRion: why is this a macro? i see very little reason for it to not be a function
14:29amalloyand several reasons for it not to be a macro
14:30TimMchyPiRion: The binary case doesn't make sense -- fn-a is ~@-inserted?
14:30TimMcAlso, what is the "g" in the doc?
14:30hyPiRionTimMc: fn-a is a form
14:30hyPiRionI need to sleep. g is b
14:31hyPiRionexample call: (fn2->fn3 (a some params to it) (b some params))
14:31hyPiRionwhere a and b return fns
14:31TimMcand you named it fn3->fn2
14:31hyPiRionand a calls b if some condition is met
14:32hyPiRionTimMc: right. That's what I meant.
14:32hyPiRion;(
14:33amalloythat expands to (fn [x y z] (let [b (b some params), g (...)] ((a some params to it b) y z)))
14:33hyPiRionamalloy: correct.
14:33bosiewhy would #"google\\..+" not match "google.com" ?
14:34amalloytoo many \s
14:34TimMcbosie: No need to double-escape in Clojure regexp literals.
14:34bosieTimMc: \. doesn't compile though?
14:34TimMcExcept where it comes to quotes, of course.
14:34amalloyof course it does
14:35amalloy&(re-find #"google\..+" "google.com"
14:35lazybotjava.lang.RuntimeException: EOF while reading, starting at line 1
14:35hyPiRion,(re-find #"google\..+" "google.com")
14:35clojurebot"google.com"
14:35amalloy&(re-find #"google\..+" "google.com")
14:35lazybot⇒ "google.com"
14:35bosieamalloy: "RuntimeException Unsupported escape character: \. clojure.lang.Util.runtimeException (Util.java:170)"
14:35hyPiRionzing
14:35amalloy&(re-find #"google\\..+" "google\\.com")
14:35lazybot⇒ "google\\.com"
14:35hyPiRionbosie: you sure you have # prepended to ""
14:35bosiehyPiRion: dang
14:35brehautbosie: what are you wanting this regexp for?
14:36mpanwhere can I find the core.logic version of 4clojure which was mentioned earlier? I'm probably googling for the wrong keywords
14:36dnolenmpan: http://4clojure.gfredericks.com
14:36bosiebrehaut: i want to define some regex and see if any of them are contained in a string
14:36amalloyhyPiRion: imo this macro is bonkers, but if you specifically want exactly what you have...well, i think you're bonkers too, but you can't do it with a function
14:36mpandnolen: Thank you!
14:38TimMcbosie: That much was obvious. :-)
14:39brehautbosie: anything more specific?
14:39TimMc(He's probably asking because you are probably reimplementing something needlessly or even dangerously.)
14:39brehautTimMc is correct
14:40hyPiRionamalloy: Without context it is indeed.
14:40amalloygfredericks: http://4clojure.gfredericks.com/problem/2 is a lot harder than you intend it to be, because the user has to somehow guess that the answer is '[_0]
14:40hyPiRionand without context I am as well.
14:40bosiebrehaut: well, i want to skip certain domains
14:40bosiebrehaut: domains which are given as a list
14:40brehautbosie: and you want to find these domains in a full urI/uri string?
14:40bosiebrehaut: yes
14:41bosiebrehaut: i read in a list of full uri strings
14:41mpanwould you like to match example.com/google or not?
14:41brehautbosie: perhaps something like https://github.com/cemerick/url/
14:41brehautwould be smarter
14:41bosiempan: i wouldn't skip it
14:41brehautor perhaps java.net.URL
14:42amalloyit would be better written, IMO, like: (= '[_0] (run* [__] succeed)). not a challenging problem to solve, but teaches the user that succeed is a goal, that "anything" is represented as _N, and that run* doesn't care what name you give the result
14:42bosiebrehaut: how so?
14:42brehautmpan: use an existing URL parsing implementation, and just ask it for the domain
14:43bosiebrehaut: the list of URLs i want to skip doesn't specify the domain per se. e.g. i would say any google domain
14:43mpanbosie: in the sense that URLs have semantic information in their components, and just regexps don't quite represent that fully
14:43bosiempan: sure
14:43mpanmight or might not make a difference in your particular use-case
14:44dnolenamalloy: +1
14:44bosiebrehaut: i am not sure what you are suggesting. wouldn't i still need the regex?
14:44bosiebrehaut: parse each full uri string from the list and check it against the list of blacklisted domain regexes?
14:44mpanbosie: but you'd be specifically matching against a particular component not the whole url
14:45brehautmpan has it
14:45bosiempan: ok
14:45TimMcbosie: What do you want to do in each of the following cases? "http://docs.google.com/&quot;, "http://google.com.example.net/&quot;, "http://example.net/google.com/etc&quot;
14:46bosieTimMc: block, dont block, block
14:46TimMcThat last one, you'd really want to block it?
14:46bosieTimMc: isn't the domain in the last one example.net?
14:47TimMcYes.
14:47bosiethen yes
14:47TimMcOh, is example.net on the blacklist?
14:47bosieah sorry, don't block
14:47TimMcOK.
14:48hyPiRionhm
14:48TimMcRegexes are not a great tool to use for filtering on highly structured strings with escaping rules and optional parts.
14:49TimMcbosie: How about http://xgoogle.com/ ?
14:49bosieTimMc: dont block
14:49TimMcWhat you want is a tool that can take a URL string and answer the question "Is the host of this URL equal to or a subdomain of google.com?"
14:50bosieTimMc: yes and with https://github.com/cemerick/url/ i could get the host
14:50TimMcHmm, it's not quite enough, is it...
14:51TimMcThat doesn't help with FQDNs.
14:51amalloydnolen: for some reason the _ character renders as invisible in gfredericks's 4clojure (when i type it into the code editor), but it renders fine on 4clojure.com. do you have a similar issue?
14:51brehaut,(map #(.split (.getHost (java.net.URL. %)) ".") ["http://docs.google.com/&quot;, "http://google.com.example.net/&quot;, "http://example.net/google.com/etc&quot;])
14:51clojurebot(#<String[] [Ljava.lang.String;@5573990b> #<String[] [Ljava.lang.String;@1844cd01> #<String[] [Ljava.lang.String;@4cef0919>)
14:52amalloybrehaut: for a less painful experience, try clojure.string/split
14:52brehaut,(map #(clojure.string/split (.getHost (java.net.URL. %)) ".") ["http://docs.google.com/&quot;, "http://google.com.example.net/&quot;, "http://example.net/google.com/etc&quot;])
14:52clojurebot#<ExecutionException java.util.concurrent.ExecutionException: java.lang.ClassCastException: java.lang.String cannot be cast to java.util.regex.Pattern>
14:52bosieTimMc: hm, if i just have a list of domains and append all TLDs
14:52TimMcbrehaut: Try this on: http://www.google.com.:80/
14:52dnolenamalloy: haven't actually tried the core.logic problems yet.
14:52brehautTimMc: ha of course
14:53llasramhttps://github.com/damballa/inet.data
14:53amalloyTimMc: wait, what's the last . there doing?
14:53brehaut(inc TimMc)
14:53lazybot⇒ 24
14:53dnolenamalloy: _ in the editor works fine for me in Safari
14:53brehautamalloy: its the top level dot. its implicit
14:53llasrambrehaut: ^^
14:53bosieTimMc: cemericks' url is clever enough for that
14:54TimMcamalloy: It's a Fully Qualified Domain Name. If you leave off the dot, DNS resolution may use the gateway's search domain.
14:54TimMcThis is why you use a library. :-)
14:55brehautllasram: nice
14:55brehautbosie: check out llasram's link above
14:55amalloyno kidding? i didn't know about that. so if you have some evil isp whose dns redirects "foo" to mycrappysearchwithads.com?q=foo, they're not allowed to do that for "foo."?
14:55llasramOh, I missed who needed this :-)
14:56TimMcamalloy: I think that uses a different (non-standard) mechanism.
14:56llasramI haven't had a personal reason to add direct URL handling, but once you parse the domain out of URL, you can check for membership in a set or use a Mozilla PSL format list to identify the E2LD label
14:58TimMcbosie: (inet.data.dns/domain-subdomain? "google.com." "www.google.com") => true
14:58TimMcoooh, it only does proper subdomains, that's no good
14:58llasramTimMc: domain-contains? Does both
14:59bosieTimMc: since its just for a personal clj project, and since i only been programming clojure since monday or sth, i think i will just let it slide and go on with it ;)
14:59TimMcbosie: Why? You've just been handed a library that will take care of all the tricky details.
15:00bosieTimMc: right
15:01TimMc(fn bad? [url] (some #(->> (java.net.URL. url) (.getHost) (inet.data.dns/domain-contains? %)) #{"google.com" "bing.com"})
15:01TimMc)
15:01TimMcAnd [inet.data "0.5.1"] in your project.clj.
15:02cemericksomeone should make one of the bots yell at anyone pasting code using a java.net.URL ctor
15:02TimMccemerick: clojure.java.io something?
15:02cemerickparse error
15:03brehautcemerick: :'(
15:03bosieTimMc: i am not sure what your code is supposed to do
15:04TimMcbosie: That function ("bad?") checks if a URL is at any of a set of hosts.
15:04bosieTimMc: i rephrase: considering i dont have the domain....
15:04bosielemme try
15:04cemerickbrehaut: ?
15:04brehautcemerick: i brought up that ctor, sorry
15:04cemerickand, for that matter, TimMc :-P
15:04llasramTimMc: Actually, `domain-contains?` just tests a single domain. For testing set-membership: (let [bad-domains (inet.data.dns/domain-set "google.com" "bing.com")] (get bad-domains input-domain))
15:04TimMcWell, the blacklist would be passed in as a second argument.
15:04cemerickah
15:05brehautcemerick: to my knowledge cemerick.url is not on clojurebots deps
15:05cemerickjava.net.URL is fairly evil
15:05cemerickbrehaut: probably a good thing at the moment
15:05hyPiRionanything java.* is fairly evil
15:05TimMccemerick: As in, that constructor throws errors on malformed URLs, so we shouldn't use it?
15:05hyPiRionexcept .lang
15:05llasramGod yes. It's hash code depends on the IP address the domain name resolves to :-(
15:05brehauthyPiRion: java.util.concurrent is a pot of gold
15:05TimMcllasram: wat
15:06hyPiRionbrehaut: util has some nuggets, but for Clojure dev they aren't that needed
15:06llasramTimMc: Exactly. Fortunately, you can use java.net.URI most places that want a java.net.URL
15:06amalloy&(hash (java.net.URL. "sfdasdfaf.com"))
15:06lazybotjava.net.MalformedURLException: no protocol: sfdasdfaf.com
15:06amalloy&(hash (java.net.URL. "http://sfdasdfaf.com&quot;))
15:06lazybot⇒ -593009291
15:06brehauthyPiRion: concurrent queues are endorsed by rhickey as something we should be using more of ;)
15:07TimMccemerick: So I should use...
15:08brehauthyPiRion: somewhere in http://skillsmatter.com/podcast/scala/the-language-of-the-system he says that the reason theres no clojure wrapper for those queues is because there is nothing to add, and that they are great
15:09hyPiRionbrehaut: I stand corrected, apparently.
15:10brehautive been itching for a reason to use a blocking priority queue for ages now, but have had no good reason
15:10mehworkwhat's a good persistant key/value database to use with clojure? Something that a noob like me can setup and use quickly for a verrry small application
15:10cemerickTimMc: It only supports the schemes/protocols it supports, and is inextricably linked to the horrific java.net.URLConnection and all of its (bad) implementation details
15:11technomancymehwork: couch is pretty accessible
15:11bosieTimMc: seems to work
15:11brehautmehwork: couch on cloudant.com is super easy to set up too
15:12TimMc&(.getHost (java.net.URI. "http://www.google.com./&quot;))
15:12lazybot⇒ "www.google.com."
15:12TimMccemerick: ...so I should use...
15:12mehworkbrehaut: hmm, i want to just have it easy to setup on my own linux box and distribute the program easy, rather than it using an exteran service
15:12S11001001TimMc: exploding fish! :)
15:12TimMcjava.net.URI? some Clojure core fn? some library?
15:12cemerickTimMc: oh, sorry: clj-http, which uses the Apache HTTP libraries underneath
15:12TimMcHrm.
15:12cemerickJust Works™
15:13technomancymehwork: sleepycat is supposed to be great for that; I wonder if anyone's done a clojure lib for it
15:13bosieTimMc: the function you gave me above (bad?)
15:13cemericktechnomancy: GPL-only still, IIRC
15:13technomancymehwork: if you don't mind SQL I think the JDK ships with an embedded DB. derby maybe?
15:13technomancycemerick: oh right
15:13cemerickYeah, derby (now called JavaDB IIRC) is a serious piece of kit
15:14bosieTimMc: thank you
15:14technomancyhuh, actually sleepycat invented their own license; fun
15:14cemerickI abused the snot out of that when it was still an IBM project.
15:14brehautcemerick, technomancy: derby ~= sqlite with less suck?
15:14TimMcbosie: No problem.
15:14cemericksince when?
15:14cemerickbrehaut: *very* full-featured in-process relational db
15:15technomancybrehaut: from what I gather
15:15bosieTimMc: and it reduced my code by about 2/3 too :/
15:15cemerickit was the basis of IBM's Java impl of DB2 for years
15:15brehautcemerick, technomancy: thanks. thats worth remembering
15:15brehautoh wow
15:15cemerickstored procs, crazy index options, different storage backends, etc, etc
15:16cemerickit's possible you need to go use Derby proper to get all that; I don't know what pieces they took (or didn't) when it got folded into the JDK
15:16brehauthah, i was just hoping for columes are more than jsut strings and table changes were sane
15:17technomancybrehaut: by sane you mean "not mysql"?
15:18brehauttechnomancy: of course! but mysql is still better than sqlite in that regard
15:18mehworktechnomancy: ok thanks
15:18technomancyyes, except for the part where mysql pretends to support concurrency =)
15:18brehauttechnomancy: ahaha
15:19brehautat least sqlite doesnt have airs
15:19mehworkwhat's airs
15:19hyPiRionIsn't mysql like, trying to break the SQL specification in as many creative ways as possible?
15:19mehworkhyPiRion: hence the name 'my'sql
15:19brehauthyPiRion: "its not so much of a specification as a guideline"
15:20mehwork(not that that's where they got the name, but you couldn't tell)
15:20mehworkif there's one thing the industry needs more of, it's defacto standards
15:20technomancyhyPiRion: specifically the fact that adding a column to a table can lock the table while every single row is modified
15:21technomancyI don't think the SQL standard says anything about that but it's still an amazing disaster.
15:21bosieis there a shorter way of saying (not (nil? (some...))) ?
15:22hyPiRionuhh
15:22mehworkisnt the not redundant
15:22mehwork(3rd day of clojure, i could easily be very wrong)
15:23bosiemehwork: hah, same timespan as me ;)
15:23hyPiRion,(some #(`%%%) [nil false true])
15:23clojurebottrue
15:23mehworkon the 3rd day of clojure, my irc gave to me...
15:24hyPiRion(not-any? ...)
15:24hyPiRionsheesh, nevermind me today.
15:24mehworkdoes not mean the bitwise op or did you mean not=
15:25bosiemehwork: http://clojuredocs.org/clojure_core/clojure.core/not
15:25hyPiRionbosie: (boolean (some ...))
15:26hyPiRionIf you want to do falsey to false and truthy to true.
15:26bosiehyPiRion: well, coming from some, it only converts nil to false. the rest should stay the same
15:26bosiehyPiRion: right?
15:26hyPiRion,(boolean 3)
15:26clojurebottrue
15:27hyPiRion,(some #(`%%%) [nil false 3])
15:27clojurebot3
15:27S11001001,(let [falze (Boolean. false)] [falze (boolean falze)])
15:27clojurebot[false false]
15:27bosiehyPiRion: but some only returns a "true value" or nil
15:27hyPiRionbosie: yeah?
15:27S11001001,(let [falze (Boolean. false)] [(if falze "true!" "false!") (if (boolean falze) "true!" "false!")])
15:27clojurebot["true!" "false!"]
15:28bosiehyPiRion: i wasn't sure if you disagreed about my statement that it has no impact when used in combination with some
15:28hyPiRionbosie: It converts truthy to true, and nil to false.
15:28S11001001iow boolean sometimes converts true to false :)
15:28bosiehyPiRion: yes
15:28mehworkwhat about not-any? nil?
15:28mehworkwhy is that wrong
15:30bosiemehwork: wouldnt it be (not (not-any? ... '(1 2 3 4 5)) ?
15:30mehworkone thing that i'm not liking about clojure is how things that read the clearest aren't necessarily the best way to do things, unlike in some other languages. Though it's too early to really tell yet
15:31bosiemehwork: give an example
15:31mehwork(not-any? nil? [1 2 3]) => true but (not-any? nil? [1 2 3 nil]) => false
15:31mehworkmaybe i misunderstood the question
15:33bosiemehwork: you did misunderstand. it was the opposite. if there isn't any hit in the list, it should return false, otherwise true
15:33mehworkah
15:35hyPiRion(def any? (comp boolean some))
15:36mehworki think (boolean (some nil? [...])) reads the clearest then
15:37hyPiRionoh, so we're working on nil? here?
15:37bosiehyPiRion: why did you define it like that? i did (defn any? [fn coll] (boolean (some fn coll)))
15:37hyPiRion,((comp boolean some) identity [nil nil nil false true])
15:37clojurebottrue
15:37hyPiRionDoesn't really matter.
15:37bosiehyPiRion: no, not really. but any boolean function would do
15:38bosie thanks hyPiRion
15:39mehworkthanks for your question bosie, it's helping me learn. +1 if it was stackoverflow
15:39hyPiRionyou're welcome
15:40bosiemehwork: haha. just be grateful that this is a seriously friendly and helpful channel ;)
15:41mehworkit'd be cool if there was a gaming style irc plugin or client that let you rate peoples' answers so next to my name would be my rep score like mehwork 0>
15:41mehworkand it would be based off channel, so in php i might have a 5000
15:42TimMclazybot has a karma plugin.
15:42S11001001(inc technomancy)
15:42mehworkor maybe it would just be better if i stfu
15:42lazybot⇒ 43
15:42TimMc$karma amalloy
15:42lazybotamalloy has karma 35.
15:42mehworkthat was cool
15:42bosie$karma TimMc
15:42lazybotTimMc has karma 24.
15:42bosie(inc TimMc )
15:42lazybot⇒ 2
15:42mehworki'm gonna kill myself now since all my ideas have already been done. What's the point
15:42bosie$karma TimMc
15:42lazybotTimMc has karma 24.
15:42amalloymehwork: i thought of that already
15:42mehworkhahaha
15:43S11001001bosie: space
15:43bosie(inc TimMc)
15:43lazybot⇒ 25
15:43mehwork(dec mehwork)
15:43lazybotYou can't adjust your own karma.
15:43TimMcbosie: The karma plugin isn't particularly clean -- you'll note that it doesn't actually operate on s-expressions.
15:43TimMcheh
15:43bosieTimMc: oh well.... ;)
15:47hyPiRionBetter to let clojurebot prepare it for you first
15:47mehworkmaybe it could auto inc people who receive a thanks
15:47hyPiRion,'(inc TimMc #_ foo)
15:47clojurebot(inc TimMc)
15:47lazybot⇒ 26
15:48llasramOh, which means
15:48llasram,'(inc llasram #_ hehe)
15:48clojurebot(inc llasram)
15:48lazybot⇒ 3
15:48hyPiRionyeah
15:48llasramI'm going to sneak in here one day when no one is watching and give myself ALL THE KARMA
15:48teromWatch for overflow...
15:48hyPiRion,(dotimes [_ 3] (println '(inc hyPiRion)))
15:48TimMcllasram: Just come in under a different nick. No one will know it is you!
15:48clojurebot(inc hyPiRion)
15:48lazybot⇒ 5
15:48clojurebot(inc hyPiRion)
15:48lazybot⇒ 6
15:48clojurebot(inc hyPiRion)
15:49lazybot⇒ 7
15:49hyPiRionIt's easy to abuse in that sense.
15:49callenhyPiRion: nice.
15:49TimMchyPiRion: Hey, did that bot quine succeed?
15:49hyPiRionTimMc: Raynes killed it :(
15:49callen(inc hyPiRion)
15:49lazybot⇒ 8
15:50TimMclazybot: ...
15:50S11001001mehwork: patches thoughtfully considered
15:50TimMclazybot: WHy do you listen to that other bot? It is trouble!
15:50callenS11001001: and then rejected out of hand after an appropriate amount of time has passed.
15:50llasram&'(inc llasram #_ and-yet...)
15:50lazybot⇒ (inc llasram)
15:50S11001001callen: even so
15:50callen(inc llasram)
15:50lazybot⇒ 4
15:50llasramlazybot known not to listen to himself
15:51hyPiRion,(println "$timer 0:0:1 Why do I even have this timer")
15:51clojurebot$timer 0:0:1 Why do I even have this timer
15:51lazybotTimer added.
15:51llasramer, knows even
15:51lazybotWhy do I even have this timer
15:51llasramhaha
15:51llasramThe bot equivalent of "why are you hitting yourself?"
15:51llasram(inc hyPiRion)
15:51lazybot⇒ 9
15:51callen,(println "This is bot abuse yo.")
15:51clojurebotThis is bot abuse yo.
15:51callenb
15:52callen^^ that was me going C-x b in Emacs. Wrong focus. Sigh.
15:52amalloywe know, man. a message "b", or "xb", means: "i'm using emacs"
15:53callenamalloy: I'm continually surprised by the relatively large number of Clojure vi users.
15:53hyPiRionThe bots are dangerous though
15:53hyPiRion"echo foo"
15:53hyPiRiongood.
15:53hyPiRion,(nth (iterate #(str % "echo ") "") 20)
15:53clojurebot"echo echo echo echo echo echo echo echo echo echo echo echo echo echo echo echo echo echo echo echo "
15:54hyPiRionNow replace every second with a call to a ,(println ) to clojurebot, and havoc is all loose
15:54amalloy*shrug* vim isn't as great as emacs, but they're both miles ahead of the text editors a lot of people use. i find it hard to object to anyone using a good editor
15:55S11001001callen: Needs a message filter confirming "b", "xb", and "ls". Actually it's probably in there somewhere, waiting to be turned on
15:55callenamalloy: no no, I take no issue with it, I just find it surprising for a Lisp.
15:55hyPiRionS11001001: ls?
15:55hyPiRionls -a
15:55lazybotbin etc lib lost+found root selinux src swap sys tmp usr
15:55callenpwd
15:55lazybot#clojure
15:55callenls -alh ./bin
15:55lazybotbin data dev etc home lost+found media mnt opt srv swap tmp usr
15:55callenls -alh ./bin/data/
15:55lazybotbin data home media mnt usr
15:55callenls -alh ./bin/data/home/
15:55lazybotdata home lib media opt selinux
15:55callenls -alh ./bin/data/home/media/
15:55lazybotbin boot data dev home lib lost+found opt proc selinux sys tmp usr
15:55callenls -alh ./bin/data/home/media/selinux/
15:55lazybotbin dev src swap tmp
15:55AimHererm -rf /home
15:57amalloylazybot - the funniest little honeypot in #clojure
15:57callenlike /bin/data/home/media/selinux/ wasn't obvious
15:57callengives me an idea for mischief with ln though.
15:58amalloyhm?
15:58clojurebotbenchmarking is https://github.com/hugoduncan/criterium
15:58callen"You are in room with many directories, all look like"
15:58callenYou could treat it as a graph theoretic problem
16:00amalloysadly only 3 of lazybot's 5 unix-joke commands have ever been triggered
16:00callenamalloy: clearly it needs documentation.
16:00rhdoengesI misread that as "sedly" and laughed
16:01callensed
16:01llasramwhoami
16:01lazybotllasram
16:01llasramHey!
16:01callendd if=/dev/fd0 of=/dev/sda1 bs=512 count=2
16:01TimMcset -o vi
16:01callenchsh /bin/echo
16:01rhdoengeswho
16:02callenecho "bwahahaha" > /bin/login
16:02lazybot"bwahahaha" > /bin/login
16:02rhdoengesls -l *
16:02lazybotlib media proc sbin selinux srv swap sys tmp
16:02rhdoengesls tmp
16:02lazybotdata dev etc home lost+found selinux srv swap tmp usr var
16:02rhdoengeswheeee
16:02amalloyi have to say the fifth one is pretty lame, so you all can be forgiven for not finding it without reading the source
16:03amalloymutt callen@whatever.com
16:03lazybotWoof!
16:03hyPiRionheh
16:03rhdoengesHa Ha Ha
16:03callenastronomy
16:03callenastronomy 94043
16:03callen...
16:03llasramed
16:03callenfuck
16:04callenkill
16:04callenamalloy: none of the stuff from the github repo works.
16:04callenamalloy: dafuq.
16:04amalloywell, there are two reasons for that
16:04callenguards
16:04hyPiRion~guards
16:04clojurebotSEIZE HIM!
16:04amalloyone is you're a bit crap at triggering commands: they start with $
16:04callen~kill
16:04clojurebotCool story bro.
16:04callen$kill
16:04lazybotKILL IT WITH FIRE!
16:04callen$shell ls -alh
16:04lazybotcallen: It is not the case that you don't not unhave insufficient privileges to do this.
16:05callen$astronomy 94043
16:05lazybotPercentage of moon illuminated: 46; Age of moon: 7; Current time: 12:57; Sunset: 16:53; Sunrise: 7:18.
16:05amalloythe other is that a lot of the plugins are disabled for the lazybot instance in here
16:05callen$say hello
16:05lazybotcallen: It is not the case that you don't not unhave insufficient privileges to do this.
16:05joevandykI think my first clojure project will be a library that can work with queue_classic (postgresql job queue -- https://github.com/ryandotsmith/queue_classic). I'm still very new to clojure and jvm. Using lein 2.0. Should I create a plugin, app, or default project?
16:05llasramecho ,(println "echo hmm")
16:05lazybot,(println "echo hmm")
16:05clojurebotecho hmm
16:05lazybothmm
16:05callen$setnick greyape
16:05lazybotcallen: It is not the case that you don't not unhave insufficient privileges to do this.
16:05callen$coin
16:05lazybotcallen: Heads.
16:05rhdoenges$bf
16:05hyPiRionOh lord, can you guys just go /msg lazybot please?
16:05lazybot{:ptr 0, :cells {}}
16:06lazybot[]
16:06rhdoengessorry :)
16:06callenamalloy: pardon me for not memorizing the bot prefixes of all 50 of the bots I share a channel with.
16:07TimMc&((fn a [m n] (cond (zero? m) (inc n) (zero? n) (recur (dec m) 1) :else (recur (dec m) (a m (dec n))))) 3 1)
16:07lazybot⇒ 13
16:07TimMc&((fn a [m n] (cond (zero? m) (inc n) (zero? n) (recur (dec m) 1) :else (recur (dec m) (a m (dec n))))) 4 1)
16:07lazybotjava.lang.StackOverflowError
16:07TimMcwheee Ackermann
16:07S11001001joevandyk: default
16:08amalloyTimMc: it's more fun to write ackermann with trampolined CPS so it runs forever
16:08callenTimMc: for some reason I thought that would get trampolined.
16:08TimMcamalloy: Too lazy.
16:08callenI must not understand recur.
16:08TimMccallen: It involves a non-tail call.
16:08amalloycallen: no, you missed the (a m (dec n))
16:09amalloyTimMc: https://gist.github.com/4023304
16:10amalloya CPS version, but not a trampolined-CPS version. improvement an exercise for the reader
16:10amalloy(and also a version that consumes no stack)
16:10technomancyjoevandyk: default would be best
16:12TimMcWhoa, gist changed.
16:12TimMc...for the better. It now has diffs.
16:13amalloyTimMc: it's had diffs for years
16:13amalloyand they were easier to get to before
16:13amalloywell, sorta. i guess it's a tradeoff in terms of ease
16:14squidzshould I stick to only using multimethods, as they seem to be most powerful, or should I fall back on protocols if nedded?
16:16dnolensquidz: stick with multimethods, you'll eventually figure out when you actually need protocols.
16:16dnolensquidz: in ClojureScript they're a bit more useful since the DOM APIs can be quite hostile.
16:17callendnolen: weird, my understanding was that the advice was to use protocols first, then upgrade to multimethods when you needed more power.
16:17callendnolen: would you mind sharing some wisdom there?
16:17squidzsquidz: okay so it will be better if I stick with multimethods. other polymorphism techniques can be refined later. Sounds good thanks
16:17callensquidz: you just addressed yourself :)
16:17squidzyeah a little too much wine
16:17squidzi meant to address dnolen
16:21dnolencallen: I don't feel inclined to use protocols unless I'm doing something "low-level". Clojure data types + fns are usually sufficient. multimethods provide some polymorphism w/o forcing you do go off into the design weeds.
16:22nDuffHmm.
16:22dnolenprotocols usually mean deftype/record which are tedious if eeking performance doesn't matter. It's easy to screw up a protocol desing.
16:22squidzdnolen: do you have any code i can look at on github?
16:22creasednolen: mdunno, in big systems too many multimethods can get really gnarly
16:23amalloyas someone who overuses protocols, i suggest you stick with multimethods until you find performance forces you to use protocols (hint: it won't)
16:23squidzcrease: really why is that?
16:23dnolencrease: if you have too many multimethods that's a sign of a other problems I think.
16:23callendnolen: seems sensible. Thanks for explaining that.
16:24dnolensquidz: Look at core.match or core.logic. You have been warned :)
16:24creasesquidz: protocols do this big dance about exactly what they're doing - it's easy to see what's going on.
16:24squidzdnolen: alright ill see if i can find a good example of multimethods in those packages
16:25dnolensquidz: oh you don't want to look at those projects for multimethod usage.
16:25dnolensquidz: if I was going to rewrite core.match, I'd probably do it with multimethods. protocols are a good fit for core.logic tho.
16:26creasednolen, squidz: also protocols play nice with reify
16:26tbaldridgesquidz: almost the entire ClojureScript compiler is one massive multimethod
16:26squidzdnolen: okay, do you have any good github examples using multimethods
16:26tbaldridgedoing that with protocols would be a pain
16:26squidztbaldridge: thanks
16:27dnolentbaldridge: yes! if you want polymorphic behavior on data instead of custom types - multimethods win hands down.
16:27dnolencustom types bring their own burden
16:28jsabeaudryWhen using ring-jetty-adapter I see that responseBufferSize has enormous impact on performance, is there a similar setting when using aleph?
16:29squidzare multimethods more functional then?
16:30oskarthhow can this be made shorter/better? ##(mapv #(vec (rseq %)) (apply mapv vector [[1 2] [3 4] [5 6]]))
16:30lazybot⇒ [[5 3 1] [6 4 2]]
16:31oskarth(behaviour is correct, transpose and reverse)
16:31creasednolen: I know of no unburdened multiple-dispatch convention. multimethods have closed dispatch functions etc
16:32tbaldridgesquidz: if you want an indepth lesson on Clojure polymorphism and why each method exists, I suggest http://vimeo.com/53223938#at=0
16:32callenhttp://stackoverflow.com/questions/8070368/clojure-multimethods-vs-protocols <--- this is the sort of reasoning that led me to believe that I should resort to protocols first.
16:33technomancycallen: terrible advice
16:33jkkramerusing multimethods sometimes requires care with dependency ordering if your method implementations aren't centralized. You may find yourself requiring a namespace entirely for the side effect of implementing a method
16:33callentechnomancy: so I've heard so far.
16:33jkkramerstill, I pretty much always reach for multimethods first when I need extensibility/polymorphism
16:33ferdStarting a simple REST service using MongoDB: How do you guys normally validate the structure of a "document" comming from a client before persisting it ?
16:33callentechnomancy: you know how Stack Overflow works. First guy out the gate with a semi-plausible answer wins the magic karma.
16:34callenwisdom, correctness, completeness be damned.
16:34squidzafter reading a bit of JOC i get the feeling that multimethods are prefered
16:34callenI find it hilarious that they expend zero effort addressing this, yet are super-concerned about shutting down joke threads.
16:35squidztbaldridge: thanks for the video ill check it out
16:35creasemultimethods are awesome and to the point in localized, high-level places where you need a certain very particular kind of arbitrarily sophisticated dispatch. protocols are much better, IMO, for everything else - you know where you stand with them.
16:35joevandykhttps://gist.github.com/243d4dc223878317a4ee -- what am i doing wrong here? i was hoping to make db a curried function
16:35tbaldridgesquidz: yeah it goes into a bit more discussion of why protocols exist in the first place.
16:38technomancycallen: added a comment; hopefully it makes things clearer
16:38technomancybut it's something people are widely confused about =(
16:39bsteuberjoevandyk: see http://clojuredocs.org/clojure_core/clojure.core/partial to get an idea how partial is being used
16:41bsteuberso do (def db (partial sql/with-connection ...))
16:41callentechnomancy: thank you :)
16:41brehauttechnomancy: striking another blow for monomorphism :)
16:42callentechnomancy: another amusing fact is that he uses Clojure's code to justify his position
16:42callenas if all code should be written in the manner its own implementation was.
16:45technomancyit's good that you can if you need it.
16:45technomancybut geez; if you're 2 weeks in you guaranteed don't need it.
16:46gtrakI've never yet written a multimethod... I can get by with protocols and simple data structures.
16:47gtrakIf I started trying to do double-dispatch with protocols, I'd reach for one, I guess.
16:49creaseseriously, neither multimethods nor protocols are panaceas, and they can both lead to their own distinct problems. Can we be more specific about how multimethods are better than protocols? I'm not speaking from nostalgia for OOP here
16:50technomancymultimethods are just vars; they're first-class and work with all the built-in tools we have for dealing with Clojure data
16:50bsteubermultimethods aren't a pain in the ass when part of your stuff is AOT-compiled oO
16:50gtrakarbitrary-function of its arguments means it's some kind of control-flow that can't be wrapped up in a type, I guess.. and the global extension mechanism and type hierarchies (haven't used those ever, either)
16:51technomancycrease: if you reload a defrecord then old instances of the record are still of the old class
16:51technomancycrease: so you can have two objects that are completely indistinguishable from each other except they are mysteriously not equal
16:53creasetechnomancy: you're right, that's bad
16:53technomancycrease: for regular clojure code if you AOT and the .class file is inaccessible, it falls back to the JIT version
16:53technomancybut with protocols this doesn't work
16:53bbloomtpope: would be nice to have a :Reconnect command. sometimes i kill my repl for some reason and then I need to run the little :Connect wizard and type the port by hand
16:54bbloomor at least provide repl-port as a default so i can slam <CR> a bunch of times in the wizard
16:54technomancycrease: also not being able to change your arglists without changing how you dispatch can lead to a mess for future changes
16:55joevandykbsteuber: like this? https://gist.github.com/a8b10140d489bac627e6
16:56callenI found out yesterday that Node.js has an implementation of Django/Jinja style templates already. I was galled.
16:56bsteuberjoevandyk: yes the partial part looks good to me - can't judge the sql stuff though since I never use it :)
16:56callenwell, "javascript". It works in the client-side too. http://paularmstrong.github.com/swig/
16:57joevandykbsteuber: "clojure.lang.Compiler$CompilerException: java.lang.RuntimeException: Can't take value of a macro: #'clojure.java.jdbc/with-connection, compiling:(src/queue_classic/core.clj:14)"
16:57bsteuberah it's a macro
16:57bsteuberright now I get it, my bad :)
16:57joevandykbsteuber: the original was (sql/with-connection "conn-string" (username (first (sql…))
16:58joevandykand i wanted to issue sql without the sql/with-connection stuff
16:59TimMcComplaint: apropos doesn't tell me where it found things
16:59bsteuberjoevandyk: I added a comment
17:00bsteuberthe indentation sucks, but you get the idea
17:01bsteuberso you can't partial on a macro, you have to write a macro yourself
17:01joevandykbsteuber: ah, ok
17:01joevandykthat works great, thanks!
17:01bsteuberthat's the disadvantage of macros, you lose a lot of compasability
17:02gtrakbsteuber: definline is like a function and a macro combined, you can partial on it
17:02creasetechnomancy: I can see how multimethods distance from the leaden guts of ossified, inexpressive type systems makes them more dynamic and revisable in some ways. I haven't run into the AOT issues you've mentioned but they sound nasty.
17:03technomancycrease: granted I probably hear the worst horror stories about protocol problems coming from lein bugs, but the reason you don't hear a lot about multimethods is that they're really straightforward (apart from the stupid defonce behaviour) and they pretty much always just work
17:03bsteubercrease: I pretty much spend the whole work day debugging some AOT-protocol-issues oO
17:04bsteuberwhich of course means I'm lucky since I can work with clojure xD
17:05bsteuberactually today our problems started when switching from AOT to non-AOT compilation - usually it's the other way around..
17:05TimMcbsteuber: Reminds me of a friend-of-a-friend who almost died when he stopped drinking massive quantities of Mountain Dew every day.
17:06amalloyTimMc: brb telling all my friends
17:06bsteubernever seen that drink in europe - so I think I know it from south park oO
17:06TimMc(The carbonation had been masking a serious medical problem.)
17:07TimMcbsteuber: Just a soda.
17:08TimMcbsteuber: So what's happening with non-AOT compilation that's problematic?
17:09bsteuberwell I got a defrecord with some inline implementations of protocols which come from another namespace (acutally another project)
17:09joevandykanyone use vimclojure? i like it, but i'd rather the output be put into a separate vim session -- anyone know if that's possible? (i have multiple monitors, and want the output to go to the other monitor
17:10joevandyk(or if vimclojure can write the output to a file or a terminal or something, that would also work)
17:10bsteuberand since we stopped using aot everywhere, in the unit tests clojure claims the protocol not to be implemented on that type
17:10TimMcAh, I think I see.
17:10bsteuberbut the bug vanished after moving the definition to an extend-type
17:11gtrakbsteuber: is it clojure 1.3?
17:11bsteuberI will probably send a clojure bug report once I have a minimal example for that
17:11bsteuberhappened in both 1.3 and 1.4
17:11bsteuberthe defrecord also implemented deref, not sure if that can be part of the problem
17:11gtrakdid you import without require? that might be why
17:12bsteuberdidn't import at all since everything's wrapped in functions
17:12creaseAt the same time, mutating record definitions themselves is a peculiar way to achieve flexibility, and you can't easily revise the dispatch fns of multimethods, either. In my experience, reify and extend-protocol provide enormous flexibility, and the definitions of protocols only really commit you to arities; multimethods commit to full-blown functions.
17:12gtrakwhen you import, you implement the interface... which may not exist yet
17:13gtrakbsteuber: what's wrapped in functions? the definition of the record?
17:13technomancyit's easy to work around the defonce flaw of multimethods; just (def mymulti nil) before every defmulti
17:13bsteubergtrak: no the constructer calls I mean
17:13bsteubertechnomancy: nice, should remember that :)
17:14technomancybsteuber: ugly but obvious
17:14gtrakbsteuber: not sure I get it, then
17:14amalloytechnomancy: you are missing out on a golden opportunity to make your code confusing
17:15bsteubertechnomancy: a propos ugly: with leiningen, we have some funny setup where about 10 projects want to share a special mvn repository
17:15amalloy(def mymulti (fn [x] (x :foo))) (defmulti mymulti mymulti)?
17:15technomancyamalloy: whoa niiiiiice
17:15bsteubertechnomancy: we tried to hack that into the user profile, but the jar task then removes that profile for compilation
17:15amalloythat actually probably doesn't work. but you can at least give it a garbage value first, and then re-def it to a real value
17:15technomancybsteuber: have you tried using project middleware?
17:15technomancyyeah the user profile is definitely not the right place for that
17:16amalloyi take it back, it totally does work
17:16bsteubertechnomancy: not sure if anyone tried, I will read it up first :)
17:16technomancybsteuber: but if the repo is not likely to change it's probably best to just copy it into each project.clj
17:16technomancyexplicit is better than implicit
17:16bsteubermm that's what I proposed ^^
17:17bsteuberclojure hackers are just sort of negative when it comes to redundancy..
17:18technomancythe property of having each project be entirely self-contained is extremely valuable
17:19bsteubertechnomancy: yes before that we did tons of magic in our own compandy-lein-plugin, with some weird consequences ^^
17:19SegFaultAXHas anyone here ever used mongo to build a real-time analytics service?
17:19bsteubermm, I feel like I am starting to get older, too...
17:21bsteuberand I'm just 29 :)
17:21bsteuberwell maybe that's already old for a hacker..
17:21gtraktechnomancy: that's one good principle I learned from python
17:21technomancybsteuber: me too but I use Debian Stable and Emacs, so that adds another level of greybeard get-off-my-lawn-ness
17:21amalloybsteuber: don't strain yourself; just relax while we grab a wheelchair for you
17:21hyPiRiontechnomancy: At least you're not running lenny
17:22bsteuberXD
17:22technomancygtrak: funny; it's one bad principle I learned from Ruby by omission
17:22gtrakhahaha
17:22gtrakit's in the 'zen of python'
17:22bsteuberI think I learned it by readying other people's clojure code and realize how it sucks if you're not the author and know what you meant ^^
17:23bsteuberor no, actually by having to *modify* other people's code :)
17:25SegFaultAXDo people usually put all their analytics data in one big table/collection?
17:26technomancySegFaultAX: at heroku we just finally moved our last metrics off that approach
17:26SegFaultAXtechnomancy: What's the underlying datastore?
17:26gtrakSegFaultAX: if I understand what you're asking, it's do people use schemas?
17:26SegFaultAXtechnomancy: And how are you sharding the data now? By object type?
17:26SegFaultAXgtrak: Not even kinda.
17:26technomancySegFaultAX: we were using postgres, but now we keep it in memory and calculate running stats on them that we feed into librato
17:27technomancyhttps://github.com/ryandotsmith/l2met
17:27SegFaultAXtechnomancy: What kinds of time series are we talking about?
17:28technomancyconnections per minute, median/perc95/perc99 of total response time, exception count, etc
17:28SegFaultAXtechnomancy: Over the entire routing mesh?
17:28technomancySegFaultAX: my work is primarily on the build pipeline, but the routing team uses the same metrics processing
17:29SegFaultAXtechnomancy: What kind of read/write throughput were you able to do with postgresql?
17:29technomancySegFaultAX: I don't recall; it was very heavily sharded
17:29SegFaultAXI imagine it was a lot of atomic counter increment/decrements.
17:30technomancythere's also https://github.com/heroku/pulse but this one kind of sucked because all the metrics were hard-coded in so you had to redeploy if you wanted to change anything. having the metrics embedded in the log stream is a lot more flexible.
17:30technomancythe postgres solution was already being phased out when I started on this team
17:30SegFaultAXtechnomancy: Any idea why?
17:32technomancyvaguely the impression I got was that a database just isn't appropriate for this kind of thing; you don't care about persistence
17:32SegFaultAXtechnomancy: Also, your librato bill must be insane.
17:33S11001001speaking of bills, where are you going to put the leiningen bins now, technomancy?
17:33SegFaultAXtechnomancy: That's the problem though, in our particular situation we kinda do. For each object, we could have minutely, hourly, daily, weekly, monthly, and yearly aggregates.
17:34technomancySegFaultAX: gotcha; we collapse things in l2met and then have them deal with storing the history of a single metric
17:34technomancys/them/librato/
17:34technomancybut we don't go that far back
17:34SegFaultAXtechnomancy: Yea, it's probably less important to see how many connections you had on Dec 1, 2010 @ 11:30a PST.
17:35technomancystill, I think there's value in separating out the two operations: turning raw logs into aggregates should be different from storing and displaying the collapsed metrics.
17:35SegFaultAXtechnomancy: Unfortunately, that's exactly the type of query we have to support :(
17:35technomancythe input of the aggregation phase is infeasible to persist anywhere but S3 but not necessarily the metrics themselves
17:36SegFaultAXtechnomancy: Does your log aggregation service use mapreduce?
17:36technomancyTBH one of my favourite things about it is that I don't have to know anything about it =)
17:37technomancyI just point my log drain at it and give it my librato creds and the metrics just start rolling in
17:37SegFaultAXtechnomancy: Hah, true. So, when you want to add a new metric, do you just add a new log entry and deploy the code?
17:37technomancyyeah, it's really nice
17:37SegFaultAXtechnomancy: That's pretty slick.
17:38technomancythere are certain cross-cutting calculations that style doesn't support though
17:38technomancylike if you want to alert when the difference between two metrics gets too large
17:38SegFaultAXtechnomancy: Right, but it's fine for simple sums and counts.
17:38SegFaultAXtechnomancy: Well that's post-processing that could be handled at the eg librato level.
17:39technomancythe implementation's all open if you don't mind reading some ruby: https://github.com/ryandotsmith/l2met
17:39SegFaultAXtechnomancy: It's not really up to the metrics engine to also apply /meaning/ to the metrics.
17:39technomancyunder 1kloc it appears
17:39technomancyyeah, good point
17:39SegFaultAXtechnomancy: Great, I'm going to read it now.
17:40technomancySegFaultAX: if you haven't seen mcgranaghan's conj talk from last year about logs as streams of data, it provides some good context
17:40SegFaultAXtechnomancy: Happen to have a link handy?
17:40technomancysure: http://blip.tv/clojure/mark-mcgranaghan-logs-as-data-5953857
17:40SegFaultAXtechnomancy: Cheers.
17:41seangroveAh, ffs
17:42seangroveSubscribed someone to a mailing list on accident, and then replied to the entire clojure mailing list, instead of just him, trying to tell him
17:42mehworkalright i have the basics of clojure down in a repl. How do i run a .clj script on the command line though?
17:42SegFaultAXseangrove: First world email problems. ;)
17:42seangroveHeh, I suppose. Face is red though
17:43technomancyit's ok; nobody reads the mailing list anymore =\
17:43amalloyseangrove: please unsubscribe me too!
17:44pjstadigseangrove: i read in digest, so i won't see your faux pas until tomorrow morning
17:44pjstadigbut thanks for the heads up
17:44seangroveAh, nice. A rolling indiscretion.
17:45pjstadigwhat goes on the Internet, stays on the Internet...forever
17:45mehworkpjstadig: not if you duckduckgo
17:52TimMcheh
17:53SegFaultAXtechnomancy: So I haven't looked at the source yet because I'm watching the talk first, but are you actually marshalling Ruby objects as your log format?
17:53SegFaultAXtechnomancy: Or perhaps, how literal is l2met with respect to this talk?
17:53the-kennyseangrove: hah, noticed this a few minutes ago! :D
17:53callenmehwork: don't propagate other peoples' marketing campaigns, it's in poor taste.
18:01technomancySegFaultAX: his talk is more about pulse; l2met was a later development
18:01SegFaultAXtechnomancy: What was wrong with pulse? It seems pretty awesome.
18:02seangrovetechnomancy SegFaultAX: same question, I'm thinking of using pulse soon
18:02SegFaultAXtechnomancy: You mentioned that it required redeploy, what's the alternative? How do you add new metrics without a redeploy.
18:02SegFaultAXseangrove: Have you seen McGranaghan's talk?
18:02seangroveYeah
18:03technomancySegFaultAX: the most obvious problem was that it had all the metric definitions hard-coded in, requiring a redeploy to update them. but the real problem was that it became unmaintained.
18:03technomancystoring the metric definitions in a DB or in the log stream itself is a much better way to go
18:03seangroveThe DSL for defining the metrics seemed like a great idea though
18:03SegFaultAXtechnomancy: Are you aware of any of the fundamental/architectural differences with l2met?
18:04technomancySegFaultAX: the main thing is that, where the definitions are kept. but l2met can also be a lot simpler because it only supports a fixed set of stastistics, whereas pulse stats can be arbitrarily complex.
18:04SegFaultAXtechnomancy: Wouldn't that incur loads of extra overhead though? If it constantly has to query the database to get the latest metric definition?
18:05SegFaultAXtechnomancy: Would you mind giving an example of what a definition might look like?
18:05technomancySegFaultAX: that's pretty easy to work around; you could have metric definition updates trigger a message on a queue that would cause reloads
18:05technomancydefinitions in pulse?
18:05SegFaultAXtechnomancy: Yea.
18:06seangroveThere were examples in the talk worth checking out
18:06technomancySegFaultAX: https://github.com/heroku/pulse/blob/master/src/pulse/def.clj#L305
18:06clojurebotTitim gan éirí ort.
18:07SegFaultAXtechnomancy: I see. So does l2met actually store clojure forms in the database/configuration files?
18:07technomancySegFaultAX: no, there's no Clojure involved. it reads key=value pairs out of log streams
18:07technomancypossibly json too?
18:07SegFaultAXjson does seem like the obvious choice instead of clojure literals.
18:08technomancyanyway, it certainly would have been feasible to turn pulse into l2met, but for nontechnical reasons it didn't happen like that at Heroku, probably because starting a new implementation makes experimentation a lot easier vs hacking on a production service that everyone relies upon
18:09technomancyI think to keep things terse most logging is done as a bunch of k=v instead of json because nesting is almost never needed
18:10technomancypulse was also problematic in that it was nearly impossible to develop on locally; you had to deploy it to staging to test any of your changes.
18:10SegFaultAXtechnomancy: Are special characters url encoded or something on the wire?
18:10technomancyit was implemented in a repl-hostile way
18:10technomancySegFaultAX: that'd be handled by https://github.com/heroku/logplex; not something I'm familiar with
18:11technomancybasically all you do is println and it gets routed to the right consumers
18:14bbloomRaynes: thanks for tentacles, it's working nicely
18:15Raynesbbloom: <3
18:15bbloomwould be nice to set my auth with a dynamic var though, rather than manually having to pass options everywhere
18:15RaynesSome people hate the dynamic var approach.
18:15RaynesNot sure why. I'm indifferent.
18:15technomancyit's the worst when it's the only option
18:15bbloomdoes that some people include you?
18:15bbloomah
18:15technomancynot bad if you get both
18:15bbloomyeah, what technomancy said
18:15RaynesI agree with technomancy, I think.
18:16Raynesbbloom: I'd take a patch for that, fwiw.
18:16hyPiRionIt's good if makes the common case readable and every case possible, methinks.
18:16hyPiRionAnd it's simple, of course.
18:17bbloomRaynes: already sent you a PR to update the readme
18:17RaynesWhoa crap
18:17RaynesAll of a sudden just got all my email for today.
18:19bbloomheh, i'll look into the dynamic var too
18:31bbloomRaynes: boom https://github.com/Raynes/tentacles/pull/20
18:35callenbloom says boom.
18:35bbloomBlOOM
18:36callencarthago delenda est: http://paularmstrong.github.com/swig/
18:36bbloomanyway, Raynes, i'm using tentacles to walk a few levels of my followers graph and map their locations. going to stalk some new yorkers when i get to town :-)
18:38hyPiRionSometimes, I'm glad I live far away from every other Clojurian
18:38callenhyPiRion: only sometimes? I live in the bay area. The Clojurians here are lucky I don't commit suicide and haunt them with my ghost.
18:39bbloomjust trying to build up my network in a new city
18:39hyPiRioncallen: Is it that bad?
18:39bbloomalways good to know smart people wherever you go!
18:39hyPiRionI thought the violence only occured during full moons.
18:39callenhyPiRion: the only thing that's bad is how deep my discontent with the state of templating.
18:40callenis the depth of*
18:40hyPiRionheh, I think I heard about that.
18:41technomancysure sucks that nobody has written just the right software for you
18:41callentechnomancy: I'm past that. I'll just start writing it and stop as soon as Santiago writes a better one.
18:42technomancyoh good, heh
18:42technomancyI mean I don't like what's out there either, but I don't actually write web apps
18:42technomancyI mean, I do like hiccup, but I don't collaborate with designers on web apps
18:42technomancywhatever
18:43bbloomi'm simply 100% convinced that html is object code
18:43callenout of spite, version 0.0.1 of the library will be translated from the Node.js version.
18:43hyPiRionIt's good we bring this template-problem up again, I think we should discuss it more than
18:44hyPiRion/s/more than we did yesterday
18:44technomancyoops; what have I done
18:44callenhyPiRion: what part of "carthago delenda est" didn't you Latin? :D
18:44technomancyhyPiRion: he's writing code now; that's an improvement =)
18:44mehworkwhat's 0.0.1 mean? a bug fix for a nonexistant project - where the bug fix is that there's something there now? :p
18:44callentechnomancy: I've even named it. That's at least one of the two difficult things in CS.
18:44callentechnomancy: next up is caching compiled templates.
18:45technomancymehwork: "Fixes these bugs: 0) project didn't exist, [...]"
18:45callenI could deploy an empty namespace to clojars for the lulz.
18:45mehworkan easy patch to merge
18:45callen,(merge nil nil)
18:45clojurebotnil
18:45callenwalla.
18:45dhmcallen: i think enlive has a good model for the caching behavior you mention
18:46mehworkthe journey of a 1000 miles begins with a first commit
18:46mehworks/miles/SLOC
18:46callendhm: you really don't want to talk to me about other template libraries.
18:46callendhm: I know you think you're being helpful, but just don't.
18:47hyPiRionI find good design harder than cache invalidation. Naming things is still hard.
18:50bbloomRaynes: i updated that PR, but didn't test it my tiny change. i take no responsibility if it explodes and kills everyone on the space station
18:52mthvedtfor some people i've worked with, a journey of a thousand SLOC is performed in a single commit
18:53mehworkand all in one function
18:55mehworkbut the software industry hires unqualified programmers like they were needing 'doctors' in a 3rd world village. Anyone will do
18:55hyPiRionNot everyone does that
18:56mehworki know a couple php guys that are like a taxi driver in america who was a heart surgeon in his home country
18:56mehworkwell i'm sure most clojure shops don't
18:57bbloomi've seen php guys who would be better off as taxi drivers calling themselves "CTO" and impressing VCs :-P
18:58mehworkit sounds like the next generation of people isn't liketly to produce that many new software engineers either.
18:59mehworkhmm anyone know what's better congomongo or monger ?
18:59bbloommehwork: there will always be self taught engineers, that's sorta the magic of the internet: it's built by geeks and first-and-foremost for geeks
18:59mehworkyeah
19:00mehworkalthough i prefer the term nerd to geek
19:01mehworkgeeks always make me think of trendy nerds - e.g., people who instagram all day thinking their computer geeks
19:01mehwork*they're
19:02mehworkhrm both congomongo and monger have their last github commits at 9 days ago. So much for using active development to weed out which one to pick
19:03mehworkcongomongo seems to have better docs, so going with that i guess
19:45clj-newb-234in clojure, can protocols inherit from other ptrotocols?
19:45clj-newb-234i.e. can I define an "IAnimal", then have "ICat" "IDog" inherit IAnimal ?
19:46brehautno
19:46clj-newb-234is there a good rationale/writeup explainign why protocol inheritance is a bad idea?
19:47technomancybecause writing Clojure programs to handle cats and dogs is not very common? =)
19:48clj-newb-234because inheritance is OO-ish, and Clojure is functional ?
19:48AimHereI think the lisper explanation is that Lisp is more flexible anyways and you can knock up a bespoke implementation for all your inhertiance needs fairly easily
19:51caspercIs there any way ti get the doc string of all the publics of a namespace?
19:51clj-newb-234yeah, I think it literally invole writing a new macro
19:51clj-newb-234probably some combination of the namespace functions + meta
19:51technomancycasperc: (map (comp :doc meta val) (ns-publics 'clojure.set))
19:51clj-newb-234that's exactly what I meant to say
19:52amalloyhah. what a literal interpretation, technomancy: I want all the docstrings, don't really care what functions they're attached to
19:52caspercAhh awesome :)
19:52amalloy(map (juxt key (comp :doc meta val)) (ns-publics 'clojure.set))
19:52technomancyamalloy: here's a pile of strings; go do ... stringy things to them or something.
19:52caspercI was having trouble with the doc macro, but that works like a charm
19:52clj-newb-234technomancy: did you have that code handy from previous work, or did you come up with that on the fly?
19:52technomancyoh snap, juxt saves the day
19:53technomancyclj-newb-234: I do a lot of tooling, so I've come to appreciate the finer points of vars and metadata =)
19:53clj-newb-234technomancy: is any of your tools opensource, I feel I can learn a thing or two from someone who recites clojure one liners on teh fly
19:54AimHereHe has a github
19:54technomancysure: https://github.com/technomancy
19:54technomancyhere's a fun one I documented pretty thoroughly: http://technomancy.us/148
19:54clj-newb-234did you fork leiningen, or did you actually write leiningen?
19:54technomancylots of crazy var manipulation in there
19:54technomancyI wrote it =)
19:55madsytechnomancy is our man :)
19:55caspercindeed :)
19:55technomancyamalloy's snippet is better though; he used juxt without being gratuitous, which is always a neat trick
19:55mpanlein is awesome but sometimes I worry because I don't know how to work without it
19:55madsympan: Why would you want to?
19:55mpanbtw is there an inside joke about "juxt" or something?
19:56caspercjust one more question now that we are talking about tooling/meta data. Can i get the source from the symbol in the same way?
19:56mpanmadsy: some sites accept clojure as a language but they specifically ask for e.g. a single file w/ a single ns w/ specific whatevers
19:56amalloyit's easy. java -cp `40 lines of bash` clojure.main -m my.main.ns
19:56madsympan: That's like worrying about not being able to code in C without a C compiler
19:56technomancympan: (first (sort-by greatness (vals (ns-publics 'clojure.core)))) ; -> #'juxt
19:56mpanhaha
19:57technomancycasperc: unfortunately no, you have to hit the filesystem or use the serializable-fn library
19:57amalloytechnomancy: unintentionally dissing functions since 2008
19:57technomancycasperc: try (source source) for the former; https://github.com/technomancy/serializable-fn for the latter
19:57mpanhttps://www.interviewstreet.com/recruit/challenges/faq/view example of somewhere that accepts clojure as a language but requires single clj file with conventions
19:57technomancyamalloy: you mean the bit about gratuitousness?
19:58mpanit's actually a minor pain to deal with their conventions because I learned lein first and it's all I know
19:58amalloyno, i mean ##(first (sort-by :greatness) [{:f :useless :greatness -10} {:f :awesome :greatness 20}])
19:58lazybotclojure.lang.ArityException: Wrong number of args (1) passed to: core$sort-by
19:58amalloy&(first (sort-by :greatness [{:f :useless :greatness -10} {:f :awesome :greatness 20}]))
19:58lazybot⇒ {:f :useless, :greatness -10}
19:58technomancyoops!
19:58madsympan: If it concerns you, then by all means, learn how to strap the clojure compiler with the proper paths
19:59casperctechnomancy: cool, i'll take a look at the serializable-fn lib :)
19:59amalloy(comp - greatness) for all your sorting needs
19:59technomancycasperc: unfortunately it's not that useful if you want source of other libs that don't use serializable-fn
19:59madsympan: But if you're productive with leinigen, I don't see the problem
19:59mpanmadsy: is there a way to do that other than bare jars on the classpath and calling the jvm?
19:59madsympan: If there is, I don't know about it.
20:00technomancympan: export LEIN_FAST_TRAMPOLINE and run `lein trampoline compile :all` or whatever and you can see the actual java invocations inside the target/trampolines directory
20:00technomancywarning: it ain't pretty
20:00madsympan: From what I know, the three options are lein, vanilla Clojure and Eclipse
20:01technomancythere are some that use maven or gradle too
20:01mpanhow do they deal with compilation? at the repl?
20:02amalloythe one option is lein. clojure without lein is unmanageable; and eclipse uses lein
20:02technomancyamalloy: I think it's technically optional?
20:02madsyOh, I thought the Eclipse plugin had its own thing
20:02amalloywell, maybe it is. i don't know that much really
20:02casperctechnomancy: I am basicly trying to crawl the namespaces of a jar, and I already loaded the namespace so I was hoping i could just get the mapping from the symbol to the actual code in some easy way
20:03mpandoes lein expect you to name your namespaces in any particular way?
20:03technomancycasperc: tried the source macro?
20:03technomancympan: no requirements beyond that of clojure itself
20:03mpanah thanks
20:03casperctechnomancy: something like mapping over the ns-publics with source but that obviously doesn't work :(
20:04technomancycasperc: oh, because source is a macro?
20:04hyPiRionWell, that's a new one.
20:04hyPiRion,EMPTY-NODE
20:04clojurebot#<VecNode clojure.core.VecNode@736c772f>
20:04caspercyep
20:04hyPiRionNot seen that before.
20:04technomancywe reimplemented source at a seajure meeting
20:04technomancybut I don't think we actually pushed that one to github
20:04technomancy,(source source)
20:04clojurebotSource not found
20:04technomancy=(
20:04technomancy,(clojure.repl/source clojure.repl/source)
20:04clojurebotSource not found
20:04eggheadwhy might core.logic return '[_0 _0] as a result when I am only asking for q
20:05technomancycasperc: well, you can see how it's implemented and steal its guts
20:05casperctechnomancy: would be useful if doc and source were functions instead (or had function versions) so you could get the source for a symbol in a var
20:05casperctechnomancy: yeah that might be the best solution actually
20:05technomancycasperc: agreed, but clojure.repl isn't intended primarily for programmatic use
20:05amalloyegghead: (run* [q] (conde [succeed succeed])), right?
20:05technomancyanyone building editor tooling on top of it will have to roll their own anyway
20:05amalloywould be the easiest way to get that result
20:06mpanwhen using core.logic to solve a "board game" of variable size, is it recommended to use one var for the board position or one var per element of the board position?
20:07bbloommpan: it's probably wise to have one lvar per degree of freedom
20:07mpanbbloom: thanks
20:07bbloommpan: consider the sudoku example
20:07mpanbtw what if you can't properly separate the dfs?
20:08eggheadhmm, must be something I'm not understanding amalloy -- I'm working on the 4clojure problems, mind if I pm you ?
20:08bbloommpan: what do you mean by "dfs" ?
20:08mpaner, degrees of freedom
20:08mpanjust realized that was ambiguous
20:08mpansorry
20:09mpanalthough I suppose that's more a problem of expressing the task rather than solving it
20:09amalloygo ahead
20:10bbloommpan: dunno enough about your problem to provide guidance, and i don't have a lot of experience designing logic programs yet
20:10bbloommpan: it pays to have some understanding of how the backtracking and search strategy works, so that you can reason about the size of the search space
20:11mpanis it possible to ask for the search to go a certain way, as if you were writing an explicit solver?
20:11bbloommpan: don't think so yet, i know dnolen was talking about adding something for that
20:14casperctechnomancy: actually the underlying source-fn seems to do the trick :)
20:14tomojif there were a catch* macro that just expanded to catch (say in cljs/core.clj..), I think you could get clojure-mode to indent try*/catch* correctly :/
20:15hyPiRion,(let [[f & r] (drop 281 (vals (ns-publics 'clojure.core)))] (remove f r))
20:15clojurebot()
20:15casperctechnomancy: so combined with your meta trick i think I am set to crawl a namespace. Thanks for the help!
20:16hyPiRionThat's my new way of getting an empty list.
20:16technomancycasperc: cool
20:16bbloommpan: see http://www.mozart-oz.org/documentation/fdt/
20:17mpanoh cool
20:17mpanthank you
20:17amalloytomoj: no you couldn't, because catch doesn't macroexpand its input
20:17bbloommpan: in general, you can use a "distribution strategy" to guide the search. with a carefully selected distribution, you can optimize a variable (ie minimize or maximize)
20:17bbloommpan: or just get to some number of solutions faster
20:17tomojamalloy: huh?
20:18amalloytomoj: (defmacro catch* [& xs] `(catch ~@xs)) (try (...) (catch* Exception e)) ;; doesn't act like a catch
20:20tomojoh, because try doesn't macroexpand?
20:20tomojer, try*
20:20amalloyyeah, that's what i meant
20:20tomojwell, would have to add catch* as another special
20:20amalloytomoj: catch is already not a special
20:20amalloyit's just a secret thing that the try special looks for
20:21tomojthen would have to add it there
20:21amalloyyes
20:21tomojmaybe someday clojure-mode will just be able to do the right thing
20:22hyPiRionHum, is there any way of getting the global hierarchy somehow?
20:24amalloy&@#'clojure.core/global-hierarchy
20:24lazybot⇒ {:parents {}, :descendants {}, :ancestors {}}
20:25hyPiRionWell, that was rather empty.
20:26bbloomamalloy: &@#' to you too
20:26bbloomthat's quite the metacharacter mouthful
20:26mpanwhat is # in that usage?
20:27mpanoverloading confused me
20:27hyPiRion,(isa? clojure.lang.PersistentArrayMap clojure.lang.IPersistentMap)
20:27clojurebottrue
20:27hyPiRion,(isa? clojure.lang.PersistentArrayMap clojure.lang.IPersistentMap @#'clojure.core/global-hierarchy)
20:27clojurebot#<NullPointerException java.lang.NullPointerException>
20:27bbloom#'x is short for (var x)
20:27hyPiRionbzz.
20:27bbloom,#'assoc
20:27clojurebot#'clojure.core/assoc
20:28mpanoh, because 'x is just a sym if unresolved?
20:28hyPiRionany sym is just a sym
20:28mpanI was accidentally conflating the sym with the var to which the sym referred
20:29hyPiRionheh
20:30bbloommpan: resolved is different than derefed
20:31bbloommpan: vars are reference types, just like atoms, but referring to one in source is automatically deref-ing them
20:31bbloom,['assoc `assoc #'assoc]
20:31clojurebot[assoc clojure.core/assoc #'clojure.core/assoc]
20:31bbloom,(map class ['assoc `assoc #'assoc])
20:31clojurebot(clojure.lang.Symbol clojure.lang.Symbol clojure.lang.Var)
20:31bbloom,(deref #'assoc)
20:31clojurebot#<core$assoc clojure.core$assoc@2cb15301>
20:31bbloom,(class (deref #'assoc))
20:31clojurebotclojure.core$assoc
20:32bbloom,(fn? (deref #'assoc))
20:32clojurebottrue
20:32bbloomthere we go :-P
20:32hyPiRion,((juxt 'dissoc #'dissoc dissoc) {} nil)
20:32clojurebot[nil {} {}]
20:33mpanso resolving is getting the fully-qualified var? and derefing is getting what is held in the var?
20:33bbloommpan: the terminology might be a little fuzzy
20:33bbloom,(clojure.core/resolve 'assoc)
20:33clojurebot#'clojure.core/assoc
20:33technomancyresolving is getting the var
20:33mpanalso, why does the language have both vars and atoms?
20:34technomancyvars are only mutable in order to support interactive development
20:34technomancythey don't have CAS semantics
20:34technomancyatoms are there to call out explicit mutable places
20:34bbloommpan: vars are thread locals, atoms are shared storage
20:34mpanso don't use vars as "storage"?
20:35technomancympan: not for things that could change at runtime
20:35mpanall right
20:35mpanthank you all for clarifying
20:36technomancywell you can use them with binding
20:36technomancybut that's not really storage
20:53TimMcmpan: vars, refs, atoms, agents
20:57rbxbxIn compojure to compose routes does one simply need to thread them through each other and then mount the result of that as your app (ie: in handler/api)
20:57rbxbxhttps://www.refheap.com/paste/7735
20:58rbxbxwhere task-routes and app-routes were defroutes'd
20:58amalloyrbxbx: (routes x y) is a route that tries x, and falls back to y if that doesn't work
20:58brehautrbxbx: overthinking it
20:58brehautamalloy beat me
20:59rbxbxamalloy brehaut cheers :)
21:14seangroveAnyone using shoreleave?
21:14seangroveI'm updating a publishized atom, but none of the callbacks are being fired
21:15seangroveUsually it's because I've forgotten something very basic, but can't seem to track it down
21:18hyPiRion,((juxt #(`%%%) number?) (/ 0.0 0.0))
21:18clojurebot[NaN true]
21:25TimMc:-P
21:26seangroveWow, actually, all of shoreleave pubsub seems to have stopped working
21:26seangroveWhat could I possibly have done...
21:29hyPiRionno bisect for you
21:31Bronsa,'#(`%%%)
21:31clojurebot(fn* [p1__27#] ((quote p1__27__28__auto__) p1__27# p1__27#))
21:31Bronsaheh, clever
21:32TimMcIt's *very* clever. Even if the arg is a map, it won't contain the gensym as a key.
21:33Bronsayeah
21:33TimMcAt best, you could fool it with a reify'd thingum.
21:37TimMchyPiRion: ##(#(`%%%) (reify clojure.lang.ILookup (valAt [this x y] "NOPE")))
21:37lazybot⇒ "NOPE"
21:38hyPiRionclever
21:39Bronsalol
21:39TimMcYou can break all sorts of things with reify.
21:40brehauti <3 reify
21:41hyPiRion,(#('+%&`%&)) ; ~= (gensym)
21:41clojurebotrest__27__28__auto__
21:41TimMc(throw (proxy [Throwable] [] (getCause [] this))) <-- fun times
21:42TimMcGood call.
21:42TimMcIt just hangs.
21:42brehautapparently so
21:42brehauthurrah for reply supporting ctrl+c
21:42TimMchmm
21:43TimMcIs that the new lein repl, or am I thinking of nREPL?
21:43brehautboth
21:43brehautreply is an nrepl client
21:43brehautits both a standalone thing and the new lein repl
21:43TimMcAh, OK.
21:43brehauttrptcolin has done a good job
21:44TimMcSpeaking of which, I need to figure out how to use Home and End in lein2 repl.
21:44brehautwhat to do?
21:46TimMcWell, I get "H" and "F" printed out instead of cursor navigation.
21:46hyPiRionrlwrap?
21:46TimMcInstalled.
21:46brehautoh weird
21:46hyPiRionC-a and C-e then
21:46TimMchyPiRion: For now, yes.
21:46brehautyeah, C-a and C-e is what i use
21:46brehauthome and end scroll the terminal
21:47brehaut(on my mac)
21:47hyPiRionBut yeah, I know the issue. I just tell myself I'm not enough of an emacs-user to complain about it.
21:47hyPiRionI shouldn't complain about C-a and C-e.
21:48hyPiRion,(#('!,*%&) :a :b :c)
21:48clojurebot(:a :b :c)
21:48hyPiRion,(#(`[[~@%&]](+)) :a :b :c)
21:48clojurebot[:a :b :c]
21:48brehauthyPiRion: celebrating 25 years of perl?
21:49hyPiRionbrehaut: Yeah - by practising my swearjure skills
21:49TimMc~factorial
21:49clojurebotfactorial is not something you need alphanumeric characters for: https://gist.github.com/3036120
21:49TimMc(inc swearjure)
21:49lazybot⇒ 1
21:49hyPiRionheheheh, I love it
21:49hyPiRionoh, factorial
21:49clojurebotfactorial is not something you need alphanumeric characters for: https://gist.github.com/3036120
21:49TimMc~botsnack
21:49clojurebotThanks! Can I have chocolate next time
21:50bbloomTimMc: aw c'mon now, (= (*) 1) is cheating
21:50TimMcbbloom: Cheating?
21:50bbloomgotta define the set of natural numbers recursively
21:50TimMcheh
21:50TimMcMy goal was not, in fact, obfuscation.
21:50brehautTimMc: have seen a doctor about htat?
21:51TimMcbrehaut: The link?
21:51brehautindeed
21:51TimMcclojurebot: botsnack is <reply>Thanks! Can I have chocolate next time?
21:51clojurebotwhat time is it?
21:51hyPiRionWe should indeed make a clojure compiler in swearjure sometime.
21:52TimMcOh, wow... you can't define a factoid ending in a question mark. (Trying to replace the one without.)
21:52brehautTimMc: i also couldnt work out how to define a factoid that looked like defining a factoid
21:52mpanis there like some sort of existing reference material for punctuationjure?
21:52mpanperhaps an explanation of why it works/how it bootstraps?
21:53hyPiRion$source apply
21:53lazybotapply is http://is.gd/VOGQDY
21:53TimMcmpan: Beyond the comments in the factorial link? I don't think so.
21:53TimMcThere's also the partial version at the bottom, which might help.
21:53ppppauli want to test some uri's out in clojure
21:53ppppaulhow do?
21:54TimMcmpan: Here's the process I went through to write rest: https://gist.github.com/3916042
21:54ppppauli see in datomic a ref to java.net.URI for using uri's in the db... i would like to test some out to see if my data is a uri or not
21:55mpanTimMc: thanks. but what was the "factorial link"?
21:55TimMchttps://gist.github.com/3036120, from ~factorial
21:56hyPiRion,(#('!%&`#{~@%&}) 1 2 3)
21:56clojurebot#{1 2 3}
21:56TimMcppppaul: You just want to see if something is an instance of java.net.URI?
21:56mpanTimMc: how are you simulating the recur call?
21:57TimMcmpan: What recur?
21:57TimMcThis isn't functionally equivalent to rest.
21:57hyPiRionheh
21:57mpanfor the factorial example
21:57TimMcI should make that clearer.
21:57mpanone of your fns knows itself?
21:58hyPiRiony-combinator
21:58TimMcNot quite the Y combinator, but very close to it.
21:59mpanthat's possible in punctuationjure? =o
21:59TimMcOh, wait... no, I don't think this uses that trick.
21:59TimMcmpan: See https://gist.github.com/3916042#file-rest-swear-clj-L21
21:59hyPiRionOh sweet, I managed to do map
21:59hyPiRionAlways been bothered by that bugger.
21:59hyPiRion,(#('!%`{~%~@%&}) 1 2 3 4)
21:59clojurebot{1 2, 3 4}
22:00mpanoh, you're exploiting maps?
22:00TimMcmpan: In the roughest version, yes. The final version uses a vector.
22:01TimMcIn swearjure, functions can only take one argument.
22:01mpanwould it be possible without exploiting other things being callable?
22:01TimMcI just make that one argument a vector of all the fns + some data.
22:01ppppaulTimMc, i want to see if some string is a uri via Java.net.URI (because that's what datomic uses)
22:01TimMcEach fn knows the indices of the fns it needs to call.
22:02TimMcppppaul: Oh, testing if a string is a valid URI? That sounds... fraught.
22:02ppppaulgah
22:02ppppaulwell, i have an idea of what shape of string i want to put in the db, so i just want to sanity check that i can type it under uri
22:03mpanis there a single-step partial evaluator?
22:03TimMcppppaul: And throw if it isn't?
22:03mpanand if so, would that help in understanding?
22:03ppppaulyeah
22:03TimMcppppaul: ##(java.net.URI. "Let's see!")
22:03lazybotjava.net.URISyntaxException: Illegal character in path at index 5: Let's see!
22:03ppppauloh
22:03TimMcmpan: Eh?
22:03ppppauli forgot the trailing dot
22:03ppppaul:)
22:04TimMcppppaul: :-)
22:04ppppaul##(java.net.URI. "/things")
22:04lazybot⇒ #<URI /things>
22:04ppppaul:D
22:04mpanerm, just abstractly, the evaluator keeps rewriting an expr until it gets the result? is that a good/bad way to think about it?
22:04TimMcppppaul: Amazing! This is a case of the proximate problem being the one that needs solving!
22:05TimMc~xy problem
22:05clojurebot"There is no problem in computer programming which cannot be solved by an added level of indirection." -- Dr Maurice Wilkes
22:05TimMc...although that's a terrible name, and I will fix that factoid some day.
22:05ppppaulok, so now i'm curious as to your opinion as to if it would even be worth while using uris in clojure over strings... is it easy to deal with uris?
22:05mpan(at least, for the subset of the language which is referentially transparent)
22:06ppppaul##(print (java.net.URI. "/things"))
22:06lazybot⇒ #<URI /things>nil
22:06TimMcppppaul: I don't know. I'm not as up to speed on URIs/URLs on the JVM as some other folks here.
22:06brehautTimMc: thus three star programmers
22:07bbloommpan: clojure's evaluator is a more traditional top to bottom left to right evaluation strategy
22:07TimMcbrehaut: ?
22:07bbloommpan: it's not a rewrite rule strategy
22:07ppppaulwhat color are the stars?
22:07bbloommpan: you go from the inside out, starting with the left most argument
22:07TimMcmpan: If you're asking if swearjure evaluation can be modeled on substitution... I think so?
22:07brehautppppaul: depends on your text editor
22:07brehauthttp://c2.com/cgi/wiki?ThreeStarProgrammer
22:07ppppauloh wow, haven't seen c2 in a while
22:08brehautand yet it looks exactly the same
22:08TimMcthe original wiki
22:08mpanI'm wondering if I could ask for intermediates in the evaluation of swearjure
22:08ppppauleleven stars!
22:08mpansomething with less "magic"
22:09hyPiRionmpan: being with different characters
22:09hyPiRion,,
22:09clojurebot#<ExecutionException java.util.concurrent.ExecutionException: java.lang.RuntimeException: EOF while reading>
22:09TimMcmpan: I don't think there's mutation in swearjure. There are other "side-effects", such as exceptions.
22:09mpanbbloom: is it ok to pretend the two are equivalent?
22:09hyPiRion*begin
22:09bbloommpan: not sure
22:10TimMcmpan: Well, the rest.swear.clj link should help, since it's the "same" function at different stages of swearingness.
22:10mpanTimMc: does it help to read it forwards or backwards?
22:10hyPiRiontop-to-bottom, I suppose?
22:11TimMcTop to bottom.
22:11mpanhow are you getting from having 0 to making 1?
22:11hyPiRion,(*)
22:11clojurebot1
22:11mpanOH
22:12mpanI thought you had an "inc" equivalent
22:12mpanthanks
22:12TimMcYeah, *I* can't read the final form.
22:12hyPiRioninc is ##(+(*) ... )
22:12lazybotjava.lang.RuntimeException: Unable to resolve symbol: ... in this context
22:12TimMcmpan: inc is (+ x (*)) :-P
22:12mpanI thought you could "make" inc without "having" 1
22:12mpanwas expecting peano numbers
22:13TimMcNope, those wouldn't interoperate.
22:13hyPiRionhmm.
22:13TimMcYou could use them internally, I guess.
22:13mpanerm, I meant like, using a construction with "expr making 0" and "expr making fn which is inc"
22:13TimMcI don't think you can get Church numerals, by the way -- lambda calculus requires nesting of fns.
22:14devnHas anyone seen datomicism?
22:14devnhttps://github.com/shaunxcode/datomicism
22:14devnSo cool.
22:14TimMc"please do not look at the code" -- good quote out of context
22:14devnThere aren't screenshots, but please, check it out.
22:15hyPiRionTimMc: could you grab metadata in swearjure?
22:15devnNavigating and toying around with the codeq schema is much more playful, like you're in a REPL.
22:15hyPiRion&(-> '(x) meta vals first)
22:15lazybot⇒ 1
22:16Bronsawtf
22:16ppppaulcodeq is pretty sweet
22:16Bronsaoh lol
22:16devnthe schema is tough to understand
22:16ppppaulall datomic schema is hard to understand
22:16devnyou really need a tool like this to play with it
22:16devnppppaul: check out datomic-simple
22:16devnhttps://github.com/cldwalker/datomic-simple
22:17ppppauli'm using zololabs stuff
22:17ppppauli may switch if this is better
22:17ppppauli got the tests to switch :D
22:17devndatomic is to lucene as datomic-simple is to solr
22:18ppppauli'm looking at it right now, with my eye-balls
22:18devnppppaul: you need to drag and drop the widgets in the top bar into your workspace
22:18devni missed that in the README and was confused as to why nothing worked at first
22:19devnppppaul: what is this zololabs stuff you speak of?
22:19ppppaulzololabs demonic
22:20ppppaulthe little-documented datomic wrapper thingy
22:20devnwhere'd you hear about it?
22:20ppppaulstrangeloop vid
22:20devndamn! i missed strangeloop this year.
22:20devnwho gave the talk?
22:20brainproxyppppaul: did you work through the day of datomic materials and the tutorial on docs.datomic.com?
22:20ppppaulthe guy in the github photo
22:21ppppauli don't think i did the day of datomic
22:21brainproxyppppaul: I found the day of datomic stuff especially helpful, learned a lot from the samples in that repo
22:21ppppauli looked at seatle
22:21devnthere are some fairly recent updates to the day-of-datomic material
22:21devnthe docs on datomic.com are a bummer
22:21brainproxyhttps://github.com/Datomic/day-of-datomic/
22:21ppppauli'll look at the day of datomic... i've learned a lot about datomic from the #datomic channel and via tests i've wrote
22:21devnanyone who claims otherwise is proud they managed to figure out what datomic is and how to use it
22:22brainproxydevn: agreed, the docs are thin
22:22devnand out of date
22:22ppppauloh i've seen day of datomic... didn't look through it much, though
22:22brainproxyppppaul: there's some nice stuff in there, make sure to look at everything
22:22brainproxymy co-worker and i basically learned datomic by working through it
22:22devni went on a datomic github repo hunt and found a bunch of good stuff, https://github.com/shaunxcode/datomicism being my favorite of the bunch
22:22ppppauloh shit. tutorial is big :(
22:23ppppauli couldn't get datomicism to work
22:23devnppppaul: use codeq to analyze a repo, then start the datomic rest service
22:23devnppppaul: what didn't work?
22:23ppppaulhave you got it working on a mem db, or do i have to use dev?
22:23ppppauli don't know if i've used the rest service yet...
22:24devnppppaul: you need the datomic rest service running
22:24ppppaulprobably haven't
22:24brainproxyppppaul: don't forget you can use local storage in free mode
22:24devnwhich, again, documentation!
22:24ppppaulthat could be why i didn't get it working
22:24ppppauli know i can use local storage, right now i'm writing tests
22:24devni feel like everyone might be using datomic already if they just paid a couple of people to keep docs up to date
22:25devnto improve them, etc.
22:25devn*shrug*
22:25ppppauli'm used to lack of documentation, doesn't bother me anymore
22:25hyPiRionTimMc: 1 without (*) (ish)
22:25ppppauli just want shit to work and to have some support behind it
22:25hyPiRion,(let [! meta] ((!,'(+))((`[~@(->,'(?)!)](+))(+))))
22:25clojurebot#<IndexOutOfBoundsException java.lang.IndexOutOfBoundsException>
22:25hyPiRion&(let [! meta] ((!,'(+))((`[~@(->,'(?)!)](+))(+))))
22:25lazybot⇒ 1
22:25brainproxythe (lack of) documentation wouldn't be so bad if the code base was open source :p
22:25devnppppaul: i haven't done much to this recently, but: https://github.com/devn/codeq-playground
22:25ppppaulcatnip helps me see any hidden docs :)
22:26TimMchyPiRion: oh hell
22:26TimMcI can't parse that right now, I have to get some work done before bed. I'll sleep on it.
22:26hyPiRionI think I can get stuff now, sec.
22:26hyPiRionlike letters
22:26devnppppaul: check out script/datomic-rest
22:26devnthis is documented in some blog post somewhere hidden on the internet
22:27devnbut that's how you run it
22:27ppppaulthanks devn
22:27ppppaullooking at it now
22:27TimMchyPiRion: The key is to get ahold of symbol and var or eval.
22:27mpanyou're allowed to self-refer by name inside a let?
22:27ppppaulthe datomic rest service will hook into mem dbs too? or just local?
22:27hyPiRionTimMc: Yeah, I'm cheating by saying meta = !
22:27mpanor am I misunderstanding what you're doing with "!" ?
22:27hyPiRionnot using any vars though
22:27devnpatches welcome btw -- if you're playing with datomic and codeq id like some help building up codeq-playground and datomic-playground (https://github.com/devn/codeq-playground & https://github.com/devn/datomic-playground)
22:28mpanoh whoops
22:28devn^- ppppaul
22:28mpancompletely mis-parsed that
22:28hyPiRionhm
22:28mpannot sure how I read a destructuring inside that :/ my bad
22:29ppppaul(def uri "datomic:free://localhost:4334/unique") this is how i set up a local db?
22:29ppppaulcool
22:29hyPiRion&(#((%,'(+))((`[~@(->,'(?)%)](+))(+))) meta)
22:29lazybot⇒ 1
22:29ppppaulhaven't seen that before
22:29devnhyPiRion: why are you writing that garbage?
22:29devnjust for fun?
22:29hyPiRiondevn: Because I should go to bed
22:30devnhyPiRion: i wish i could find some code that chouser wrote in this channel like 3 years ago
22:30hyPiRionIt originally started with me not wanting to create tests
22:30ppppauldevn, in my tests i'm using d/with, do you think this is sane, or should i just use regular transactions with a temp mem db?
22:30mpanhyPiRion: what is your current goal?
22:30brainproxyseeing if he can make denser line-noise than a 25 year perl hacker
22:30hyPiRionmpan: For tonight? getting a character I suppose
22:30hyPiRionin swearjure
22:31devnppppaul: i think a temp mem db -- people are always going to these great lengths to stub out solr or elasticsearch or whatever, and it just strikes me as a fool's errand
22:31brehautbrainproxy: APL solved that problem years ago
22:31mpanare there string/character constants floating around in the ns?
22:31devnppppaul: just like you'd use postgres or mysql with a develeopment and test db, i think it's fair to use a datomic mem DB
22:31hyPiRionmpan: yeah, in the metadata
22:32brainproxybrehaut: true ... though I wonder if J took it a step further
22:32ppppauli tried it to see how the code would look... had my whole setup in a let statement with a single test for the body
22:32mpanonly in the metadata? :/
22:32ppppauli couldn't eval anything but the whole let form :(
22:32devnJ and APL. Fun times.
22:32devnheh
22:32mpana company at the job fair said they primarily used J... and they were very proud of it
22:32ppppaulyour (def rules) in playground are big... wow
22:32mpanand they kept telling me how it was just like lisp
22:33mpanwhich... I don't... I can't comprehend :/
22:33devnAPL, J, K => APL: J/K
22:33amalloyhyPiRion: \( <== a character, in legal swearjure! you can move on to a new goal now
22:33devnwhat is swearjure?
22:33hyPiRionamalloy: alphanum then
22:33mpanan esoteric programming language indeed
22:33ppppauli am swearjure
22:34mpanhyPiRion: can you do char arithmetic?
22:34hyPiRionmpan: not yet
22:34mpanhyPiRion is it not the same as numeric arithmetic?
22:34hyPiRionI don't know if it's even possible
22:34devnppppaul: heh, im quite serious -- what the hell is swearjure?
22:34hyPiRionmpan: no
22:34devnjust obfuscated clojure?
22:34hyPiRion,(+ \a \c)
22:34clojurebot#<ClassCastException java.lang.ClassCastException: java.lang.Character cannot be cast to java.lang.Number>
22:34mpanactually, why can't you go fishing for char?
22:34ppppaulI AM SWEARJURE!
22:35hyPiRionbecause I need alphanums for it
22:35hyPiRionheh
22:35mpancan't you do the same fishing in your ns by index trick as before?
22:35devn,(+ (int \a) (int \c))
22:35clojurebot196
22:35ppppauli think, therefore i swearjure
22:35hyPiRionmpan: trying to now
22:35mpandoes "fishing" generalize to any core function?
22:36mpan(provided you were willing to construct large enough int constants)
22:36devnppppaul: do you know what swearjure is or do I need to keep "fishing"?
22:37ppppaulphish
22:37ppppauli claim to be swearjure, but nobody listens
22:37ppppaulyou must seek your swearjure, and fish it
22:37devnppppaul: seriously though -- is it a library or something or what?
22:38devni googled it and im coming up empty handed
22:38devnamalloy: please enlighten me.
22:38hyPiRion&(#((%,#'+)((`[~@(%,#'+)](+(*)(*)))(+))) meta)
22:38lazybot⇒ "clojure/core.clj"
22:38ppppaulgoogle has refs to swearjure, but only in this channel
22:38hyPiRionhmm
22:38mpanI'm beginning to wonder if you could bootstrap something compiler-like with a small set of primitives
22:38devnhyPiRion: what is swearjure?
22:39hyPiRion~factorial
22:39clojurebotfactorial is not something you need alphanumeric characters for: https://gist.github.com/3036120
22:39hyPiRion^
22:39mpanrather than attempting each particular core fn, you just come up with some way to get something arbitrary from core
22:39hyPiRionIt's clojure without alphanumeric characters
22:39mpanand with core you bootstrap... erm... a "compiler"
22:39devnhyPiRion: THANK YOU! jesus man, was starting to go a little crazy with the cryptic answers
22:40devnhyPiRion: (*) and (+) seem like they're primitives to me if that's the goal
22:40bbloomdevn: i think cryptic answers is sorta the point of swearjure
22:40hyPiRion&(#(`[~@((%,#'+)((`[~@(%,#'+)](+(*)(*)))(+)))](+)) meta)
22:40lazybot⇒ \c
22:40hyPiRionAHA
22:40mpanis there a higher level overview of that strategy?
22:41mpanbesides attempting to parse the string?
22:41hyPiRiondevn: yeah, that's what I know
22:41hyPiRionoh, I can get symbols
22:41mpanI vaguely recall someone doing this to python/ruby and they were fishing around in the globals for the stuff they wanted
22:42devnpython/ruby/perl*
22:42hyPiRionjavascript
22:42mpancan you get the [java] methods of an object?
22:42devn1 + {}
22:42ppppaul<3 day of datomic
22:42hyPiRionmpan: through reflection, possibly
22:42ppppauli'm going to shave
22:43devncool.
22:43mpanthat would get you toString among other potentially useful bits
22:43mpanand dot is free!
22:43TimMcdevn: Blame gfredericks for swearjure.
22:43mpanwoohoo!
22:43TimMc(inc gfredericks)
22:43lazybot⇒ 12
22:43devnTimMc: it's fun and all, but it's killing me inside
22:43TimMcdevn: hyPiRion also goes for a level of obfuscation beyond what I feel is strictly good taste. ;-)
22:44hyPiRion&(#(`[(`[~@((%,#'+)((`[~@(%,#'+)](+(*)(*)(*)(*)))(+)))](+(*)))](+)) meta)
22:44lazybot⇒ ((clojure.core/apply clojure.core/vector (clojure.core/seq (clojure.core/concat ((p1__13332__13333__auto__ (var clojure.core/+)) (((clojure.core/apply clojure.core/vector (clojure.core/seq (clojure.core/concat (p1__13332__13333__auto__ (var clojure.core/+))))) (... https://www.refheap.com/paste/7742
22:44hyPiRionwooo
22:44mpanwhoooo
22:44hyPiRionwow, with apply I can do everything
22:44devnTimMc: in football this kind of thing is called a "gadget play"
22:44devn(american football)
22:45devngadget being the operative word
22:45mpanwhy are you so attached to "meta", though?
22:45TimMcGood source of strings.
22:45hyPiRionmpan: Can't do anything without it
22:45mpanis there not something else floating around you could substitute with?
22:46mpanactually, can you get anything useful out of empty string?
22:46devni agree with mpan, seems like a lack of imagination
22:46mpanI mean, I understand it would be amazing if you had meta
22:46mpanbut are there other strings out there?
22:47devnsure..
22:47devn,*
22:47mpanI think when they did this in other languages they had easier access to string constants
22:47clojurebot#<core$_STAR_ clojure.core$_STAR_@470384ef>
22:47TimMc,[`~@"hello"]
22:47clojurebot#<ExecutionException java.util.concurrent.ExecutionException: java.lang.IllegalStateException: splice not in list>
22:47TimMc,`[~@"hello"]
22:47clojurebot[\h \e \l \l \o]
22:47TimMcAnd it's a damn shame we can't do char arithmetic.
22:48TimMcWell, OK, a minor shame.
22:48mpanuh, could someone tell me again how you were getting the seq of all the stuff in core?
22:48TimMc,````etc ;; mpan
22:48clojurebot(clojure.core/seq (clojure.core/concat (clojure.core/list (quote clojure.core/seq)) (clojure.core/list (clojure.core/seq (clojure.core/concat (clojure.core/list (quote clojure.core/concat)) (clojure.core/list (clojure.core/seq (clojure.core/concat (clojure.core/list (quote clojure.core/list)) (clojure.core/list (clojure.core/seq #))))) (clojure.core/list (clojure.core/seq (clojure.core/concat (clo...
22:49mpanerm, I mean, I thought you had a way to enumerate a seq of everything in core
22:49mpanor was that just misunderstanding and wishful thinking?
22:50devnI think it's cool you can do that on some level, and feel free to tell me I'm a freedom-hating asshole the next time you see me, but why are you wasting your time with this bullshit?
22:50devnwhy not do something useful?
22:51mpandevn: one reason is that it's oddly related to the fundamentals of computing stuff
22:51TimMcdevn: Sometimes you want to watch Requiem For a Dream; sometimes you want to watch the Life of Brian.
22:51devnit's a self-made puzzle for people content on avoiding real work
22:51devnmpan: i can dig that, and i get it
22:51devnbut at a certain point the analogy breaks down
22:51mpanI'm avoiding packing my belongings and going home from school =P
22:51TimMcmpan is correct as well.
22:51devnit's not.
22:51mpanmy semester just ended and I've got a bit to do... stuff
22:52TimMcdevn: I actually don't spend my time working on Swearjure -- it was mostly a couple of bursts of activity.
22:52TimMcmodulo some screwing around on IRC
22:52hyPiRion,(`[~@```+](+))
22:52clojurebotclojure.core/seq
22:53TimMcdevn: It's a fiar criticism, though.
22:53brehauthyPiRion: ◎_◎
22:53mpanwhat if you could make some sort of "interpreter"?
22:53mpanI'm hesitant to use these terms because this is so far beyond my usual expectations of said terms
22:54TimMc,(`[~@'`[~@[]]](+)) ;; hyPiRion
22:54clojurebotclojure.core/apply
22:54hyPiRionoh sweet
22:55hyPiRionmy life is complete
22:55mpancan you make the sym for fn?
22:55hyPiRion,((`[~@'`[~@[]]](+))(`[~@```+](+))[1 2 3])
22:55clojurebot[1 2 3]
22:55hyPiRionhuh
22:56TimMc,(class (`[~@'`[~@[]]](+)))
22:56clojurebotclojure.lang.Symbol
22:56TimMcWell, crud.
22:57TimMcOK, that's enough for me tonight. For serious, this time.
22:57hyPiRion,`[#'~(`[~@'`[~@[]]](+))]
22:57clojurebot[(var clojure.core/apply)]
22:57hyPiRion,`([#'~(`[~@'`[~@[]]](+))](+))
22:57clojurebot([(var clojure.core/apply)] (clojure.core/+))
22:58hyPiRionit's a damn shame we can't resolve them
22:58hyPiRionOh well, night
22:58mpannight
22:59TimMcg'night
22:59mpanok I think I know why I was confused
22:59mpansomeone earlier had a need to enumerate all of a namespace?
23:00mpanwould that be applicable to swearjure?
23:01hyPiRionmpan: yes, if we could iterate over the vars
23:02mpanthat would be (almost) everything we wanted
23:02hyPiRionwith them we could do anything
23:02mpandidn't you have arbitrary string construction, though?
23:02hyPiRionstring splicing, nothing else
23:03mpanwhat about str->sym and sym->referent
23:03mpan?
23:03hyPiRion,(symbol "foo")
23:04clojurebotfoo
23:04mpanI'm sorry. I keep confusing myself occasionally with other conversations from slightly earlier.
23:04hyPiRion,(resolve (symbol "str"))
23:04clojurebot#'clojure.core/str
23:04hyPiRion,((resolve (symbol "str")) 1 2 3)
23:04clojurebot"123"
23:04hyPiRionthat's the idea.
23:04mpandidn't you get one of those two though already? is what I meant
23:05hyPiRiononly symbols
23:05hyPiRionnot their resolved variant
23:05mpanwhat about
23:05mpanbootstrapping through ns-* functions?
23:05mpanif we could fish one of them out?
23:06mpanbut sadly that sounds circular to me :( because where do we get the ns functions other than by enumerating the ns :/
23:06hyPiRionexactly
23:06mpanis there an act of reader-abuse which will get you one of the ns-* functions?
23:07newbNewb question - how do I add two lazy sequences together, e.g. add [1 2 4 8...] to [9 10 11 12 ...] to get [10 12 15 20 ...] ?
23:07mpanmap them with +
23:07hyPiRionnewb: (map +
23:08hyPiRionmpan: we're exploring
23:08hyPiRion,(map + (range) (iterate inc 1000))
23:08clojurebot(1000 1002 1004 1006 1008 ...)
23:09newbDidn't realise map took multiple args! Thanks!
23:12mpandot is free, and it is so tempting
23:12mpanif only you could construct arbitrary symbols
23:13mpanit would free you from the need for resolve/eval/apply/etc