#clojure log - Mar 05 2013

The Joy of Clojure
Main Clojure site
Google Group
IRC
List of all logged dates

0:23 muhoo: you can't use emacs with your pinky removed

0:23 or vi, either, how else will you reach the ESC key?

0:32 jeremyheiler: muhoo, I use my middle finger for the ESC key :-P

0:33 Licenser: jeremyheiler you have your pinkies removed?

0:33 jeremyheiler: jeremyheiler, No haha. But in order to hit ESC with my pinky I have to lift my harm. I can just side my hand up to hit it with my middle finger.

0:34 Licenser: also I'm pretty sure there is a no-pinky-mode.el out there somewhere

0:34 jeremyheiler: Licenser, wow..

0:34 Licenser: ^^

0:47 tomoj: it sort of blows that map-indexed is basically a copy of map

0:47 and it only does one coll

0:50 bbloom: tomoj: it's really easy to do mapped index with multiple collections:

0:50 (map vector (range) [:a :b :c] [\a \b \c])

0:50 ,(map vector (range) [:a :b :c] [\a \b \c])

0:50 clojurebot: ([0 :a \a] [1 :b \b] [2 :c \c])

0:50 tomoj: good point

0:50 clojurebot: the point of moby dick is "be yourself"

0:50 tomoj: that's better that map-indexed

0:51 bbloom: i think this is a case of core being a bad example to look at the code

0:52 the fact that it's a copy paste job rather than delegating is clearly a performance thing

0:52 rather than allocating a lazy, infinite range

0:53 tomoj: yeah

0:53 it still blows :(

0:53 bbloom: might be nice if it supported multiple collections tho

0:53 could trivially implement those as a slower version by just delegating to map with range :-)

0:54 tomoj: I almost said (partial map (range)) :O

0:54 bbloom: heh

0:54 tomoj: I wonder what would have to change about clojure to get rid of some of these copy-paste jobs

0:55 bbloom: tomoj: a lot.

0:56 in order to get good perf out of core core core functions, you need to specialize and inline to a degree that you simply can't do without a lot of inherent assumptions, type information, etc

0:56 tomoj: ah right

0:56 bbloom: and by the nature of how clojure is bootstrapped, you have a very limited environment in order to work with to build up these functions

0:56 tomoj: needs to be haskell :P

0:56 bbloom: generally, the way this sort of thing is accomplished is via a metacircular compiler toolchain

0:57 where you have a bootstrapping compiler/runtime, which is either a simplified toolchain (as is the case with factor) or is an older version of the real thing (as is the case with most C toolchains)

0:58 tomoj: so then you can write fancy macros which define the core functions?

0:58 bbloom: tomoj: yeah, see clojurescript for an example :-P

0:58 although clojurescript has it's own terrible issues with respect to bootstrapping

0:58 bootstrapping is *hard*

0:59 and the benefits are relatively small for a language like clojure

0:59 clojure's core semantics and library are so small that it's easier to just tune everything by hand and then not really worry about it

1:00 tomoj: right, I guess it doesn't suck so bad

1:01 since only rich has to do it

1:01 bbloom: heh

1:04 Hendekagon: thm_prover: you can write most cljs code as normal clj code anyway - just separate logic from gui stuff

1:05 thm_prover: Hendekagon: in theory yes, in practice, I found it very different.

1:05 Hendekagon: debug in your favourite environment as you would normal Clojure, except for the gui stuff, then you get cryptic errors

1:05 it is quite troublesome

1:06 but it will get easier...CLJS will overtake CLJ!

1:06 thm_prover: let others tame this CLJS beast

1:06 I will use it when it's easy

1:07 :-)

1:08 Hendekagon: there's people working on it...you've got Lighttable, Session, Catnip, Himera, source maps on the way - lots of experiments on the go

1:09 technomancy: ugh I hope not

1:11 Hendekagon: ...but I use a text editor and lein cljsbuild

2:19 luxbock: hey, I'm taking a edx.org stats course and trying to get familiar with Incanter at the same time but I ran into some confusion with standard-deviation

2:20 or variance I should say

2:20 https://www.refheap.com/paste

2:20 my definition of variance follows the courses example, and I get the same result

2:20 so I'm wondering why is Incanters different

2:25 ambrosebs: This should be a little fun for those who know Haskell and are interested in core.typed https://github.com/clojure/core.typed/blob/master/src/test/clojure/clojure/core/typed/test/hole.clj

2:25 Watch the video first.

2:34 noidi: ambrosebs, is it hard to add new types to core.typed? I played with it a bit yesterday, and noticed that it doesn't support ratios (e.g. 1/10)

2:34 if it's not terribly hard, I might give it a go :)

2:35 ambrosebs: Is there a literal syntax?

2:36 If so, I probably just haven't added a case for it.

2:36 noidi: &&1/10

2:36 lazybot: java.lang.RuntimeException: Invalid token: &1/10

2:36 noidi: ,1/10

2:36 clojurebot: 1/10

2:36 noidi: ,(type 1/10)

2:36 clojurebot: clojure.lang.Ratio

2:37 ambrosebs: noidi: look at "clojure/core/typed/constant_type.clj"

2:37 Patch welcome!

2:38 If you can think of any other syntax I've missed, please add them also.

2:38 noidi: ambrosebs, do I need a signed contributor agreement now that typed clojure is a core project?

2:38 ambrosebs: noidi: yes

2:39 noidi: crap, haven't got one :)

2:39 ambrosebs: :)

2:39 noidi: oh well, I would've run into it sooner or later, so better get it over with

2:40 ambrosebs: Cool!

2:40 noidi: another core.typed question: is it possible to create custom subtypes of existing datatypes?

2:40 e.g. to subtype lengths from numbers and meters from lengths

2:41 ambrosebs: I don't understand the example.

2:44 noidi: ambrosebs, I was thinking about something like scala's value classes and haskell's newtype

2:45 if I deal with two kinds of numbers, say lengths in meters and weights in grams, if I type them both as Number, there's a risk of getting them mixed up

2:45 ambrosebs: Not currently. I'm still thinking about the best way to add it, it's high on the priority list.

2:46 Typed Racket has Refinements, but I'm not entirely sure if its what I want.

2:49 Maybe something pretty much like newtype would work fine.

2:59 noidi: how might you create an instance of Meter? `1` is a Long... would you expect a wrapper ctor for this sort of feature?

3:04 noidi: ambrosebs, I haven't given it much thought (and don't even know if the idea makes sense). it's just something I've seen in some scala posts, and would've liked to give it a try if core.typed supported it :)

3:04 e.g. http://www.blog.project13.pl/index.php/coding/1769/scala-2-10-and-why-you-will-love-implicit-value-classes/

3:04 http://docs.scala-lang.org/sips/pending/value-classes.html

3:05 ambroseb_: noidi: thx

3:06 noidi: yeah, you'd probably need functions for "wrapping" and "unwrapping" to convert between the primitive and refined type (of course the value itself would remain unwrapped)

3:09 ambrosebs: ok

3:10 Seems useful but it isn't clear if it fits with core.typed.

3:13 noidi: yes, implicit wrappers may not work as well in a mostly untyped language

3:13 and explicit wrappers such as [1 :m], [20 :kg] may fit in better with dynamic, REPL-centric development

3:19 ambrosebs: noidi: well there probably won't be any actual wrappers. Only on the static type level.

3:19 (for a potential core.typed implementation)

3:21 noidi: and I'm wondering whether actual wrappers would make more sense in Clojure :)

