#clojure logs

2012-07-09

00:01ro_stemezeske: looking at cljs-build's multiple build configurations. can i build two distinct code-trees in parallel with this feature?
00:02ro_stsay a base app and a module that may or may not be loaded at runtime?
00:02ro_stif so, is there any support for generating externs in the one based on the exports of the other?
00:07emezeskero_st: I... let me think about that
00:08emezeskero_st: You can definitely supply multiple trees, and they will both be on the classpath
00:08ro_stok so it'll build both, but not do anything about allowing the two to run side-by-side in the same VM
00:09emezeskero_st: I'm not sure what you mean by side by side
00:09ro_stas in the case with a base app (js 'binary') loading another module of code (also a js 'binary') into memory and calling into it
00:10ro_stthe base app would need to be compiled with a set of externs that correspond to the exports of the module
00:10emezeskero_st: ah, no, AFAIK if you produced two output js files with lein-cljsbuild, from two separate trees, the output files would each include any code from the other that was called
00:11emezeskero_st: I think you'd have to supply your own externs file, and mark public things in the base library with ^:export
00:12emezeskero_st: In otherwords, no help from lein-cljsbuild :)
00:12ro_stand make sure that when compiling the module that it uses the externs instead of the actual base code
00:12ro_stif it can find both an actual namespace and that namespace is in externs, which gets precedence?
00:12emezeskero_st: yeah, you couldn't use the (ns ...) form to hook up to them
00:12emezeskehah, you've got me stumped on that one.
00:12ro_stright, it'd have to be a call directly to js, using js/symbol?
00:13emezeskero_st: yeah, AFAIK
00:13ro_sti can live with that
00:13emezeskeI'm definitely not certain there's no other way
00:13ro_stforces me to think about that api super carefully
00:13emezeskeBut that is the only way I can think of :)
00:13ro_sti'm going to stub this out and see what happens
00:14emezeskecool, that's an interesting use case
00:14wingyis it recommended to always use loop/recur instead of calling the fn when recursing?
00:14ro_stin my case, the module is actually 95% static content and 5% logic, and you can only have one loaded at a time
00:14wingydue to TCO
00:14ro_stwingy: recur doesn't add a call to the stack
00:14ro_stso you don't blow the stack on long recursions
00:14wingyro_st: so it's recommended even on short recursions?
00:15emezeskewingy: I've found that often when I think I need a loop/recur, I can rewrite as a reduce
00:15wingyemezeske: nice
00:15emezeskeI tend to find reduce more readable than loop/recur, but I guess that's personal taste?
00:16ro_stmadsy: looks like lein-cljsbuild's crossover support gives me what i want
00:17madsyro_st: Yeah, I've just started using it, so I don't know exactly how easy it is.
00:17ro_stlooks fairly straightforward. i'm so totally nowhere near ready to write macros, so i'm not worried about that aspect of it
00:19madsyro_st: If you want some crappy cljs code to play with: https://gist.github.com/3062242
00:20ro_stin the cljs repl, in dev mode, i can do everything i usually could in a repl? define new fns, overwrite existing vars, etc?
00:20madsysure
00:20wingyi read a whole chapter in a book without quite getting why i would need atom .. the http://en.wikibooks.org/wiki/Clojure_Programming/Examples/Cookbook made me getting it with one line: "How to write x = x+ 1" :)
00:21ro_stit's when you go advanced that everything is statically compiled and you lose this capability
00:21ro_stmadsy: interesting. webgl. never played with it before
00:27ro_stis there some sort of a cheatsheet for cljs, kinda like clojure.org/cheatsheet?
00:28zerokarmaleftro_st: http://himera.herokuapp.com/index.html
00:28ro_stoh of course! thank you
00:34ro_stemezeske: how do i teach cljsbuild how to find Firefox on osx?
00:35ro_sti'm getting "Error in background process: #<IOException java.io.IOException: Cannot run program "firefox": error=2, No such file or directory>"
00:35ro_stwhen running "lein trampoline cljsbuild repl-launch firefox http://localhost:3000/repl-demo&quot;
00:35ro_ston your advanced sample project
00:44ToxicFrogWhat is the best way to define an anonymous function returning its second argument?
00:44ToxicFrog#(%2) tries to call its second argument, which is not what I want
00:44ro_st#(-> %2) maybe?
00:44amalloy(fn [x y] y)
00:45amalloyyou can mess with #() syntax if you want, but it hardly saves you any characters and looks silly
00:45dnolenor (fn [_ x] x)
00:46amalloywingy: as long as its tail recursion, recur is preferred to calling the function directly
00:46amalloydnolen: sure. depends whether you want to document/reinforce why you're ignoring the first one
00:47emezeskero_st: I don't know much about OSX, does it have a $PATH variable in the shell?
00:47ro_stit does
00:48ro_stso it's just trying to call 'firefox'?
00:48emezeskero_st: Maybe "export PATH=/parent/dir/of/firefox:$PATH" ?
00:48emezeskeI believe so
00:48emezeskeYou could always change it to an absolute path in the project.clj
00:50ro_stthe first arg in the vector?
00:50emezeskeyeah
00:50ro_stcool
00:50wingyamalloy: ok
00:54ro_stemezeske: fyi, for the next person: instead of "firefox", use "/Applications/Firefox.app/Contents/MacOS/firefox-bin"
00:54ro_sti'm guessing there's no easy way to run this repl from within emacs?
00:58evildaemonOkay, what am I doing wrong in this code? (Besides the horrible abuse of function parameters.)
00:58evildaemonhttp://pastebin.com/Szg6zwBe
00:59evildaemon(I'm going to go ahead a preface this with "I kind of suck."
00:59evildaemon)
01:00technomancyro_st: OS X has all kinds of issues with PATH on gui-launched emacs
01:00technomancythe official fix involves mucking with an XML plist file =(
01:01evildaemontechnomancy: If he's on OS X, why not just distribute a patch file?
01:02technomancya patch for de-fubaring the PATH?
01:02emezeskero_st: :)
01:03ToxicFrog,(- 2 1)
01:03clojurebot1
01:03technomancyevildaemon: (do) is just nil
01:04evildaemontechnomancy: I know.
01:04evildaemontechnomancy: It wouldn't take nil because it's not a function.
01:05technomancydo isn't a function either
01:06ToxicFrogasdfghl
01:06evildaemontechnomancy: Special form.
01:06ToxicFrogThere's the problem
01:06ToxicFrog(split-lines "\n") returns [] rather than ["" ""]
01:06technomancyevildaemon: I don't know what you're doing there, but I'm pretty sure there's no need for (do)
01:07amalloyi can't think of a reason tot est whether j is even in a fib impl
01:07ToxicFrog,(split-lines "asdf\n\nfdsa")
01:07clojurebot#<CompilerException java.lang.RuntimeException: Unable to resolve symbol: split-lines in this context, compiling:(NO_SOURCE_PATH:0)>
01:08ToxicFrog,(clojure.string.split-lines "asdf\n\nfdsa")
01:08clojurebot#<CompilerException java.lang.RuntimeException: java.lang.ClassNotFoundException: clojure.string.split-lines, compiling:(NO_SOURCE_PATH:0)>
01:08ToxicFrog,(clojure.string/split-lines "asdf\n\nfdsa")
01:08clojurebot["asdf" "" "fdsa"]
01:08ToxicFrogwhat
01:08evildaemonamalloy: It's not a test for j, it's to do the second euler problem.
01:08ToxicFrog,(clojure.string/split-lines "asdf\n\n")
01:08clojurebot["asdf"]
01:08amalloyoh, you're trying to get all the even fibs
01:08ToxicFrogWHAT
01:08ToxicFrogThis is nonsense
01:09evildaemontechnomancy: You're right. I just needed a way to return nil and got lazy.
01:09amalloyyou don't need a way to return nil either. you just want to return k
01:10technomancy,((partial constantly nil))
01:10clojurebot#<core$constantly$fn__2351 clojure.core$constantly$fn__2351@4a2cf11b>
01:10ToxicFrog,(clojure.string/split-lines "\n\nasdf")
01:10clojurebot["" "" "asdf"]
01:10technomancy,(((partial constantly nil)))
01:10clojurebotnil
01:10evildaemonamalloy: *Stares* I'm an idiot.
01:10ToxicFrogAAAA WHAT IS THIS
01:10evildaemonamalloy: Thank you.
01:11technomancyToxicFrog: Spartaaaaaa?
01:11amalloyToxicFrog: if it doesn't do what you want, write a function that does?
01:11amalloy(inc technomancy)
01:11amalloylazybot: what the hell. give the Dude his karma
01:11lazybotIt's AWWWW RIGHT!
01:11ToxicFrogamalloy: I'm going to have to, yeah
01:11ToxicFrogSince split-lines completely ignores trailing newlines
01:12ToxicFrogThis tastes like a bug
01:13ToxicFrog,(clojure.string/split "\nasdf\n" #"\n")
01:13clojurebot["" "asdf"]
01:15ro_stToxicFrog: it's calling into java's Pattern class
01:19ToxicFrogAha
01:19ToxicFrogre.split(s) calls re.split(s, 0)
01:19ToxicFrogWhich brings this into play: "If n is non-positive then the pattern will be applied as many times as possible and the array can have any length. If n is zero then the pattern will be applied as many times as possible, the array can have any length, and trailing empty strings will be discarded."
01:21ToxicFrog,(clojure.string/split "\nasdf\n" #"\n" -1)
01:21clojurebot["" "asdf" ""]
01:24ro_stwatching stuart sierra's evident code talk. datomic looks great
01:26wingyshouldn't this one return a lazy seq: (def integers (iterate inc 0)) . i can't figure out why my processor is overworking when i run that line
01:28technomancyworks for me
01:30ToxicFrogOk, so this is a Java bug, not a Clojure bug~
01:31wingytechnomancy: get it now, it doesn't work on Light Table .. one reason could be that it's running clj 1.5, another that it's trying to realize the infinite lazy sequence
01:32wingybut that latter makes more sense
01:35technomancyweird, why would it try to realize the value of the var returned? that's kind of crazy =\
01:37wingytechnomancy: light table has to print out something for us to see to the right
01:37wingyso that we know what values are in the sequence
01:37technomancythe whole point of def returning a var is so that this doesn't happen
01:38technomancyso it's kinda going out of its way to defeat Clojure's built-in workaround for this problem
01:40wingy(def ll (range 3)) prints out in Light Table (def (0 1 2) (range 3))
01:42wingyit seems to handle (def ll (range)) fine and less fine with custom fns for constructing values in lazy seqs
02:21noidiI'm using CCW and "navigate to definition" (F3) only works on my project's dependencies, but not on my own code
02:22noidiany idea how to fix this?
03:02fureddoI have a constructor function called create-item. I would like to inialize a list with 10 items, 5 items of type a and 5 items of type b. How can I do that? I'm trying (list (dotimes [_ 5] (create-item 'a)) (dotimes [_ 5] (create-item 'b))) It doesn't work because dotimes always returns nil.
03:08_ulisesfureddo: just return a vector/list/etc with something like (map (fn [] (create-item 'a)) (range 5))
03:08pyrtsaSomething like (concat (take 5 (repeatedly create-item)) ...)
03:08_ulisespyrtsa: I suspect that the 'a and 'b are params that denote the type being created though
03:08_ulisespyrtsa: otherwise, +1 on yours
03:08pyrtsa_ulises: Right.
03:09pyrtsaHa, you can give the count to repeatedly directly!
03:09alexeyrepeatedly takes number as parameter, like (repeatedly 5 create-item)
03:10fureddoI think that _ulises's answer is ok for my needs, I will try it in a moment.
03:10pyrtsaSo what remains is: (concat (repeatedly 5 (partial create-item 'a)) ...)
03:10pyrtsa"..." being, the same for 'b instead of 'a.
03:11alexeywhat concat does there, by the way?
03:11alexeyoh, didn't notice ... :)
03:12_ulisesa more contrived solution might be: (take 10 (map create-item (interleave (repeatedly (constantly 'a)) (repeatedly (constantly 'b)))))
03:13_ulisesand by contrived I mean ugly, complex and utterly pointless of course
03:13fureddo:-)
03:13_ulisesif you know you need 5 and 5, stick to a something like [(map ...) (map )]
03:14pyrtsa_ulises: Or just (repeat 'a)
03:19fureddoAfter some tests, I think that (concat (repeatedly 5 (partial create-item 'a))) is the solution.
03:19pyrtsaHere's one more: (mapcat #(repeatedly 5 (partial create-item %)) ['a 'b])
03:22ro_stanyone using cljsbuild got an idea why i'm getting this crossover error? https://www.refheap.com/paste
03:22ro_sterk
03:22ro_sthttps://www.refheap.com/paste/3518
03:23ro_stthe namespaces all look right
03:24alexyakushevCould someone please explain this inconsistent behavior of type hints across different namespaces? https://www.refheap.com/paste/3519
03:26alexyakushevLooks like if the hint is placed before the argument vector (rather than before the function symbol) and it is not package-qualified, then the namespace using this function should also have this class imported
03:26amalloyalexyakushev: the second form is only for primitive typehints
03:27alexyakushevamalloy: Could I read about it somewhere? I actually never saw anyone placing the hint there, though I discovered it works... most of the time
03:27amalloy*shrug*
03:28alexyakushevamalloy: So by primitive you mean the primitive types?
03:28amalloyyes, double and long
03:29alexyakushevBut it still works for classes as well (if I qualify the hint class). Is it undocumented behavior then?
03:29amalloyas you can see, it doesn't actually work
03:29alexyakushevIt doesn't because namespace 'bar doesn't have ArrayList imported
03:30alexyakushevIf I either import it, or the hint in 'foo would go like (defn make-list-2 ^java.util.ArrayList [] ....) then it works
03:30amalloyjust...don't do it, it's not what hints there are for
03:31alexyakushevYes, I know, I just have to use them a lot, Android reflection is very expensive
03:32amalloythat's not really relevant? just put the typehints in the right place instead of the wrong place
03:33alexyakushevYes, you are right
03:33alexyakushevThank you
04:25tozzAny good resources on how to think about immutable data when building a web app? Coming from Ruby I wanna have a go a Clojure, but I can't wrap my head around how not changing things will work out / look in code, guess it's a mindset thing
04:26kralnamaste
04:28wingyconfusing that the REPL prints out a list structure when it's infact a sequence
04:28wingyadds confusion since it's not a list
04:29wingyeg. (list? (seq [1 2 3]))
04:29wingy,(list? (seq [1 2 3]))
04:29clojurebotfalse
04:29wingybut the structure returned looks like a list .. (1 2 3)
04:30wingywhy not have it printed out something like: 1 2 3 or whatever to tell it's a sequence, not a list
04:32pyrtsawingy: I like that idea. But a lazy sequence of one element (or an empty one) might then be hard to understand.
04:32pyrtsaSomething like (lazy-seq [1 2 3 ...]), perhaps?
04:32wingyyeah that would do better
04:33wingyi feel that clj is a really simple and great lang, the last thing to do should be adding incidental complexities
04:33wingythen it would be simple for everyone to get it and thus making it even more popular
04:37stainanyone done EBNF parsing in Clojure? I have not found anything except fnparse - which just has 'EBNF like' rules in Clojure.
04:37stainone would think that one of the first things to do with an EBNF-like parser is to write a parrser for EBNF..
04:51augustldoes http://pastie.org/4224635 make sense?
04:52wingyno since there is no highlighting
04:52wingyuse gist github next time :)
05:01augustlwingy: any other paste sites that highlight lisp?
05:05wingyaugustl: why not github gist?
05:05wingyhttp://pastebin.com/
05:07wingydo you think that "Programming Clojure" is still a good read even though it's from 2009?
05:12augustlwingy: don't like the way they stick around forever
05:14stainwingy: why not Clojure in Action or perhaps the O'Reilly Clojure Programming?
05:14wingystain: i have already read clojure programming
05:14evildaemonaugustl: But yeah, pastebin does syntax highlighting for stuff I've never even heard of.
05:15augustl:D
05:15wingyprogramming clojure seems short and concise for a better coverage on basics
05:15wingythought i could read joy of clojure after this one
05:16augustlhttp://pastebin.com/MnFQZUR8 !
05:16augustlnow with colors
05:16augustlso, does it make sense? :)
05:16wingyperhaps clojure in action after that one. lets dig deep
05:20stainJoy of Clojure is good, but not as a first book!
05:33arglist_und_wilkMist.
05:36kralsome of the examples of The Joy of Clojure are misleading
05:36kralyesterday I was reading it, trying some example
05:36kral(def *test* \a) gives me a warning
05:37kralthen I discovered ^:dynamic
05:37stainyes, the book is pre 1.3 style :(
05:37staingood the warning message gets you straight onto the right track
05:37kralit stills to be a great book, anyway
05:37kralstain: sure
05:37RaynesThe book was written pre-1.3.
05:38wingythey should update it for each clj version and release an updated ebook
05:38RaynesThe examples, when written, were not at all misleading.
05:38_nmmnagree that its great book, maybe there are some editions planned for post 1.3 style hmm
05:38wingythings in programming world change so fast .. they need to iterate as well in docs
05:39_nmmnwell depends, dont think cobol docs changed much in last decade =]]]
05:39wingya waste if 90% of the things in a book is still valid but people choose the most up to date book to read since it will be 100% correct
05:40kralanyway, for a newbie, it can be quite discouraging when an example "fails"
05:40wingyyepp
05:40wingyreading programming clojure atm and they use defstruct
05:40stainyeah. But then this makes you learn the other side - reading the API docs (still horrible), etc.
05:40_nmmnif its easy example i think newbie gets even more info
05:40wingya good thing i know its deprecated
05:41_nmmnand its not kind of book read-follow-forget, i prefer books that make you think learn and know =]
05:42kraldefstruct is deprecated?
05:42RaynesYes. Records are better.
05:42kraloh, sure
06:04wingyi guess that a function can be considered a value since it could be bound to a var. could one say that a function is data then?
06:06wingyor should one separate data (eg. numbers, strings etc) from functions
06:28clgvRaynes: hey Raynes. you are in the 4clojure "business" right?
06:38Raynesclgv: I guess.
06:38RaynesWhat's up?
06:39clgvRaynes: I have a problem with my solutions for two problems timing out although one runs in less than 700ms for all tests and the other consumes only less than 30ms for all tests on my machine
06:40clgvRaynes: posted it here: http://groups.google.com/group/4clojure/browse_thread/thread/f43d0acbbc22a1bc
06:40RaynesAll of the code given to 4Clojure runs through a sandbox. Some code takes significantly longer in the sandbox. We're not entirely sure why or how to fix it.
06:41clgvI guessed something like that.
06:41RaynesUsually you can just write the solution differently and fix it.
06:41RaynesIt's a pain in the ass.
06:42clgvthats difficult without feedback how long each test took and what the timeout for each test is
06:54alexyakushevDoes anyone uses Org-mode for Github wiki pages/readmes?
06:54alexyakushev*use
06:55pyralexyakushev: i do
06:56alexyakushevpyr: I'd like to write some text in superscript but ^ is not working
06:57alexyakushevpyr: Any ideas how those can be done?
06:57pyrah nope, i only pushed very basic outlines
06:57pyrthe more complicated stuff i generate with o-blog
06:58alexyakushevI see. Well, perhaps I would be better without them. Thanks for responding
07:26pyrschani: clojurec is very exciting
07:27schanipyr: thanks. that's why i started it ;-)
07:30piotr_hi
07:30piotr_Do you know who is maintaining the clojure cheat sheet? There's a dead link in it...
07:32piotr_The problem is with the dotdot operator. The problem is more on the ClojureDocs side in fact...
07:33wingyto answer my own question: fn is not data
07:33wingybut they are both values
07:38clgvwingy: LISP => Code is Data and Data is Code
07:40tickingclgv, in good old lisps yes, in clojure only with heavy restrictions
07:41clgvI didn't encounter that heavy restrictions yet
07:41kmicuticking: can you give an example? :)
07:42tickingCode => mostly Data but Data =|=> Code
07:42tickingthe problem is that java shines too to much for this to truly work
07:43kmicuticking: but can you give an real example, wich part of clojure code is not a clojure data? :)
07:43tickingkmicu, seen picolisp?
07:43clgvI would say: Code => Data, Compiled Functions != Data
07:44tickingclgv, yeah but in good old lisps there is no such concept
07:45clgvif I remember correctly, you cant access the code of a compiled function in sbcl either...
07:46unnalinope, sbcl compiles to native
07:47unnaliclisp too
07:47unnalimost CLs, I guess.
07:49tickingunnali, i wouldnt call sbcl that classic either ^^ but the compilation process is rather transparent
07:49tickingbut yeah the only lisp I know of where data is truly code and code is truly data is picolisp^^
07:56wingyhow do i use clojure contrib namespaces in my lein project? eg http://clojuredocs.org/clojure_contrib/clojure.contrib.repl-utils/show
07:57clgvwingy: you must not - it is deprecated
07:57wingyclgv: all contrib libs are deprecated?
07:57wingyor have they been moved somewhere?
07:58clgvyes. a lot of them were replaced by single libs that are still maintained
07:58clgv~contrib
07:58clojurebotMonolithic clojure.contrib has been split up in favor of smaller, actually-maintained libs. Transition notes here: http://dev.clojure.org/display/design/Where+Did+Clojure.Contrib+Go
07:59clgvwingy: in fact, some of the namespaces in contrib will not compile with clojure 1.3/1.4
08:02wingywouldn't it be a good idea to not list the contrib lib functions in the search results in clojure docs?
08:03clgvwingy: I have no idea who is in charge for clojuredocs ;)
08:06michaelr525wingy: there is a lot of good stuff in the old contrib. sometimes i just copy/paste functions from there
08:07clgvmichaelr525: I miss clojure.contrib.repl-utils/show
08:11wingyit seems that different sources are describing forms differently
08:11wingyis form the function call itself with fn and its args or any evaluation?
08:12babilenHow can I add two lines (one at the start and one at the end) to an input-stream? (I essentially need to read files and add a string at the beginning and at the end). I am currently using something like https://www.refheap.com/paste/3522 but think that it is ugly. Can you think of something better?
08:12wingyeg. 1. (fn arg1 arg2) 2. [1 2] .. which one is a form?
08:12wingyfrom Programming Clojure: "A vector of numbers is another kind of form."
08:13wingyhe even says "Numeric literals are forms." .. 1 2 3 etc
08:18wingybut then some people say that form is a S-expression that is a valid fn call
08:20clgvwingy: the [...] brackets are just syntactic sugar for (vector ...)
08:20unnaliwingy: http://stackoverflow.com/questions/2877371/definition-of-lisp-form
08:21clgvunnali: lol in short everything in round brackets ;)
08:23clgvwingy: so why splitting hairs - are you learning for a theoretical exam?
08:23unnaliand then some :)
08:23wingyclgv: i just hate when i dont understand
08:24wingyok lets say its just an expression that is valid
08:26clgvwingy: well, just distinguish between "form" and "valid form"
08:26wingyform has to be valid?
08:26wingy(1 2 3) is not a form
08:26lucianwingy: i think a form is a data structure that can be evaluated as a program
08:26wingyyeah
08:26wingy1 is a data structure .. it can be evaled .. 1 will be returned
08:26madsywingy: Think of why (1 2 3) isn't a valid form. What happens when you call 1?
08:27wingy(fn 1 2) as well
08:27wingy"Forms such as +, concat, and java.lang.String are called symbols and
08:27wingyare used to name things."
08:27wingyin this case the forms he is referring to is symbols that are evaled to the values of the vars they are naming
08:27wingymadsy: hmm
08:28wingyi just know it wont work since 1 is not a fn
08:28luciandoes it matter?
08:28wingyyeah
08:28clgvwell I think those sentences are meant to explain to you what the author will call "form" thrroughout the book
08:28madsywingy: In a way 1 is a function. It evaluates to itself.
08:28wingyknowledge matters :)
08:28madsyHence it is a unary function.
08:28madsySame with strings and keywords
08:28gfredericksmadsy: wat
08:28michaelr525watwat
08:29madsygfredericks: I said you can think of it like that. Not that it literally is a function.
08:29gfredericksmadsy: I just can't see why that's helpful
08:30gfredericksmaybe "function call" instead of "function"
08:30madsygfredericks: Yeah, okay.
08:30gfrederickssince ("foo") won't work
08:30gfredericksmichaelr525: what kind of certificate were we talking about
08:31madsygfredericks: right
08:32wingyi think i get it .. form is simply a data structure that can be evaled
08:32wingy(1 2 3) is a data structure when read into memory, but not a form
08:32AWizzArdwingy: a form is something that you intend to evaluate.
08:32wingywii
08:32clgvwell you can do ##(eval '+)
08:32lazybotjava.lang.SecurityException: You tripped the alarm! eval is bad!
08:32clgvlol not in the sandbox ;)
08:32clgv&+
08:32lazybot⇒ #<core$_PLUS_ clojure.core$_PLUS_@1ca18e9>
08:33wingyyeah + is a form
08:33AWizzArdA type hint is not a form, as you don’t want to evaluate it. But a type hint is an expression, like everything else.
08:33gfrederickstype hints can't be read on their own
08:33michaelr525gfredericks: ssl?
08:34gfredericksmichaelr525: don't they serve the function of ensuring there aren't two certs for the same domain?
08:34michaelr525gfredericks: hmm.. didn't know that
08:35gfredericksmichaelr525: how else do the clients know that they're connecting to your site?
08:36michaelr525gfredericks: that's why i thought it isn't worth the money, but if you say that they issue only one cert per domain maybe it is :)
08:36rabblerI have a really, really stupid Lisp/Clojure design decision to ask…. Why can't primitive types (integral, float strings and such) just resolve to themselves, such as symbols? Why can't everything be a function? Again, this is just a design question. Seems strange to me that we have to differentiate these from functions. But, I must be missing something important.
08:36gfredericksmichaelr525: everything about "you connecting to your bank" can be easily faked by e.g.. your ISP except for the cert part
08:37clgvrabbler: what use would that have? do you want to build a herbrandt universe? ;)
08:37michaelr525i see..
08:37michaelr525gfredericks: well i feel a bit safer now.. thanks :)
08:37gfredericksmichaelr525: probably "one per domain" isn't even all that important; more important is only issueing them to the domain owner
08:38rabblerJust a silly question. If I have a function, which takes another function that expects that function to return, lets say an Int, why can't I just pass an int to test. That int would just be treated as a function and return itself.
08:38gfredericks"one per domain" might not even be true...
08:39clgvrabbler: you can create such a function via e.g. (constantly 1)
08:40clgvgfredericks: subdomains should be possible
08:40rabblertrue, but I have to create such a function. Why not treat them the same? Again, just a question.
08:41rabblerJust wondering why it would be bad.
08:41clgvrabbler: how would you distinguish when it shall be really used as a function and when not?
08:42rabblerit still has a type. Just as a map does. Right? It's early and I am on my first cup. I just popped on because this has been bugging' me.
08:42clgvrabbler: if it would always be a function you'll get performance issues since you always have to call it to get the value
08:43rabblerclgv:So, you think it's just a performance thing? Wouldn't the runtime be able to deal with this once it's compiled and sees that the value in it is static?
08:44rabblerclgv: Sorry for all the silly questions. Just something I was wondering.
08:45clgvrabbler: most of the time you want to use those constants as constants - I think that's a reason as well. if not there is `constantly`
08:45rabblerclgv: I'm not clojure/lisp expert. I've been to two clojure-conj and still don't use it. Grrr. No iOS version. ;-)
08:45rabblerclgv: Thanks for the info.
08:46clgvrabbler: you want to program clojure on an iOS device?
08:46algalclgv: who doesn't ? :)
08:46rabblerclgv: I thought we'd want to program clojure on everything?
08:46rabblerclgv: Though, not really.
08:46clgvI'd stick to something with a keyboard and a mouse ;)
08:46rabblerclgv:It's just what I have been doing for 6 months and I miss messing with clojure.
08:47bordatouehello, could anyone tell me how i can pass string than need to re-find function
08:47clgvrabbler: programming on a tablet?
08:47rabblerclgv: No, writing iOS software. Using Xcode, on a Mac. You know.
08:48bordatoueokay, sorry for being stupid , i need to pass a string to re-find however # symbol keeps getting in the way
08:48bordatoueis there any way to do it .
08:48clgvrabbler: lol, right. hmm they are working on android though, GSoC project afair
08:48rabblerclgv:But, I've offloaded all server-side work to java devs. Some want to try to use clojure, badly! But, darned management. We have to sneak it in and show that it worked. You know how it is.
08:53unnalibordatoue: how do you mean by "getting in the way"?
08:53bordatoueunnali: the # symbol is being converted to string so this doesn't work
08:53unnalibordatoue: could you show me an example? I'm not entirely sure I'm on the same page as you.
08:53bordatoueunnali: all i need to do is to pass an argument that prefix # in such a way that # is not a string
08:54bordatoueunnali: for example (re-find #<something> [col]) ; how do i pass something as an argument
08:54unnalioh, right.
08:55clgvbordatoue: re-pattern
08:55unnali#"blah" is a reader macro to compile a java.util.regex.Pattern .. so there should be one to create such a thing from the string?
08:55unnali^
08:55unnalibordatoue: per clgv's advice, (re-find (re-pattern <something>) [col])
08:56bordatoueunnali: # is implemented as re-patter
08:57unnaliuh.. yes.
08:57bordatouehow did you find that # was implemented as re-pattern
08:57unnaliclgv said so.
08:57clgv&(doc re-pattern)
08:57lazybot⇒ "([s]); Returns an instance of java.util.regex.Pattern, for use, e.g. in re-matcher."
08:57bordatoueis there any other way to know about these things
08:58unnalibordatoue: search the API docs I guess?
08:58clgv$findfn "bla" #"bla"
08:58lazybot[]
08:58clgvoh he cant do that :/
08:58unnalibordatoue: http://clojure.github.com/clojure/ and look for functions starting with "re-" is a good start.
08:59bordatoueunnali: i can find docs , but i need to understand the association of reader macros with the actual fn names
08:59unnalithat's probably only defined in the clojure source
08:59clgvbordatoue: books are good for that ^^
08:59bordatouenice one
09:00unnalibordatoue: https://github.com/clojure/clojure/blob/master/src/jvm/clojure/lang/LispReader.java#L100
09:01unnali'#' causes delegation to a DispatchReader()
09:01unnalihttps://github.com/clojure/clojure/blob/master/src/jvm/clojure/lang/LispReader.java#L105
09:01unnaliand '"' in turn causes delegation to a RegexReader()
09:01unnalihence #" starts reading a regex in.
09:01unnalihttps://github.com/clojure/clojure/blob/master/src/jvm/clojure/lang/LispReader.java#L422
09:01bordatouecan we not use source
09:01bordatoueto list the macros
09:01unnalibook vs. source, if they disagree, who wins? ;-)
09:02bordatoue(source #) would that work
09:02unnalino
09:02unnalireader macros are not first-class
09:02unnalithey're defined here in LispReader.java, as you can see
09:02unnalithat's not necessarily introspectable (I haven't looked that far)
09:02unnaliand besides, the source is java, not clojure
09:02bordatouealright
09:02bordatouethanks very much
09:04unnalinp!
09:13gfredericksclgv: oh certainly, I didn't intend to exclude subdomains
09:21jsabeaudryIs sandbar the best library when it come to authentication for a web server written in clojure?
09:22clgvjsabeaudry: there is chas' "friend" library which he actively develops
09:23kmicujsabeaudry: https://github.com/cemerick/friend/
09:25jsabeaudryclgv, kmicu, thanks!
09:31bordatoueis there any python equivalent of string[:-1] in clojure
09:31foxdonut /leave #clojure
09:32jsabeaudryI love the quotations (and the inspirations) for library names like friend and leiningen, great stuff
09:35bordatoueis there any python equivalent of string[:-1] in clojure
09:35mtkoanwhat does string[:-1] do in python
09:35unnalibordatoue: what have you tried?
09:36clgvbordatoue: (->> s count dec (nth s))
09:36bordatoue(nth "string" idx)
09:36bordatoue(butlast
09:36bordatoue(butlast string)
09:36unnali,(drop-last "xyz")
09:36clojurebot(\x \y)
09:36clgvthen use butlast ^^
09:36bordatoueproblem is they return character sequence not a string
09:36unnalithen use str after!
09:36foxdonutapply str
09:37unnali,(apply str (drop-last "great string"))
09:37clojurebot"great strin"
09:37bordatoueso what about the performance
09:37unnaliso what about the performance ;-)
09:37clgvbordatoue: for performance you have to use stringbuilder or similar anyway
09:37bordatouedoesn't it matter to keep on calling serveral fns to attain a simple task
09:37llasram&(let [s "examples"] (->> s count dec (subs s 0)))
09:37lazybot⇒ "example"
09:38bordatoueokay, subs based on string builder
09:38unnalibordatoue: pick the clean solution first, profile and optimise later
09:38llasramI do wish the Clojure index-taking functions would accept negative indices as counting from the end where sensible
09:39bordatoueexactly llasram
09:40bordatoueunnali: i think we should write clean code from the start not just writing some ting that involves multiple invokataion to attain a simple task of creating a substring
09:40unnali^ not that it would help perf-wise.
09:40bordatouein python its "string"[:-1] thats it
09:40unnalijust because python does it with one invocation, it doesn't mean any other language can necessarily do that
09:40unnaliif the building block isn't there for you already, then that's it, you'll have to make your own.
09:40unnaliit's idiomatic to treat strings as seqs.
09:41unnalibut I mean, heck.
09:41lucianbordatoue: python's slicing isn't necessarily more efficient than function calls in clojure
09:41unnali^^^
09:41lucianand getting back a seq is meh
09:41luciannot really a problem either way
09:42lucianperhaps strings should act as seqs without becoming something else
09:42lucianbut it's not a big deal imo
09:42unnali,(let [str "Blah blah"] (.substring str 0 (dec (count str))))
09:42clojurebot"Blah bla"
09:42unnalihardly better than llasram's example before, but whatever.
09:43clgv`subs` is definitely the way to go here, though ;)
09:43lucianbut yeah, i also wish negative indices did something meaningful in more places
09:43unnalifor sure :)
09:43luciani think it's a nice small feature of python
09:43unnaliditto ruby, it's nice and makes sense
09:43solussd_it's a feature that you could add to [your] clojure [library] as a one-liner though, so just do it. :)
09:44lucianand it only eats into behaviour that is in fact an error, too
09:44luciansolussd_: but not all clojure funcs will support it magically
09:44solussd_what clojure functions would need to support it?
09:44solussd_outside of what you write
09:45lucianindexing vectors, for example
09:45lucian&([0 1 2] -1)
09:45lazybotjava.lang.IndexOutOfBoundsException
09:46clgv&((subvec [0 1 2 3 4 :evil] 0 2) 5)
09:46lazybotjava.lang.IndexOutOfBoundsException
09:46clgvah that one got fixed :)
09:46solussd_ooh ok.. you want that behavior everywhere
09:47solussd_;)
09:47Iceland_wordMaybe something like ([:-3] "string") ;)
09:47luciansolussd_: i think it might be nice
09:47solussd_i agree
09:47clgv&((subvec [0 1 2 3 4 :evil] 2) -1)
09:47lazybot⇒ 1
09:47clgvor not :P
09:48clgv&(clojure-version)
09:48lazybot⇒ "1.4.0"
09:48jweissanyone know what might be wrong when emacs slime-connect says it connects, but no slime repl buffer appears? clojure-jack in works just fine
09:49solussd_jweiss: have you verified it isn't in your buffer list (even though it doesnt appear)?
09:49jweisssolussd_: yeah, it's not there
09:55jsabeaudryjweiss, any clue in the *swank* buffer?
09:58bordatouewould it be possible to pass #{somevalues} as an argument to the main method
09:58bordatouebasically I would like to pass clojure set as an argument to -main fn from cmd line
10:00ohpauleezbordatoue: You can pick off the cmd args you want, and put them into a set
10:00ohpauleezor
10:00ohpauleeztake the first arg and pass it to read-string
10:00ohpauleezand it'll return a set
10:01jweissjsabeaudry: hm, all that's in there now is the output from clojure-jack-in. what's interesting is after i ran clojure-jack-in, and doing sayoonara, slime-connect now works normally.
10:02jweissso clojure-jack-in must be initializing something in slime that i need to do in my emacs init file
10:07locojay1hi if i want to import a local api project is the right way to do it lein install and then use lein local repo to install produced jar file to m2 repo? or is there a better way
10:09clgvlocojay1: lein install should work fine
10:10clgvI use it all the time
10:10locojay1k thanks
10:13locojay1if i plan to opensource and upload to github is there any other step involved (repo server?) so others don't need to clone and install first. will do so research
10:22clgvlocojay1: if you publish, you can upload your jars to clojars
10:27locojay1clgv: thanks
10:52mtkoanJust upgraded emacs24, now when compiling with swank-clojure, if there is an error in a file, the compilation error isn't reported correctly
10:53mtkoanjust prints: error in process filter: symbols function defintion is void: cl-set-getf
10:53mtkoanhappen to anyone else?
11:09bordatoueif i create a clj file with a -main fn would I be able to pass #{} clojure set as an argument to the clojure main fn , I don't know if it will be possible as all the argument to the main method in java is type String
11:10bordatouecan anyone please suggest
11:11jsabeaudrybordatoue, I beleive ohpaulesz had a pretty good suggestion the last time you asked the question
11:16bordatouejsabeaudry: well, I didn't understand what he meant, by putting cmds in a set. Wont the main method in java accepts a string array
11:17bordatouehello
11:18jsabeaudrybordatoue, From my limited experience, the main function in all languages accept a string array. What he suggested is how to transform a string in a clojure data structure, "read-string"
11:20bordatoueusing read-string, thanks. So why doesn't repl require a readstring
11:20clgvbordatoue: why would you want to put something in a main function?
11:20jsabeaudrybordatoue, the R in repl is about that part
11:21bordatoueso it is not a good env to test your functions then
11:22jsabeaudryit is a great environment to test your functions
11:22jsabeaudryjust not your "-main"
11:23clgvbordatoue: you should test your functions in a REPL ...
11:23bordatoueokay, so how do i add a local jar file to the classpath in lein if i manually copy something to lib it is still not picking it up ,
11:23bordatoueclgv: testing in REPL is what ihave done, i came acrross this special case for -main
11:24bordatouei wanted to pass few arguments to the main function
11:24clgvbordatoue: ideally your -main method only contains task selection code
11:24nDuffbordatoue: ...if you're doing it right, your -main is so trivial as to be obviously correct, and all the logic goes somewhere else that's easier to test.
11:25clgvI'll test my main via (-main "-E" "bla" "-R" "blubb"), well I have a convenience macro to just write (main -E bla -R blubb) ;)
11:25bordatoueclgv: nDuff there should be a entry point in the code to pass some arguments , is there any properties in clojure similar to java -D options
11:26clgvsee above ^^
11:26nDuffbordatoue: ...well, you can certainly access Java properties from Clojure.
11:26bordatouein my case i wanted to test something so (-main #{no no2 })
11:30clgvbordatoue: how do you provide that to your jarfile from commandline?
11:36jsabeaudrybordatoue, your main function needs to receive strings because that is what your OS will give it. If you find an OS that will pass clojure data structures to your main, then you will be able to do what you want to do
11:37jsabeaudrybordatoue, until then, if you want the strings to be clojure data structures, you need to perform the conversion yourself, possibly using read-string
11:47bordatouethis works in repl breaks from cmd
11:48clgvbordatoue: erm what?
11:48bordatoueclgv: just not getting anywhere
11:48bordatoueokay, in lein how do i add a local .jar file to the classpath
11:48clgvbordatoue: from cmd you can ONLY pass STRINGS to a program.
11:48bordatouei copied .jar to lib directory and still it didn't pick up
11:48TimMcbordatoue: Of course it will work from the REPL, you can pass anything in there.
11:49clgvbordatoue: restart your repl - then it works
11:49bordatoueclgv: TimMc is there any equivalent of python keywords in clojure
11:49TimMcYou mean, named arguments? Not really.
11:50bordatoueyes
11:50bordatoueokays forget the string , i do understand now. thanks/
11:50bordatouetell me how do i add a local jar file in lein classpath
11:51clgvbordatoue: putting it in the lib folder works. just restart that repl
11:51bordatoueclgv: are you sure about it , so if i do a uberjar will it work
11:52clgvbordatoue: no. because you have to disable auto-clean of the lib folder which uberjar will do otherwise.
11:52clgvhave a look at the sample-project-clj
11:53bordatouethanks, and how do i disable this auto-clean hopefully it must be something in the project.clj file
11:53bordatoueclgv: i can goolge that one
11:57ToxicFrog,(let [test-kwargs (fn [x y & args] (let [kwargs (apply hash-map args)] (println x y kwargs))] (test-kwargs "one" "two" :foo true :bar false :baz []))
11:57clojurebot#<ExecutionException java.util.concurrent.ExecutionException: java.lang.RuntimeException: Unmatched delimiter: ]>
11:58TimMcbordatoue: Down that road madness lies.
11:58TimMc~repeatability
11:58clojurebotrepeatability is crucial for builds, see https://github.com/technomancy/leiningen/wiki/Repeatability
11:59ToxicFrog,(let [test-kwargs (fn [x y & args] (let [kwargs (apply hash-map args)] (println x y kwargs)))] (test-kwargs "one" "two" :foo true :bar false :baz []))
11:59clojurebotone two {:foo true, :bar false, :baz []}
11:59ToxicFrogThere you go, named arguments.
12:00clgvToxicFrog: it can be much nicer with the "clojure.options" library
12:00ToxicFrogThe API doesn't list that library.
12:02TimMcToxicFrog: And then everyone who wants to use 'apply with that will hate you.
12:02ToxicFrogTimMc: why?
12:02clgvToxicFrog: https://github.com/guv/clojure.options
12:02TimMcToxicFrog: Go ahead, combine test-kwargs with {"one" "two", :foo true, :bar false, :baz []}
12:03TimMcIt's surprisingly common and surprisingly irritating.
12:03ToxicFrog,(let [test-kwargs (fn [x y & args] (let [kwargs (apply hash-map args)] (println x y kwargs)))] (test-kwargs {"one" "two", :foo true, :bar false, :baz []})
12:03clojurebot#<ExecutionException java.util.concurrent.ExecutionException: java.lang.RuntimeException: EOF while reading>
12:04ToxicFrog,(let [test-kwargs (fn [x y & args] (let [kwargs (apply hash-map args)] (println x y kwargs)))] (test-kwargs {"one" "two", :foo true, :bar false, :baz []}))
12:04clojurebot#<ArityException clojure.lang.ArityException: Wrong number of args (1) passed to: sandbox$eval103$test-kwargs>
12:04TimMcIf you think you need kwargs, you should probably just accept an options map at the end.
12:04ToxicFrogWhy is the above result meant to be surprising?
12:04TimMcIt's not. It just shows that the standard tool for the job, 'apply, can't be used here.
12:05TimMcAnd that pisses people off.
12:05ToxicFrogWhy can't apply be used there?
12:06TimMc&(apply (fn [& args] args) {:a 1 :b 2})
12:06lazybot⇒ ([:a 1] [:b 2])
12:06TimMc&(apply (fn [& args] args) [:a 1 :b 2])
12:06lazybot⇒ (:a 1 :b 2)
12:07ToxicFrogAah.
12:07ToxicFrogSo it's not that you can't use apply, it's that you can't pass in an options map (with or without apply)
12:08clgvTimMc: well it's said that you should not pass options as a map. when ever you want named options they shall be passed without additional "{}"
12:08TimMcToxicFrog: No, it's that you can't apply an options map.
12:09TimMcclgv: I don't care what the clojure core style guide says.
12:09TimMcI mean, most of that document is pretty reasonable, but that suggestion is misguided.
12:10clgvTimMc: For the cases of passing options from function to function with added documentation I wrote clojure.options ;)
12:11clgvfor all other cases I do not want to add additional {}
12:13locojay1whein i use lein run install of java -jar i keep on getting output to stdout. example : upload sequence to mongodb via monger will keep on outputing the writeresult. anyway to prevent this witout redirecting when using lein run
12:14antares_locojay1: lein run install of java -jar?
12:14antares_if you use tools.logging or timbre and make your application to log to a file or elsewhere, it will
12:14antares_leiningen does not control that
12:15locojay1sry i meant lein run instead of java -jar
12:15antares_locojay1: can you paste the output?
12:17locojay1will get {"$oid":"4ffb02f0c0126262551793277b"},"n":1, "connectionId": 64, "wtime"0, "err":null,"of":1.0} for each elem in sequence im updating (so allot of output)
12:20antares_locojay1: this means you probably have println somewhere
12:20antares_as far as I know MongoDB Java driver does not log
12:20antares_monger definitely does not
12:25locojay1https://gist.github.com/3077448
12:31ToxicFrogmthvedt: I've got a working lexer and parser now!
12:31ToxicFrogThe lack of error reporting in the parser is still a problem, though - I'm having to query the lexer to get a rough idea of where the error is
12:34wingyis it possible for 2 different vars to bind to one and the same value?
12:34jweiss,`(let [x 1] x)
12:34clojurebot(clojure.core/let [sandbox/x 1] sandbox/x)
12:34jweisshow do i avoid the x getting namespaced in the syntax quote? is there any other way besides using gensym?
12:35wingyjweiss: i thought you were answering my question :)
12:35jweissi tried doing postwalk/replace, but then that doesn't affect macros that expand into let
12:35jweisssorry :)
12:35jweisswingy: to answer your question can't you bind them both to a atom?
12:36S11001001,`(let [x# 1] x#) ; jweiss is this what you mean?
12:36clojurebot(clojure.core/let [x__53__auto__ 1] x__53__auto__)
12:36wingyjweiss: have no idea .. just a thought that came up in my head .. nm :)
12:36jweissS11001001: yeah, that *works* but part of the reason I'm using syntax quote is so the expression is more human-readable. those autogenned names are pretty ugly.
12:37S11001001jweiss: human-readable and avoiding capture don't go hand in hand, not without first-class bound/free variables in the forms (like scheme has) anyway
12:38jweissS11001001: i prefer risking capture
12:38jweissotherwise i have to explain to my users to always remember to put # at the end of their local variables or else it will not compile
12:38jweissor eval, rather
12:40wingyis ^ not valid anymore in clj for returning meta data?
12:40technomancyjweiss: are you writing an anaphoric macro?
12:40nickaugustso when I use (map my-func my-seq) the function calls are not fired until I read the returned seq? I have a map call that doesnt run unless I (println (map ...
12:40wingyi get "java.lang.RuntimeException: EOF while reading" when using ^object
12:41jweisstechnomancy: no, i'm trying out using quoted code for steps of funtional tests (and then evaling it to run the test)
12:41ToxicFrog,(cons [1 2] [3 4])
12:41clojurebot([1 2] 3 4)
12:41jweissthe point being that i want to preserve the original data
12:41technomancyjweiss: it's considered bad form to introduce implicit lexical bindings for callers; much better to let them pick the name for the local
12:42jweisstechnomancy: that's what i want to do.
12:42nickaugust(map #(+ % 3) [2 4 7])
12:42nickaugust,(map #(+ % 3) [2 4 7])
12:42clojurebot(5 7 10)
12:42technomancyjweiss: if the caller provides the name you don't need to set it in the syntax-quote
12:43jweisstechnomancy: my users are going to give my test harness syntax-quoted forms, and the test harness runs them. at this point they cannot use let without the reader gensym
12:43nickaugustis there a map function that calculates the results immedietly?
12:44ToxicFrognickaugust: (doall (map ...))
12:44nickaugustToxicFrog: thanks :)
12:44ToxicFrogIf you just want the side effects and not the resulting seq, use (dorun) instead
12:45nickaugustToxicFrog: perfect thanks!
12:45hiredmanhttp://news.ycombinator.com/item?id=4218820
12:45ToxicFrog(in particular, (dorun (range)) is an infinite loop and (doall (range)) is an OutOfMemoryException~)
12:47hiredman(I imagine dons is being sarcastic there)
12:47dnolenhiredman: :P
12:47technomancyjweiss: I don't think there's a good way to do that
12:48technomancywith syntax-quote
12:48jweisstechnomancy: i'm open to non-syntax quoted, but figured i'd need it for namespace resolution
12:49technomancynot if you can bind *ns*
12:51jweisstechnomancy: i probably can, but then what?
12:52jweissoh you mean pop it back out before eval?
12:57technomancyjust bind it to whatever ns has the values your form needs
13:04wingywhy would i want to use the :tag meta data to describe what data type is expected in a parameter? it doesn't seem that clj enforces type checking
13:05wingyeg. what good does this :tag meta data do: (defn #^{:tag String} shout [#^{:tag String} s] s)
13:07dakronewingy: :tag metadata is type-hinting
13:08foxdonut~CPOR
13:08clojurebotCPOR is Clojure Programming (O'Reilly): http://www.clojurebook.com
13:09ToxicFrogdakrone: right, but what actual effect does the type-hinting have?
13:09dakroneToxicFrog: http://clojure.org/java_interop#Java%20Interop-Type%20Hints
13:10ToxicFrogAah
13:11wingyfoxdonut: lol i actually ignored the java interop chapter in that book
13:11wingyperhaps i should read it :)
13:11wingydakrone: thx
13:11nDuffEasiest way to tell is to set the *warn-on-reflection* flag
13:11foxdonutwingy: :-)
13:11nDuffanywhere that doesn't generate a warning, type hinting is unnecessary/useless.
13:11nDuff(and it's not necessarily best placed at the warning site, either -- if putting it somewhere else allows inference...)
14:03dustingetzdnolen: i see a clojuescript branch "ext-js-sample" as well as an issue "CLJS-54 Create a sample cljs app that uses an external JavaScript library" (which is resolved) http://dev.clojure.org/jira/browse/CLJS-54
14:04dustingetzi already have from hackerschool i functional sencha/extjs sample app
14:04dustingetzis this something i can just slam in as a new sample, tag it against cljs-54, and submit a pul req? is that valuable and likely to be accepted?
14:04dnolendustingetz: at this point probably not.
14:04dustingetzcool, glad i asked haha
14:05dnolendustingetz: also, CLJS doesn't take pull requests, only patches via JIRA
14:05dustingetzsure, we'll get all that figured out
14:05dustingetzi dunno if you talked to sonali, its "open source week" at hackerschool. six of us looking at cljs issues right now
14:05dustingetzwe just started
14:06dnolendustingetz: I take it you all are you looking for low hanging fruit?
14:06dustingetzyeah, we think we can handle the docstring issue
14:06dustingetzmight take a whack at it today and see what we come up with
14:07dnolendustingetz: the docstring issue and related REPL things are not as simple as they seem (though not overly complex either)
14:07dustingetzyeah, the related repl stuff (from your email to Alan a month ago) would be a next step, but unlikely we can contribute something significant in a week
14:08brainproxydnolen: I acquired an introductory prolog book last night :) but it doesn't recommend one runtime over another; do you recommend swi prolog or gnu prolog?
14:08dustingetzwe spent a couple days looking at cljs internals last month, we may have a shot at the docstring issue
14:08dustingetzcan you point us to other low hanging fruit issues ? we're skimming the jira now
14:08foxdonutbrainproxy: which book is that?
14:09dnolendustingetz: a simple docstring fix would be welcome and welcome.
14:09brainproxydnolen: this one http://www.springer.com/computer/swe/book/978-1-85233-938-8
14:10brainproxydnolen: i researched various intro books, and liked the fact that one can be purchased as a DRM free pdf
14:10brainproxyeventually I'd like to get the AI prolog book you recommended
14:10dnolendustingetz: hmm nothing jumps out at me.
14:10brainproxybut this one will be my starter
14:12dnolenbrainproxy: I'm not familiar that one. SWI-Prolog works well and has an active community.
14:12oskarth_dnolen: would writing marginalia docs for the source code be desirable?
14:12dnolenoskarth_: not really.
14:12brainproxydnolen: okay, then I'll go w/ swi for starters
14:17dnolenoskarth_: dustingetz: to be honest if you all way to contribute I recommend first reading and playing around with the analyzer and compiler sources. More than happy to answer specific questions.
14:18dustingetzthanks, yeah, we agree
14:21oskarth_roger, thanks
14:45jsabeaudryAre people using 1.4 in production?
14:46gfredericksjsabeaudry: I am
14:46jsabeaudrygfredericks, so far so good?
14:46gfrederickssurely
14:46gfredericksI'm not using anything 1.4 specific, I just wanted to postpone library issues as far into the future as possible
14:46jsabeaudrygreat, I'll give it a spin then
14:47hiredmansonian skipped 1.3 (too many issues) right to 1.4 from 1.2
14:51jsabeaudrypretty agressive liveperson on the sonian website :)
14:57hiredman:)
14:57hiredmanclojure is all the back end, so no point in looking at websites, etc
14:58gfredericksunless we have a mountain of emails and don't know what to do with them?
15:00amalloygeni skipped 1.3 to 1.4 also
15:01wingyfun performance comparison: https://gist.github.com/3078233
15:01hiredmangfredericks: sure, if you are interested as a customer, but if you are interested in clojure there isn't much to see
15:02wingyjust paste it into the repl .. reduce is 500 times slower :/
15:02wingybut more readable
15:03wingyi cant even get the second one .. would you still prefer using reduce for readability?
15:03amalloywingy: so try again with arrows: (-> (* n (inc n)) (/ 2))
15:04KirinDaveHey, if I do (dosync (pmap …))
15:04KirinDaveDoes that work the way I'd lexically expect it to?
15:04amalloyno
15:04KirinDaveFigured
15:04hiredmanyou're gonna have a bad time
15:05technomancydosync is the moral equivalent of dynamic scope
15:05KirinDaveSo each work unit in the pmap should establish its transaction internally?
15:05hiredmana. pmap is a mix of eager and lazy b. if you have a task where the runtime of the task dominates the over head of pmap you should *not* but it a transaction
15:05hiredmanput
15:05amalloytechnomancy: you seem to be saying it's not actually dynamic scope
15:06KirinDavehiredman: I have a really big structure I'd like to iterate within.
15:06amalloyit's not dynamic scoping of a variable, but it's dynamic scoping of a resource (the transaction)
15:06KirinDaveOkay, well easy enough to fix, I suppose.
15:06technomancyamalloy: right; I wouldn't use the word scope for something that's not reified
15:06KirinDaveJust put the dosync inside the pmap and get the master list outside in its own transaction.
15:06hiredman:(
15:06KirinDaveI suppose I could always use a readwritelock if this really causes consistency problems.
15:06technomancyor maybe you could use that word, but it would be a kind of pun
15:07hiredmanclojurebot: pmap?
15:07clojurebotexcusez-moi
15:07hiredmanclojurebot: pmap is not what you want
15:07clojurebotOk.
15:08amalloyi'm not sure i really understand what reified means in that context. is it just: something with a real existence manipulable by your program at runtime?
15:14TimMcEh, it's still scope, just not a var.
15:23ibdknoxMore useful instarepl! http://www.chris-granger.com/2012/07/09/light-table-playgrounds-level-up/
15:27dnolenibdknox: nice! when i try to run it seems to hang on "Waiting for server"
15:27ibdknoxhm
15:27ibdknoxweird
15:28RaynesUses a special version of Clojure?
15:28RaynesWhy is that?
15:28ibdknoxmetadata gets nuked and I needed more position info
15:28ibdknoxno reason those things can't make it into clojure proper, just haven't had the time to make that happen
15:28ibdknoxdnolen: ~/.lighttable/logs/server.log
15:29Raynesibdknox: So light table will end up not being compatible with < 1.5.0?
15:29ibdknoxdnolen: it might be that somehow the server didn't get started?
15:29RaynesAssuming your stuff even gets into 1.5.0.
15:29ibdknoxRaynes: no, it's a weird version that's actually 1.4.0
15:29ibdknoxoh
15:29ibdknoxsort of
15:29ibdknoxonly for the instarepl stuff
15:30ibdknoxshowing things flow through and whatnot
15:30ibdknoxcan't do that without position info :(
15:30RaynesSucks.
15:31ibdknoxRaynes: in theory I could fork the reader out
15:31ibdknoxand do it that way
15:31RaynesI'm not really complaining. Just seems strange.
15:31RaynesBut I get why it is necessary.
15:32amalloyibdknox: what do you mean by "metadata gets nuked"?
15:32ibdknoxamalloy: metadata in the symbol -> var transition disappears
15:33ibdknoxduring analysis
15:33dnolenibdknox: hmm, deleted light table, ran install commands from scratch - hangs on "starting server" in my terminal
15:34ibdknoxdnolen: it usually does that when there's a rogue server hanging out somewhere :( ps aux | grep -i lighttable and kill those
15:34wingyibdknox: i like the update notification
15:34ibdknoxdnolen: I'm trying to come up with a different packaging mechanism
15:34ibdknoxdnolen: hopefully next release :(
15:34ibdknoxI reallllllly wish javafx would work
15:34ibdknoxbut the webkit it uses is so incredibly slow it's not even an option
15:37dnolenibdknox: k killing rogue server allow terminal to start process "Server up!", but actual Light Table app frozen on "Waiting for server"
15:37scriptoron a fresh install of lein, trying to do lein new <something> is giving me:
15:37scriptorhttps://gist.github.com/3078433
15:38ibdknoxdnolen: ah, are you pressing cmd-r? I don't think that's hooked up on that page. If you open it in a new window does it work? How about in chrome can you get to http://localhost:8833/?
15:38scriptorany idea why it's trying to get the clojure 1.5 alpha?
15:38scriptorinstead of 1.4
15:39scriptorinstalled lein through homebrew, if that makes a difference
15:40foxdonut"--- Found a new version!" awesome :)
15:40dnolenibdknox: hmm neither things work
15:40ibdknoxdnolen: oh weird :(
15:40ibdknoxdnolen: did the server.log have anything in it?
15:40Raynesscriptor: Did you add lein-light?
15:40foxdonut./light: line 198: unexpected EOF while looking for matching `"'
15:40scriptorRaynes: yep
15:41foxdonut./light: line 200: syntax error: unexpected end of file
15:41Raynesscriptor: That's why it is trying to get 1.5.0
15:41scriptorah
15:41scriptorI had to create the profiles.clj file for it, so otherwise if I remove that it won't use 1.5?
15:41ibdknoxfoxdonut: yeah, after the update that should go away
15:41RaynesBut I'm pretty sure that's wrong.
15:41Raynesibdknox: Why is it trying to get clojure 1.5.0-alpha1 when you never pushed that jar?
15:42ibdknoxI haven't seen it do that
15:42ibdknoxRaynes: I have no idea
15:42pyrtsaHmm, so macros like "doc" don't quite work yet in Light Table? Despite that, this is looking really great!
15:42dnolenibdknox: Connected. Server started. CONNECTING: local
15:42RaynesWhy is everything broken today?
15:43foxdonutibdknox: then I get a "We seem to have lost that one." on http://localhost:8833/
15:43RaynesI bet even amalloy isn't working.
15:43technomancyRaynes: clojars was broken because stupid American date formatting made it look to an aussie like the cert expired in August.
15:43ibdknoxpyrtsa: yes they do, just do (use 'clojure.repl)
15:43wingyyeah I get "waiting for server" as well
15:43pyrtsaAh, thanks!
15:43Raynestechnomancy: Don't think that's the problem.
15:43ibdknoxdnolen: looking into it
15:43dnolenibdknox: I get that at :8833 as well. If I kill the light table app I get a rogue server that I have to kill at terminal.
15:43pyrtsaGreat!
15:44scriptoris lein-light on github?
15:44technomancyRaynes: of course it is; month-first sucks
15:45technomancyI mean the cause of the issues over the weekend
15:45gfrederickstechnomancy: I question your patriotism.
15:46RaynesHe hates aussies.
15:46RaynesBet he doesn't like kittens either/.
15:46wingyibdknox: also lein-light doesn't work: it cant find artifact
15:46ibdknoxwingy: what can't it find?
15:47RaynesLet me guess, clojure 1.5.0-alpha1.
15:47pbostrom_ibdknox: The following artifacts could not be resolved: lighttable.hub.clj:lighttable.hub.clj:jar:0.0.2, org.clojure:clojure:jar:1.5.0-ibdknox5: Could not find artifact lighttable.hub.clj:lighttable.hub.clj:jar:0.0.2 in central (http://repo1.maven.org/maven2)
15:47ibdknoxwtf
15:47seancorfieldibdknox: i was just about to report that same error
15:47wingyhttps://gist.github.com/3078481
15:47wingyibdknox: ^
15:47scriptoryep, that's what I'm getting
15:47Raynesibdknox: You've screwed up a project.clj somewhere.
15:47gfrederickswait do aussies use month-first?
15:47ibdknoxapparently
15:47gfredericksdon't americans also?
15:47gfredericksoh he wasn't talking to me
15:48gfredericksI knew my "always assume ibdknox is talking to you" policy would backfire eventually
15:48HodappAmericans often to month-first with dates.
15:49Hodappthat's very common when writing in full - as in July 9, 2012 - and often they'll just take that and turn 'July' to a number.
15:49Hodappnot that 7-9-12 is ambiguous or anything.
15:49gfrederickshaha
15:49scriptorthere's always the yyyymmdd format
15:50Hodappscriptor: that's what I use almost always
15:50foxdonutso that would be September 12, 2007 :)
15:51HodappNEVER FORGET
15:52amalloyi use yyyy-mm-dd in programs, and mm/dd/yy in real life. it's pretty terrible, i guess
15:52Raynesamalloy: Get out of my intenret.
15:52Raynesinternet too
15:53amalloysometimes just m/d/yy. i bet you feel dirty just reading that
15:53kmiculol
15:53Raynesamalloy: If you knew what I've been through with GEDCOM date parsing.
15:56locojay1python has a cool lib dateutil from dateutil.parser import parse as dateparser. dateparser(<string> , fuzzy=true) will convert any kind of format... Is there something simlar in clojure/java
15:59ibdknoxlein2 deps :tree isn't showing anything anyone else have a good way to debug rogue deps?
16:01amalloyibdknox: is the lein-light plugin source somewhere?
16:01amalloyit seems likely to me you're doing something naughty like modifying the project map when your plugin loads, rather than when it's invoked
16:01RaynesApparently brokeville.
16:04ibdknoxok
16:04ibdknoxfixed
16:04ibdknoxlein-light 0.0.3
16:04acagle(def ^:private uri1 "datomic:dev://localhost:4334/portland")
16:04acagle(def ^:private uri2 "datomic:mem://portland")
16:04Raynesibdknox: What was the problem?
16:04ibdknoxor if you want you can nuke the one in you ~/.m2
16:04ibdknoxI did something stupid
16:04ibdknoxchanged the name of the project
16:04RaynesWell, yeah, but what in particular? ;)
16:04RaynesHah
16:04ibdknoxbut it adds itself to the project map like amalloy said, and was using the old name
16:05amalloyoh wow, so i was close? i don't even know how to write a lein plugin
16:05scriptorso the fix is to change 0.0.2 to 0.0.3 in profiles.clj?
16:06ibdknoxyes
16:06RaynesThat always fixes my problems.
16:07scriptorhmm, still getting the same error :/
16:07Raynesibdknox: It isn't too late to quit programming and become a firefighter.
16:07amalloy*laugh*
16:08ibdknoxRaynes: seems like a reasonable decision
16:08scriptoribdknox: still getting errors saying it couldn't find the artifact clojure 1.5.0 in central or clojars
16:09ibdknoxscriptor: ah yeah. rm ~/.m2/repository/ibdknox ~/.m2/repository/lein-light
16:10foxdonuthmm, even downloading from scratch gives me "We seem to have lost that one" on localhost:8833
16:12wingyibdknox: http://pastebin.com/1k2TuHZX
16:12wingyeven though i changed version to 0.0.3
16:12LeNsTRI have the same problem (
16:12scriptoribdknox: removed those 2 directories, got the same error as wingy
16:13amalloyRaynes, technomancy: i'm about to make the big leap, guys. i'm pointing ~/bin/lein at lein2
16:13Raynesamalloy: Me moving protobuf/jiraph to lein 2 is the catalyst, right?
16:13amalloyyes
16:13amalloyyou are the hero
16:14ibdknoxooook
16:14ibdknoxonce more with feeling
16:14ibdknoxlein-light 0.0.4
16:15scriptorshould we rm /ibdknox and /lein-light again?
16:15ibdknoxyou shouldn't need to
16:15amalloyi'd rm everything ibdknox has ever written, just to be safe
16:16ibdknoxA wise call really.
16:16scriptorlet's rm ibdknox while we're at it
16:16scriptorback him up first, of course
16:16ibdknoxyou didn't -f
16:17wingyuse -r as well just in case
16:17wingyibdknox: it says "connected" but is idling
16:18amalloyjeez, i didn't mean to start a kill squad
16:18ibdknoxwingy: idling?
16:18wingyyeah nothing happens
16:18RaynesMeans he doesn't have the accelerator depressed.
16:19foxdonutneeds anti-depressants, then.
16:19LeNsTRit's work! ^^
16:19wingyibdknox: does it work for you?
16:19foxdonutLeNsTR: let's the goods time rolls!
16:19ibdknoxwingy: what are you expecting it to do?
16:20ibdknoxwingy: it's kind of like swank
16:20ibdknoxit should just start up :)
16:20ibdknoxthen you open light table and connect to it
16:20scriptoris there something I need to do to compile a clojure file if I've made changes after I connected?
16:20foxdonutibdknox: sorry everyone's bombarding you.. in my case it has nothing to do with the plugin, just plain server up and running but error message on web page
16:20wingyibdknox: ah
16:21wingy:)
16:2145PAAS8B6is there a way to have emacs code navigation, e.g. M-., on a project that doesn't use lein
16:21wingyibdknox: it says Waiting for server...
16:21dustingetz_me ^
16:21ibdknoxfoxdonut: kill your java processes and rm ~/.lighttable/ and start over
16:22ibdknoxI pushed an update that is my best guess as to why people are running into this
16:23wingymoment of truth
16:23scriptoribdknox: sorry for the dumb question, but how do I use it? I have manual mode enabled and trying to evaluate a function call to a function from core, but I'm not seeing anything
16:23ibdknoxif that doesn't work, what does going to http://localhost:8833 show?
16:24foxdonutibdknox: works, thank you!
16:24ibdknoxk
16:24ibdknoxgood to know
16:24foxdonutpoor guy
16:24foxdonutbombardment! bombardment!
16:24ibdknoxscriptor: what do you mean exactly? as in you pressed cmd-enter and nothing happened?
16:24scriptoribdknox:
16:24scriptorright
16:25ibdknoxwhat are you executing?
16:25foxdonutibdknox: "here it is, the update you've been waiting for, like the salivating dogs that you are..."
16:25scriptormy project's called tutor, and I have a function inside it called foo that just returns 2 + 3
16:25foxdonut(bonus points for recognizing the simpsons krusty-the-clown reference)
16:25scriptorso I have (tutor.core/foo) and shift-enter
16:25scriptorbut nothing shows up on the right side
16:25ibdknoxscriptor: hmm and you required tutor.core?
16:27SegFaultAX|work2Any vim users in here that use vimclojure: I'm having trouble with the indentation settings. If I type `(defroutes main-routes` and press enter, it indents to align with the m in `main-routes` instead of 2 spaces in.
16:27dnolenibdknox: sweet LT works again for me now.
16:28ibdknoxgood deal
16:28RaynesSegFaultAX|work2: let vimclojure#FuzzyIndent = 1
16:28RaynesPut that in your .vimrc.
16:29scriptoribdknox: I need (require '[tutor.core]) right?
16:29ibdknoxI have no idea how that could be different for people
16:29SegFaultAX|work2Raynes: Awesome, thanks mate.
16:29ibdknoxthe thing that was causing the issues was a filter to make sure only local requests came in
16:29scriptorat this point I'm fairly sure I'm just failing at writing clojure
16:29ibdknoxscriptor: yeah, that should be it
16:30technomancymy barista just called me "friendo" and I thought "wait, a logic programmer?"
16:30SegFaultAX|work2Raynes: That was it, thanks mate.
16:30scriptoribdknox: nope, still doesn't work, this is all the code: https://gist.github.com/3078705
16:30SegFaultAX|work2Raynes: Also, are you aware of any way to get syntax highlighting for custom macros?
16:31seancorfieldibdknox: fwiw, i'm happily running LT connected to my local worldsingles project and it's *HOT* so thanx for that update!
16:31scriptorinterestingly enough, if I change it to just (foo) I do get an error, but changing it back to (tutor.core/foo) and the error text is still there
16:31SegFaultAX|work2Raynes: Or even normal functions not included in clojure for that matter.
16:31scriptorRaynes: didn't know about FuzzyIndent, you just made vimclojure so much better for me
16:31technomancyseancorfield: is your work to make c.j.jdbc not require dynamic binding underway or is that still in the planning stage?
16:31ibdknoxscriptor: does anything show up at the bottom?
16:31seancorfieldscriptor: try (require '[tutor.core :as tc]) and (tc/foo)
16:31RaynesSegFaultAX|work2: No idea.
16:32scriptoribdknox: yep, tutor.core in red text
16:32seancorfieldtechnomancy: i'm incubating the new code in another project right now
16:32ibdknoxscriptor: ah
16:32ibdknoxscriptor: apparently that is the message of the exception O_o
16:32scriptorseancorfield: look through the files you have to install for vimclojure
16:32foxdonut(inc Raynes)
16:32ibdknoxscriptor: ok, that means you probably aren't connected to your project, in the bottom right open the menu
16:33ibdknoxscriptor: click connect and then select your project
16:33scriptorseancorfield: it won't be automatic, but you can manually add more keywords to highlight
16:33seancorfieldscriptor: why would i install vimclojure? :)
16:33ibdknoxseancorfield: yay it's working for someone!
16:33scriptorargh, wrong person
16:33scriptorSegFaultAX|work2: check the files you copy to install vimclojure, you can at least manually change the list of highlighted keywords, nothing automatic though :/
16:34ohpauleezibdknox: the only error I'm getting is a missing clj-stacktrace error, but I think that's an error on my part
16:34scriptoribdknox: nope, I think I was connected before and I just tried having it connect again, same issue
16:34ibdknoxhm
16:35scriptorseancorfield: just tried your suggestion, now getting:
16:35ibdknoxscriptor: not sure then :( It picks up all its classpath stuff from Lein, so it should be there as long as it's running in that project
16:35kotarakvimclojure issues?
16:35hyPiRionibdknox: It seems like some sort of documentation on this thing would be nice - people have questions and problems all over, and there's no real place where the questions and answers is placed.
16:35technomancyseancorfield: right; cool
16:36scriptoribdknox: getting a new error from seancorfield's suggestion, but this friggin might mouse is being a pain
16:36ibdknoxhyPiRion: as soon as the issues are fixed. Only have two hands :)
16:36kotarakSegFaultAX|work2: vimclojure issues?
16:36hyPiRionibdknox: Just my two cents. ;)
16:37kotarakSegFaultAX|work2: with a running backend you get automatic highlighting of required, used and aliased namespaces.
16:37kotarakSegFaultAX|work2: see vimclojure#DynamicHighlighting.
16:37scriptoribdknox: seancorfield: new error, this time with :as tc and (tc/foo) https://gist.github.com/3078737
16:38wingyibdknox: it has been on: --- Starting server... (this takes several seconds) forever .. and the cpu is idling .. i have reinstalled it but its still idling
16:38ibdknoxscriptor: apparently tutor.core has an error in it
16:38ibdknoxwingy: you have an old server running
16:38scriptoryes…yes it does
16:39ibdknoxwingy: kill you java processes and run it again, should be ok
16:39pandeirowas there a new release of lighttable?
16:40SegFaultAX|work2kotarak: Does that require nailgun to use?
16:40kotarakSegFaultAX|work2: yes
16:40foxdonutpandeiro: have you been living under a rock? it's been over 2000 seconds already!
16:41scriptoribdknox: it works!
16:41SegFaultAX|work2kotarak: Alright, well I was about to get that one up and running as well?
16:41SegFaultAX|work2I didn't main to make that a question. It's imperative. :)
16:41SegFaultAX|work2Mean. Man I can't type right now.
16:41pandeirofoxdonut:
16:41pandeirosorry, link?
16:42wingyibdknox: works fine
16:42pandeiroah nvm hackernews
16:42foxdonutpandeiro: http://www.chris-granger.com/2012/07/09/light-table-playgrounds-level-up/
16:42ibdknoxalrighty then
16:42ibdknoxI believe the issues are sorted out
16:42kotarakSegFaultAX|work2: There is lein-parsier for leiningen, and vimclojure/gradle for gradle
16:42ibdknoxthanks for bearing with me guys :)
16:42pandeiroweird, i went to chris' site and wasn't getting the new post
16:42kotarakSegFaultAX|work2: to start the backend server easily in your project.
16:42foxdonutpandeiro: but maybe just ./light table will auto update for you
16:42wingylove the "live off" feature already
16:43scriptoribdknox: thanks for bearing with my inability to write clojure :)
16:43kotarakSegFaultAX|work2: that should be lein-tarsier, can't type neither
16:44SegFaultAX|work2kotarak: Is using nailgun as a stand-alone in-vim REPL a supported use case? Or does it only make sense inside of a project?
16:44pandeirowow, looks like an enormous upgrade
16:45kotarakSegFaultAX|work2: I only use it inside a project, but vc itself doesn't care. Start the server manually as you like and it is good to go. Just make sure to get the classpath right.
16:45SegFaultAX|work2kotarak: Awesome, thanks.
16:46scriptoribdknox: is there a way for it to reload code after I've made changes in the project?
16:46ibdknox(require [..] :reload)
16:46sjlis there a way to provide a default implementation for a protocol method? Or must I always type out the same fn body every time if just one implementor might need something different?
16:46scriptorah, nice!
16:47ohpauleezibdknox: Working for me - I had to comment out all my clj-stacktrace stuff in my profile.clj
16:47ohpauleezTotally awesome stuff
16:48pandeiroright now light table is just doing jvm clojure, right? no js compilation?
16:48ohpauleezslj: are you in cljs or clj
16:49ibdknoxpandeiro: yeah, just JVM right now
16:50sjlohpauleez: clojure
16:50seancorfieldibdknox: it doesn't seem to recognize a top-level form like @foo - i have to either do (identity @foo) or (deref foo) - known issue?
16:50ohpauleezsjl: You can extend the protocol to Object
16:50ibdknoxseancorfield: ah yeah, it doesn't know how to do that yet
16:50ohpauleezwhich will provide a default implementation
16:50sjlohpauleez: that only works in an all-or-nothing wway, right?
16:51ohpauleezslj:Nope, it'll match specific extensions before it hits that one
16:52kotaraksjl: Use extend: (def your-defaults {:proto-fn (fn …)}) (extend YourType YourProtocol your-defaults)
16:53kotaraksjl: you can mix-in other functions (extend YourType YourProtocol (merge your-defaults {:overriden-proto-fn (fn …)}))
16:53sjlkotarak: ohpauleez: one sec, let me type out something and paste it
16:55SegFaultAX|work2Random question: Is clojure feasible on Android (yet)?
16:56scriptordoes vimclojure's fuzzy indent only work on def* and with-* names?
16:56kotarakscriptor: you can define your own patterns
16:56scriptorkotarak: right, just checking what comes out of the box
16:57pbostrom_ibdknox: my own $0.02: 1) it would be nice to have option to word-wrap output on right side instead of scrolling 2) It might not be that clojure-esqe, but if I want to de-reference an atom that has changed outside the light table scope, I have to exit live mode
16:57kotarakscriptor: that's basically what comes out of the box. def and with.
16:57RaynesSegFaultAX|work2: https://github.com/alexander-yakushev/lein-droid
16:57scriptorkotarak: ah, looks like let* also gets included
16:58kotarakscriptor: ah. indeed. The documentation contains a full list.
16:58kotarakscriptor: :help clojure
16:58sjlohpauleez: http://paste.stevelosh.com/4ffb45e5c5338c0007000000?clojure
17:00sjlkotarak: I think I can use bare extend and wrap a bit of sugar around it, thank you!
17:01ohpauleezsjl: Right, you don't want a default implementation, you just don't want to write the same code over and over again for you given types
17:01sjlohpauleez: yeah, that's what I meant by default but there's probably another word that's better
17:02ohpauleezusing raw extend is one way, or clojure.template if you felt really inclined
17:02kotarakslj; you always have to implement all functions of a protocol.
17:02seancorfieldibdknox: you need to update this page to show version 0.0.4 http://app.kodowa.com/playground/lein-light
17:02kotarakohpauleez slj extend should be the first guess. No need to overengineer stuff for extend-type which just expands to an extend.
17:02sjlkotarak: really? In the example I gave ohpauleez the Dog can speak just fine, even though I didn't define the other one
17:03kotaraksjl: but you wrote that in-location fails for the dog.
17:03ibdknoxseancorfield: pushing now, thanks
17:03ohpauleezkotarak: I agree
17:03sjlkotarak: in-location does fail. but speak works, even through I didn't implement thr full protocol
17:03scriptorI feel proud in having contributed to the creation of two entire lein-light versions
17:03scriptoreven if it was by whining
17:03foxdonuthehe
17:04kotaraksjl: yes. But in-location fails. If you want both to work, you have to implement them in the same extend.
17:04ohpauleezsjl: that's because you didn't implement the full protocol - that's why it failed, it has no method, because you didn't write one
17:04kotaraksjl: if you want default for the dog for in-location, you need extend+merge
17:04ohpauleezwhat kotarak said
17:04sjlkotarak: yeah, that "in the same extend" is what I'm trying to get around, and the bare extend + merge will let me do that
17:12jg(defmacro with-tokens [& body] `(let [tokens# (yaml/parse-string (slurp "tokens.yml")) {:keys [consumer_key access_key]} tokens#] (do ~@body)))
17:13jgcould someone explain what i'm doing wrong here?
17:13jgthe idea is to be able to write (with-tokens (print consumer_key))
17:13technomancyjg: consumer_key and access_key are locals
17:13technomancyso they need gensyms
17:14pydave6357Hey all. I'm running my project with lein run -m <project-name>.core, but the execution time is pretty slow, presumably because I'm starting the JVM each time. Is there any way to speed things up? Keeping the JVM running in the background perhaps?
17:14jgtechnomancy: but will i be able then to access them in ~@body ?
17:15technomancyjg: what you're trying to do is write an anaphoric macro, which is widely considered a bad idea
17:15technomancyyou want to accept the names of the locals as args to the macro
17:15technomancypydave6357: most people start a repl and work from there
17:16jjttjjsomewhat general question, but let's say I have have an entity "item" which corresponds to a db table, and I have an item model in my application. Some things, like a picture url, are not directly stored in the db, because they can be derived from the item's other attributes, config vars, etc. My question is, is it a bad idea to simply wrap the getters to tack on an extra k/v pair, eg, (assoc (first (select item)) :image-url
17:16jjttjj"www.site.com/blah.jpg"), or is it strictly better to have a seperate function (item->image-url [item])?
17:16pydave6357technomancy: I'll do likewise. Thank you.
17:19jgtechnomancy: okay i've written a macro accepting the names, it works. Still, i would be interested to know how to fix the posted code or if it's at all possible.
17:20haspakerHi
17:20haspakerMy function returns 0N
17:20haspakerAny knows what kind of value that is?
17:20haspaker*anyone
17:20technomancyjg: it's not possible to use :keys in syntax-quote
17:21hyPiRionhaspaker: ##(class 0N)
17:21lazybot⇒ clojure.lang.BigInt
17:21haspakerThanks
17:21uvtchaspaker: trailing "N" means arbitrary-precision decimal.
17:22hyPiRionuvtc: I think you're refering to M - ##(class 0.1M)
17:22lazybot⇒ java.math.BigDecimal
17:22hyPiRionAnd no problem, sir.
17:22haspakerSo what separates 0 from 0N? That the value is not certain to be 0, only close to it?
17:22uvtchyPiRion: ack. I meant arbitrary-precision int. Thanks.
17:23hyPiRionhaspaker: 0N means that the element is a BigInteger. In practice no difference from being a normal 0 integer.
17:25haspakerYeah, looked it up on Wikipedia.
17:25haspakerThanks for the help everyone
17:26haspakerStill strange, it should return 0.6
17:26haspakerBut I'll try some more debugging
17:27hyPiRionhaspaker: Keep in mind that clojure has ratios. ##(/ 1 3)
17:27lazybot⇒ 1/3
17:31haspakerhyPiRion: I don't understand your advice. Are you suggesting I should look for 3/5 instead of 0.6? :>
17:32SegFaultAX|work2Will (ns foo :reload-all) re-compile source?
17:33hyPiRionhaspaker: Uh, not really. Just be aware of that. I burned myself on it first time I was around it.
17:34haspakerAh. Don't worry then, I'm aware of that.
17:34technomancySegFaultAX|work2: I think you have to scope :reload-all under a specific :require
17:35technomancybut you can always try it
17:35SegFaultAX|work2technomancy: Here is the problem: I just want to reload source anytime I make changes without having to reload the repl.
17:36technomancySegFaultAX|work2: best to do that via editor integration
17:36SegFaultAX|work2Also, I haven't got nailgun up and running yet.
17:37SegFaultAX|work2technomancy: Ah. So does nailgun automatically relaod changed files?
17:37technomancyno, but presumably vimclojure would
17:37technomancyor at least would make it easy
17:37technomancyI don't know
17:38emezeskeSegFaultAX|work2: You are a vim user?
17:38emezeskeSegFaultAX|work2: Use lein-tarsier, nailgun, and vimclojure, then you can type "\ef" to reload the current file. (You could also set up an after-change trigger to reload it)
17:39kotarakSegFaultAX|work2: vimclojure does not reload files automatically by design. You can add a autocmd on file saving to do that if you like.
17:39SegFaultAX|work2emezeske: Yea, that's what kotarak suggested earlier. I just haven't taken the time to get nailgun working.
17:40kotarakSegFaultAX|work2: I avoid doing anything automatic.
17:40emezeskeSegFaultAX|work2: I see. You need to spend time to get it working, then :)
17:40SegFaultAX|work2kotarak: That's fair. What's the canonical way to reload something at the repl then?
17:40kotarakSegFaultAX|work2: Just do \ef or \et in the file. The repl will know the change.
17:41SegFaultAX|work2kotarak: What's the doing under the hood?
17:41kotarakSegFaultAX|work2: or a plain (require :reload 'your.name.space) in the repl.
17:41kotarakSegFaultAX|work2: takes the code and sends it to the backend.
17:41kotarakSegFaultAX|work2: the backend and repls running there will pick-up the change.
17:41SegFaultAX|work2kotarak: It just ships the entire file to the repl?
17:41kotarakSegFaultAX|work2: yes. With \ef. Or the current toplevel expression with \et.
17:42SegFaultAX|work2kotarak: That's pretty neat!
17:42SegFaultAX|work2kotarak: Where is the best tutorial for setting up nailgun on OSX?
17:42SegFaultAX|work2kotarak: (Or one for Linux if you got it)
17:43kotarakSegFaultAX|work2: java -cp clojure.jar:vimclojure-server.jar vimclojure.nailgun.NGServer 127.0.0.1
17:43kotarakSegFaultAX|work2: with the correct jar names of course.
17:43kotarakSegFaultAX|work2: There is also a launcher script in the VimClojure distribution but I haven't used it for ages.
17:43emezeskekotarak: Why not use lein-tarsier?
17:43kotarakSegFaultAX|work2: You have to use the nailgun server from the vc distribution.
17:44kotarakemezeske: or vimclojure/gradle for gradle users. But SegFaultAX|work2 wants to use it outside a project.
17:45SegFaultAX|work2kotarak: That's right. While I'm learning it would be nice to have quick access to a REPL from vim eg slimv.vim
17:46kotarakSegFaultAX|work2: there is a repl built into vc. But with certain restrictions.
17:46kotarakSegFaultAX|work2: eg. no access to stdin. So no (read-line).
17:46emezeskeWell, I'd say particularly while you're learning, you should be using lein. But to each his own!
17:51pandeirowas there a doc somewhere on upgrading to lein2, specific issues etc?
17:52technomancyclojurebot: upgrading to leiningen 2?
17:52clojurebotupgrading to leiningen 2 is easy with this handy upgrade guide: https://github.com/technomancy/leiningen/wiki/Upgrading
17:56pandeirotechnomancy: awesome thanks
17:56technomancysure
17:59haspaker_God, my genetic algorithm certainly takes its time
18:00TimMchaspaker: Try giving it a few million years, I'm sure you'll see a result.
18:01haspakerI actually have some result just after 2000 iterations
18:02haspakerThe best of the created algorithms are 60% effective
18:02emezeske60% of the time, they work every time.
18:03tacomanI think that's the first time I've heard that statement in a way that makes sense.
18:04haspakerI have a bug that only manifests itself after several thousand iterations
18:04haspakerIt's quite a pain in the ass to debug
18:08tacomanI think I've seen several mentions of genetic algorithms on the channel at various points. what are people using them for?
18:08tacomanand does Clojure have any particular advantages to leverage them?
18:09haspakerThey rarely have any real usage, only in very specific situations
18:09haspakerThey are mostly cool to make, I think
18:09gtrak`immutability means history's built-in?
18:09ohpauleeztacoman: genetic algorithms are great when you expect to have multiple maxima, and you don't have the clear way to find the absolute
18:09ohpauleezso any problem that has that, counts
18:10ohpauleezbeing able to have powerful, immutable data structures, with sane concurrency makes modeling the fitness function and the problem space easier
18:10ohpauleezand opens the door for making the algorithm parallel
18:11ohpauleeztacoman: You probably see a high mention of them here because a lot of early adoption of Clojure came from people doing machine learning and general sequence/stream crunching
18:12tacomanyeah. I have an AI class during my final undergraduate semester this fall, I wonder if the prof will let me use Clojure for it. I *think* we're supposed to do something along those lines.
18:13ohpauleeztacoman: If the prof can take a jar, solid. If not, spin up a Noir app on your university hosting account, and send him a URL :)
18:13ohpauleezprofs love the "extra mile"
18:13tacomanheh. and it'd certainly be good Clojure experience. I'm not even sure that I get any such hosting account. you mean one that the university would give to every student, right?
18:13ohpauleezright
18:14tacomanyeah.... despite being a "tech" school, I don't think I get one of those. >_<
18:15SegFaultAX|work2kotarak: So when you run your ng server, do you run it as a background job?
18:16kotarakSegFaultAX|work2: No. I run it in a separate terminal.
18:16SegFaultAX|work2kotarak: Or do you just always have an extra term open.
18:16SegFaultAX|work2kotarak: I see. Isn't that kind of a waste, though?
18:16kotarakSegFaultAX|work2: I prefer the extra term. => Full job control.
18:16kotarakSegFaultAX|work2: Other people prefer background jobs. Should work in any way.
18:17kotarakSegFaultAX|work2: Who cares? Windows may be minimized if necessary.
18:17SegFaultAX|work2kotarak: That's true. I just have a separate tab in my console for it now (or a window in tmux depending on the environment I'm using)
18:18ohpauleezSegFaultAX|work2: FWIW, I use leon repl, then just start the ng server from there when I want it
18:21SegFaultAX|work2ohpauleez: Leon?
18:21SegFaultAX|work2ohpauleez: Oh, lein. Yea.
18:21SegFaultAX|work2ohpauleez: Disregard last highlight. :D
18:22ohpauleezleon - yes. OSX auto correct fail
18:22technomancyleon?
18:22clojurebotleon is a good sign it's time to turn off auto-"correct"
18:22ohpauleezlein**
18:22technomancyclojurebot: botsnack
18:22clojurebotThanks! Can I have chocolate next time
18:22ohpauleezhaha seriously, that was spot on
18:23SegFaultAX|work2kotarak: Your rainbow parens feature makes me want to find a general purpose plugin for that exact thing.
18:23SegFaultAX|work2kotarak: Not only is it colorful and fun, it's damn useful to match things up visually.
18:27kotarakSegFaultAX|work2: It's probably possible to extract that. I just stole it from the lisp or scheme plugin. (Don't remember)
18:27SegFaultAX|work2kotarak: It's awesome all the same. :D
18:35haspakerWohoo!
18:36haspakerMy genetic algorithm worked perfectly
18:36haspakerTurns out I has set up the conditions wrong, so the "bug" was nothing more than the algorithm solving a different problem than I had expected
18:40zakwilsonI'm looking for an imap library. All I've found with google is nonomail (which hasn't had an update in a while) and a project on nakkaya.com that has jars, but no public repo. There are a lot of noise results related to the interface imap.
18:48hiredmanzakwilson: client? have you dismissed javamail's implementation?
18:49taliosit works. but thats all I can say :)
18:50hiredmanjavamail has the virtue of generally enforcing rfc compliant email generation, given the abundance of email that isn't compliant, there must be a lot of software that doesn't
18:51taliosAgreed. I don't mind the API, its more some of its internals that are kinda weird, designed to be open/flexible almost tooo much, the whole activation.jar framework stuff
18:52taliosBut… theres plenty of wrappers around it ( like SpringMail etc. ) which make it nicer to work with for simple things.
18:52brehauthiredman: what do you mean you cant use a regexp to validate an email address correctl‽ *sigh*
18:52zakwilsonhiredman: yes, client. nonomail seems to wrap com.sun.mail.imap. The other wraps javax.mail.
18:52talios'lo brehaut
18:52brehauthi talios
18:52hiredmanwe've been running in to almost the opposite at work, javamail has a lot global options
18:53hiredmana lot of
18:53hiredmanand options the result of which are read in to a finaly private field, so you cannot change them, etc
18:53taliosdoh
18:54taliosThere might be some stuff extracted from the Apache James mailserver project now as well, I know mime4j popped out of that.
19:06hiredmanI just saw an email address that had a non-breaking space as the last character in the domain part
19:06hiredmanemail really is disgusting
19:06technomancyit's the date headers that'll really churn your stomach
19:09zakwilsonI have yet to find a satisfactory mail client (no, I'm not currently looking for libraries to write a general-purpose mail client in Clojure)
19:11zakwilsonBut yes, email is a mess. I love email though, conceptually.
19:32Rayneszakwilson: You can't even find a satisfactory IRC client!
19:33seancorfieldusing javax.mail is pretty nasty... at world singles we wrapped it up so we can just say (send-email from to subject body) and not have to see how the sausage is made...
19:34zakwilsonRaynes: I have a pretty satisfactory general-purpose interactive IRC client. Clojure IRC libraries, on the other hand....
19:34zakwilsonseancorfield: yeah, I have a wrapper like that in a product I built for a customer too. I want to receive email now.
19:36hiredmanzakwilson: you can use something like subetha smtp to just recieve mail that way
19:37hiredman(being an smtp server)
19:38Raynesseancorfield: You could have just used that apache commons library and not have bothered with javamail.
19:42zakwilsonhiredman: I don't want to be a mail server. I want to be an imap client.
19:44RaynesReally? I always wanted to be a fireman when I grew up.
20:04zakwilsonI wanted to be a cop. Almost went for it.
20:05hiredmanthen you realized you'd spend your days telling kids to get off their skateboards and move a long?
20:06hiredmanthis email address is in the form: "Foo Bar" <foobar[foobar@blah.com]>
20:06hiredmanugh
20:07brehauthiredman: is dealing with that better or worse than the affordmention skateboards?
20:07hiredmantouche
20:18TEttingerhow would I call a function a set amount of time after the program starts?
20:19TEttinger(Clojure, probably going to be Swing-based)
20:19gtrak`java Timer
20:20gtrak`http://docs.oracle.com/javase/1.4.2/docs/api/java/util/Timer.html#schedule(java.util.TimerTask, long)
20:22jeremyheileryeah, email sucks. There's a reason why I haven't done much with Lime. I'm still digesting the million related RFCs
20:23FrozenlockTEttinger: Check https://github.com/overtone/at-at
20:23FrozenlockIs there a way to change the destination port in clj-http?
20:23brehautFrozenlock yes
20:24brehaut(finding it)
20:25brehautFrozenlock: actually, cant you just put it into the url string like normal?
20:25pandeiroare there any existing clojure wrappers for java smtp servers?
20:25FrozenlockLike "http://127.0.0.1:8443&quot;? I must have done something wrong, it blew up when I tried...
20:26brehautyeah, i was sure that worked
20:27FrozenlockOh- it does, I forgot to put https
20:27brehautaha
20:27brehautyou have my sympathy
20:27Frozenlock:p
20:27Frozenlockthanks
20:27FrozenlockBut of course my certificate is for my URL, not 127.0.0.1, so it just refuses to connect -_-
20:27brehauthosts file time
20:28FrozenlockOh wait, I just listened to the security now podcast about that!
20:34TEttingerFrozenlock, I can't seem to install AT-AT via Lein
20:35pandeirowho knew setting up an e-mail server was so easy? http://www.ian-barton.com/blog/linux/2011/10/31/archlinux-mail-server.html
20:35pandeirojust 73 steps
20:36FrozenlockTEttinger: [overtone/at-at "1.0.0"] works just fine for me...
20:36Frozenlock(in your project dependencies)
20:37TEttingerhttp://ideone.com/usffj
20:38TEttingeroh, /
20:39brainproxytime to shop for a new work laptop, will primarily be doing clojure and nodejs dev stuff.. new macbook pro? or thinkpad w530 + linux? any clojure devs here recently contemplated similar decision?
20:39FrozenlockArg I was messing with the hostname file silly me
20:41emezeskebrainproxy: both of those options are very good, I think
20:41Frozenlockbrainproxy: Why not a real computer? A big manly tower :)
20:42brainproxyFrozenlock: because I like to be able to switch easily between my standing desk, an easy chair, and going elsewhere to code
20:42brainproxyso using a beefy laptop as a mobile workstation is appealing to me
20:43FrozenlockOh- didn't think of that. I must say I have a transforming desk. Desk, maximize! *weird tranformers sound*
20:45FrozenlockEhhh... do I need to reboot or something once I changed my hosts file?
20:45brainproxyshouldn't need to
20:46Frozenlockgrrr
20:47FrozenlockIs there, by any chance, a command to return the current hostname?
20:47nsxt_Frozenlock: echo $HOST
20:47nsxt_?
20:48FrozenlockSorry, I meant the name associated with 127.0.0.1
20:48Frozenlockbut yes, echo $HOST does work, thanks ;)
20:49unnalibrainproxy: I use a MacBook Air for node/erlang/clojure, it's pretty sweet.
20:49aperiodicFrozenlock: `hostname`
20:50Frozenlockyes! Thank you very much
20:51brainproxyunnali: I'm wearing out a 17" mbp from 2010.. new mbp would make a lot of sense; but so many of my tools are *nix things or platform neutral and would work just as well on a linux laptop
20:52brainproxyso I'm contemplating just switching over to full-time linux for my work machine
20:52brainproxybut hesistant at the same time :/
20:52unnalibrainproxy: I find the unrefinedness of the Linux experience distracts from just trying to get shit done™
20:52emezeskebrainproxy: I do all dev under linux, and confirm that it is just fine
20:53unnali(I used Linux as primary for 6 or 7 years, had to use OS X with work, didn't go back.)
20:53nsxt_brainproxy: all dev under linux here as well, no problems. "getting shit done" is highly contingent on your distro, i've found.
20:53brainproxynsxt_: what distro do you use?
20:53nsxt_brainproxy: arch
20:53FrozenlockI don't care about my OS anymore since I use Emacs
20:54unnalirofl
20:54brainproxyFrozenlock: yeah, emacs here also
20:54emezeskeThe first thing I do when I install an OS is totally bastardize it into what I want (xmonad, xterm+tmux, vim, etc), so OSX isn't really more refined for me
20:54brainproxybut at the same time, my brain has been wired to mac since i started using the os x public beta back in 2000
20:54brainproxyi mean for everyday desktop/laptop stuff
20:55brainproxybut I deploy and dev in linux virtual machines also
20:56brainproxyi wonder if I could find a place that would let me rent a thinkpad for awhile and wouldn't care if I blow away the OS and put linux on it
20:56brainproxyiow, try it for awhile and see if I would be happy
20:56nsxt_brainproxy: are you looking for any old laptop to try linux with? or specifically a thinkpad
20:57brainproxyI met some clojure devs at Strange Loop last year, and they all had thinkpads + linux
20:57brainproxyso seemed to me like a promising combo
20:57nsxt_brainproxy: i've an old dell i wouldn't mind giving away for free. i know some people cringe at the thought of dell, but for 3 laptops straight now, it's been pretty solid.
20:58Frozenlockbrehaut: ok I don't want to sound like an easily impressionable little girl, but... OMG it worked! Thank you for mentioning the hosts file!
20:58unnaliFrozenlock: nothing wrong with sounding like a girl :3
20:58brainproxynsxt_: i might consider dell, i just know thinkpad has a reputation for being linux friendly
20:59FrozenlockNo, but "an easily impressionable little girl", yes :P
20:59unnaliso you say it in a manly way … an easily impressionable little man? :P
20:59nsxt_brainproxy: i haven't really followed dell's bundling of ubuntu, but i'm fairly positive they're just as, if not more, friendly
20:59Frozenlockunnali: Ouch
20:59brainproxynsxt_: thanks for the tip, I'll definitely research that avenue
21:00nsxt_brainproxy: here's some help: http://www.ubuntu.com/certification/desktop/make/Dell/?csrfmiddlewaretoken=c61120be39ee7cdbb58136e7ab7e4f57&amp;query=&amp;category=Laptop&amp;release=Any&amp;level=Any
21:00FrozenlockGod I can't believe I thought I would have to test my webserver from outside my LAN after I added the certificates.
21:00nsxt_not that you're necessarily going to run ubuntu, but it'll give you a good idea of compatibility
21:03pandeirothat thinkpad w530 looks pretty butch, anyone use one?
21:08brainproxynsxt_: thanks for the link.. for starters I probably will use ubuntu
21:10TEttingerpandeiro, just got one for my brother
21:11TEttingerhe loves it, but he loved his 4-year-old thinkpad (that still runs) too
21:11TEttingerold one was a thinkpad T-series
21:11TEttingerthey are both clearly durable things, no flimsy bits anywhere on them
21:12TEttingerthinkpad edge series are crazy cheap for what you get though, especially when there's a coupon
21:17brainproxyTEttinger: what does he think of the new chiclet keyboard?
21:17brainproxyvs the old style keyboard that was so highly praised for many years as one of the best features of thinkpads
21:18TEttingerbrainproxy, haven't heard him complain -- he has always had a lenovo-branded thinkpad, never had an IBM
21:23_tcathe new keyboards are still good brainproxy
21:23brainproxyI'm pretty used to the chiclet style, since mbp's have had that for awhile
21:23pandeiroTEttinger: i think i'd prefer to shed the optical drive and a couple inches off the screen, but it's an impressive machine for the price
21:23pandeiroalbeit once you quadruple the RAM and switch to a 128GB SSD it pushes $2500
21:44TimMcI know that 'keys and 'vals must return the same ordering for a given instance, but are (map key m) and (keys m) guaranteed to match?
21:48zakwilsonI don't think it makes that guarantee. The current implementation might always behave that way, but you can't rely on it.
22:05amalloyTimMc: probably not
22:30alfrede
22:35emezeskebash: e: command not found
22:40cshell_e
22:50unnaliksh: e: command not found
22:57TimMcclintm: Nope, -> is a stitching macro.
22:58TimMc&(clojure.walk/macroexpand-all '(-> d (c) (b) (a e)))
22:58lazybot⇒ (a (b (c d)) e)
23:01nDuffHrm.
23:15clintmTimMc: damn, that's cool. $ and . in haskell. sort of.
23:16clintmwait, not sort of. Per that example, it's the same behavior as $ in .hs
23:17clintmeither way, pretty cool.
23:25nDuff::foo seems to always be becoming "\ufdd0'user/foo" in cljs, regardless of the local ns
23:32amalloyclintm: no, it's not the same
23:32wmealingso, ive done some quick reading on https://github.com/schani/clojurec , i think you'd lose the java interop, but can you call C ?
23:32amalloy-> operates at the source-code level because it's a macro, so it can do things that are not possible with function composition
23:33amalloy&(-> lol whut undefined symbols quote)
23:33lazybot⇒ (symbols (undefined (whut lol)))
23:41mwanga`clj-camel - a new library that lets you write routing DSL in clojure
23:41mwanga` as plain vectors. https://github.com/hmanish/clj-camel
23:42mwanga`clj-camel - a new library that lets you write Apache Camel routing DSL in clojure
23:42mwanga` as plain vectors. (https://github.com/hmanish/clj-camel)
23:43brehautmwanga`: pure functions of no arguemnts are just constants; you could write (defn make-error-handler [] [[…]]) as (def error-handler [[…]])
23:44mwanga`agreed ... i'll fix the sample
23:53nDuffdnolen: I'm hitting the CLJS-266 issue myself, and have attached a patch updated to apply to the current code. WORKSFORME, but I'm not sure if the decisions in terms of which namespace to put the new vars in was appropriate.
23:57dnolennDuff: will take a look
23:57dnolennDuff: thx