2010-07-22
| 00:00 | tomoj | btw, does choas's version have some good stuff I need? I'm just using stu's |
| 00:00 | defn | he just updated it for 1.2.0 |
| 00:00 | defn | tomoj: your way worked |
| 00:00 | defn | thanks for that |
| 00:01 | tomoj | ah |
| 00:01 | tomoj | groupId/artifactId are not necessarily related to the namespaces defined |
| 00:01 | mmarczyk | seancron: strangely enough, it seems to me that the dataset function in Incanter isn't prepared to cope with empty dataset definitions... or maybe I'm just too sleepy to think clearly |
| 00:02 | defn | tomoj: yeah that's always been sort of finicky |
| 00:02 | seancron | (def data (dataset ["time" "up?"] [[]])) does the same thing |
| 00:02 | mmarczyk | seancron: right. see above |
| 00:02 | defn | im trying to teach my friend clojure right now and getting him "set up" seems to be a pretty big feat |
| 00:03 | defn | he has to learn: git, slime, paredit, and clojure of course |
| 00:03 | mmarczyk | seancron: you could always construct |
| 00:03 | mmarczyk | seancron: an incanter.core.Dataset yourself... |
| 00:03 | defn | i guess on paper it doesn't seem like it's all that bad, but for someone who is unfamilliar it's a tall order to just start writing some code |
| 00:03 | mmarczyk | seancron: (incanter.core.Dataset. ["time" "up?"] {}) |
| 00:03 | defn | i know there are other methods but he happens to know emacs so... |
| 00:04 | tomoj | why git? |
| 00:04 | tomoj | I mean, if you want to contribute to any projects, sure |
| 00:05 | defn | well we're working on a project together |
| 00:05 | defn | he just finished his undergrad CS degree and im trying to get him up to speed with "real life" development |
| 00:05 | defn | :) |
| 00:05 | tomoj | hehe |
| 00:05 | defn | so we're doing clojure + hadoop + twitter nozzle + opennlp + git + jfugue |
| 00:05 | defn | with some machine learning for fun |
| 00:06 | jacortinas | sounds cool |
| 00:07 | tomoj | what the hell does jfugue have to do with the rest of that? |
| 00:07 | defn | yeah the basic idea is we're going to generate music based on tweets by using NLP |
| 00:07 | defn | :) |
| 00:07 | tomoj | haha |
| 00:07 | tomoj | please share if successful |
| 00:07 | jacortinas | why the hadoop? |
| 00:07 | defn | we're going to store results |
| 00:08 | defn | and then tag them for quality |
| 00:08 | mmarczyk | awesome :-) |
| 00:08 | jacortinas | ahh I see, so you need to map reduce over them after storage |
| 00:08 | jacortinas | should be a ton of data |
| 00:08 | defn | yeah it's insane -- i was just playing with "nozzle" earlier and I had a callback that was (println tweet) |
| 00:08 | defn | so im staring at my repl thinking: hm that's weird, the stream is open where are the tweets? |
| 00:09 | defn | i go to my terminal about 40 minutes later and see tweets screaming by lol |
| 00:09 | defn | i think at first we're just going to start with a single day of tweets and see what happens |
| 00:09 | Bahman | Hi all! |
| 00:10 | defn | some fun ideas are we're going to use syntax like , ; : and ' to modify duration of words/notes |
| 00:10 | defn | and also do some intelligent part writing techniques to try and find common chord progressions based on groupings of characters |
| 00:10 | defn | so "The" becomes "ACE" an a major triad |
| 00:11 | defn | and so on from there |
| 00:11 | defn | there is also some neat stuff in the opennlp library which allows you to chunk phrases, which could be interesting to explore like they are musical phrases |
| 00:11 | defn | but anyway -- we'll see if it ever gets finished! :) |
| 00:12 | jacortinas | sounds cool |
| 00:14 | defn | totally useless, but a fun chance at a code art project |
| 00:18 | rjevans | defn: you can check the last modified date if you go to: http://clojars.org/repo/ |
| 00:18 | rjevans | but I also wish it was on the actual pages for a jar |
| 00:19 | defn | rjevans: oh right, good thinking |
| 00:20 | defn | rjevans: clojars needs some work -- i should really fork and try to improve it |
| 00:20 | defn | searching needs improvement, as does the ability for a maintainer to take "ownership" of a repository, or to make their repo the "official" version |
| 00:20 | defn | maybe parse the pom and discover which version of clojure.core it was built for |
| 00:22 | rjevans | improved searching and more info on the actual pages for a jar would be a great step |
| 00:24 | seancron | mmarczyk: hmm, I'm getting ClassNotFoundExceptions when I try to use (incanter.core.Dataset. ["time" "up?"] {}) How do I include the Dataset class? |
| 00:30 | talios | jacortinas: clojars is maven based already. it's a maven repo. |
| 00:30 | jacortinas | yeah I know that |
| 00:30 | talios | even ivy uses maven |
| 00:31 | qbg | ,(some not [true true false true]) |
| 00:31 | talios | and we use it cause no one else has anything better |
| 00:31 | clojurebot | true |
| 00:31 | jacortinas | Would you guys want to organize something better? |
| 00:31 | defn | `ryan`: how about "some" |
| 00:31 | jacortinas | whatever your opinion is on Ruby, the Rubygems system is amazing |
| 00:32 | defn | ,(some #(= true %) [false false false true]) |
| 00:32 | clojurebot | true |
| 00:32 | defn | ,(some #(= false %) [true true true]) |
| 00:32 | clojurebot | nil |
| 00:33 | `ryan` | oh yeah that's perfect, thanks |
| 00:33 | defn | you could also use (every?) or (not-every?) |
| 00:33 | defn | in the same fashion |
| 00:33 | talios | jacortinas: probably not, mostly as I want something that's polyglot across clojure, scala, java etc. etc. JVM centric. |
| 00:33 | defn | (not-any?) would work also |
| 00:33 | defn | fwiw |
| 00:33 | jacortinas | hmmm |
| 00:34 | jacortinas | talios: that's a good point |
| 00:34 | talios | gems is nice, but doesn't differentiate between build-time or run-time. which may or may not be a good thing. |
| 00:34 | maravillas | ,(some identity [false false true]) |
| 00:34 | clojurebot | true |
| 00:36 | `ryan` | oh thanks maravillas, I was wrapping identity in a #() because I don't know what I'm doing |
| 00:37 | `ryan` | just got in the habit |
| 00:38 | jacortinas | ,(doc identity) |
| 00:38 | clojurebot | "([x]); Returns its argument." |
| 00:38 | maravillas | no prob |
| 00:38 | jacortinas | ,(doc some) |
| 00:38 | clojurebot | "([pred coll]); Returns the first logical true value of (pred x) for any x in coll, else nil. One common idiom is to use a set as pred, for example this will return :fred if :fred is in the sequence, otherwise nil: (some #{:fred} coll)" |
| 00:39 | maravillas | oh yeah, that's maybe a little bit more readable... #{true} instead |
| 00:40 | jacortinas | ,(some #{true} [false false true]) |
| 00:40 | clojurebot | true |
| 00:40 | tomoj | jacortinas: why wouldn't we use somethin maven based? |
| 00:41 | jacortinas | ,(some #{true} [false false false]) |
| 00:41 | clojurebot | nil |
| 00:41 | jacortinas | tomoj: for the eventual move away from being completely jvm dependent |
| 00:41 | tomoj | oh, yes |
| 00:41 | tomoj | fuck that :P |
| 00:42 | jacortinas | tomoj: haha, I'm coming to clojure for a love of lisp, but I still hate Java |
| 00:42 | qbg | A larger problem than a build tool is all of the JVM dependent code |
| 00:42 | jacortinas | yup |
| 00:42 | tomoj | it's not a problem :( |
| 00:42 | tomoj | it's a blessing |
| 00:42 | jacortinas | haha |
| 00:42 | jacortinas | xml libs and stuff like that |
| 00:43 | jacortinas | in my opinion for a language to be taken very seriously it needs to "eat it's own dogfood" |
| 00:43 | jacortinas | as much as possible should be "pure" |
| 00:43 | jacortinas | and only the very very lowest level things should be platform dependent |
| 00:44 | jacortinas | don't think that I hate that Clojure is on the JVM |
| 00:44 | tomoj | maybe someday in the far future |
| 00:44 | jacortinas | it's great that the JVM allowed clojure to be designed so well |
| 00:44 | tomoj | without the JVM clojure would be nothing, though |
| 00:44 | talios | jacortinas: but a maven repository, is just HTTP + XML metadata - nothing "jvm" about that itself |
| 00:44 | jacortinas | that's what I'm saying |
| 00:45 | jacortinas | IMO XML metadata == JVM |
| 00:45 | jacortinas | haha |
| 00:45 | talios | mmm riiiiiight. |
| 00:45 | jacortinas | and maven is not really a JVM agnostic tool |
| 00:45 | jacortinas | **platform agnostic** |
| 00:46 | talios | sure it is - it works on openjdk, sun jdk, ibm jdk |
| 00:46 | talios | bea |
| 00:46 | jacortinas | true |
| 00:46 | tomoj | we're distributing jars |
| 00:46 | talios | that's like saying we shouldn't use linux cause its all C |
| 00:46 | tomoj | JVM agnosticism is not very important for a tool for distributing jars |
| 00:46 | talios | tomoj: a jar is just a zip file. call it a .car :) |
| 00:47 | tomoj | ok, if the jars contain no .class files, sure |
| 00:48 | jacortinas | I don't feel like it's saying don't use linux |
| 00:48 | talios | Does clojure.net distribute .dll's? :) |
| 00:48 | jacortinas | I feel like it's more like writing the clojure language in ruby |
| 00:48 | jacortinas | and then using rubygems to distribute clojure code |
| 00:48 | tomoj | hmm? |
| 00:49 | talios | nothing wrong with that actualy - if gems make a play for your infrastructure |
| 00:49 | tomoj | a clojure written in ruby sounds like a disaster |
| 00:49 | jacortinas | it feels based in the underlying implementation a little too much |
| 00:49 | talios | just like nothing with using puppet, or chef to distribute/configure your apps |
| 00:49 | jacortinas | tomoj: and I know that, it's a hypothetical |
| 00:49 | tomoj | oh, I misunderstood |
| 00:50 | jacortinas | tomoj: in my hypothetical situation Ruby == Java |
| 00:50 | tomoj | right |
| 00:50 | jacortinas | right |
| 00:50 | tomoj | we'd need to get to a point where we didn't need java libs anymore, though |
| 00:50 | jacortinas | ahh |
| 00:50 | tomoj | which I don't guess is going to happen any time soon |
| 00:50 | jacortinas | that's a great point |
| 00:51 | jacortinas | I would love to get to that point |
| 00:51 | talios | tomoj: even if a lot of apps were pure clojure, for enterprise integration, you're probably going to talk to a JEE server or something somewhere anyway |
| 00:51 | qbg | Rewriting Swing in Clojure would suck |
| 00:51 | talios | The sooner I can some clojure running in our OSGi setup I'll be a happier man :) |
| 00:53 | tomoj | how would you even go about writing swing in clojure? |
| 00:53 | tomoj | end up like ruby with gems written in C? |
| 00:54 | tomoj | or maybe some bundled ffi? |
| 00:54 | talios | at that point we may as well just go haskell |
| 00:54 | jacortinas | I see that as the equivalent of having all of clojure's libs really just using java libs |
| 00:54 | tomoj | hooray |
| 00:54 | talios | and complain about not understanding monads |
| 00:54 | jacortinas | lol |
| 00:54 | jacortinas | I love monads |
| 00:54 | jacortinas | ... I want to love monads |
| 00:55 | jacortinas | ... It would make a smarter person |
| 00:55 | jacortinas | :*{ |
| 00:55 | jacortinas | ... if I understood them |
| 00:55 | talios | :) |
| 00:55 | qbg | What I know about monads: let = identity monad, for = list monad |
| 00:56 | jacortinas | that's haskel you're writing? |
| 00:56 | qbg | (the clojure constructs let and for are the identity monad and list monad respectively) |
| 00:58 | tomoj | for isn't exactly the list monad, is it? |
| 00:59 | qbg | Isn't much of a difference, from what I know |
| 00:59 | tomoj | concatenation? |
| 00:59 | qbg | There is a series of articles about monads in clojure |
| 01:00 | qbg | http://onclojure.com/2009/03/05/a-monad-tutorial-for-clojure-programmers-part-1/ and http://intensivesystems.net/tutorials/monads_101.html |
| 01:01 | qbg | And there is clojure.contrib.monads |
| 01:02 | mmarczyk | for's :while goes beyond what the list monad can normally do, I believe |
| 01:02 | mmarczyk | :when translates to guard in Haskell |
| 01:14 | defn | isnt that a running joke in Haskell? |
| 01:14 | defn | How many monad tutorials does it take to make a Haskell programmer? |
| 01:14 | defn | just one more... |
| 01:16 | jacortinas | haha |
| 01:17 | jacortinas | you know what's crazy? |
| 01:17 | jacortinas | I said "haha" in the #c room |
| 01:17 | jacortinas | and I was basically told to shutup until I had something intelligent to say |
| 01:20 | defn | oh dude. that's par for the course |
| 01:21 | jacortinas | it's really "douchy" in there |
| 01:21 | jacortinas | some admin saying that stupid people make a lot of noise |
| 01:29 | fualo | I started emacs and it asked me if I wanted to download clojure (after trying to get it installed) - what package does this? in *Messages* it looks like it was downloaded from rep.technomancy.us |
| 01:29 | fualo | I had swank/slime/etc installed from ELPA |
| 01:38 | tomoj | the technomancy-approved way is to use lein-swank |
| 01:39 | tomoj | then it doesn't matter whether emacs downloads clojure or not |
| 01:40 | tomoj | just add swank-clojure to your lein project's :dev-dependencies, `lein swank`, and M-x slime-connect |
| 01:45 | seancron | mmarczyk: Thanks for your help. I figured out that dataset doesn't like it when the data is "[[]]". It works when the data is just "[]" |
| 01:47 | mmarczyk | seancron: oh, so it does -- thanks for pointing this out, I actually thought it was a bug :-/ |
| 01:48 | mmarczyk | seancron: shouldn't stay at the keyboard this long, I guess |
| 02:45 | Raynes | mmarczyk: Remember that weird sexpbot bug that happened when sexpbot was run through a swank server, and you tried to use rseq or iterate? I just tried it locally with 1.2-beta1, and it worked. :o About to try it remotely. |
| 02:49 | Raynes | Hrm, no dice. Odd. Before, it wouldn't even work locally. |
| 02:49 | Raynes | Bleh, back to the shell script. :\ |
| 02:50 | Raynes | Oh. The dependencies are screwed up. That can't be good. |
| 02:51 | Raynes | I absolutely love maven... |
| 02:51 | Raynes | talios: Not a word from you. :p |
| 02:51 | talios | maven maven maven :) |
| 02:51 | talios | and yes - I do have a highlight notification on the word 'maven' :) |
| 02:52 | talios | you'd have the same issue with leiningen tho - bad dependency references are bad dependencie references |
| 02:52 | Raynes | Different jars are being pulled down on Licenser's server than they are on my machine. |
| 02:52 | Raynes | talios: It is Leiningen. |
| 02:52 | talios | oh :) |
| 02:52 | Raynes | But it uses maven. |
| 02:52 | talios | true true |
| 02:53 | talios | I guess you ( or the other server ) has a ~/.m2/settings.xml file with mirrors defined |
| 02:53 | technomancy | Raynes: sometimes the maven central mirrors get screwed up |
| 02:53 | talios | maybe |
| 02:53 | technomancy | depending on which mirror you hit, you get a different jar. it's Magical. |
| 02:53 | talios | local mirrors/repos for the win. |
| 02:53 | Raynes | technomancy: I have two clojure-http-client jars, the wrong clojure-contrib jar... |
| 02:53 | Raynes | All sorts of stuff. |
| 02:54 | Raynes | I'm guessing that one of my own projects is the cause of the former. |
| 02:54 | Raynes | I probably forgot to push a new clj-github snapshot or something. |
| 02:54 | defn | "It's magical." |
| 02:55 | talios | Maven is part of slitherin house. |
| 02:55 | talios | The bad kind of magic. |
| 02:55 | talios | -i+y |
| 02:57 | tomoj | I think maven has this "I couldn't find it so I won't try to find it again for X amount of time" thing? |
| 02:58 | talios | it does for -SNAPSHOTS |
| 02:58 | tomoj | does leiningen do that too? |
| 02:58 | talios | but you can override that with -U |
| 02:58 | tomoj | aha |
| 02:58 | technomancy | talios: you have to scp a pom with the jar. |
| 02:59 | talios | technomancy: ahh right. good good |
| 02:59 | talios | tomoj: I think by default its once a day it checks for new SNAPSHOTS, but thats configurable in ~/.m2/settings.xml ( which I suspect should solve it for lein as well ) |
| 03:01 | talios | tomoj: John Smart has a good post on this: http://www.wakaleo.com/blog/246-maven-mythbusters-maven-automatically-updates-for-every-build |
| 03:02 | Raynes | Ah yes, thus solves the mystery of the two clojure-http-client jars. I haven't uploaded a new snapshot, and the old one depended on a version of clojure-http-client under my own groupid |
| 03:02 | talios | mmm, thats more debunking the 'always downloads' myth actually |
| 03:03 | talios | Time to run off for Thursday Night Curry anyways - night all! |
| 03:08 | Raynes | Oh, clj-sandbox's version range is causing the other problem. |
| 03:08 | Raynes | I'll have to wait for Licenser to wake up and throw up a new version without the version range, then all our sexpbot woes should be fixed. |
| 03:09 | Raynes | Version ranges are horrible beasts. |
| 03:09 | Raynes | I only recently learned that projects you depend on can require one "soft" version, but your project's version is preferred. |
| 03:33 | bsteuber | where am I supposed to put (non-maven) dependency jar files using leiningen? |
| 03:33 | bsteuber | I guess not lib as they'll get deleted on every clean |
| 03:35 | defn | is it more idiomatic to do: (defn deserialize [f] (with-open [r (PushbackReader. (FileReader. f))] (let [rec (read r)] rec))) |
| 03:35 | Licenser | Raynes: I am just pushing the sandbo |
| 03:35 | defn | or should i make the let => (fn [r] (read r)) |
| 03:35 | Raynes | Licenser: Cool stuff. Are you about to head to work or something? I have a sandbox question when you have some time. :) |
| 03:36 | Licenser | I have a few minutes |
| 03:36 | bsteuber | defn: (let [x y] x) is identical to just y, no? |
| 03:37 | bsteuber | so just (read r) |
| 03:37 | defn | bsteuber: yeah im trying to figure out why i would have written a let there |
| 03:37 | defn | :) |
| 03:37 | Raynes | A guy made an issue on try-clojure, pointing out that (doc slurp) and doc on anything not whitelisted fails. I suppose this is by design, but is there any way around this, and is there any particular reason that this should fail in the first place? I'm pretty sure you can't pass *anything* to doc that isn't a symbol. |
| 03:37 | bsteuber | :) |
| 03:38 | Licenser | yes since doc takes a variable not a symbol |
| 03:38 | Raynes | Licenser: Aye, but you can't do anything malicious with doc, can you? |
| 03:39 | Licenser | a way around it would be rolling your own doc that is a macro escapes the symbol and then have doc |
| 03:39 | Licenser | * |
| 03:39 | Licenser | that looks up the doc on a symbol and is whitelisted |
| 03:39 | Licenser | and yes I am a genius |
| 03:40 | Licenser | hmm while it might be hard to internalize a macro I'm not entirely sure how that works |
| 03:40 | Licenser | would need to execute it upon startup and declare a doc* function |
| 03:40 | Licenser | like (doc* [x] (doc (resolve x)) |
| 03:41 | Licenser | and (defmacro doc [x] `(doc* '~x)) |
| 03:44 | Raynes | Man, I hate that "cannot change nickname while banned on channel" stuff. |
| 03:44 | Licenser | Raynes: 0.4.1 is pushed |
| 03:45 | Raynes | Licenser: Awesome. |
| 03:45 | Raynes | Thank you. |
| 03:53 | Raynes | Hrm, still happens. Weird, but d'oh well. |
| 04:09 | defn | is (meta) off limits to the sandbox? |
| 04:10 | Raynes | Yes. |
| 04:10 | Raynes | I believe so. |
| 04:11 | sid3k | yo |
| 05:33 | bsteuber | technomancy: is lein uberjar currently broken? for me it deletes lib but doesn't populate it again |
| 05:37 | bartj | hi all |
| 05:38 | bartj | can someone reproduce this error message with an example - "Parameter declaration method-name should be a vector" |
| 05:54 | lozh | ,(defn a (a) a) |
| 05:54 | clojurebot | java.lang.IllegalArgumentException: Parameter declaration a should be a vector |
| 05:54 | lozh | ,(defn a (method-name) a) |
| 05:54 | clojurebot | java.lang.IllegalArgumentException: Parameter declaration method-name should be a vector |
| 05:55 | lozh | fix by putting [method-name] instead |
| 07:30 | sthuebner | Is (read-line) supposed to work with SLIME? |
| 07:30 | sthuebner | I'm using SLIME-20091016 with swank-clojure-1.1.0 |
| 07:31 | sthuebner | and (read-line) doesn't come back on the REPL |
| 07:31 | sthuebner | but if I execute (read-line) in the *inferior-lisp* buffer, it works as expected - returning what I've typed until I hit ENTER |
| 08:22 | lpetit | hello all |
| 08:23 | serp_ | hi |
| 08:23 | lpetit | cemerick, ericthorsen: just read -and then answered- to the post in enclojure's ml |
| 08:55 | defn | hi lpetit |
| 08:55 | lpetit | defn: hi! |
| 08:57 | defn | lpetit: how goes the clojre hacking |
| 08:59 | lpetit | defn: I wish I had more time on it ! |
| 08:59 | lpetit | defn: how goes the joyful book hacking ? :) |
| 09:15 | defn | lpetit: joy of clojure? |
| 09:15 | defn | lpetit: well it |
| 09:16 | defn | lpetit: well it's not my book of course, that's fogus and chousers' baby |
| 09:17 | cryptic_star | morning all - as far as I'm aware, a Java array is a type of seq, but is there an easy sort of way to convert it into a list? |
| 09:19 | lpetit | defn: I'm really not awaken today ! |
| 09:20 | eckroth | Using Swing from Clojure gives me a blank gray window; right-click works (for incanter windows), but the main window does not draw; same effect if I use a simple repl with this code: http://www.dreamincode.net/code/snippet3252.htm ; however, JDK demos work fine (independent of Clojure) |
| 09:20 | defn | lpetit: a list is a seq |
| 09:20 | defn | errr sorry |
| 09:20 | defn | cryptic_star: a list is a seq |
| 09:21 | defn | cryptic_star: seqs are an abstraction |
| 09:21 | eckroth | Why would only Java windows called from Clojure show as blank, and only the main window (tooltips, right-click menus, etc. work) |
| 09:21 | LauJensen | Has anyone here tried wrapping a Clojure program in an installer, which checks for the presence of the JVM - for Windows? If so, any recommended tools? |
| 09:21 | defn | eckroth: perhaps your version of the JVM? |
| 09:22 | eckroth | defn: I'm on Arch Linux, JVM version is 1.6.0_20 |
| 09:22 | rhudson | eckroth: openjdk or sun? |
| 09:23 | defn | eckroth: i had a similar problem on ubuntu, perhaps it is openjdk vs sun |
| 09:23 | defn | im guessing you need sun |
| 09:23 | Raynes | Oh boy. |
| 09:23 | bozhidar | OpenJDK is very buggy |
| 09:23 | eckroth | rhudson: defn: it's Sun |
| 09:23 | bozhidar | when it comes down to swing |
| 09:23 | Raynes | eckroth, defn: I actually wrote that code last march. I had no idea what I was doing back then. |
| 09:23 | raek | cryptic_star: arrays are not seq themselves (but they are seqable). you can make a seq from an array with (seq the-array) |
| 09:24 | eckroth | Raynes: yours is the dreamincode.net link? |
| 09:24 | cryptic_star | @defn @raek many thanks! |
| 09:24 | Raynes | It worked at the time, but I can't promise that it is decent in any way. |
| 09:24 | defn | rhudson: is raek thanks for fixing that for me :) i was just looking up the sequence docs |
| 09:24 | chouser | raek: yay. I was about to say that. I love it when I don't have to say things. :-) |
| 09:24 | Raynes | eckroth: Yeah. |
| 09:24 | defn | err rake: thanks ^^ |
| 09:24 | bozhidar | I haven't used clojure that much for Swing development, but I've used Java a lot - and you I hate bug reports submitted from OpenJDK users... |
| 09:24 | defn | raek*, gah, sorry for the typos folks |
| 09:24 | eckroth | Raynes: ah, cool; well, I don't know why it would not work now.. |
| 09:25 | defn | chouser, raek: could you explain to me the difference between something being a sequence and being seq'able? |
| 09:26 | eckroth | Raynes: ah are you the 'famous' Try Haskell / Try Clojure / Try Ruby guy, as seen on HN? |
| 09:26 | defn | eckroth: he's the try clojure guy :) |
| 09:26 | Raynes | eckroth: I'm just the Try Clojure guy. |
| 09:26 | eckroth | Raynes: ok I just misremembered; you showed up on HN recently right? |
| 09:26 | Raynes | Yeah. |
| 09:26 | eckroth | Raynes: ok, cool! congrats on the publicity |
| 09:27 | triyo | I'd like to give counterclockwise a try. Does it play nicely with leiningen |
| 09:27 | Raynes | I think that tryclojure thread was the only one I've posted in there. |
| 09:27 | Raynes | eckroth: Indeed, thanks. It was overwhelming. I never expected people to be so crazy about trylanguage sites. :p |
| 09:27 | defn | Raynes: yeah, really, a hacker new reference is like the nerd version of digg |
| 09:28 | Raynes | eckroth: And that code actually does still work for me. |
| 09:28 | defn | it's kind of a big deal |
| 09:28 | eckroth | Raynes: yeah I've never used them myself, but I'd like to try them as a teaching aid someday, if I ever get the pleasure of teaching a dynamic language (I'm a CS grad student) |
| 09:28 | defn | you rode the front page for almost a day i think |
| 09:28 | eckroth | Raynes: ok so it works; I wonder why clojure-swing apps won't draw for me, but regular java ones will |
| 09:28 | Raynes | defn: Yeah, you know when people start telling you how bad something is, it's popular. |
| 09:29 | chouser | defn the 2 or 3 paragraphs in the book describing the differences between seq, seqs, sequentials, and things that support seq went back and forth between us and rhickey 3 or 4 times trying to get all the terminology just so. |
| 09:29 | defn | chouser: ill re-read that section in JoC |
| 09:30 | defn | chouser: oooooo! At the same time, a wide variety of objects satisfy this interface. Every Clojure collection provides at least one kind of seq object for walking through its contents, exposed via the seq function described above. Some collections provide more than one, for example vectors support rseq and maps support the functions keys and vals. All of these functions return a seq or, if the collection is empty, nil. |
| 09:30 | Raynes | eckroth: Well, it kind of works. Half of the first button can't be seen, and I believe I have it set so you can't resize the window. |
| 09:31 | defn | so lists are collections which have a way in which they are seq'able? |
| 09:31 | chouser | defn: PersistentLists are a bit of an exception, actually, in that they support the ISeq interface directly. |
| 09:31 | eckroth | What's weird is that I can generate an incanter plot window, but I see nothing but gray; yet if I right-click I get a menu, and I can save the plot as a PNG, and the PNG looks fine; I even get tooltips on the gray plot window, but no plot, no matter how much I resize, etc. |
| 09:32 | cryptic_star | triyo: I use counterclockwise, but never with leiningen, mostly because I used counterclockwise when on Windows, and getting leiningen set up with Windows didn't look fun :) I believe leiningen has a way to start an eclipse project and then build off of it - however, I don't know if you can execute leiningen inside eclipse |
| 09:32 | eckroth | Raynes: it's somewhere down the list of google results for "clojure swing" |
| 09:32 | Raynes | Oh, that is horrible. |
| 09:32 | Raynes | There has to be better examples out there. |
| 09:32 | defn | chouser: that actually makes sense -- since vectors (correct me if im wrong here please), seem to be a more complex version of the ISeq interface |
| 09:33 | defn | and the same with maps and sets, they're sort of evolved versions of ISeq, where the list is the analog to them both |
| 09:33 | defn | chouser: am i barking up the wrong tree? |
| 09:33 | chouser | defn: you're very close. :-) Vectors themselves provide a more complex interface (assoc, conj, pop, peek, etc.) so in that sense yes. But again, they don't support ISeq directly -- you call seq on a vector to get a thing that supports ISeq. |
| 09:33 | cryptic_star | triyo: there may be a way to do it from the external tools configuration - I've set up gradle to run from there before (Run -> External Tools -> External Tools Configuration) |
| 09:34 | chouser | ,(seq? [1 2 3]) |
| 09:34 | clojurebot | false |
| 09:34 | defn | chouser: ah-ha! |
| 09:34 | chouser | ,(seq? (seq [1 2 3])) |
| 09:34 | clojurebot | true |
| 09:34 | chouser | ,(class (seq [1 2 3])) |
| 09:34 | clojurebot | clojure.lang.PersistentVector$ChunkedSeq |
| 09:34 | lpetit | triyo: ccw will not get in your way with lein, but does not use lein yet |
| 09:34 | defn | ,(class (seq '(1 2 3))) |
| 09:34 | clojurebot | clojure.lang.PersistentList |
| 09:34 | chouser | so seq on a vector returns an instance of a "chunked-seq-on-a-vector" class |
| 09:35 | defn | ,(class (seq #{1 2 3})) |
| 09:35 | clojurebot | clojure.lang.APersistentMap$KeySeq |
| 09:35 | defn | chouser: yeah! that makes perfect sense now |
| 09:35 | defn | you've completely demystified it for me. :) |
| 09:35 | raek | for java folks it might be useful to think of seqs as iterators |
| 09:35 | defn | iteration has no place in FP! *kidding of course* |
| 09:35 | Raynes | And for me. |
| 09:35 | chouser | defn: well, great! Now why didn't the book do it... *glares at the book* |
| 09:35 | lpetit | triyo, cryptic_star: there's a work in progress in Stephan Mülhstrasser's fork (a contributor of ccw) where he is already able to use lein to get dependencies of labrepl and create a labrepl project |
| 09:36 | Raynes | chouser: I faintly remember reading that section like 3 times, and still not quite *getting* it. |
| 09:36 | chouser | :-( |
| 09:36 | raek | I think this abstraction is one oof the most beatiful things about clojure... |
| 09:36 | triyo | lpetit: thanks for that info |
| 09:36 | Raynes | I don't think anyone has really explained it to me quite well until now. |
| 09:36 | Raynes | chouser: Just throw this IRC excerpt into the book. ;p |
| 09:36 | defn | chouser: could i suggest you show examples of (class (seq [1 2 3])) into the book |
| 09:37 | defn | i think that really helps |
| 09:37 | chouser | raek: maybe, though the word "iterator" may also bring in thoughts of mutable semantics that are entirely unhelpful. |
| 09:37 | chouser | defn: yeah, I think you're right. |
| 09:37 | raek | true. |
| 09:37 | defn | chouser: it demonstrates that pivot point between seq and how they're actually implmeneted |
| 09:38 | defn | implemented |
| 09:38 | chouser | I agree the seq abstraction and its use is one of clojure's most beautiful points, but it's just enough different from anything else we have words for that it's hard to talk about without tripping up. |
| 09:39 | defn | yeah, it sort of becomes a dialog in a lot of ways i think |
| 09:39 | Raynes | chouser: To be fair, you're still doing an excellent job with all of that. |
| 09:39 | defn | because here, i can say: so you mean it works like this? and you sharpen the definition ever so slightly |
| 09:39 | raek | I think that it would be useful for beginners if one could turn off the "call seq on its argument" convenience feature of first and rest when learning |
| 09:40 | Raynes | I still hate manning. They never emailed me back. :( |
| 09:40 | defn | Raynes: what was your issue again? |
| 09:40 | defn | not being able to download the latest? |
| 09:40 | defn | i just use my original email from them with the yahoo order number |
| 09:40 | Raynes | defn: I need to sign in to get the latest MEAP, but it wont let me create an account, and told me to email support. That didn't work. |
| 09:40 | Raynes | I don't have my original email. |
| 09:40 | defn | you don't need to sign in |
| 09:41 | defn | wha? where'd it go? |
| 09:41 | defn | email is cheap, no need to delete ;) |
| 09:41 | Raynes | I have no clue where it is. Probably in my old root.disk files, in thunderbird's trash. I have no clue how to get to it. |
| 09:41 | Raynes | I never delete emails. |
| 09:41 | Raynes | Ever. |
| 09:41 | Raynes | Doesn't mean I don't misplace them. ;) |
| 09:41 | defn | Raynes: that's pretty lame that manning didn't reply |
| 09:41 | defn | who did you email |
| 09:41 | Raynes | support |
| 09:42 | defn | hrmph -- bummer |
| 09:42 | Raynes | It isn't that big of a deal. I can wait for chapter 8, I suppose. |
| 09:42 | chouser | Raynes: do you provide an email address or something when you order the MEAP? Do you know which email address you used? |
| 09:42 | defn | im awfully excited to see the last few chapters |
| 09:42 | Raynes | chouser: Yeah, because they send me stuff. |
| 09:43 | chouser | Raynes: let me see if I can use my contact to get any traction for you. |
| 09:43 | chouser | Raynes: PM your email address to me? |
| 09:43 | Raynes | Sure. |
| 09:43 | defn | the "When to use refs/agents/atoms/primitive locking/futures/promise and deliver/pmap/cells/per-thread bindings stuff is absolutely want I want to hear more about |
| 09:43 | defn | " |
| 09:43 | Raynes | I appreciate that. |
| 09:43 | defn | wow my typing is getting worse and worse today |
| 09:44 | Plouj | forgive my ignorance, but if clojure is a dynamically typed language, does that mean that it requires more unit-testing to make one feel more confident about the correctness of the code? |
| 09:44 | Raynes | defn: It's because I was talking about Perl6. It has you all mixed up. |
| 09:44 | defn | :D |
| 09:44 | Plouj | more than a staticly typed language like Haskell |
| 09:44 | defn | Plouj: it depends on what you're doing |
| 09:45 | Raynes | Unit testing is always good. |
| 09:45 | defn | Plouj: if you have I/O going on then testing will be more important |
| 09:45 | Plouj | defn: I'm wondering in general because I'm trying to decide whether to focus on learning Haskell or clojure for their concurrent tools |
| 09:45 | defn | Plouj: clojure is less restrictive |
| 09:45 | defn | and for that reason i prefer clojure |
| 09:46 | defn | i dabbled with haskell -- it's a beautiful language with lots of interesting ideas |
| 09:46 | chouser | Plouj: I'm sure they're both worth learning. I've only dabbled with Haskell -- some day I need to give it a more serious look. |
| 09:46 | defn | but clojure is more "flexible" -- i dont feel constrained by the rules of the language |
| 09:46 | lpetit | Plouj: people generally don't use this criteria to choose between the two |
| 09:46 | Raynes | The argument of dynamic typing versus static typing isn't as simple as "with static typing, you can be more confident that your code is correct" |
| 09:46 | defn | that's a good point also |
| 09:47 | Raynes | But Haskell is a great thing to learn. |
| 09:47 | Plouj | lpetit: heh, I might be listening to wrong advice, but I wouldn't want to learn a language that later requires me to write unit tests for every piece of code :) |
| 09:48 | Raynes | Knowing either is a benefit to the other. |
| 09:48 | Raynes | I learned stuff with Clojure that helps me write better Haskell code, and vice versa. |
| 09:48 | chouser | unit testing is less prevelent in the clojure community that in, say, the ruby community. Whether this is justifiable or not is something else... |
| 09:48 | Raynes | I don't actually write much (any, lately) Haskell code though. |
| 09:49 | defn | im going to go out on a very, very long limb here |
| 09:49 | defn | and suggest that unit testing in ruby is partly due to the high number of novice programmers |
| 09:49 | defn | that's going to get my head chopped off |
| 09:49 | defn | but i think it's encouraged as much as it is to offer a more tangible "guarantee" |
| 09:50 | Raynes | I suggest that the lesser prevalence of unit-testing in the Clojure community is related to Clojure being more functional-oriented. |
| 09:50 | defn | well yeah there's that too of course |
| 09:50 | Raynes | There isn't much to test in pure functions. |
| 09:50 | defn | yeah, i tried doing unit testing on some stuff i was writing and it just felt like i was re-writing my code |
| 09:51 | Plouj | heh, ok, I guess not all is as bad as I thought :) |
| 09:51 | defn | like asserting that (inc 1) is 2 or something |
| 09:51 | defn | of course it's 2 |
| 09:51 | chouser | heh |
| 09:52 | defn | and when you build that up to a complex function, if the function contains pure elements like inc |
| 09:52 | defn | then there is nothing to test |
| 09:52 | Hodapp | I've talked to a lot of people who paid massive amounts of lip service to the idea of unit tests... and hardly ever wrote them. |
| 09:53 | raek | making seams in clojure is really simple |
| 09:53 | defn | i can echo that -- however, in Ruby there are /lots/ more reasons to have them |
| 09:53 | dnolen_ | Plouj: also remember that Haskell makes certains kind of generic programming difficult. Adopting a strong type system means you give something up. |
| 09:53 | raek | if a function uses another complex function, that one can be dynamically rebound with (binding ...) |
| 09:53 | Plouj | I guess I'll learn that once I use clojure/Haskell more |
| 09:55 | defn | mutable vs immutable => the reason for unit testing EVERYTHING versus only some things |
| 09:56 | defn | Plouj: try to open a file, read it, write to it, execute a line of code contained inside of it |
| 09:57 | defn | Hodapp: working at Google, eh? ;) |
| 09:57 | chouser | Hodapp: no worries ... these days I'm debugging in PHP! :-D |
| 09:58 | Plouj | defn: what about testing that the types that your variables take are what you actually expect? How big of a reason is that for unit testing? |
| 09:58 | defn | oh god chouser ... say it isn't so |
| 09:58 | defn | Plouj: consider that the main "real" outside inputs will be few |
| 09:58 | defn | think about a google search... |
| 09:58 | chouser | PHP is a fascinating language, in a sort of anthropological sense. |
| 09:59 | raek | Plouj: in some cases, that can be done with pre- and postconditions |
| 09:59 | defn | that too |
| 09:59 | defn | but in general i dont find it necessary |
| 09:59 | bortreb | is there something like perl's CGI:Ajax module for clojure yet? |
| 09:59 | defn | because 90% of my code is relying on code above it |
| 09:59 | defn | if the inputs were bad to begin with, we wouldnt be at this depth |
| 10:00 | defn | abstract i know, but you just dont need to pay much attention to it -- if you treat your input like a string, and make sure it receives a string from the next level up the function chain |
| 10:00 | defn | then there's nothing to worry about |
| 10:00 | clojurebot | @ has nothing to do with whether sth is evaluated or not |
| 10:00 | Hodapp | defn: nah, not Google. I thought they mostly were Python or something. |
| 10:01 | defn | Hodapp: GMail is C++ to the max |
| 10:01 | Plouj | heh, ok |
| 10:01 | defn | their interviewers get mad if you write Java on the whiteboard |
| 10:01 | Plouj | interesting |
| 10:01 | defn | Hodapp: they do a lot of python too, but GMail and such is heavy C++ |
| 10:02 | Plouj | does anyone know of any trading companies using clojure? |
| 10:02 | wwmorgan | how do you pronounce the macros -> and ->>? |
| 10:03 | lpetit | thread-first , thread-last |
| 10:03 | defn | heh |
| 10:03 | defn | i call them arrow and double arrow |
| 10:03 | defn | and know how they work |
| 10:03 | Raynes | wwmorgan: Hyphen left arrow and hyphen right arrow right arrow. ;) |
| 10:03 | Raynes | s/left/right/ |
| 10:03 | sexpbot | wwmorgan: Hyphen right arrow and hyphen right arrow right arrow. ;) |
| 10:04 | mefesto | i wonder how much google has been dog fooding their go language |
| 10:04 | defn | mefesto: i think they've been doing quite a bit with it |
| 10:04 | lpetit | google releases a lot of things "in the wild" |
| 10:05 | defn | after all of the unfavorable publicity ive seen some "updates" to go which actually made it looks quite good |
| 10:05 | Raynes | I'm more interested in Rust. |
| 10:05 | defn | what big company is sponsoring rust? |
| 10:06 | Raynes | What big company is sponsoring Clojure? :p |
| 10:06 | Bahman | Hi all! |
| 10:06 | defn | Raynes: Mozilla is developing Rust |
| 10:06 | Raynes | I know. |
| 10:06 | defn | Clojure is riding a lisp wave to heaven right now |
| 10:07 | defn | I'm still sort of amazed that the mainstream has held an interest |
| 10:08 | defn | Raynes: in any event, re: rust vs go -- they're decided to do specific things in-house |
| 10:09 | defn | "structural" typing is kind of a dead giveaway when it comes to go vs rust |
| 10:09 | defn | they're both structurally typed |
| 10:11 | defn | FAQ on Rust: Why did you do so much work in private? |
| 10:11 | defn | A certain amount of shyness. Language work is somewhat political and flame-inducing. |
| 10:11 | defn | Languages designed by committee have a poor track record. Design coherence is important. There were a lot of details to work out and the initial developer (Graydon) had this full time job thing eating up most days. |
| 10:12 | defn | Rich isn't shy, but he won't bend to the whim of committee |
| 10:12 | Raynes | I bet he is having all sorts of fun at emerginglanguagescamp |
| 10:13 | defn | at just about any conf right now clojure is getting a lot of attention |
| 10:13 | defn | im going to strange loop and like 40% of the talks are on clojure |
| 10:13 | defn | btw chouser: looking forward to your talk at strangeloop :) |
| 10:14 | chouser | excellent! I'm looking forward to being there. |
| 10:14 | raek | I *really* want to go to strangeloop |
| 10:14 | defn | raek: so go then! :) |
| 10:14 | raek | I must investigate some more if the university might sponsor this |
| 10:14 | chouser | 40% might be a slight exaggeration |
| 10:15 | raek | it will cost at least about $ 1000 for me to get there |
| 10:15 | chouser | but one talk on clojure in nearly every time slot is nothing to sneeze at. |
| 10:18 | defn | :) |
| 10:19 | defn | In the middle of MO, no less! :) |
| 10:21 | defn | chouser: im sure you've seen this, but you know how a lot of books have those cards that you can tear out? |
| 10:22 | defn | the "quick reference" thing? |
| 10:22 | defn | chouser: http://faustus.webatu.com/clj-quick-ref.html |
| 10:22 | defn | ive been helping my friend learn clojure and this has become invaluable -- it's a very nice mix |
| 10:22 | dpritchett | Has anyone else encountered a problem with the cljr install trying to invoke X11? I don't have X installed at all and I'm getting this: ~$ java -jar ./cljr-installer.jar Exception in thread "main" java.awt.HeadlessException: No X11 DISPLAY variable was set, but this program performed an operation which requires it. at java.awt.GraphicsEnvironment.checkHeadless(GraphicsEnvironment.java:173) |
| 10:23 | chouser | defn: yeah, I saw that -- a very nice quick reference. Not exactly small, altogether. |
| 10:24 | defn | chouser: yeah fair enough -- but it seems to hit all of the points, and give a nice overview without being reductive or overly verbose |
| 10:25 | defn | chouser: food for thought anyway |
| 10:25 | chouser | I agree that page fills a gap in the existing docs. |
| 10:26 | cemerick | dpritchett: sounds like the installer is trying to do some UI stuff, and is in headless mode that doesn't allow it. |
| 10:26 | cemerick | (or importing certain classes is enough to trigger that) |
| 10:26 | dpritchett | It does sound that way - I am surprised that I can't get away with installing on an X-less machine. Guess I'd better check to make sure that I really purged X like I thought I had. |
| 10:27 | AWizzArd | cemerick: After spending trillions of hours with Ant I must now admit that it very much sucks for non-trivial projects. OMG I hate it. |
| 10:27 | dpritchett | su |
| 10:28 | cemerick | dpritchett: If that's actually the problem, then whether X is around or not isn't going to help. |
| 10:28 | Plouj | defn: how does Rust benefit Clojure or am I missing something? |
| 10:28 | dpritchett | That's what I'd think but it's possible I only removed half of X and so the installer is detecting it and assuming my machine isn't completely wonky. |
| 10:28 | cemerick | AWizzArd: Agreed. The same goes for any task/target-oriented build system AFAICT. |
| 10:28 | dpritchett | Either way I submitted a ticket to cljr on github |
| 10:28 | dpritchett | http://github.com/liebke/cljr/issues/issue/12 |
| 10:29 | Lajla | What's the exact difference between symbols and keywords? |
| 10:29 | Lajla | THat keywords evaluate to themselves? |
| 10:30 | AWizzArd | cemerick: I can't say enough about it, as I don't know how Maven or Ivy or Gradle or Leiningen are doing it. |
| 10:30 | dpritchett | Yes Lajla |
| 10:30 | dpritchett | at least that's what it says on page 29 of JoC |
| 10:31 | cemerick | AWizzArd: Ivy just adds maven-style dependency mgmt and compat to ant. |
| 10:31 | Lajla | dpritchett, JoC? |
| 10:31 | Lajla | Joy of Child rape? |
| 10:32 | cemerick | I've not looked at gradle for more than an hour, but I'm really not excited by the notion of using yet another language in connection with a less mature build tool. *shrug* |
| 10:32 | AWizzArd | cemerick: I would like to have one build script for all 24 projects that site under my src/ folder. And I want to specify with each call: 1) which project I want to build, 2) do I want to compile it into a build/ dir?, 3) do I want to jar it? 3a) do I want to include the deps into the jar? 3b) do I want to include the sources into the jar? |
| 10:32 | Raynes | That was majorly inappropriate. |
| 10:32 | dpritchett | ಠ_ಠ |
| 10:33 | AWizzArd | ant {:project "name", :compile false, (jar :sources false, :deps true)} |
| 10:33 | dpritchett | http://joyofclojure.com/ |
| 10:33 | AWizzArd | this is a horror with ant |
| 10:36 | arkh | at strangeloop, will there be video of the conferences, a. la. TED? |
| 10:36 | dpritchett | I just discovered strangeloop last week - hours after I'd committed to a fishing trip for that same weekend. I only live 7 hours' drive away too :( |
| 10:37 | chouser | I think the talks will be recorded, but I don't know how those will be released. |
| 10:37 | cemerick | AWizzArd: I'm not sure about the whole idea of nested dependent projects (which is what it sounds like you have), but FWIW, you can do all that in maven, once, and have all of your projects "inherit" that behaviour. |
| 10:38 | Lajla | dpritchett, I was close, wasn't I? |
| 10:38 | cemerick | chouser: I still pine away for a few of the talks from the ILC. :-( |
| 10:46 | chouser | cemerick: me too |
| 10:47 | chouser | but understandable, I guess. Video on the web is hard. It's not like there are services where you can make video files downloadable for free... |
| 10:47 | defn | youtube... |
| 10:48 | cemerick | chouser: I think it just fell on the floor -- Dan's surely got way more important things on his plate. |
| 10:48 | cemerick | http://ilc2009.scheming.org/node/15 |
| 10:48 | Hodapp | defn: interesting, did not know they used that much C++ there. |
| 10:49 | Hodapp | (delayed response, I know) |
| 10:50 | defn | Hodapp: no worries |
| 10:52 | bortreb | does anyone know of a good compojure tutorial/ can you do AJAX-y things with it? sorry for being such a noob... |
| 10:52 | defn | Lajla: How in the hell does JoC translate to what you said? You're sick. Seek medication. |
| 10:52 | stephyn | I have a question about an idiom in Clojure. I'm watching SICP and it seems to be idiomatic in Scheme to nest define's. I discovered that this doesn't have the desired effect in Clojure. What is the idiom in Clojure? I can think of two things: use let or make the defn's ns private. The 2nd feels Java-ish to me...but what do I know. |
| 10:53 | defn | stephyn: let is functionally equivalent to nested fn's |
| 10:53 | defn | it's the identity monad |
| 10:53 | Chousuke | stephyn: there's letfn |
| 10:54 | Lajla | defn, well, it is greatly inappropriate, but since by your own admission I have asperger, you can never ever blame me for this because I don't understand social rules. |
| 10:54 | stephyn | chousuke: interesting. I have in mind as the canonical example of this the sqrt by approximation example. |
| 10:55 | Lajla | Chousuke, besides, my Finnish is all proper, isn't it? |
| 10:55 | Lajla | En puhu lapsiseksistä suomeksi. |
| 10:55 | Hodapp | wtf did I walk into |
| 10:55 | arkh | cemerick: that was over a year ago :( |
| 10:55 | cemerick | arkh: yeah, I know. I've basically assumed the vids are gone now. |
| 10:56 | cemerick | Which is a huge shame in a couple of cases. |
| 10:56 | defn | Lajla: and yet, due to the forces of reality, you could be expelled from the clojure community because people do not understand your strange mix of asperger's and tourettes |
| 10:56 | Lajla | defn, that would be so unfair, I can't help it. |
| 10:57 | arkh | If he sent me the DV's, I'd do it (for free of course) |
| 10:57 | Lajla | Instead, you should grant me an excuse to do whatever I want because I can't help myself and aspies are sooooo sad because they can't get a girl. |
| 10:57 | cemerick | arkh: stuff like that is what I was thinking with my "crowdsourcing" suggestion. |
| 10:57 | Raynes | defn, Lajla: -> #clojure-casual |
| 10:57 | defn | i'll pass on continuing this conversation |
| 10:57 | defn | moving on |
| 11:01 | chouser | stephyn: you want a seq of the maps? basically the second arg to func? |
| 11:03 | chouser | stephyn: [[x [{a :a} {b :b} :as ms]] |
| 11:03 | stephyn | chouser: what I had was a double and a list of 2 maps. I wanted to both be able to extract specific keys and refer to the 2 maps as whole. What I ended up doing was [x [a b]] and then just using (a :a) and (a :b) as needed. |
| 11:04 | stephyn | and then a and b as needed. |
| 11:05 | AWizzArd | What is the idiomatic solution for two namespaces requiring each other? |
| 11:05 | stephyn | I don't think that [x [{a :a} :as a1 {b :b} :as b1]] worked, IIRR. |
| 11:06 | cemerick | AWizzArd: "don't do it" is idiomatic. Everything else is a hack. :-) |
| 11:06 | chouser | stephyn: [[x [{a :a :as a1} {b :b :as b1}]] |
| 11:07 | stephyn | chouser: interesting. thanks. |
| 11:10 | dpritchett | I feel silly that I had to read fogus's blog to figure out that dosync.posterous.com is written by HN/github user swannodette |
| 11:10 | dnolen | dpritchett: that's me |
| 11:11 | tomoj | are you trying to fracture your identity? |
| 11:12 | dpritchett | Maybe he's trying to avoid being recruited ;) |
| 11:18 | pdk | ANYway |
| 11:23 | lpetit | So, who is talented, and has time to grow a pretty logo for counterclockwise ? What about the suggestion made by Konrad ? |
| 11:26 | lpetit | You know you've done too much ccw, when you encounter this in your code "DSLConstListType.newType(this, projectName, ni.getIdentifier())", and, in order to make "ni.getIdentifier()" replace the parent call, hit Alt + R (Raise over) without success ... |
| 11:34 | lpetit | must leave, cu |
| 11:41 | cemerick | If there's only one method of a given name and arity, clojure interop should select and call it without complaint (or reflection, for that matter), no? |
| 11:42 | cemerick | Here I'm referring to java.awt.geom.GeneralPath.moveTo(float, float), which seems to require (float x) wrapping to call. |
| 11:43 | cor|n | ,(println "corin and afkafka and iryuu and bot0 are faggots") |
| 11:43 | clojurebot | corin and afkafka and iryuu and bot0 are faggots |
| 11:43 | cor|n | nice one clojurebot. lol |
| 11:44 | cor|n | ,(println "#wrongplanet will be owned. come and troll it. :-)") |
| 11:44 | clojurebot | #wrongplanet will be owned. come and troll it. :-) |
| 11:44 | cor|n | nice advise clojurebot, rofl |
| 11:47 | bortreb | cemerick: I've had the same problem -- it looks like you actually have to wrap it in (float) |
| 11:48 | cemerick | wtf is going on with the bizarre/insulting msgs today? :-( |
| 11:48 | cemerick | bortreb: it certainly seems like a regression |
| 11:49 | danlarkin | :-/ trolls |
| 11:49 | Drakeson | how can I get the list of currently "require"d namespaces that start with a given prefix? |
| 11:50 | cemerick | danlarkin: Hrm, not entirely. I'll not repeat what was said earlier. |
| 11:51 | dpritchett | balrogs |
| 11:55 | dpritchett | Bah, Raynes logged out just as I wanted to recommend a magnet school in his area |
| 12:00 | arohner | Drakeson: I don't know about the required part, but c.c.find-namespaces might help |
| 12:03 | Drakeson | arohner: thanks. That ns solves another problem, though :p |
| 12:04 | arohner | Drakeson: aha, then deref clojure.core/*loaded-libs* |
| 12:05 | arohner | it's private, so you'll have to use the var trick |
| 12:05 | arohner | ,@#'clojure.core/*loaded-libs* |
| 12:05 | clojurebot | #<Ref@157c2bd: #{clojure.contrib.accumulators clojure.contrib.def clojure.contrib.error-kit clojure.contrib.except clojure.contrib.generic clojure.contrib.generic.arithmetic clojure.contrib.io clojure.contrib.macro-utils clojure.contrib.monads clojure.contrib.properties clojure.contrib.seq clojure.contrib.seq-utils clojure.contrib.sql clojure.contrib.sql.internal clojure.contrib.string clojure.contrib.types clojure.core cl |
| 12:06 | Drakeson | arohner: aha, thanks a lot |
| 12:12 | stephyn | is there a shorter anonymous function literal that always returns 1 than #(identity 1)? |
| 12:12 | bortreb | #(1) |
| 12:12 | arohner | ,(#(1)) |
| 12:12 | clojurebot | java.lang.ClassCastException: java.lang.Integer cannot be cast to clojure.lang.IFn |
| 12:12 | arohner | ,((fn [] 1)) |
| 12:12 | clojurebot | 1 |
| 12:13 | Chousuke | (constantly 1) |
| 12:13 | bortreb | ,(#(*)) |
| 12:13 | djpowell | cemerick: have you figured out your GeneralPath problem yet? |
| 12:13 | clojurebot | 1 |
| 12:13 | cemerick | djpowell: aside from the (float arg) workaround, no |
| 12:13 | stephyn | bortreb: weird...why does that work? |
| 12:14 | cemerick | I don't have time to spelunk in the clojure compiler today. :-) |
| 12:14 | arohner | stephyn: that's the identity on multiplication |
| 12:14 | arohner | (#(+)) |
| 12:14 | djpowell | GeneralPath *does* have overloads. it got retrofitted at some point. you may be looking at old javadocs |
| 12:14 | bortreb | because the zero-element under multiplication is 1 |
| 12:14 | arohner | ,(#(+)) |
| 12:14 | clojurebot | 0 |
| 12:14 | stephyn | oh, that's right. |
| 12:14 | stephyn | I'm not sure I want to rely on *that*. ;) |
| 12:15 | bortreb | I don't think you can do shorter tho :) |
| 12:15 | djpowell | ,(filter #(= (.getName %) "moveTo") (seq (.getMethods (class (java.awt.geom.GeneralPath.))))) |
| 12:15 | clojurebot | (#<Method public final synchronized void java.awt.geom.Path2D$Float.moveTo(float,float)> #<Method public final synchronized void java.awt.geom.Path2D$Float.moveTo(double,double)>) |
| 12:15 | stephyn | no, that's true...you did meet the requirements admirably. |
| 12:16 | cemerick | djpowell: Crud. Well, I'm an idiot. :-x |
| 12:16 | cemerick | djpowell: good catch. My usual javadocs are 1.5; I'm using 1.6 for this particular project. |
| 12:16 | djpowell | in earlier java or something it had float params, but then they made it a subclass of some other class |
| 12:16 | djpowell | apparently it is legacy now |
| 12:21 | dpritchett | #(inc 0) |
| 12:22 | cemerick | djpowell: yeah, the change was in 1.6. I should upgrade my on-disk javadocs, clearly. |
| 12:25 | hugod | anyone know of something like enlive, but in javascript? |
| 12:25 | cemerick | hugod: hahahaha. Good one, mate. |
| 12:26 | cemerick | Oh, you're serious. ;-) |
| 12:26 | hugod | cemerick: :) |
| 12:26 | hugod | why can't I program my browser in clojure! |
| 12:27 | Raynes | hugod: Because of the price of tea in China. |
| 12:27 | cemerick | hugod: The real question is, will chouser respond better to subtle hinting or outright bribery? |
| 12:27 | hugod | Raynes: tea has started revolutions before now |
| 12:28 | arkh | hugod: it wasn't really the tea they had qualms about ;) |
| 12:29 | hugod | arkh: the rum? |
| 12:29 | pdk | so, quick q with vimclojure setup |
| 12:30 | pdk | when i go to run ant in the installation steps (for winxp) it gives me "build.xml:66: could not find clojure.lang.Compile" |
| 12:30 | arkh | hugod: aye, the rum |
| 12:35 | arkh | pdk: wish I knew something about ant but it sounds like it can't find the clojure.jar in your path |
| 12:35 | arkh | classpath? idk ... |
| 12:36 | pdk | hm just checked my classpath under control panel -> environment vars |
| 12:36 | pdk | even after adding full paths to clojure.jar and clojure-contrib.jar then restarting the console, still gives the error |
| 12:36 | pdk | or is lang.Compile yet another extra clojure.org download |
| 12:37 | arkh | pdk: no, it should be in clojure.jar |
| 12:37 | pdk | though i think i had this crap yesterday |
| 12:37 | pdk | where if i updated PATH |
| 12:37 | arkh | pdk: is clojure.jar in your system path, e.g. does it show up when you type 'PATH' at the command prompt |
| 12:38 | pdk | even when restarting the console window the new PATH wouldnt take effect until i rebooted or just added it manually every time i opened a console |
| 12:38 | pdk | ok that's stupid as hell it has to be in PATH |
| 12:38 | pdk | i just went and put it in CLASSPATH |
| 12:39 | arkh | when in doubt, do both ;) |
| 12:39 | pdk | nah that doesnt fix it |
| 12:41 | arkh | this is a kludge, but what if you copied it into your ./classes subdirectory, under build.xml ? |
| 12:41 | Blaine | I wish clojuredocs.org would automatically link glossary terms to their definitions |
| 12:52 | pdk | hmmm |
| 12:52 | pdk | there's an idea arkh |
| 12:52 | pdk | do you mean a classes subdir in the vimclojure folder |
| 12:52 | arkh | or wherever other jars are vimclojure depends on |
| 12:53 | pdk | nah didnt fix it |
| 12:53 | arkh | :( |
| 12:56 | pdk | sometimes you just wish there was a version of notepad or something with lisp autoindent |
| 12:59 | Blaine | pdk: trying to get vimclojure set up? |
| 12:59 | pdk | yeah |
| 12:59 | pdk | ant is being stupid and saying it can't find clojure.lang.Compile even after a few attempts to coax it |
| 12:59 | Blaine | how is that relevant to vimclojure? |
| 12:59 | Blaine | :P |
| 13:01 | pdk | well kotka's site says that's an install step so :p |
| 13:01 | pdk | cause there's some vimclojure.jar i need to compile via ant |
| 13:01 | Blaine | aw dude, nah |
| 13:01 | pdk | oh can you skip this step |
| 13:01 | pdk | that's news for sore ears... eys |
| 13:02 | pdk | yeah EYS |
| 13:02 | pdk | not eyes! |
| 13:02 | Blaine | just download http://www.vim.org/scripts/script.php?script_id=2501 |
| 13:02 | pdk | the hell |
| 13:02 | Blaine | and copy autoload, doc, ftdetect, ftplugin, indent and syntax folders to your .vim dir |
| 13:02 | pdk | i dled it from there |
| 13:02 | pdk | hmm |
| 13:02 | Blaine | and you're golden |
| 13:02 | pdk | will i still have access to nailgun if i do it that |
| 13:02 | pdk | cause one blog post was saying |
| 13:02 | Blaine | no idea |
| 13:03 | pdk | "i don't like nailgun so i did it in <the way blaire described>" |
| 13:03 | Blaine | are you new to clojure? |
| 13:03 | Blaine | I am, and I don't know what that is |
| 13:03 | Blaine | but I don't think I need it |
| 13:03 | Blaine | haha |
| 13:04 | Blaine | I just copied all those dirs to ~/.vim and I get syntax highlighting, nifty indendation, and rainbow parenthesis |
| 13:04 | Blaine | I went by this blog post: http://writequit.org/blog/?p=386 |
| 13:04 | pdk | yeah all things considered thats basically all i wanted to get out of an editor |
| 13:05 | pdk | since id still need to get actual practice with the "put stuff in and watch it happen instantly on the repl" sort of editing :p |
| 13:07 | Blaine | yeah dude |
| 13:07 | Blaine | you won't need that stuff until later, probably |
| 13:08 | Blaine | doing what I did will get you a good editor at least |
| 13:08 | rhall | Hi all, can I jump in with a completely unrelated question ? |
| 13:08 | Blaine | rhall: too late, you already did |
| 13:08 | rhall | yeah... I know... it's irc after all :) |
| 13:08 | rhall | but I try |
| 13:08 | rhall | anyway |
| 13:08 | rhall | is there a "notnil?" |
| 13:08 | rhall | literally the opposite of "nil?" |
| 13:09 | Blaine | (not nil)? |
| 13:09 | rhall | I'm looking for something I can use in filter |
| 13:09 | Blaine | :P |
| 13:09 | rhall | (filter notnil? (function-that-returns-a-seq-some-items-of-which-are-nil)) |
| 13:09 | rhall | so I want to filter out the nils |
| 13:09 | stephyn | pdk, blaine: yeah, I use that set up and it's great. I wish I'd know about screen years ago for irb, ./script/console development in rails. |
| 13:10 | bortreb | (comp not nil?) |
| 13:10 | pdk | why not (fn [x] (not (nil? x))) |
| 13:10 | rhall | yeah... you type faster than me... |
| 13:10 | pdk | for the function arg to your filter call |
| 13:10 | rhall | that's what I've been using |
| 13:10 | rhall | but wondered if there was a "sugared" form |
| 13:10 | pdk | actually is the screen stuff going to work in gvim on windows |
| 13:10 | pdk | better yet will i have to do all this crap twice to make it work in both cmdline vim and gvim |
| 13:10 | raek | (complement nil?) |
| 13:11 | pdk | or do settings and crap carry over between the two |
| 13:11 | pdk | yeah |
| 13:11 | Blaine | (defn not-nil? [x] (not (nil? x))) |
| 13:11 | raek | (remove nil? seq) |
| 13:11 | pdk | complement nil? would prob return the same function i just wrote |
| 13:11 | pdk | basically complement just |
| 13:11 | pdk | takes a 1-argument function |
| 13:11 | Blaine | pdk: you're working on a windows box? |
| 13:11 | pdk | and returns a function that just returns falce when that function returns true and vice versa |
| 13:11 | pdk | yeah winxp |
| 13:11 | pdk | i know thats gonna draw some glares :p |
| 13:11 | stephyn | pdk: I wouldn't think so; unless the dos prompt has a version of screen...you might need cygwin. |
| 13:11 | rhall | raek: both of those work... thx!! |
| 13:12 | pdk | hmm |
| 13:12 | raek | pdk: exactly, but complement works for functions of any arity |
| 13:12 | pdk | oh yeah |
| 13:12 | pdk | so in this case |
| 13:12 | raek | if and when have if-not and when-not counterparts |
| 13:12 | pdk | (complement nil?) would just return something that acted the same as (fn [x] (not (nil? x))) |
| 13:12 | raek | and filter has remove |
| 13:13 | pdk | yeah |
| 13:13 | raek | pdk: correct |
| 13:13 | pdk | you could do (remove nil? ...) instead of (filter (complement nil?) ...) |
| 13:13 | pdk | filter only keeps the items for which the condition function returns true |
| 13:13 | pdk | remove only keeps the items for which the condition function returns false |
| 13:13 | rhall | yeah... forgot about remove |
| 13:14 | rhall | <----- is total clojure newb but loving it |
| 13:15 | stephyn | <-- same here; for some reason, I'm getting more traction with it than trying to learn Haskell :O |
| 13:15 | raek | one should never be ashamed of asking questions... :) |
| 13:16 | pdk | one thing practical clojure is good about is that it has these references for sets of functions relating to a certain topic all over the place |
| 13:17 | pdk | so at least once per chapter you run into a list of functions relating to stuff like seqs or whatever, fairly handy |
| 13:17 | pdk | plus the documentation you tend to get with (doc function) is terse as hell |
| 13:17 | pdk | very often just 1 unclear sentence |
| 13:18 | bortreb | empty? is about as close as I can find for a core function that is sort of "not-nil," but that's the CL in me coming through... |
| 13:19 | rhall | raek: I have no fear of showing my ignorance lucklly |
| 13:19 | pdk | [13:15] <stephyn> <-- same here; for some reason, I'm getting more traction with it than trying to learn Haskell :O <- maybe cause we don't have the type system :p |
| 13:20 | bortreb | is there any snazzy way of doing ajax stuff with clojure --- like bind a div to be updated by a certain function (sort of like perl's CGI::Ajax0? |
| 13:21 | stephyn | that's probably part of it. I also think the impurity is handled more gracefully in Clojure but I'm not afraid to say that perhaps Ruby has rotted my brain as far as dynamic typing goes. I can barely Java anymore. |
| 13:21 | bortreb | heh, you guys should try coding in bluespec some day :) |
| 13:21 | mfex | bortreb: conjure has some ajax functionality |
| 13:21 | bortreb | it makes java look like the most dynamic language ever |
| 13:22 | pdk | let's go back to the days of no typing scheme! |
| 13:22 | pdk | everything is pointers |
| 13:22 | Chousuke | bortreb: empty? isn't used that often. The recommended idiom is "(if (seq x) ...)" |
| 13:23 | bortreb | bluespec is so strongly typed, even the TYPES are typed (I'm not kidding) |
| 13:23 | technomancy | hugod: here's an enlive-like for JS: http://github.com/cohitre/baconl |
| 13:23 | Chousuke | bortreb: Haskell has that too doesn't it? |
| 13:24 | Chousuke | kind of |
| 13:24 | Chousuke | I'm still not very proficient with the type wizardry in haskell |
| 13:24 | hugod | technomancy: thanks! looks interesting |
| 13:25 | bortreb | Chousuke: yeah but bluespec does it in a more literal way since everything utlimately compiles down to transistors |
| 13:25 | Chousuke | for more complicated types, I get confused about what are the type constructors and what are its parameters. |
| 13:25 | technomancy | hugod: I don't know if it's used for anything or just atoy |
| 13:26 | pdk | is it a hardware design language |
| 13:27 | stephyn | I'm afraid I'll probably have to learn Haskell some day...but Clojure seems to be a good 2nd choice for now. |
| 13:33 | pdk | blaire |
| 13:34 | pdk | do i stick these plugins files in a subdir of vim's $HOME |
| 13:41 | rhall | I'm seeing the need for an "antonym" cross-ref in the docs |
| 13:41 | rhall | for instance my filter vs remove question earlier |
| 13:41 | rhall | now I'm looking for the opposite of (keyword x) |
| 13:41 | rhall | if I want to pull out and print the keyword in a map, and print it without the colon |
| 13:42 | pdk | (str :keyword) gives you a string |
| 13:42 | pdk | then you can do (. (str :keyword) substring 1) to get a string with the : chopped off |
| 13:42 | rhall | pdk: cool |
| 13:42 | pdk | or (rest (str :keyword)) to get a sequence of chars without the : |
| 13:42 | pdk | ,(rest (str :for-example)) |
| 13:42 | clojurebot | (\f \o \r \- \e \x \a \m \p \l \e) |
| 13:42 | chouser | rhall, pdk: name |
| 13:42 | chouser | ,(name :foo) |
| 13:42 | clojurebot | "foo" |
| 13:42 | pdk | OR THAT |
| 13:43 | pdk | why ya gotta ruin our fun man |
| 13:43 | rhall | good stuff |
| 13:44 | raek | ,(let [kw :foo/bar] [(namespace kw) (name kw)]) |
| 13:44 | clojurebot | ["foo" "bar"] |
| 13:44 | rhall | I think I have read and re-read, and re-re-read the api page |
| 13:44 | rhall | is that (iterate (read api)) ? |
| 13:45 | pdk | ba dum tschh |
| 13:48 | rhall | pdk: two drums and cymbal? |
| 13:48 | pdk | indeed |
| 13:53 | pdk | UMMMMMMM |
| 13:53 | pdk | you see nothing! |
| 13:53 | Hodapp | where ya been? |
| 13:53 | pdk | this is like one of those "SO WE MEET AGAIN" moments |
| 13:53 | pdk | havent been to #zdoom in like 2 or 3 years haha |
| 13:53 | pdk | kinda got the feeling i wasnt wanted then but i guess it wasnt so bad so might as well pop in again sometime probably |
| 13:53 | Hodapp | er |
| 13:53 | Hodapp | whoops |
| 13:53 | Hodapp | disregard |
| 13:54 | pdk | yeah it's all gravy for #clojure |
| 13:54 | Hodapp | I'm still in #zdoom, trolling BBG and saying weird stuff. |
| 13:54 | pdk | is bbg still there |
| 13:55 | pdk | doin the stoner gun nut thang |
| 13:55 | Hodapp | yeah |
| 13:55 | Hodapp | he's a riot sometimes because he takes himself so seriously |
| 13:56 | pdk | the more things change the more things stay the same then |
| 13:56 | pdk | dude was like |
| 13:56 | pdk | every other day it was a political argument with him and zark/darknation |
| 13:56 | pdk | also one choice bit of wisdom i learned from him |
| 13:56 | Hodapp | and tries to do his whole "my street smarts trump your formal education every day, which is why I still live with my parents and make minimum wage" |
| 13:56 | pdk | chess has a random chance factor! |
| 13:56 | Hodapp | that was classic |
| 13:57 | pdk | does he just do that when it comes to politics/gun rights issues |
| 13:57 | pdk | or is he like that with other stuff he has no clue in like comp sci |
| 13:57 | Hodapp | when it comes to comp sci |
| 13:57 | pdk | i recall him defending the windows .exe .txt etc scheme once |
| 13:57 | Hodapp | he finds a way to talk about guns or politics instead |
| 13:57 | pdk | and his mac hate |
| 13:57 | pdk | actually i dont think i heard where he works |
| 13:58 | Hodapp | idk, but he barely makes shit and still lives with his parents |
| 13:58 | Hodapp | which he tries to spin into superiority over everybody else |
| 13:59 | pdk | wasn't he saying he was getting a degree in gunsmithing |
| 13:59 | pdk | and talking like smith and wesson would snap him right up |
| 13:59 | Hodapp | that boy hasn't set foot in a classroom or a lab for like a decade |
| 13:59 | stephyn | is there an equivalent of a ruby file's if $0 = __FILE__; // stuff; end for a Clojure script? |
| 13:59 | pdk | or at the very least taking some specialized course on making guns |
| 14:00 | pdk | maybe just mentioned it on dwforums once |
| 14:00 | Hodapp | he mostly just spends all his income on acquiring more guns, ammo, and gun parts |
| 14:00 | edbond | why Math/abs doesnt works in .clj file but works in repl? No matching method: abs |
| 14:00 | pdk | see if importing java.Math helps |
| 14:01 | pdk | hm how about the rest of the #zd crew then |
| 14:01 | edbond | pdk: added (:import (java.lang Math)), doesn't help |
| 14:01 | qbg | edbond: Perhaps you are calling it with the wrong type |
| 14:01 | qbg | ,(Math/abs 5) |
| 14:01 | clojurebot | 5 |
| 14:01 | pdk | bs always kinda struck me as being kinda serious about it too in #zd when i was there |
| 14:01 | qbg | ,(Math/abs [1 2 3]) |
| 14:01 | clojurebot | java.lang.IllegalArgumentException: No matching method found: abs |
| 14:01 | pdk | though i hardly see him talk in #ud |
| 14:01 | Hodapp | how old is that guy? |
| 14:02 | pdk | i thought he was around 26 |
| 14:02 | pdk | by the by #ud is on quakenet now |
| 14:02 | Hodapp | he banned me once for like 2 months because he was being pissy and I said "stfu periodbleeder" |
| 14:03 | pdk | yeah it just felt like a lot of the #zd crew was that way at the time |
| 14:03 | pdk | though you cant blame everyone else 100% either way i guess |
| 14:04 | pdk | though fraggle was cool |
| 14:04 | pdk | and he keeps graf in check when he talks about how everyone should be using c++ :p |
| 14:05 | Hodapp | screw that language |
| 14:05 | edbond | qbg: thanks, you're right. |
| 14:06 | pdk | prob not the place to get into it here but some buds tell me stories of two 14 year old versions of graf over on a board i used to visit |
| 14:06 | raek | there's no need to import things in java.lang.* since they are imported by default |
| 14:07 | edbond | next question: how to get double from '/' not Ratio ? |
| 14:08 | raek | ,(double 1/3) |
| 14:08 | clojurebot | 0.3333333333333333 |
| 14:08 | raek | the java.lang.Math library only supports its own type |
| 14:08 | raek | ,(class 1/3) |
| 14:08 | clojurebot | clojure.lang.Ratio |
| 14:08 | pdk | clojure has (int) (float) etc functions for coercing stuff to java primitives |
| 14:08 | AWizzArd | ,(class (int 15)) |
| 14:08 | clojurebot | java.lang.Integer |
| 14:09 | raek | the ratios are provided by clojure |
| 14:09 | pdk | and (unchecked-add) (unchecked-subtract) etc for doing native java math on them without overflow checking |
| 14:09 | pdk | AWizzArd it's going to box primitives up automatically when you take them back into clojure to work on them |
| 14:09 | pdk | but this lets you pass primitive args to java functions etc |
| 14:13 | raek | stephyn: there is the gen-class stuff where you can make a main method |
| 14:13 | raek | in that case, you can use the generated class as the main class |
| 14:13 | stephyn | ah, but it only works with compiled code not interpreted? |
| 14:14 | raek | but when making scripts, AOT compilation might not be the most convenient alternative |
| 14:14 | raek | yes |
| 14:14 | stephyn | thanks. |
| 14:14 | raek | when ran as a script, the *command-line-args* var contains the arguments |
| 14:15 | raek | I think clojure source files tend to be used as either a library or a script, but not both |
| 14:15 | raek | (as far as I know) |
| 14:16 | raek | the AOT compiled main methods are the closest counterpart to the python if __name__ == "__main": I can think of |
| 14:17 | raek | I can see that it's convenient to be able include testing code that way |
| 14:19 | stephyn | well, I'm fooling around with a GA in Clojure right now and every time I reload the file it runs it once. I guess I could go all SICP on it and enclose it in a lambda so the computation is delayed until the lambda is called. :) |
| 14:19 | raek | hehe |
| 14:20 | raek | I mostly use emacs + slime + swank and reevaluate only the functions I change |
| 14:21 | raek | (defonce can be used for code that should only, well, be defined once) |
| 14:21 | stephyn | yeah, I use the vim setup with screen...it's nice but every so often I like to make sure that the state in REPL would actually be produced by my code. |
| 14:22 | bortreb | stephyn: you can't always rely on *command-line-args* because you might call your script with no args, |
| 14:22 | raek | you can always do a (remove-ns 'name.of.namespace) |
| 14:24 | bortreb | stephyn: I like : (defn command-line? [] (.isAbsolute (java.io.File. *file*))) because it works for no args too |
| 14:25 | stephyn | It's not a big deal...I'm just trying to get a feel for the constraints. I like the fact that I can do AOT compilation. I'm getting ready to start work on my dissertation and ruby just can't cut it for running reinforcement learning algorithms. Additionally, I'd like to take advantage of any concurrency I can get. Funny though...Lisp in general isn't taught in most AI courses anymore...I'm thinking of adding Clojure to mine next summer |
| 14:25 | stephyn | late for this year). |
| 14:25 | raek | maybe a (defn reset-ns [ns-sym] (remove-ns ns-sym) (require ns-sym)) is useful to´have... |
| 14:26 | raek | (or a :reset option for require) |
| 14:26 | bortreb | stephyn: then you can do at the bottom: (if (command-line?) main) or smtg |
| 14:26 | bortreb | also you can totally use your files for libraries and command line scripts with this method |
| 14:28 | cemerick | I'm surprised no one here is liveblogging the oscon talk :-) |
| 14:29 | _fogus__ | ,(use ,(clojure.pods/podify [:a :b]) |
| 14:29 | clojurebot | EOF while reading |
| 14:29 | _fogus__ | Hmmmm, I guess pods haven't made it into core yet. :p |
| 14:30 | cemerick | I've no idea what they do, but the name is a little goofy. :-) |
| 14:30 | _fogus__ | ,(clojure.pods/podify [:a :b]) |
| 14:30 | clojurebot | java.lang.ClassNotFoundException: clojure.pods |
| 14:30 | _fogus__ | oh well |
| 14:30 | bortreb | stephyn: I'm also working on AI -- I'm doing cross-modal clustering. want to compare notes some time? |
| 14:30 | _fogus__ | Are they not related to cells? |
| 14:32 | bortreb | that's weird... I don't see anything there that would be a macro |
| 14:32 | stephyn | me either. |
| 14:32 | bortreb | ,*file* |
| 14:32 | clojurebot | "NO_SOURCE_PATH" |
| 14:33 | stephyn | I teach it just in the summer...13 weeks...3 hours a sitting...I think it kills the peeps...if it's 8:15 PM, it must be A* search...oh, there was neural networks...*wave*. |
| 14:34 | bortreb | stephyn: what does *file* resolve to for you? maybe it got redefined? |
| 14:34 | technomancy | dnolen: are you at emerging langs? |
| 14:34 | stephyn | some as here, "NO_SOURCE_PATH" |
| 14:34 | technomancy | http://p.hagelb.org/pod.jpg |
| 14:34 | dnolen | technomancy: no, just following along here and on twitter |
| 14:35 | dnolen | technomancy: nice |
| 14:36 | dnolen | haha Pod Power! |
| 14:37 | leifw | http://healthhabits.files.wordpress.com/2008/12/pod-people-invasion-of-the-bodysnatchers.png |
| 14:37 | dnolen | sounds like next level cells |
| 14:37 | stephyn | in a sort of related question, if you use java.io.File do you have to import it still or is it like Java where if you use the fully qualified name, you don't need to import? |
| 14:37 | qbg | The second |
| 14:38 | stephyn | LOL...I do that all the time, except I say "a" or "b". |
| 14:41 | hiredman | we demand copies of rhickey's slide deck from the emerging lang con |
| 14:42 | scgilardi | a pod here, a pod there, pretty soon you're talking real process |
| 14:43 | danlarkin | pods!?!?! |
| 14:43 | qbg | rhickey, open the pods |
| 14:43 | danlarkin | please open the pod bay doors, HAL |
| 14:44 | qbg | <rhickey> I'm sorry qbg, I can't do that |
| 14:47 | leifw | http://www.bandswallpapers.com/data/media/16/pod2_1024x768.jpg |
| 14:47 | pdk | thank goodness |
| 14:47 | pdk | props blaire, now this looks like it'll fit the bill |
| 14:47 | pdk | assuming the plugins work the same in gvim |
| 14:49 | pdk | oh that's dumb |
| 14:49 | pdk | using a different gvim color scheme makes all the rainbow parens the same color except for the outermost block |
| 14:56 | stephyn | bortreb: ah...it does work...somewhere along the line I deleted the opening paren in one of my function definitions and it was reporting the wrong line number by a large margin of error. |
| 14:57 | bortreb | yay! |
| 14:58 | wilig | Hey all. Stupid macro question: http://gist.github.com/486410 I desperately want to get rid of e# but I'm unclear on how to accomplish it. Anyone have a moment to enlighten me? |
| 14:59 | qbg | ~'errors |
| 14:59 | clojurebot | It's greek to me. |
| 14:59 | stephyn | is there a way to get a fresh repl without quiting repl? |
| 15:00 | bortreb | stephyn: then, if your flavor of linux supports it, you can put something like #!java -cp "whatev" clojure.main at the top and then run it directly |
| 15:00 | wilig | qbg: thanks, I knew I was being thick. |
| 15:01 | stephyn | bortreb: ah yeah, right. |
| 15:01 | cmbntr | is there more on pods online? http://p.hagelb.org/pod.jpg |
| 15:02 | dsantiago | Whoa. What the heck is that. |
| 15:03 | rhall | really really basic question: if I run a script in clojure.main that contains "(map (fn [x] (println x)) (range 5))" why do I get no output |
| 15:04 | leifw | rhall, map is lazy |
| 15:04 | leifw | you need to force execution |
| 15:04 | rhall | damn |
| 15:04 | leifw | try (doseq (fn [x] (println x)) (range 5)) |
| 15:04 | AWizzArd | hmm? |
| 15:05 | AWizzArd | ,(macroexpand-1 '(doseq (fn [x] (println x)) (range 5))) |
| 15:05 | clojurebot | java.lang.IllegalArgumentException: doseq requires a vector for its binding |
| 15:05 | qbg | ,(doseq (map println (range 5))) |
| 15:05 | clojurebot | java.lang.IllegalArgumentException: doseq requires a vector for its binding |
| 15:05 | qbg | ,(dorun (map println (range 5))) |
| 15:05 | clojurebot | 0 1 2 3 4 |
| 15:05 | AWizzArd | Hi kotarak |
| 15:05 | leifw | there it is |
| 15:05 | kotarak | AWizzArd: mann bist Du schnell... |
| 15:06 | AWizzArd | ,(dotimes [i 5] (println i)) |
| 15:06 | clojurebot | 0 1 2 3 4 |
| 15:06 | kotarak | ieh |
| 15:06 | pdk | ,(doc iterate) |
| 15:06 | clojurebot | "([f x]); Returns a lazy sequence of x, (f x), (f (f x)) etc. f must be free of side-effects" |
| 15:06 | AWizzArd | dotimes may run side effects |
| 15:07 | rhall | so any "rule of thumb" on coding such that effects in the repl are the same as scripts? |
| 15:07 | rhall | or just watch for the "lazy" in the doc strings ? |
| 15:07 | kotarak | rhall: watch for no "do" in the name |
| 15:07 | AWizzArd | rhall: the rePl includes P for print |
| 15:07 | AWizzArd | It forces lazy things |
| 15:07 | rhall | AWizz: good point |
| 15:08 | rhall | "do..." in the name also good |
| 15:08 | AWizzArd | when you have on toplevel a (map ...) then map evals and immediately returns an object that needs to be accessed |
| 15:08 | technomancy | rhall: if you (def _ (map my-fn my-coll)) it will avoid the printy-ness, making it work like "the real world" |
| 15:08 | fualo | Is there a prototype in clojure (or actually any lisp) that shows what's going on behind lazy evaulation? i.e. how I could implement laziness without lazy-seq? |
| 15:08 | kotarak | So are cells now called pods? |
| 15:08 | rhall | technomancy: I'll have to ponder that one |
| 15:09 | dnolen | kotarak: sounds like cells, minus the things rhickey didn't like, renamed to Pods |
| 15:09 | qbg | fualo: Lazyness is like delay |
| 15:10 | cmbntr | POD != pain old datastruct |
| 15:10 | technomancy | more or less |
| 15:11 | kotarak | fualo: you can for example use a closure. (fn [] (thing to-be done la ter)) and later you do (previously-created-fn). |
| 15:11 | cmbntr | are pods already on the github tree? where to start looking for these? |
| 15:12 | raek | pods == cells? |
| 15:12 | AWizzArd | seems so |
| 15:12 | dnolen | cmbntr: no, and cells never got past a gist. |
| 15:13 | AWizzArd | dnolen: well, I am using them :-) |
| 15:13 | cmbntr | dnolen: so this stuff is way beyond 1.2? |
| 15:14 | stephyn | Scheme has (trace). Does Clojure have something similar or is there a nice simple, similar debugger for Java to use with Clojure? |
| 15:15 | raek | there is clojure.contrib.trace, but I haven't used it myself |
| 15:16 | raek | ,clojure.contrib.trace/dotrace |
| 15:16 | clojurebot | java.lang.ClassNotFoundException: clojure.contrib.trace |
| 15:16 | dnolen | cmbntr: yup. 1.2 is in beta, all we're going to see is bug fixes there. |
| 15:19 | raek | is there a video stream of rhickeys's talk? |
| 15:33 | arohner | what's the type hint for an array of Objects? |
| 15:33 | qbg | ^objects |
| 15:34 | arohner | qbg: thanks |
| 15:38 | arohner | I'm working on a macro, and I'm trying to optionally insert something. Is there a way to make it show up, or not at all? |
| 15:38 | arohner | i.e. |
| 15:38 | arohner | `(foo ~(if expand? stuff nil) [1 2]) |
| 15:38 | arohner | but if expand? is false, a nil gets stuffed into the form, as opposed to nothing |
| 15:39 | qbg | `(foo ~@(if expand? [stuff] nil) [1 2]) |
| 15:39 | arohner | qbg: thanks! |
| 15:39 | tomoj | whoa |
| 15:39 | tomoj | I thought that was impossible |
| 15:40 | tomoj | qbg: nice! |
| 16:02 | technomancy | raek: video in a few weeks is the hope |
| 16:08 | bhenry | what's the best clojure way to copy image files from one location to another? |
| 16:08 | Blaine | what's a binding-form? |
| 16:09 | Blaine | that term is all over the docs, and I have a suspicion of what it is, but I feel it should be defined somewhere |
| 16:09 | bhenry | blain it's the [a 1] in (let [a 1] a) |
| 16:09 | bhenry | blaine* |
| 16:09 | Blaine | suspicion confirmed, thanks |
| 16:09 | technomancy | bhenry: I believe clojure.java.io/copy works with java.io.File objects |
| 16:10 | bhenry | argh. rtfm i guess |
| 16:11 | Blaine | so, when the docs use the term binding-form, it's referring to similar behavior as let? |
| 16:11 | Blaine | i.e. in other functions |
| 16:12 | bhenry | yes like in for, if-let etc. |
| 16:13 | tomoj | I think the binding-form in (let [a 1] a) is a |
| 16:13 | Blaine | so specifically, binding-form is the name/symbol/whatevs |
| 16:14 | Blaine | ? |
| 16:14 | Blaine | e.g. a |
| 16:14 | tomoj | or [a b] in (let [[a b] [1 2]]) |
| 16:14 | mfex | tomoj has it: bindings => a 1, binding-form is a name or de-structuring form |
| 16:16 | tomoj | why does if-let have an & oldform param? |
| 16:16 | tomoj | seems like you aren't allowed to pass anything to it |
| 16:18 | mfex | Blaine, the whole explanation is at http://clojure.org/special_forms in the (let section |
| 16:21 | Blaine | mfex: ah, yes, makes sense now |
| 16:21 | Blaine | regardless, seems very unintuitive |
| 16:21 | Blaine | and that term is littered everywhere |
| 16:22 | Blaine | like, the syntax used to describe it: (binding => binding-form init-expr) -- just looks confusing at first glance |
| 16:22 | Blaine | I dunno, just my 0.02USD |
| 16:23 | Blaine | I wouldn't have known to search for special_forms, and then to look for the let function, and then realize that the definition for a binding-form would be there |
| 16:23 | Blaine | hence my desire for a glossary |
| 16:24 | hiredman | my guess is oldform is left backwards compat stuff, from before the Great Binding Form Consistency Check |
| 16:24 | tomoj | but it's not backwards compatible if it throws an exception when you pass anything at all to oldform, is it? |
| 16:24 | hiredman | e.g. if-let may have used to not have a binding vector |
| 16:24 | hiredman | tomoj: left over and now vestigial |
| 16:24 | leifw | I believe that's known as "backwards loudpatible" |
| 16:25 | hiredman | all compatibility with stuff before the binding forms clean up is broken/gone now |
| 16:25 | tomoj | oh, hmm |
| 16:25 | tomoj | now you will get an error that says "requires a binding vector" or whatever instead of "wrong number of parameters" |
| 16:26 | tomoj | so I guess it isn't totally vestigial |
| 16:32 | mfex | Blaine, that is a bit of a knowledge bootstrapping issue. The special forms page is part of the reference on clojure.org. The "programming clojure" book has an entry for bindings in the index |
| 16:33 | Blaine | sweet |
| 16:33 | Blaine | I think I'll go through the book then |
| 16:34 | Blaine | :) |
| 16:35 | tomoj | start keeping a list of terms that confuse you, maybe? |
| 16:35 | hiredman | binding forms like that are common among functional languages, just bracketing is different |
| 16:35 | defn | Yeah I was just going to say write your own |
| 16:36 | hiredman | special forms are a lisp concept, they are the forms that the compiler supports directly |
| 16:36 | tomoj | might be harder for someone who's been with clojure for a while to make a glossary |
| 16:36 | tomoj | or at least to pick the words |
| 16:37 | defn | to talk about at a dinner party maybe, but in general writing it down helps solidify the concept |
| 16:37 | defn | improve as you go |
| 16:40 | Blaine | a'ight |
| 16:47 | dpritchett | If I'm running a .clj file in one pane and slime in another in emacs is there a way to pass "eval the current line" to slime from the other pane? |
| 16:48 | technomancy | dpritchett: C-x C-e evals the form before the point |
| 16:49 | technomancy | C-M-x does the whole top-level dep |
| 16:49 | technomancy | *def |
| 16:50 | dpritchett | when i try C-M-x i see something in the status bar at the bottom suggesting that my code was evaluated but i'd like to see the results executed in the repl. am i doing it wrong? |
| 16:50 | technomancy | dpritchett: C-x C-e will put it in the minibuffer; don't know if there's a way to put it in the repl. |
| 16:51 | dpritchett | let's say I have (ns my-namespace) as the first line in a file thanks to leiningen. i would love to be able to go to the frist line and then push a chord to have my repl suck that down, execute it, and have its namespace switched from user to my-namespace |
| 16:51 | technomancy | dpritchett: C-c M-p for that |
| 16:51 | technomancy | once it's compiled |
| 16:51 | bhenry | so if i do (def f (file "path/to/file")) how do i save the file or make something actually write to disk? i don't do much io stuff... |
| 16:52 | qbg | ,(doc spit) |
| 16:52 | clojurebot | "([f content & options]); Opposite of slurp. Opens f with writer, writes content, then closes f. Options passed to clojure.java.io/writer." |
| 16:52 | dpritchett | thanks phil |
| 16:53 | bhenry | i'm having trouble using copy since it needs a File/OutputStream/Writer for the output. |
| 16:54 | bhenry | i've got a collection of file objects that i want to copy into a tmp dir |
| 17:01 | tomoj | dpritchett: https://gist.github.com/013b2bd0c2b80c7c3836 |
| 17:02 | raek | bhenry: do you need the contents of the file, or do you just want the OS to copy them? |
| 17:02 | bhenry | just copy |
| 17:03 | bhenry | raek: ^ |
| 17:03 | dpritchett | Thanks tomoj! Now I need to bind a key to that |
| 17:04 | tomoj | I have (define-key lisp-mode-shared-map (kbd "C-c r") 'eval-print-repl) |
| 17:05 | tomoj | that the method for do-copy [File File] uses input and output streams seems strange |
| 17:06 | dpritchett | That works perfectly, thanks tomoj |
| 17:07 | tomoj | oh I guess you need some external dep to get a sane copy |
| 17:08 | raek | bhenry: all I find is this http://openjdk.java.net/projects/nio/javadoc/java/nio/file/Path.html#copyTo%28java.nio.file.Path,java.nio.file.CopyOption...%29 |
| 17:08 | raek | but that is in java 1.7 |
| 17:08 | raek | the upper right corner says "DRAFT-b102" |
| 17:09 | raek | if you use the clojure.java.io/copy solution, all the data will pass though your application |
| 17:10 | bhenry | hmm. |
| 17:10 | raek | you could use java.io.shell/sh to run the "cp" command on unicies |
| 17:10 | bhenry | i may go that route. |
| 17:11 | raek | all java examples I can find copy through Input- and OutputStreams |
| 17:12 | tomoj | commons-io has something |
| 17:12 | tomoj | but :/ |
| 17:12 | raek | this? http://commons.apache.org/io/api-1.4/org/apache/commons/io/FileUtils.html#copyFile%28java.io.File,%20java.io.File%29 |
| 17:12 | raek | it's really weird that this stuff is not in Java |
| 17:13 | raek | I mean, one of the selling points of Java is that it's supposed to be platform independent |
| 17:14 | tomoj | which is probably why this stuff is not in java.. |
| 17:14 | dnolen | dpritchett: emacs does that, C-c M-p |
| 17:14 | dnolen | oops, irc window was scrolled up |
| 17:14 | dpritchett | thanks |
| 17:15 | raek | tomoj: exactly. apache seems to be one of the actors that has been "filling the gaps" in Java... :) |
| 17:16 | s450r1 | raek: yeah, I thought it was weird there wasn't any "copyFile" in Java too... I went the apache commons io route, which worked fine. |
| 17:21 | raek | hrm, I should continue with my pipes-and-filters/sources-and-sinks/functional-io/blocking-lazy-sequences/streams lib |
| 17:21 | raek | ...as always, the naming is the hardest part |
| 17:22 | sthuebner | I've got a questions regarding closures: In Common Lisp I could do something like (let ((a 1)) (setq a 2) a). |
| 17:23 | sthuebner | How can I do a similar thing in Clojure? |
| 17:23 | raek | the frustration that motivated this lib is the lack of a general "put item" and "take item" interface for bytes/lines/deserialized objects from/to (In|Out)putStreams/Queues/etc |
| 17:23 | technomancy | sthuebner: locals are immutable in clojure |
| 17:24 | technomancy | sthuebner: you can close over an atom if you must |
| 17:24 | raek | sthuebner: mutation is handled more explicitly in clojure. there are multiple strategies |
| 17:24 | raek | one could be to use an atom: |
| 17:24 | raek | (def a (atom nil)) |
| 17:24 | raek | (reset! a 2) |
| 17:24 | sthuebner | I'd like to define two functions, that act on the same variable - a socket-server object |
| 17:25 | sthuebner | on starts the server and stores the server object in the var, the other one stops it |
| 17:26 | raek | to stop it, the variable does not have to change, right? |
| 17:26 | sthuebner | I didn't want to expose that server as a global *server* |
| 17:26 | sthuebner | raek: no |
| 17:26 | raek | there is defvar- in clojure.contrib.def for these situations |
| 17:26 | raek | the hyphen means "private" |
| 17:27 | sthuebner | raek: OK |
| 17:27 | raek | (a clojure convention is to only name globals with *earmuffs* when they are public variables meant to be reboundable) |
| 17:27 | raek | (sthuebner: you might be interested in this too http://clojure.github.com/clojure-contrib/server-socket-api.html) |
| 17:28 | raek | for some application I have made myself, where I only have one server that is active during the whole program execution, I put it straight in a var |
| 17:28 | raek | (def server (...create-server...)) |
| 17:29 | raek | or (defvar- server (... |
| 17:29 | sthuebner | raek: I use that server-socket. quiet handy! |
| 17:29 | sthuebner | quite, I meant |
| 17:30 | raek | you can mutate global variables with def |
| 17:30 | raek | but |
| 17:30 | raek | that is most oftenly only use to redefine a broken function with a working one |
| 17:31 | raek | or other kinds of changes that would not happen in the final system |
| 17:31 | sthuebner | raek: thanks for all the hints |
| 17:31 | sthuebner | I think I can stick with the (def server (create-server...)) for now |
| 17:32 | raek | that is what you see in most hello world servers, anyway |
| 17:34 | tomoj | careful |
| 17:35 | sthuebner | raek: It's simple enough. |
| 17:35 | tomoj | might need defonce depending on how you work |
| 17:36 | sthuebner | tomoj: good point |
| 17:37 | tomoj | I wish assert-args weren't private |
| 17:41 | bhenry | when using clojure.java.shell/sh what directory is the command run from? the dir of the file holding the sh form? or the project dir? |
| 17:42 | defn | the project root im guessing |
| 17:42 | clojurebot | what time is it? |
| 17:42 | defn | clojurebot: you're annoying |
| 17:42 | clojurebot | No entiendo |
| 17:44 | raek | probably from the dir the jvm was started from |
| 17:45 | technomancy | bhenry: the JVM doesn't have a useful notion of a working directory. it's just wherever you happen to launch from. |
| 17:45 | raek | I think I heard somewhere that the working directory of the jvm cannot be changed |
| 17:58 | rhudson | bhenry: there's a :dir option to sh that lets you set its cwd |
| 18:06 | bhenry | rhudson i just read that. thanks. |
| 18:07 | neotyk | ping tomoj |
| 18:07 | tomoj | hello |
| 18:08 | neotyk | updated ahc-clj, take a look if you like it better: http://github.com/neotyk/ahc-clj/tree/issue-1 |
| 18:11 | raek | what would you feel about programming network clients and servers this way: http://gist.github.com/486687 ? |
| 18:12 | raek | se.raek.pipes is a library for making it easier to code the largest part of a network based program in a functional manner |
| 18:13 | tomoj | neotyk: looks cool |
| 18:13 | tomoj | I feel a bit weird calling string on the response instead of the body |
| 18:13 | tomoj | but it's fine |
| 18:15 | neotyk | I've seen it in http.agent, but felt the same |
| 18:16 | neotyk | it could handle both |
| 18:18 | tomoj | I think it's fine this way |
| 18:19 | tomoj | looks like you were right originally about baos vs. bais |
| 18:20 | neotyk | I always have to check which one is which ;-) |
| 18:20 | neotyk | it get's even worse with ByteBuffers |
| 18:21 | raek | flip! :) |
| 18:22 | neotyk | raek: exactly |
| 18:23 | neotyk | simplicity was not a requirement for java.nio |
| 18:23 | kwertii | s/java.nio/java/g |
| 18:23 | sexpbot | kwertii: Format is sed [-<user name>] s/<regexp>/<replacement>/ Try $help sed |
| 18:24 | neotyk | sexpbot: you should support global replacements ;-) |
| 18:24 | raek | imagine that, plus that you have to return from the method every now and then when the out buffer gets full or in buffer gets empty |
| 18:25 | raek | and that you have to remember which state you were in when you returned, in order for you to continue from there |
| 18:25 | raek | and, doing all this in java |
| 18:26 | raek | welcome to the world of implementing CharsetDecoder! |
| 18:26 | raek | http://github.com/raek/utf8-with-fallback/blob/master/src/se/raek/charset/Utf8WithFallbackCharsetDecoder.java |
| 18:28 | neotyk | it is good that most of time one can totally avoid those corners |
| 18:42 | bhenry | raek, technomancy and anyone else who was helping me with the file copy. this is what i came up with. http://gist.github.com/486723 |
| 18:44 | lozh | technomancy: running lein swank, I get two processes, one has args -e (use 'leningen.core) (-main "swank") the other has something a lot bigger starting with a classpath. Would you expect the first one to hang around? |
| 18:44 | raek | bhenry: clojure.java.io can do the File(Reader|Writer) step too |
| 18:45 | tomoj | if there's a way to get it to not hang around, that would be awesome |
| 18:45 | raek | ,(doc input-stream) |
| 18:45 | clojurebot | Titim gan éirí ort. |
| 18:45 | raek | ,(doc clojure.java.io/input-stream) |
| 18:45 | clojurebot | "([x & opts]); Attempts to coerce its argument into an open java.io.InputStream. Default implementations always return a java.io.BufferedInputStream. Default implementations are defined for OutputStream, File, URI, URL, Socket, byte array, and String arguments. If the argument is a String, it tries to resolve it first as a URI, then as a local file name. URIs with a 'file' protocol are converted to local file names. Should |
| 18:46 | rhudson | bhenry, take a look at clojure.core/with-open |
| 18:46 | technomancy | lozh: that's how it works right now; could be changed in the future. |
| 18:47 | raek | you can do it with (copy (input-stream str-in) (output-stream str-out)) |
| 18:48 | raek | the strings gets turned into Files or URLs, then into Input/OutputStreams |
| 18:48 | lozh | thanks |
| 18:49 | technomancy | lozh: well, it may be possible. ant is pretty lousy at being unixy, so who knows if exec is even on the table. |
| 18:49 | raek | if you want to force the string to be interpreted as a file and not as an URL, you can do it like this: (copy (input-stream (file str-in)) (output-stream (file str-out))) |
| 18:51 | lozh | I just wondered if it was another windows gremlin, I'm not worried if that's how you're expecting it to work |
| 18:52 | bhenry | raek. that looks good. |
| 18:55 | technomancy | there's lots of windows gremlins, but that's not one of them. |
| 18:55 | raek | the point of clojure.java.io is to be able to avoid the "PrintWriter pw = new PrintWriter(new BufferedWriter(new InputStreamReader(new FileInputStream(filename))));" pattern of java |
| 18:56 | raek | modulo the PrintWriter part, the clojure way is (writer filename) |
| 18:57 | raek | (also: replace the input/reader parts of my previous utterance with corresponding output/writer) |
| 19:39 | lozh | if I've got an int[] can I convice aget to give me an int rather than an Integer? |
| 19:48 | chouser | lozh: aget does return a primitive int |
| 19:49 | chouser | ,(use '[clojure.contrib.repl-utils :only [expression-info]]) |
| 19:49 | clojurebot | java.io.FileNotFoundException: Could not locate clojure/contrib/repl_utils__init.class or clojure/contrib/repl_utils.clj on classpath: |
| 19:49 | chouser | oh. well, do that and then: (expression-info (aget (int-array [1 2 3]) 0)) |
| 19:51 | raek | {:class java.lang.Integer, :primitive? false} |
| 19:54 | chouser | what!? |
| 19:55 | chouser | here I get: {:class long, :primitive? true} |
| 19:56 | leifw | different versions of clojure maybe? what are you each running? |
| 20:06 | lozh | chouser: thanks for that, very useful tool to know about :) |
| 20:20 | fanatico | Has Rich posted the slides from his emerginglangs talk today? |
| 20:28 | aria_42 | If anyone is interested, I've written a Dropbox client library, clj-dropbox, for interacting with the "Dropbox FS". Its at http://github.com/aria42/clj-dropbox |
| 20:31 | auser | nice aria42 |
| 20:40 | aria_42 | asuer: thanks! let me know if you get anything out of it. |
| 20:53 | hiredman | aria_42: you use a for inside your with-user macro at the bottom of the examples, for is lazy, so I don't think that will work out well |
| 21:06 | cais2002 | morning guys |
| 21:07 | aria_42 | hiredman: thanks. fixed. |
| 21:09 | cemerick | jkmkjhgftydrftgyikol,kofr65dftgyjuikl,uiku87178i9w34e4bh nmnbvcxsaqiky621t6yuijuhyte4w32qwkmlu5r4jn m,hy7t65rkmjihytrdcfv nhy5431SWE4R5BJN MMN545JMN ,,M8L,. |
| 21:09 | aria_42 | hiredman: that's what I get for not copying from my test code |
| 21:13 | cemerick | mmm, sorry |
| 21:21 | mmarczyk | RFC on my letrec macro: http://gist.github.com/486880 |
| 21:21 | mmarczyk | :-) |
| 21:22 | mmarczyk | I'm not even sure if it works... but the ev? / od? example does |
| 21:42 | chouser | mmarczyk: ooh, a code walker. did you know about letfn? |
| 21:42 | mmarczyk | yup |
| 21:43 | mmarczyk | a better example might be (letrec [xs (lazy-seq (filter even? ys)) ys (range 10)] xs) |
| 21:44 | mmarczyk | I was hoping to do some mutual recursion of sequences, which turns out to be a bit of a challenge for various reasons... not having a letrec appeared to be one of them |
| 21:47 | tomoj | I don't get it |
| 21:47 | mmarczyk | (letrec [x (delay y) y :foo] @x) :-) |
| 21:47 | mmarczyk | ,(let [x (delay y) y :foo] @x) |
| 21:47 | clojurebot | java.lang.Exception: Unable to resolve symbol: y in this context |
| 21:47 | tomoj | what would that do differently than (let [ys (range 10)] (filter even? ys)) ? |
| 21:48 | mmarczyk | tomoj: well, not much, except slow things down a tiny bit |
| 21:48 | mmarczyk | tomoj: but I was hoping to build mutually recursive things like, say, tying the knot in Haskell etc. |
| 21:48 | Lajla | ,(let [Who + Worships 1 His 2 Shadow? 3] (Who Worships His Shadow?)) |
| 21:48 | clojurebot | 6 |
| 21:49 | tomoj | oh, I see the difference |
| 21:49 | tomoj | didn't notice that the reference to ys was before the ys binding |
| 21:49 | mmarczyk | right |
| 21:58 | slyrus | the other day (yesterday?) I was asking about test vs src/test |
| 21:58 | slyrus | let me try to rephrase that... |
| 21:59 | slyrus | i have a project.clj with a src directory. I run lein swank. <some magic happens>. how does leiningen know which files to load? and does it load the test directory too? |
| 22:00 | tomoj | I don't believe it loads anything |
| 22:00 | slyrus | what's clojurish for (cl:list-all-packages)? |
| 22:01 | slyrus | ah, all-ns |
| 22:02 | aria_42 | lein sets the classpath of the swank server to src/ resources/ and lib/*jar by default |
| 22:02 | slyrus | ok, I see... |
| 22:02 | mmarczyk | slyrus: see also c.c.find-namespaces |
| 22:02 | aria_42 | I thought it also did test/ |
| 22:03 | mmarczyk | test/ is included too |
| 22:03 | tomoj | ,(System/getProperty "java.class.path") |
| 22:03 | clojurebot | java.security.AccessControlException: access denied (java.util.PropertyPermission java.class.path read) |
| 22:03 | tomoj | well, |
| 22:04 | mmarczyk | slyrus: it'll go and hide under your bad, then keeping making weird noises as you try to sleep |
| 22:04 | mmarczyk | s/bad/bed/ |
| 22:04 | sexpbot | slyrus: it'll go and hide under your bed, then keeping making weird noises as you try to sleep |
| 22:04 | slyrus | yes, like loading my jar instead of my source files... argh... |
| 22:04 | slyrus | can I just have my fasls back please? :) |
| 22:05 | slyrus | I was hoping that lein would be smart enough to see that I have what I want in checkouts and not put the jar on the classpath. |
| 22:05 | tomoj | it puts the source stuff first |
| 22:05 | tomoj | so it shouldn't matter |
| 22:06 | slyrus | I thought it did too, but not here. |
| 22:06 | mmarczyk | apparently this: http://stackoverflow.com/questions/2761253/graph-representation-in-dr-scheme can be translated to Clojure with my funky letrec :-) |
| 22:06 | mmarczyk | well, this makes me a happy panda |
| 22:06 | tomoj | slyrus: 1.2.0? |
| 22:06 | slyrus | "...:/Users/sly/projects/chemiclj/lib/shortcut-0.0.0.jar:/Users/sly/projects/chemiclj/lib/dev/swank-clojure-1.3.0-20100502.112537-1.jar:/Users/sly/projects/chemiclj/checkouts/shortcut/src:/Users/sly/projects/chemiclj/checkouts/shortcut/classes" |
| 22:06 | mmarczyk | chemiclj sounds interesting :-) |
| 22:06 | slyrus | hmm... well, maybe not. |
| 22:07 | tomoj | http://github.com/technomancy/leiningen/commit/d6c50fbc28920f4ea51b04b55ca2826f2d08b8c7 |
| 22:07 | slyrus | thanks mmarczyk |
| 22:07 | slyrus | yeah, thanks tomoj |
| 22:08 | slyrus | mmarczyk: it's just getting started, but I'm thinking of rewriting my (also somewhat nascent) chemicl in clojure. chemicl is here: http://git.cyrusharmon.org/cgi-bin/gitweb.cgi?p=chemicl.git;a=summary |
| 22:08 | slyrus | chemiclj is why i needed shortcut (my undirected graphs package) for representing molecules. |
| 22:09 | mmarczyk | oh, this is cool |
| 22:10 | slyrus | chemiclj? |
| 22:10 | slyrus | i mean chemicl |
| 22:10 | mmarczyk | yup |
| 22:10 | mmarczyk | :-) |
| 22:10 | slyrus | thanks! |
| 22:10 | lancepantz | slyrus: you should also check out http://github.com/ninjudd/jiraph |
| 22:10 | slyrus | hopefully it will be cooler when it's chemiclj |
| 22:11 | slyrus | although I'm not looking forward to rewriting the smiles parser... |
| 22:11 | slyrus | and I should move the rest of my code to github :) |
| 22:11 | slyrus | heh. I thought about giraff for the graphics package name. |
| 22:12 | slyrus | sounds like i should talk to ninjudd |
| 22:12 | mmarczyk | :-) |
| 22:13 | slyrus | s/should talk/should have talked/ |
| 22:13 | sexpbot | sounds like i should have talked to ninjudd |
| 22:13 | mmarczyk | incidentally, I could definitely use a Clojure graph library... |
| 22:14 | slyrus | great, now you have 3! |
| 22:16 | mmarczyk | hm? really? |
| 22:17 | mmarczyk | I only know of c.c.graph |
| 22:17 | mmarczyk | but it doesn't do what I need |
| 22:17 | slyrus | shortcut and jiraph being the other two |
| 22:17 | mmarczyk | shortcut? interesting |
| 22:17 | mmarczyk | jiraph advertises itself as a graph db |
| 22:17 | slyrus | mmarczyk: http://github.com/slyrus/shortcut |
| 22:18 | mmarczyk | I want a library of algorithms for use with some representation of graph algorithms convenient to use in Clojure code |
| 22:18 | mmarczyk | cool, thanks |
| 22:18 | slyrus | and i want somebody who knows clojure, as opposed to common lisp, to review my code for me and tell me what common-lisp-isms i need to get over :) |
| 22:19 | mmarczyk | sounds great :-) |
| 22:19 | lancepantz | the other option is neo4j, i benchmarked the two and jiraph was an order of magnitude faster |
| 22:19 | lancepantz | that being said, we didn't implement the full blueprint property graph that neo4j is |
| 22:20 | mmarczyk | slyrus: I mean, I'll definitely read it, so I'll share my impressions ;-) |
| 22:20 | slyrus | cool, thanks! |
| 22:20 | lancepantz | we store edges on the nodes themselves, instead of in a separate hash, so each walk essentially has half as many seeks |
| 22:20 | lancepantz | i say we, ninjudd did the heavy lifting on jiraph |
| 22:21 | mmarczyk | slyrus: then if sth that I need is missing, I'll definitely try to work towards becoming competent to contribute :-) |
| 22:21 | mmarczyk | lancepantz: interesting!, thanks |
| 22:23 | slyrus | lancepantz: why do you say it has half as many seeks? you still have to look up the edges, right? |
| 22:23 | lancepantz | nope, they are stored in a protocol buffer on the node, so they are already loaded |
| 22:24 | slyrus | umm... assuming the node is loaded. I guess I'm not sure what you mean by loaded though. |
| 22:24 | lancepantz | actually, less than half as many seeks |
| 22:24 | lancepantz | in memory |
| 22:24 | lancepantz | there is 1 seek per node instead of 1 seek per edge and node |
| 22:26 | slyrus | oh, right, but then your nodes have to know about edges. I wanted to be able to use things like 1 and "node1" and #:chemiclj.core.atom{... as nodes. |
| 22:27 | tomoj | lancepantz: I still don't understand jiraph. do you think it might be helpful for neural networks? |
| 22:27 | tomoj | didn't really seem like it when I looked last |
| 22:29 | aria_42 | People still use neural nets? |
| 22:29 | lancepantz | tomoj: not really, i haven't done neural nets before, but most ai stuff usually works better with matrices |
| 22:30 | lancepantz | tomoj: just think of it as a database with arbitrary relationships between rows, and no tables |
| 22:31 | lancepantz | we use it represent family trees, another use would be social graphs |
| 22:41 | slyrus | mmarczyk: so you have three choices :) c.c.graph in which there is _no_ representation of graphs or edges, but you need to provide a function that takes a node and returns its neighbors, shortcut which has no explicit representation of nodes, but provides a representation of edges and things that contains nodes and edges and jiraph which is something like an old-school network database, IIUC |
| 22:41 | slyrus | with a corresponding (heavyweight?) representation of nodes and edges |
| 22:42 | mmarczyk | slyrus: these choices might leave me wondering to which project to contribute the code I'll have to write ;-) |
| 22:42 | mmarczyk | slyrus: though from an initial glance, shortcut might save me some pain |
| 22:45 | mmarczyk | it's far too late -- actually too early -- here for me to look into this just now, but I'll definitely try to squeeze every last drop of that "potion of don't-make-me-do-this-myself +3" from your lib ;-) |
| 22:47 | slyrus | cool. hopefully someone who understands defprotocol/deftype/clojure-in-general than I do will weigh in with some suggestions. |
| 22:47 | mmarczyk | slyrus: btw |
| 22:48 | mmarczyk | slyrus: I see you're using (first queue) / (subvec queue 1) where queue is a vector |
| 22:48 | mmarczyk | slyrus: a clojure.lang.PersistentQueue would probably be better |
| 22:48 | slyrus | why? |
| 22:48 | clojurebot | http://clojure.org/rationale |
| 22:48 | mmarczyk | clojurebot :-) |
| 22:49 | mmarczyk | ,(peek (conj clojure.lang.PersistentQueue 1 2 3)) |
| 22:49 | clojurebot | java.lang.ClassCastException: java.lang.Class cannot be cast to clojure.lang.IPersistentCollection |
| 22:49 | mmarczyk | ,(peek (conj clojure.lang.PersistentQueue/EMPTY 1 2 3)) |
| 22:49 | clojurebot | 1 |
| 22:49 | mmarczyk | ,(peek (pop (conj clojure.lang.PersistentQueue/EMPTY 1 2 3))) |
| 22:49 | clojurebot | 2 |
| 22:50 | mmarczyk | ,(peek (conj (pop (conj clojure.lang.PersistentQueue/EMPTY 1 2 3)) 4)) |
| 22:50 | clojurebot | 2 |
| 22:50 | mmarczyk | conj at end, peek / pop at front |
| 22:50 | mmarczyk | also, subvec prevents the vector you're calling it on from being GC'd |
| 22:51 | slyrus | ok, i'll take a look. thanks! |
| 22:51 | slyrus | it would be nice if there were cleaner clojure syntax for queue support though |
| 22:52 | mmarczyk | it's both nicer as a queue because of how all the sequence functions "do the right queue-y thing" with it *and* more efficient |
| 22:54 | mmarczyk | (defn queue ([] clojure.lang.PersistentQueue/EMPTY) ([xs] (into (queue) xs))) ? :-) |
| 22:54 | mmarczyk | or maybe [& xs] |
| 22:56 | slyrus | some reader support for clojure.lang.PersistentQueue/EMPTY would be nice :) |
| 22:57 | slyrus | #[] or some such |
| 22:57 | hiredman | QUEUE FISH |
| 22:57 | hiredman | http://clojure-log.n01se.net/date/2010-05-14.html#01:34g |
| 22:58 | slyrus | mmarczyk: I don't understand why you evaluate everything into variables in your letrec macro |
| 22:59 | slyrus | why not put btes inline instead of in the let? |
| 23:00 | slyrus | and bssl and bexs might better with a destrcutred let of (apply map list (partition 2 binding)) |
| 23:01 | slyrus | I take it from this that letfn acts more like flet than labels? |
| 23:06 | mmarczyk | queue fish! cool :-) |
| 23:06 | mmarczyk | slyrus: hmm, let me think a moment |
| 23:07 | slyrus | what is queue fish? |
| 23:08 | mmarczyk | ,(conj clojure.lang.PersistentQueue/EMPTY :<=<=<=) |
| 23:08 | clojurebot | #<PersistentQueue clojure.lang.PersistentQueue@82f7129c> |
| 23:08 | mmarczyk | awwww, doesn't work anymore |
| 23:08 | mmarczyk | see the link above |
| 23:09 | mmarczyk | slyrus: what do you mean by "inline" (btes)? |
| 23:09 | slyrus | I mean delete btes from the let and replace the use of it below with the form that you were using for the value of btes |
| 23:10 | slyrus | there's no point in having a variable you use once like that is there? I mean there _can_ be a point (readability) but I don't think it applies here :) |
| 23:10 | mmarczyk | as for letfn vs. flet / labels, I'm not a CLer, so wouldn't want to say; it's similar enough to a restricted letrec where all binding expressions evaluate to functions |
| 23:11 | mmarczyk | slyrus: ah, ok then, got it now :-) |
| 23:11 | mmarczyk | it's written this way because that's how I wrote it ;-) |
| 23:12 | mmarczyk | I knew what I wanted btes to look like when I got to that point, then I've written down the `(let [~arrs ~arrv] ... thing, then I've written down the map... no other reason really |
| 23:13 | mmarczyk | but if there might be a slight readability edge to this approach, why would I obfuscate it now ;-) |
| 23:17 | mmarczyk | slyrus: actually, if I understand the hyperspec correctly, letfn is quite similar to labels, but I wanted Scheme's letrec |
| 23:23 | tomoj | isn't there some problem that makes letrec impossible (or just really hard?) in clojure? |
| 23:24 | mmarczyk | tomoj: I don't know -- and I sincerely hope mine isn't broken ;-) |
| 23:25 | mmarczyk | slyrus: in Scheme, let-bound names are not in scope of the value expressions of the binding forms of their let form |
| 23:25 | mmarczyk | slyrus: with letrec, they are |
| 23:26 | mmarczyk | (let ((od? (lambda (n) (if (zero? n) #t (ev? (sub1 n))))) (ev? (lambda (n) (if (zero? n) #f (od? (sub1 n)))))) (od? 10)) won't work -- or if it will, it'll be because of ev? and od? being bound in the enclosing scope |
| 23:26 | mmarczyk | with letrec, it'll work as intended |
| 23:27 | mmarczyk | there is a requirement that it be possible to evaluate all the value expressions without using the other values |
| 23:27 | slyrus | right, so letrec ~= cl:labels, right? |
| 23:28 | mmarczyk | sort of, but I thought CL's labels only allows you to define local functions |
| 23:28 | lancepantz | is there any difference between (declare foo) and (def foo nil)? |
| 23:28 | mmarczyk | whereas in Scheme you can do, say, (letrec ((x (delay y)) y 10) (force x)) |
| 23:29 | slyrus | sure, but x is still local, right? |
| 23:29 | tomoj | lancepantz: try it |
| 23:29 | mmarczyk | lancepantz: declare apparently adds {:declare true} to the Var's metadata |
| 23:29 | tomoj | (declare foo) then foo |
| 23:29 | tomoj | then (def foo nil) then foo |
| 23:29 | lancepantz | fair enough tomoj :) |
| 23:29 | tomoj | error, then nil |
| 23:30 | mmarczyk | ah, right... (declare foo) is more like (def foo) |
| 23:30 | mmarczyk | but with the extra piece of metadata attached -- I wonder what's it for |
| 23:30 | mmarczyk | slyrus: right |
| 23:30 | tomoj | I don't see that metadata |
| 23:31 | tomoj | user> (do (declare baz) (meta #'baz)) |
| 23:31 | tomoj | {:ns #<Namespace user>, :name baz} |
| 23:31 | tomoj | |
| 23:31 | mmarczyk | hm, funny |
| 23:31 | tomoj | did I do it wrong? |
| 23:31 | mmarczyk | no, not that I can see |
| 23:32 | lancepantz | as far as evaluation they both seem to behave the same |
| 23:32 | mmarczyk | tomoj: aha! (declare ^String foo) |
| 23:32 | tomoj | (def foo) and (declare foo) ? |
| 23:32 | lancepantz | i dont get an exception on either |
| 23:32 | tomoj | huh? |
| 23:32 | lancepantz | (def foo nil) and (declare foo) |
| 23:32 | tomoj | try (declare baz), then baz |
| 23:32 | mmarczyk | I wonder if vary-meta should act differently when there's no metadata already present |
| 23:33 | tomoj | I see, :declared true now, weird |
| 23:33 | lancepantz | tomoj: correct, you're right |
| 23:33 | tomoj | hmm |
| 23:33 | tomoj | is that a bug? |
| 23:34 | mmarczyk | slyrus: Haskell's let is like Scheme's letrec, by the way... coupled with lazy evaluation, this enables some interesting code, which is what I'm trying to recreate in Clojure |
| 23:34 | mmarczyk | tomoj: dunno, but if it is, it's in vary-meta |
| 23:35 | mmarczyk | I think. |
| 23:36 | mmarczyk | aaaaaaa. |
| 23:36 | mmarczyk | no it isn't in vary-meta |
| 23:38 | tomoj | swank.core/break inside a macro is weeeird |
| 23:38 | tomoj | mmarczyk: what is it? |
| 23:38 | slyrus | mmarczyk: what am I missing: (letfn [(ev? [n] (if (zero? n) true (od? (dec n)))) (od? [n] (if (zero? n) false (ev? (dec n))))] (ev? 10)) |
| 23:38 | slyrus | why do you need your letrec? |
| 23:38 | mmarczyk | tomoj: see (def ^{:declared true} baz), then (meta #'baz) |
| 23:39 | mmarczyk | slyrus: I don't for this |
| 23:39 | mmarczyk | slyrus: have a look at the other two examples in the Gist |
| 23:39 | slyrus | ok, the second one: (let [ys (range 10) xs (lazy-seq (filter even? ys))] xs) |
| 23:39 | tomoj | mmarczyk: why does that happen? |
| 23:39 | mmarczyk | tomoj: beats me |
| 23:40 | slyrus | ah, I see. for third one your hosed. |
| 23:40 | mmarczyk | tomoj: I'm considering a trip to clojure/lang/Compiler.java to find out, but it is 5.40 am ... :-) |
| 23:40 | tomoj | haha |
| 23:41 | mmarczyk | slyrus: right! :-) |
| 23:41 | tomoj | similarly (def ^{:file "foo"} baz) |
| 23:42 | mmarczyk | slyrus: the ultimate goal would be to tie the knot in Clojure :-) |
| 23:42 | tomoj | includesExplicitMetadata is involved in the conspiracy |
| 23:42 | mmarczyk | tomoj: hah! sniffing around then? :-) |
| 23:42 | slyrus | mmarczyk: so your macro basically generates this: (letfn [(NY [] (list "NY" (delay [(London) (Paris)]))) (Paris [] (list "Paris" (delay [(NY)]))) (London [] (list "London" (delay [(NY)])))] (ffirst @(first (nfirst @(second (NY)))))) |
| 23:42 | tomoj | but I'm giving up now because I don't really care anyway |
| 23:46 | mmarczyk | slyrus: hrmpf :-P |
| 23:48 | mmarczyk | slyrus: I'm not sure I can produce an example which couldn't be rewritten with letfn with "scalars" and seqs hidden behind functions-producers |
| 23:49 | mmarczyk | slyrus: are you convinced it'll always be possible? |
| 23:51 | mmarczyk | slyrus: I'm under the impression that "tying the knot" relies on a "full" letrec being available, but I won't say I'm sure... |
| 23:51 | mmarczyk | (here's the link to what I'm talking about, btw: http://www.haskell.org/haskellwiki/Tying_the_Knot) |
| 23:54 | aria_42 | Sure, this has been asked to death, but any slides for rhickey's pod-talk? |
| 23:54 | mmarczyk | tomoj: DECLARED_KEY is interned in RT.java and used in that one function in Compiler.java... otherwise it isn't used anywhere |
| 23:54 | mmarczyk | tomoj: :declared only appears in clojure.core/declare |
| 23:55 | mmarczyk | tomoj: apparently Clojure doesn't care about this lone piece of metadata at all... |
| 23:58 | tomoj | odd |