3:21 ambrosebs: One idea I've been thinking about is using an intersection type.

3:21 Don't you just want to pass these Meters to functions like + and -?

3:21 without further ceremony

3:22 noidi: I don't think that would work. Meter * Meter -> Meter^2, Meter + Meter -> Meter

3:23 ah, stupid me, of course * and + would return Numbers, which then should be wrapped by the caller

3:24 so unwrapping could be automated, even though re-wrapping can't be

3:24 ambrosebs: Yes exactly

3:28 I'm not sure how useful that would be.

3:28 (kilometer (+ meter1 meter2)) doesn't really mean much.

3:30 As you said before, Clojure already has a cheap, ad-hoc "boxing" strategy in maps and vectors.

3:31 and core.typed supports heterogeneous versions of both

3:33 "cheap" to type, that is :)

3:37 noidi: ambrosebs, btw. one more question: is there a reason why check-ns isn't typed?

3:37 when I've played around with core.typed, I've just added (check-ns) at the end of a typed ns to check it upon reload

3:37 but since it isn't typed, I've had to wrap it in (tc-ignore)

3:38 ambrosebs: nope. Should just be able to just (ann clojure.core.typed/check-ns (Fn [Symbol -> Any] [-> Any])

3:40 noidi: great

3:41 so far the biggest issue the Java/Scala crowd seems to have with Clojure is its lack of typing, I hope that core.typed will change that :)

3:43 I'm sure that Clojure will be a much easier sell at Java shops once core.typed becomes production ready

3:43 (and I hope to be able to chip in to make that happen, but unfortunately can't make any promises)

3:44 ambrosebs: Yep, it's easy to dismiss Clojure because of dynamic types.

3:45 I think it'll also be very useful for beginners. Error messages don't suck as much.

3:47 There's no pleasing the Scala folk though, core.typed isn't a "real" type system :)

3:47 It's a "verification environment", which sounds better to me :)

3:48 ucb: heh

3:50 RazLaptop: Is there a way to store a reference to a list like a pointer? Or is there another way to approach it?

3:51 I want to store many thousands of combinations but I want to make sure they're stored once uniquely

3:54 amalloy: that's really the only way to store a list

3:55 RazLaptop: amalloy: clojure has pointers?

4:03 amalloy: RazLaptop: you should read http://en.wikipedia.org/wiki/Persistent_data_structure, especially the section on linked lists

4:16 ikitommi: is there a clean way to get line source code numbers working with clojure.tools.logging?

5:48 lantiga: weavejester: Hello James, I was researching for a way to generate codox-like docs based on Compojure routes. I guess that's not possible right now. Do you think it's something it makes sense pursuing?

5:50 weavejester: lantiga: My current thought is that we need a more restrictive but more transparent way of constructing routes. Compojure routes are just nested functions, which are opaque. If there was another system that allowed routes to be constructed from data instead, that would be more restrictive (not turing complete) but easier to document and reason about.

5:53 lantiga: weavejester: Agreed 100% and it sounds like fun too. As to more restrictive, I think you could actually get pretty far by separating routes in a few basic functions and data. Do you have something in the works?

5:54 abp_: weavejester: using functions to route is ok, but some structure should cary information about those routes

5:56 lantiga: abp_: Thinking about the codox thing for routes, my first thought was to leverage on meta, but probably a whole rethink might be beneficial

5:56 abp_: lantiga: I'm working on a vector based route dsl that compiles to clout calls

5:59 lantiga: abp_: very interesting, looking forward to take a peak when you release it

6:00 abp_: lantiga: I still need to separate the dsl from what it's supposed to integrate with, same goes for resulting routing functions. A lot of work to do still. What's that codox thing for routes?

6:04 lantiga: I need to generate documentation for a REST API implemented using Compojure and I would have liked to do it the same way you can generate documentation for a Clojure API using Codox. The fact that they are nested functions gets in the way of a clean implementation, though.

6:04 abp_: Sorry, I forgot to prepend your nick to my last message

6:05 weavejester: lantiga: I haven't been working on any alternative routing system. It's currently not an "itch to scratch" so to speak.

6:08 abp_: lantiga: np. Documentation generation for routes is quite a problem, yes. I think having specific functions as route handlers would ease that.

6:09 lantiga: Just had a cool idea on how to integrate the routing dsl with my system but also with plain clojure. :)

6:09 lantiga: weavejester: abp_: There's cgrand's Moustache that is more data-driven than Compojure, but it's unclear to me what are the downsides of it. It could provide a very good reference in any case.

6:10 abp_: I'm all ears

6:10 abp_: lantiga: I looked at it while building the dsl

6:10 lantiga: Well, it would basically be mapping named routes to functions in namespaces

6:10 honza: any ideas why (slurp) on a local file would add a leading and a trailing space?

6:11 abp_: lantiga: More interersting to me is mapping named routes into prismatics graph

6:11 lantiga: So two named route to implementation mapping strategies there.

6:12 lantiga: abp_: Mapping to functions in namespaces is what I had in mind too but wondered if it was the way to go - it looked klunky. The graph way, I hadn't thought about it, that's interesting. I actually worked with plumbing myself.

6:13 abp_: lantiga: What did you do with it?

6:15 lantiga: abp_: I'm using it for a project involving integration sources of information, running numerical optimization on them and producing outputs. I'm playing with a distributed version of it on the side, you can see something at https://github.com/lantiga/hyperplumbing

6:16 abp_: I still have to entirely wrap my head around how it would fit a routing library, but the idea is pretty bold.

6:16 abp_: Just curious, what did you take home by looking at Moustache?

6:21 abp_: lantiga: Yeah I'm thinking about graph-based webapps for quite a while. Honestly, I haven't looked into moustache in detail. Mostly to "confirm" ideas around structure of vectors and parameter binding. But I think what clout does is perfectly fine and a viable target for any routing dsl.

6:23 lantiga: abp_: I also like clout, nice and lean

6:23 abp_: lantiga: Yes, try reading Moustache. I J

6:23 I just could not beat me to it

6:25 lantiga: abp_: yep, cgrand's style is amazingly clever in general

6:32 michaelr5251: hello

7:19 ticking: I wonder if the equivalence problem is still solvable for clojure/java regex, being able to do (= #"x|y" #"y|x") would be cool

8:10 mpfundstein: hi, can i somehow "break" a doseq?

8:11 a hwile

8:11 vijaykiran: mpfundstein: you probably want to filter out the unwanted values from the seq

8:13 clgv: mpfundstein: yeah you can with :while

8:15 notostraca: OK, I'm trying to evangelize Clojure a bit to a friend who knows Racket and Java, and is currently using Java and hating it. He's using Java because of a library it has, but not Clojure because he thinks the macros will be too different from what he writes in Racket. Are Clojure macros hygienic?

8:15 clgv: ,(doseq [x (range 10)] :while (< x 4)] (println x))

8:15 clojurebot: #<RuntimeException java.lang.RuntimeException: Unmatched delimiter: ]>

8:15 clgv: ,(doseq [x (range 10) :while (< x 4)] (println x))

8:15 clojurebot: 0\n1\n2\n3\n

8:17 notostraca: I have been using Clojure on and off for a while now, still haven't made the effort to really learn the language via 4Clojure or whatnot, so I don't really grasp macros yet

8:18 michaelr5251: notostraca: usually you don't really need to write macros at all..

8:20 notostraca: michaelr525, that's what I have observed by not knowing them :-)

8:20 I have been getting by writing simple apps

8:20 mpfundstein: vijaykiran: i am trying :-)

8:21 (def test ({:id 73333, :time 1362488571357, :priority 9, :action "whatever", :args nil, :group nil} {:id 50252, :time 1362488575325, :priority 9, :action "whatever", :args nil, :group nil}))

8:21 noidi: notostraca, clojure macros are not hygienic, but syntax-quote namespaces all symbols which practically eliminates accidental name capturing

8:21 ,`(+ 2 2)

8:21 notostraca: I made one that looks up nutrition data from the FDA's offline data dumps and displays it in a seesaw form, a simple 2-button app meant for the elderly

8:21 clojurebot: (clojure.core/+ 2 2)

8:21 mpfundstein: (filter #(= (50250 (:id %))) tet)

8:21 (filter #(= (50250 (:id %))) test)

8:21 throws

8:21 Pupnik-: oh hey notostraca ;)

8:21 notostraca: hey Pupnik-

8:21 guess who I'm talking about in here...

8:22 Pupnik-: hehe

8:22 I did my part! the link i posted had hickey talking about how you can use macros without stuffing up your namespaces

8:22 notostraca: that's cool noidi, also thanks Pupnik-

8:22 Pupnik-: but as my understanding of the subject is very limited, i cant really say much

8:23 clgv: mpfundstein: because you try to use the integer 50250 as function

8:23 mpfundstein: clgv: AH :D

8:23 clgv: thx

8:23 clgv: haha works now :-)

8:23 clgv: stupid

8:25 clgv: you could also use: ##(filter (comp #{50250 4711} :id) [{:id 4} {:id 5} {:id 50250} {:id 4711}])

8:25 lazybot: ⇒ ({:id 50250} {:id 4711})

8:30 mpfundstein: clgv: thx

8:30 clgv: thats awesome

8:30 clgv: :-)

8:31 notostraca: so comp returns a function, that's convenient

8:32 clgv: notostraca: yeah it is a higher-order function

8:59 Foxboron: just wrote a little IRC Bot in Clojure as my first project. Would anyone mind take a look at it and maybe give some feedback?

9:01 ambrosebs: Go ahead.

9:01 As in, sure, post the code :)

9:02 Foxboron: https://github.com/Foxboron/Parjer

9:03 I should probably add a better readme

9:09 melipone: hello, is this a good place to ask a lein question?

9:10 notostraca: melipone, don't know a better one

9:10 melipone: I am using lein 1.7.1 and I've noticed that it's using clojure-1.2.jar in its script. Does it matter and does the specified clojure gets loaded at the repl?

9:11 notostraca: it loads a clojure version in your project.clj

9:11 i think your code is separate from lein's clojure

9:11 melipone: okay, thanks. That will do for me!

9:11 clgv: melipone: better upgrade to lein 2 anyway

9:11 notostraca: yes

9:11 the repl in lein 2 is great

9:11 melipone: yes? I didn't see anything new in 2.0

9:12 notostraca: auto-complete in the repl

9:12 clgv: melipone: there is plenty new in 2.0

9:12 melipone: is it easy to upgrade?

9:12 clgv: melipone: compare the two project.clj examples

9:12 melipone: okay, will do.

9:12 thanks

9:13 clgv: btw there is #lein

9:13 melipone: okay

9:13 notostraca: really? I did not know

9:13 clgv: ah no #leiningen

9:14 melipone: I can never remember how to spell leiningen

9:15 gfredericks: it's spelled exactly how it's not pronounced

9:15 ambrosebs: Foxboron: Looks good to me. I'm no web guy so I can't comment on functionality, but idioms are fine.

9:17 Foxboron: have you used another FP language?

9:17 Foxboron: ambrosebs: nope.

9:17 only done Python before this :P

9:17 ambrosebs: Ah, close enough. :)

9:18 Foxboron: i'll take that as good news :D

9:18 ambrosebs: Foxboron: If you felt like it, you could make `add-event` a macro, so you could have a sort of defmethod syntax.

9:19 It would be a good exercise.

9:19 Foxboron: ambrosebs: thats what i did. But my friend (a clojure guy) thought it would be better that way :P

9:19 ambrosebs: Yep, I agree.

9:19 Just sounded like fun. :)

9:19 Foxboron: so at the start i basically did (defevt eval "eval" [x y z] (body))

9:20 abused the docstring as the event trigger :3

9:20 ambrosebs: Very easy to make sugar for the most common case though.

9:20 Foxboron: but i do believe a macro would look better as you'd avoid the (fn (body)) all together

9:21 funny thing tho. The eval didnt have a sandbox. So my friend ended up making files in the project folder with the eval command :P

9:21 ambrosebs: :)

9:23 I might try and type check this with core.typed and send it back.

9:26 Foxboron: ambrosebs: yay :D

9:27 ambrosebs: Foxboron: what are the [c x] in events?

9:28 Foxboron: ambrosebs: c is basically the connection ref used. So the functions that write back to the IRC knows where the output should go

9:28 i did copy pasta parts of the connection code as i really didn't bother reading much into the java stuff :/

9:28 x is the refference to what was typed

9:29 which is parsed with a regex.

9:29 ambrosebs: c is a (Ref '{:in BufferedReader, :out PrintWriter}) or something like that?

9:30 Foxboron: yes

9:30 x is basically this:

9:30 http://mybuddymichael.com/writings/a-regular-expression-for-irc-messages.html?utm_source=dlvr.it&utm_medium=facebook

9:30 i should name them something better :P

9:33 ambrosebs: Foxboron: what is the `serv` argument to network/connect?

9:33 and where is it created?

9:34 Ah, thats the configuration map?

9:34 Foxboron: ambrosebs: yes. I newly added it.

9:35 ambrosebs: Cool.

9:35 Foxboron: ambrosebs: it is just using the :server and :port from the map.

9:36 ambrosebs: i have been reading like 200 pages in Clojure Programming but never really gotten to a point where i found something interesting to code. I buddy wanted me to try make an IRC bot. So been spending 2-3 days with it now ^^

9:36 ambrosebs: Great!

9:36 It shows that you've been studying.

9:37 Foxboron: ambrosebs: i procrastinate too much. Wanted to learn Clojure since november but never really sat down and did anything D:

9:37 ambrosebs: (def-alias Serv '{:nick String

9:37 :server String

9:37 :port AnyInteger

9:37 :chan String

9:37 :owner (APersistentSet Symbol)

9:37 :mark String})

9:37 Foxboron: is this right for the config?

9:37 (lol I'll paste it somewhere next time, sorry)

9:37 Foxboron: yes. Looks god.

9:40 ambrosebs: Foxboron: does `conn` also have an :exit key?

9:40 Foxboron: ambrosebs: i am actually not sure.

9:40 ambrosebs: It isn't added anywhere, but `conn-handler` uses it.

9:40 Foxboron: judging by (nil? :exit @c) i doubt it.

9:41 ambrosebs: Foxboron: write-to-out is usually preferred over writeToOut

9:42 Foxboron: ah, sure :)

10:15 jtoy: can someone help me figure out what I am doing wrong here: https://www.refheap.com/paste/12125 when I run that it returns the whole category_groups

10:16 preyalone: Hello World prints in Mac, but in Windows it silently quits. https://gist.github.com/mcandre/5091006

10:18 Foxboron: preyalone: add (-main) at the end

10:18 clj execute the file, it dosnt care if -main is there.

10:19 preyalone: Foxboron: I want the program to work like Java, in that main is only executed for "clj <program>", not in cases where the program is imported by other Clojure code.

10:20 Foxboron: preyalone: well, clojure dosnt work like that :)

10:20 if you use lein it will use -main

10:20 but normal clj <script> dosnt

10:21 to get around that, you need to do it like in python.

10:33 jtoy: I think Im closer, but I still get the wrong answer: https://www.refheap.com/paste/12127

10:37 canweriotnow: ,(reduce + '(1 2 3 4))

10:37 clojurebot: 10

10:45 mpfundstein: can someone help me on this?

10:45 https://gist.github.com/MarkusXite/10bdd101e16ee7e4ba82

10:45 the macro somehow doesnt expand the & more in the argument list

10:47 ambrosebs: mpfundstein: have you tried using macroexpand to debug it?

10:47 mpfundstein: ambrosebs: no i am not so far yet

10:48 clgv: mpfundstein: it seems questionable whether you need a macro for that at all.

10:49 mpfundstein: clgv: :-) i try to figure out how to use variable parameters etc. :D some stackoverflow post refered to macros so i tried

10:49 clgv: mpfundstein: what do you want to do? examples?

10:50 mpfundstein: i want a wrapper around

10:50 (assoc my-map k1 v21....)

10:50 (assoc my-map k1 v1....)

10:51 clgv: what exactly needs to be wrapped? what should the final form look like?

10:51 mpfundstein: that instead of assoc

10:51 the name of the function is

10:51 (update-job

10:51 thats all :-)

10:52 llasram: (a) You probably just want to use `assoc`; (b) You can just use a function -- no macro necessary

10:52 mpfundstein: llasram: to (a) -> true, but i dont want to :-) ; (b) -> yeah but how

10:52 clgv: mpfundstein: then write a function named update-job ;)

10:52 llasram: (def update-job assoc)

10:52 mpfundstein: llasram: lol :-) thats what i want

10:53 llasram: didnt think so "easy"

10:53 clgv: plain renaming of assoc has hardly any use though

10:53 tomoj: oh

10:53 clgv: except obscuring your code if you do that repeatedly

10:54 mpfundstein: clgv: well, its a bit of information hiding

10:54 clgv: update-job is implement as assoc ok, but who says it must.. if i want to change it later and i keep the interface the same

10:54 clgv: than no end user would need to do a s/assoc/new_method/g

10:56 clgv: mpfundstein: I'd bet there will be a rewrite of that soon ;)

10:56 llasram: mpfundstein: For a more real answer, where maybe you want to do more than *just* assoc, check out `apply`

10:57 mpfundstein: clgv: :D its purely educational what i built

10:57 buid*

10:57 build* sry

10:57 llasram: Ok will do :-) thanks

10:57 clgv: well now you lost the end user argument ;)

10:59 mpfundstein: clgv: ok ok ok :D

11:27 sundbp: hi. not that long ago i remember seeing a project advertised that had to do with macros, quoting and namespace resolution. can't seem to find it now - anyone know which one i'm talking about?

11:29 blrm: sundbp: not familiar, but it might be here: http://www.clojure-toolbox.com/

11:30 sundbp: blrm: i'll take a look. have a feeling it'd be too new to have ended up there yet

11:31 chronno: sundbp: Maybe you are talking about https://github.com/brandonbloom/backtick ?

11:31 sundbp: chronno: that sounds and looks like it - great. thanks!

11:32 chronno: sundbp: np

11:33 sundbp: chronno: yes, that's the one. now i jsut need to work out if my gut feel that this would be helpful to me is correct :)

11:35 chronno: sundbp: he he, well that parts is always fun :-)

11:35 sundbp: (at least with clojure libraries...)

11:36 sundbp: chronno: indeed

11:40 ambrosebs: noidi: whenever I use `check-ns` in a namespace, I usually get an infinite loop because check-ns calls require.

11:40 Does it work for you?

11:40 sundbp: chronno: and in this case my foggy memory is right, it will make it easier to write the macro i'm writing

11:41 chronno: sundbp: great!

11:43 sundbp: I haven't had the opportunity to use it, but it looks like a welcome addition to our toolset

11:59 jtoy: where is the repl history for my command line?

11:59 sundbp: chronno: yes, i'm sort of doing the template approach manually right now for generating some code for defrecords etc

11:59 jtoy: I started my reply with lein repl

12:03 jweiss: is it bad for to do (let [f (fn [x y] ...)] (def add (partial f true)) (def remove (partial f false))) ? eg, a top level let so you don't pollute the namespace with a utility function in a top level var

12:05 sundbp: chronno: done - it "just worked" :)

12:05 technomancy: jweiss: opinions are mixed. I prefer private vars since they retain more metadata, you can jump to their definition, etc

12:05 jweiss: technomancy: private as in defn- ?

12:05 technomancy: also I get twitchy about defs in non-zero columns

12:05 yeah

12:10 chronno: sundbp: Nice

12:12 mpfundstein: jtoy: its a hidden file .lein_repl_history in the same folder as where you started your repl

12:21 jtoy: mpfundstein: thanks

12:22 mpfundstein: hmm, mine only has .lein-deps-sum

12:22 mpfundstein: jtoy: hm

12:22 jtoy: but i have history

12:22 mpfundstein: jtoy: did you run it from within a lein project folder?

12:22 jtoy: im on lein 1.x, not 2.x

12:23 mpfundstein: yes

12:23 mpfundstein: jtoy: ah k than i cant help you

12:23 jtoy: mpfundstein: ok, thanks

12:24 technomancy: lein1's repl was really not very good

12:25 jtoy: technomancy: ok, ill upgrade real soon

12:25 Pupnik-: leins repl takes a billion years to start up

12:25 mpfundstein: yah :D

12:25 jtoy: Pupnik-: in general or in 1.x ?

12:25 Pupnik-: im using 2.0

12:26 so in general

12:26 mpfundstein: jtoy: in general, its a pain

12:26 ToBeReplaced: if I map over a set multiple times, is the order passed through to the map guaranteed to be the same?

12:27 jtoy: thats too bad

12:27 is there a better way to get a repl?

12:27 * technomancy gesticulates in the general direction of https://github.com/technomancy/leiningen/wiki/Faster

12:29 jtoy: I just dont exit

12:36 josteink: you do discover that throwing up a JVM is a bit costly when running lein on a raspberry pi with a soft-float JVM

12:36 * josteink chuckles

12:39 ambrosebs: Foxboron: I've fully type checked your IRC bot. https://github.com/frenchy64/Parjer

12:39 And hallelujah I found a type error!

12:40 line 125 of parjer.commands

12:44 fbernier: Is there a way to know if I am at the last element of a sequence when using map ?

12:46 krl: fbernier: http://clojuredocs.org/clojure_core/1.2.0/clojure.core/map-indexed

12:52 Foxboron: ambrosebs: awsome. I am cooking so can't read code atm :)

12:52 ambrosebs: :)

12:55 Foxboron: I had to make a lot of trivial changes to get around current core.typed limitations. eg. (v 1) -> (nth v 1)

12:56 Foxboron: I also turned add-event and friends into macros so I could sneak in some type annotations.

12:56 Foxboron: ambrosebs: i will take a look at it :D Awsome. I did not expect this!

12:57 ambrosebs: FYI: core.typed isn't AOT yet, so it takes awhile to load.

13:14 stuartsierra: Any ideas why core.typed isn't compiling?

13:15 stuartsierra: ambrosebs: Haven't had time to look at it since my last email, I'm afraid.

13:16 ambrosebs: Ok, I've released onto Clojars in the meantime.

13:18 mechazoidal: If I've got a non-native type that can't be automatically cast to a ref/atom, do I need to wrap it with deftype and provide accessors?

13:19 solussd: with a defprotocol I can specify doctorings for each function of the protocol- but I have no wa to enforce that the implementation adheres (e.g. "This function takes a Thing and returns a set of OtherThings"). I could enforce thet with pre/post conditions with a regular function, but protocol function declarations don' support pre/post conditions. Is there a good reason for this?

13:19 bbloom: mechazoidal: do you just need the resulting type to implement IDeref?

13:19 mechazoidal: you can use reify

13:20 stuartsierra: ambrosebs: The dependencies in the pom are still confused.

13:20 ambrosebs: net.intensivesystems is not in Maven Central.

13:20 ambrosebs: And neither is trammel.

13:21 bbloom: solussd: the common pattern is to define protocol methods with a dash as a prefix, like '-foo and then provide a free function `foo that calls it. you can put the pre/post conditions onto the free function

13:21 mechazoidal: bbloom: basically I've got a JNA pointer that I want protected, all operations that work on it are wrapped-JNA.

13:21 technomancy: I thought trammel was deprecated?

13:21 stuartsierra: I don't even know what it is.

13:21 solussd: bbloom: I can live with that, thanks!

13:21 bbloom: mechazoidal: what do you mean "protected" ?

13:21 ambrosebs: trammel is core.contracts

13:22 but fogus just added the features I needed about 30 minutes ago.

13:24 stuartsierra: ambrosebs: OK, so you can replace trammel with core.contracts and then figure out what 'arrows' is.

13:25 mechazoidal: bbloom: The pointer is opaque, it's the entry point for stack operations. I want to have a reference to the pointer to manage operations when I pass values to/from its stack.

13:25 ambrosebs: stuartsierra: there's also `analyze` which I'm trying to get into contrib.

13:25 stuartsierra: ok

13:25 bbloom: mechazoidal: yeah, use deftype

13:25 mechazoidal: bbloom: (note that I'm still a bit green with clj concurrency, so I may have the wrong idea how to manage it)

13:26 bbloom: mechazoidal: if you're working with external pointers, you're far outside the range of problems clojure's concurrency primitives can help you with

13:26 ambrosebs: stuartsierra: I was more worried about the compilation failure TBH, forgot about the deps.

13:26 Raynes: Good morning sirs.

13:26 bbloom: mechazoidal: java.concurrent is available :-P

13:26 stuartsierra: ambrosebs: I can't do much to debug the Maven compile step until the dependencies are sorted out.

13:27 ambrosebs: stuartsierra: np

13:27 stuartsierra: Good luck!

13:27 ambrosebs: :)

13:30 mechazoidal: bbloom: My hope was to manage clj's access into the structure in a concurrent way, since I'm basically trying to plug a script interpreter into clj, and have clj provide backing support for any I/O the interpreter needs.

13:31 bbloom: (the end result of this rube goldberg experiment is to see if I can plug it into aleph as a worker service)

13:31 bbloom: mechazoidal: all of clojure's concurrency primitives assume that you are working with immutable and equatable values

13:32 mechazoidal: can you guarantee that the native code won't change the value (in a strict functional programming sense of that word) out from under you? can you compare those values for equality?

13:42 mechazoidal: bbloom: the pointer itself shouldn't be changed by the native code, as you're expected to work on it purely through its C stack api

13:42 bbloom: mechazoidal: what about the data the pointer points to?

13:42 the *value* of that pointer

13:42 mechazoidal: bbloom: the structure itself is mutable, you're right. :/

13:42 bbloom: mechazoidal: yeah, you need locks :-P

13:43 ie not clojure's concurrency primitives

13:43 mechazoidal: yeah. :|

13:43 gfredericks: ,(doc locking)

13:43 clojurebot: "([x & body]); Executes exprs in an implicit do, while holding the monitor of x. Will release the monitor of x in all circumstances."

13:43 mechazoidal: I'm still a little bit confused on how overtone's doing it, since I'm also using clj-native.

13:43 oh

13:45 pepijndevos: I remember this quote that went something like "it is more useful to have 100 functions over 10 types than 10 functions over 100 types", any idea what that could have been?

13:46 technomancy: perlis IIRC

13:47 gfredericks: (defmacro docking [] `(doc locking))

13:49 pjstadig: ~9

13:49 clojurebot: Cool story bro.

13:49 pjstadig: hmm

13:50 arcatan: pepijndevos: "It is better to have 100 functions operate on one data structure than 10 functions on 10 data structures." -Alan Perlis

13:51 hiredman: pjstadig: huh

13:53 pjstadig: i thought there was a way to get clojurebot to recite the epigrams

13:54 #9

13:55 pepijndevos: arcatan: yay, thanks

13:58 hiredman: ~#9

13:58 clojurebot: 9. It is better to have 100 functions operate on one data structure than 10 functions on 10 data structures. -- Alan J. Perlis

13:58 hiredman: ah

14:01 ivan: ~#73

14:01 clojurebot: 73. It is not a language's weakness but its strengths that control the gradient of its change: Alas, a language never escapes its embryonic sac. -- Alan J. Perlis

14:30 drorbemet: Hi, does anybody know which companies in Germany are using Clojure in their projects?

14:33 chronno: drorbemet: I think I once saw a video of some guys using it at Deutsche Bank

14:34 drorbemet: http://skillsmatter.com/podcast/scala/real-world-clojure

14:37 aravind: This is a little off-topic, but I am looking for some help with incanter. I have a dataset which has data generated via a lazy seq. When I try to use (view) that dataset, I get a ArrayIndexOutOfBoundsException the first time, but subsequent calls to it display the data just fine.

14:38 I guess the question is how do I use this (lazy seq) correctly?

14:47 llasram: aravind: Sounds like a bug in Incanter to me, although I'm not sure how. What happens if you `doall` the seq?

14:52 aravind: llasram: hmm.. this might not be an incanter bug, when I generate that plain sequence (without any incanter fanciness), and do a doseq println on it, it works for a little while before it dies with the same exception.

14:53 I assumed the doseq would run for a while before it finished, but it seems like I am running into some other problem.

14:55 llasram: aravind: Oh, that actually makes more sense. Once generation of the lazy seq throws an exception, further generation is terminated, and you're just left with what had been produced thus-far

14:56 aravind: yeah.. I am debugging the part when the sequence is generated..

15:00 bbloom: for all those interested in clj/cljs code sharing, i'd appreciate some feedback on this idea i had: http://dev.clojure.org/display/design/Feature+Expressions?focusedCommentId=6390066&#comment-6390066 (last comment)

15:00 would love to push along the design and implementation of *something* for conditional compilation

15:02 drorbemet: chronno: Ah, thanks for the hint :-)

15:03 chronno: drorbemet: You're welcome :-)

15:03 llasram: bbloom: Oooh. And the forms are nestable, if you need to conditionally evaluate how you determine what to conditionally evaluate

15:03 bbloom: llasram: i mean, who wouldn't want to conditionally compile their conditionally compiled conditional compilation?

15:04 hiredman: I still think it is a mistake to put the conditional stuff in the reader

15:04 RazLaptop: So I'm confused about something, in C, I could store a gigantic list as a dynamic array with a linked list and doing malloc or calloc. In Clojure.. if I need to store an extremely large amount of data, do I just stick it all in one list? (def giganto-list) and append to it? It would contain hashes, vectors, anonymous functions, etc... possibly running into gigs of size?

15:04 * drewc will say that Common Lisp has reader conditionals #+ and #- and I use them all the time!

15:04 hiredman: yeah, I know

15:05 but the problem is they then become opaque to anything post reader

15:05 bbloom: drewc: what do you do about if/else conditionals? just #+foo and #-foo ?

15:05 drewc: #+win32 #+sb-thread #+(or)

15:05 or #-

15:05 bbloom: hiredman: lots of stuff is already opaque post reader

15:05 kaoD: bbloom: couldn't you just do a macro for that ?

15:05 hiredman: if you make a code analysis tool that walks forms after the reader has read them, the analyzer won't see conditionals

15:05 bbloom: yeah, and it sucks

15:05 kaoD: or what are the benefits of reader syntax besides it being concise ?

15:06 bbloom: drewc: hmm had not considered #+(or), wouldn't that just be the same as not specifying #+ at all ?

15:06 hiredman: but I've said all that on the wiki page

15:06 bbloom: hiredman: but we can't change that now. it's too late: if you want to make an analysis tool, you have no choice but to operate with a special class of reader

15:06 hiredman: which i agree is unfortunate, but it's waaay too late to fix :-(

15:07 personally, i'd rather specify namespaced symbols for all special reader syntax to be expanded to, which is still possible even if you add more conditional reading stuff

15:07 for example `foo really should be (clojure.core/syntax-quote foo)

15:08 drewc: bbloom: yeah, exactly. Sometimes you want to 'comment' out a whole sexp. #+(or) is perfect (at least on CL, no idea about the clojure commenting syntax, been 6 years since I had a clojure contract)

15:08 bbloom: and there is no reason you can't have #~foo be (clojure.core/reader-unquote foo) visible to an analysis phase

15:08 drewc: clojure has #_

15:08 ,(+ 1 #_2 3)

15:08 clojurebot: 4

15:09 bbloom: hiredman: although, you're STILL screwed if you're building a live code analysis tool in an editor, b/c there is no where to hang comments and significant whitespace :-P

15:10 hiredman: bbloom: I am not opposed that, a set of reader macros that expand in to information preserving s-expressions that are handed off to the compiler

15:10 drewc: bloom: but what about, for example : #+(or win32 win64 macosx) ... that are supposed to be reader conditionals for a reason ...

15:10 bbloom: hiredman: also, this is the point where i should mention small talk's comment syntax is just a string: http://www.inf.ufsc.br/poo/smalltalk/ibm/tutorial/chap3.html#3.30

15:10 hiredman: but I don't think anyway besides me cases

15:10 me cares

15:11 bbloom: *shrug*

15:11 bbloom: hiredman: heh. i think tools.reader could pretty easily be extended to return information preserving forms

15:11 maybe there should be a clojure.reader namespace for those things, so there is no concern of conflict

15:12 i agree it's a mistake to lose info in the reader, i'd rather it be a configurable translation pass

15:13 hiredman: the non-reader conditional feature expressions could be implemented as a library

15:14 bbloom: hiredman: yes. if others like my unquote/unquote-splicing suggestion, then phase 1 is to implement the feature expressions as a macro library

15:14 hiredman: (defmacro feature-condition [...] ...) and it does some sniffing of the environment to see if it is being expanded in clojure or clojurescript

15:14 bbloom: actually, that's all phase 2. phase 1 is to define what info is stored where

15:15 hiredman: s/library/single simple macro/g

15:15 bbloom: personally, i think a set of flags is a bad plan compared to a map or a collection of vars

15:17 * drewc will say that "string" is not a string, and '(1 2 3 4) is not a list ... so the reader already lost the information on what turns into what ... reader/macroexpander/compiler/evaluator after all :P

15:20 hiredman: ~hyperspec

15:20 clojurebot: hyperspec is not applicable

15:20 rplaca: clojurebot: it is for clojure.pprint/cl-format :)

15:20 clojurebot: You don't have to tell me twice.

15:20 bbloom: somebody totally needs to make a clojure hyperspec :-)

15:20 clojurebot: hyperspec is http://www.lispworks.com/documentation/HyperSpec/Front/

15:20 clojurebot: In Ordnung

15:20 bbloom: ~hyperspec

15:20 clojurebot: hyperspec is http://www.lispworks.com/documentation/HyperSpec/Front/

15:21 rplaca: bbloom: of course, that assumes a spec to start from

15:21 bbloom: rplaca: what's a spec? never heard of it. :-P

15:22 hiredman: rplaca: the hyperspec would lead you too believe clojure.pprint/cl-format can format numbers as roman numerals, but last time I tried it just barfed at me

15:22 rplaca: bbloom: the hyperspec is based on the CL spec. Clojure doesn't have a spec to start from

15:22 bbloom: that should work

15:22 bbloom: rplaca: i know... i was kidding around...

15:23 rplaca: there tests in the test suite that do it

15:23 *there are

15:23 bbloom: hiredman: so one reason you need conditional compilation at read time is for things like extend-type (via deftype, defrecord, etc)

15:23 hiredman: bbloom: that is not true

15:24 bbloom: hiredman: how would i conditionally implement a protocol?

15:24 hiredman: bbloom: there are lots and lots of ways

15:24 bbloom: hiredman: lol share with me just one

15:25 hiredman: (feature-cond :clojure (extend-protocol ...) :clojurescript (extend-protocol ...))

15:25 the simplest

15:25 bbloom: hiredman: that's not a good enough solution b/c deferring extend-protocol has performance implications

15:25 hiredman: (feature-cond :clojure (deftype ...) :clojurescript (deftype ...))

15:26 rplaca: ,(clojure.pprint/cl-format true "It is now the year ~@R~%" 2013)

15:26 clojurebot: #<ClassNotFoundException java.lang.ClassNotFoundException: clojure.pprint>

15:26 bbloom: it also means that i can't conditionally implement a single method of a multi-function protocol without duplicating the boilerplate

15:26 hiredman: bbloom: fortunately lisp has a great mechanism for dealing with that

15:26 rplaca: well, it would work if clojurebot would let it :)

15:26 bbloom: hiredman: i shouldn't be expected to write per-use-case macros for everything i want to conditionally compile

15:27 hiredman: i'd need to recreate the parsing and semantics of each macro in order to create a meta macro that supports conditional compilation

15:27 hiredman: bbloom: no, but you can build generic macros on top of that

15:27 bbloom: hiredman: wouldn't that generic macro just be like my backtick library?

15:27 ie code templating

15:27 hiredman: bbloom: or deftype can actually macroexpand things instead of expecting literal names

15:28 bbloom: ie unquote and unquote-splicing ?

15:28 hiredman: bbloom: sure, but not at read time

15:29 bbloom: hiredman: ok, so basically i just wrap my whole file in (conditionally-compiled-block ...) and then delegate to backtick

15:29 which is honestly what i was about to do for some conditional code i'm gonna write

15:29 hiredman: bbloom: I don't follow

15:29 you put conditionals where you want them

15:29 bbloom: hiredman: github.com/brandonbloom/backtick

15:30 hiredman: I am familiar with backtick

15:30 bbloom: hiredman: i'm just gonna wrap a whole file with that and now ~ and ~@ work for splicing in code like the reader changes i proposed

15:30 it's one example of a "generic macro" you suggest

15:30 you look for forms that demarcate conditional blocks & then rewrite them

15:31 but you don't do symbol resolution like a normal syntax quote, you just leave the symbols alone

15:31 which is what backtick's template does

15:31 in theory, we don't even need to change the grammer, if we just used ~ and ~@ and the whole file was in an implicit syntax-quote with symbol resolution turned off

15:32 unfortunately, clojure also doesn't have anything like racket's #lang

15:32 so you can't achieve implicit whole file stuff before the 'ns form

16:33 pppaul: mls

16:33 ug, stupid synergy

17:18 Rich_Morin: Is Clojure's architecture (ie, an evaluator/compiler, coupled to a VM) particularly new? For example, do any other Lisps employ this approach?

17:24 technomancy: Rich_Morin: I don't know of any other lisps which piggyback on an existing VM apart from Kawa/ABCL, which are just ports of existing lisps

17:24 S11001001: Rich_Morin: could you be more specific about the aspects you're looking for? "evaluator/compiler coupled to a VM" describes *lots* of things.

17:26 Rich_Morin: I'm trying to create an overview page for Clojure's architecture (http://wiki.cfcl.com/bin/view/Projects/Clojure/Key/Architecture). I was wondering about similar technologies.

17:28 technomancy: I guess elisp is coupled tightly to a VM, albeit a VM implemented solely for the purpose of running elisp.

17:28 mpenet: Rich_Morin: there is joxa

17:28 S11001001: Rich_Morin: well, that diagram can be used unchanged to describe the two technomancy mentioned, plus sisc. If you're willing to substitute "JVM", there are many more examples that still fit that diagram.

17:28 technomancy: S11001001: sisc is an interpreter though, isn't it?

17:29 craigbro: scheme48

17:29 scsh

17:29 lisp in pop11 vm

17:29 poplog that is

17:30 Poplog is a reflective, incrementally compiled software development environment for the programming languages POP-11, Common Lisp, Prolog, and Standard ML, originally created in the UK for teaching and research in artificial intelligence at the University of Sussex.

17:30 S11001001: technomancy: ah, yeah.

17:30 craigbro: the scheme48 VM is special purpose for scheme tho

17:30 S11001001: craigbro: right, swap JVM out and there are lots of examples.

17:31 craigbro: netlogo

17:31 not a lisp

17:31 but lispish in many ways

17:31 S11001001: craigbro: I'm also assuming this applies: "If the evaluator detects invocation of a macro, it sends the current data structures off for macro expansion. The expanded versions are accepted in place of the originals. This process is repeated until all macros have been resolved."

17:32 except s,evaluator,evaluator/compiler,

17:33 craigbro: that's compilation

17:33 no matter how you slice it

17:45 brehaut: what advantages does core.contracts have over just using regular clojure :pre and :post conditions?

17:45 Rich_Morin: http://wiki.cfcl.com/bin/view/Projects/Clojure/Key/Architecture - updated; comments welcome...

17:45 gfredericks: brehaut: adding contracts to existing functions outside their definition?

17:45 brehaut: gfredericks: excellent :)

17:46 gfredericks: if you're not altering a var's root, you're doing it wrong.

17:46 --perlis

17:46 brehaut: ive never seen that one before

17:48 technomancy: perlis apocrypha

17:48 brehaut: technomancy: i hope theres one about a dragon

17:52 technomancy: there is if you want there to be

17:52 that's the great thing about apocrypha

17:52 gfredericks: it knows how to say yes?

18:00 Rich_Morin: Is there a "link" stage (eg, as the bytecode is loaded into the JVM)?

18:00 technomancy: Rich_Morin: there is classloading, yeah

18:01 I don't know enough about C to say whether it's like linking

18:02 Rich_Morin: Traditional linking mostly has to do with symbol resolution. Dunno how this applies to Clojure or the JVM.

18:03 S11001001: Rich_Morin: all the symbol resolution is delayed on a symbol-by-symbol basis; every class has its own init, only invoked when the class is demanded at runtime

18:03 Rich_Morin: clojure eagerly demands a lot more, though, and has its own mutable tables of symbol mappings.

18:03 Rich_Morin: you really have to separate clojure's environment from java's.

18:03 Rich_Morin: Does that include situations where some Java code is calling a Clojure function?

18:04 brehaut: java code calling a clojure function (rather than a method implemented on a type in clojure) indirects at least once through the same symbol table (vars) that clojure code uses

18:04 Rich_Morin: Basically, does the JVM need any sort of plumbing to be set up when a new Clojure function is added?

18:05 S11001001: Rich_Morin: Java code calls clojure functions by looking them up in clojure envs, which are ordinary data structures. The clojure code has to be loaded to be found in the env.

18:09 Rich_Morin: Cool; thx

18:09 brehaut: S11001001: you know about core.typed right?

18:10 S11001001: brehaut: a bit

18:11 brehaut: S11001001: is it reasonable to use on only some namespaces in a project, or once you start using it, do you have to type everything and your deps too?

18:12 S11001001: brehaut: the former. You'll get more out of it if you type bottom-up, rather than top-down, though.

18:12 brehaut: S11001001: awesome; im thinking about giving it a shot on a new project, so i would be working bottom up

18:12 S11001001: but i'd like some escape hatches if i run into hard to check stuff

18:12 S11001001: brehaut: great; new code is best

18:13 technomancy: are there plans to make it honor existing metadata-based type hints?

18:13 brehaut: S11001001: thats good news :)

18:13 S11001001: brehaut: tc-ignore is there so you can say "frell it, this implementation is fine"; you can still attach a type to syms defined in a tc-ignore and it's cool with it

18:14 brehaut: sweet :)

18:14 this is exciting

18:14 technomancy: using not-metadata for types struck me as a very strange implementation tactic

18:14 S11001001: brehaut: you can also attach types to syms in a module that is itself not checked at all

18:14 brehaut: which is how clojure.core syms have types

18:15 brehaut: S11001001: right, that makes sense

18:15 S11001001: technomancy: the existing metadata isn't really very good. Seqable isn't enough, you want (Seqable A) for some A

18:16 technomancy: S11001001: sure, but you can encode the latter as metadata

18:17 I just don't like inventing new channels for expressing things we already have a good way to express.

18:21 brehaut: S11001001: so it would be possible to declare all the types in, eg, a test namespace so that core.typed is only a dev dependancy?

18:24 S11001001: brehaut: Maybe. There are a few clojure.core functions and macros with constrained alternatives in typed that are easier to type, so if you want typed versions of those... also, having your ann forms next to the defns they're typing is pleasant.

18:24 brehaut: I wouldn't try it; better would be lazy loading for typed itself

18:24 brehaut: S11001001: sure, im just slightly concerned about having all that extra dependancy (and memory usage) in my built product

18:27 S11001001: hg st

18:27 :D

18:58 bendlas: Does anybody currently have ritz working with nrepl and emacs?

19:27 tjgillies: is there a way to install a package for one time use from lein repl?

19:27 if i just want to test some functions

19:29 abp: tj

19:29 tjgillies: You mean without a project?

19:29 tjgillies: abp: yes

19:31 abp: tjgillies: http://www.learningclojure.com/2013/02/runtime-require-downloading-new.html

19:31 tjgillies: abp: thnx

19:34 papachan: somebody here use IntelliJ for clojure?

19:56 ravster: What is the clojure equivalent of common lisp's 'push'. I want to add something to a list

19:56 hiredman: lists are immutable

19:57 ravster: okay, how to I create a new list of the first one plus something else?

19:57 mrowe: ravster: conj maybe?

19:58 ravster: mrowe: thanks. conj is what I need.

19:58 I figured there would be something, I'm just not familiar with the set of clojure functions yet.

20:06 ambrosebs: Foxboron: had a browse through my Parjer?

20:17 tjgillies: (defn push [element lst] (dosync (alter lst conj element)))

20:17 * tjgillies hides

20:23 Raynes: Parjer. God, the names, make it stop.

20:24 technomancy: parjer.core

20:24 rasmusto: technomancy: haha, I saw the LEIN_IRONIC_JURE thing in leiningen, cracked me up

20:28 technomancy: we all have a part to play to make the world a better place

20:32 papachan: hi there

20:32 anybody using intellij here?

20:33 just trying to make my project running my main function with intellij

20:35 hiredman: win /win 15

20:46 noprompt: could i gather some thoughts regarding a clojurescript macro?

20:47 it's for use with angularjs if anyone's worked with that framework.

20:47 here's the gist https://gist.github.com/noprompt/5095995

20:47 with some explanation.

20:47 it's the first cut at it and it feels a little messy.

20:49 lynaghk: if you're around, you're thoughts would be much appreciated since you've had some experience working with cljs and angular.

20:59 thearthu1: I'm de-contribing and old 1.2.1 library and trying to figure out where prxml went (it's not in "where did contrib go")

20:59 anyone here catch where it got to if anywhere

21:01 amalloy: thearthu1: there's no direct replacement, but migration to data.xml isn't bad. sexp-as-element takes input prxml-style, and emit outputs strings

21:02 thearthu1: thanks amalloy, I'll try sexp-as-element

21:30 Hendekagon: papchan: yes, sometimes

21:45 papachan: Hendekagon: but do you use main function to start your project?

21:46 i cannot give arguments to my main script

21:47 Hendekagon: papchan: 2 options: use the la clojure plugin + leiningen plugin and run your code from the la clojure repl....

21:48 papchan: ok have you got la clojure installed ?

21:50 papachan: la clojure?

21:50 i have clojure installed in my intelliJ plugins

21:51 Hendekagon: papachan: ok - then you can either run clojure code from the la clojure repl, or using run...

21:51 papachan: ok i will look for it

21:53 yeah i have La Clojure installed Hendekagon

21:53 Hendekagon: you can set arguements under project structure>modules><your module>>Clojure

21:54 papachan: oh i am lost

21:54 i see the edit run configs

21:55 project-settings?

21:56 Hendekagon: file>project structure...

21:57 papachan: oh isee

21:57 where i have clojure.main

21:58 Hendekagon: - add any JVM options there

21:58 papachan: i try that

21:59 Hendekagon: if you want to run your code as a Java program, and your Clojure code has a -main function, you follow the rules for normal Java apps under the Run menu

21:59 papachan: but if i want to call a main function from a class?

22:00 Hendekagon: then you need to add a function (defn -main [& args] (code here)) to one of your Clojure namespaces

22:00 then you can run it as if it were a Java app

22:01 using the settings given under Run>edit configurations>

22:01 frozenlock: er... how does one make a jar with a bunch of java files? (there's a build.xml in the lot)

22:01 papachan: Hendekagon ok. do i check run script in REPL or not?

22:02 Hendekagon: frozenlock: add the java source to your leiningen project.clj & do lein uberjar

22:03 frozenlock: Hendekagon: it's not a clj project... it's a library I want to use as a dependency. I want to upload it to clojars, but I need a .jar beforehand

22:03 Hendekagon: papachan: if you want a repl to talk to your app

22:03 frozenlock: ummm, has it gone through all the maven hoops ?

22:05 frozenlock: I think so, I used to upload the .jar myself with a carefully handmade pom file.

22:05 But this time the author didn't jar it :s

22:17 technomancy: frozenlock: you should yell at him for not putting it in a repository

22:18 but you can also use the scp upload method

22:18 george`: hi, I have a problem with future-call that I don't understand; I do (future-call my-function), where my-function calls println, then enters a while loop, then calls println. When I make the call I get the first println, but when the while-test fails, it just returns nil, and I don't get the second println (at the repl)

22:18 a paste is here if it helps, https://www.refheap.com/paste/12147

22:18 frozenlock: technomancy: it's in CVS :s

22:19 technomancy: frozenlock: might have to yell louder then; he's probably hard of hearing.

22:19 george`: testing a simple while loop with the same behavior at the repl works fine

22:19 frozenlock: Indeed. What an horrible interface..

22:20 (on sourceforge that is)

22:21 george`: also testing (future-call simple-while-loop) at repl works OK

23:03 xeqi: george`: does (myfunction) throw an exception?

23:18 george`: xeqi: no, but I'm wondering if the last println output is somehow getting redirected...I don't rebind anything though

23:20 xeqi: ah, you might be looking for #(doc boundfn)

23:20 &(doc boundfn)

23:20 lazybot: java.lang.RuntimeException: Unable to resolve var: boundfn in this context

23:20 xeqi: doh

23:20 &(doc bound-fn)

23:20 lazybot: ⇒ "Macro ([& fntail]); Returns a function defined by the given fntail, which will install the same bindings in effect as in the thread at the time bound-fn was called. This may be used to define a helper function which runs on a different thread, but needs the same bindings in place."

23:24 george`: thanks that looks useful

23:24 but a future should not rebind normally, right?

23:26 xeqi: I think that a future doesn't bring along the bindings, so things like *out* (which is implicitly used by println) get the value System/out

23:26 Raynes: Futures do not bring bindings.

23:26 xeqi: ##(println *out*) ##(future (println *out*))

23:26 lazybot: (println *out*) ⇒ #<StringWriter #<StringWriter > nil

23:26 (future (println *out*)) java.lang.SecurityException: You tripped the alarm! future-call is bad!

23:26 xeqi: silly lazybot

23:27 Raynes: Futures really are bad.

23:27 :p

23:27 xeqi: just like ##(Thread. (constantly nil)) s

23:27 lazybot: ⇒ #<Thread Thread[Thread-7602,5,sandbox]>

23:28 Raynes: Naw, threads are fine.

23:28 xeqi: futures get block because they use a threadpool?

23:28 *blocked

23:29 Raynes: Yes.

23:29 abp: (if (not-any ::unbound cells) ...)

23:29 neat :D

23:29 Raynes: xeqi: Not promising any of it makes sense, but that's how it works. :p

23:29 george`: System/out in Emacs repl is still the repl though? Or Not? Because the first println in the function called by future prints to the repl

23:29 xeqi: Raynes: heh, I'm tempted to find a way to make a thread stick around

23:29 abp: more like (if (not-any? ::unbound cells) ...)

23:30 Raynes: It probably wouldn't be hard, xeqi.

23:30 xeqi: You already know how to forkbomb him though.

23:31 xeqi: george`: I think it ends up there, but there are some interleaving issues with multiple writeres, but this hits my limits of understanding

23:33 abp: That's not bad as well: (assert (not-any? ::unbound cells) ("Got unbound param: " (some ::unbound cells)))

23:33 I want to write Clojure dsls forever.

23:55 TimMc: Raynes: WTF, I thought futures conveyed bindings!

23:57 Raynes: (let [f (binding-conveyor-fn f) ...] ...) from future-call -- I think it conveys bindings just fine.

23:57 dcolish: is a future a 1:1 for java Future?

23:58 Raynes: TimMc: Then apparently I'm wrong.

23:58 I've been known to be this way before.

23:58 TimMc: BOOYAH

23:58 i mean

23:59 "Yeah, I guess so."

23:59 Raynes: We should arrange for a bout of fisticuffs, sir.

23:59 TimMc: I'll have my people contact your people.

Logging service provided by n01se.net