#clojure logs

2012-04-15

00:10jakkoanyone have any recent instructions (e.g. a blog post) for setting up emacs+slime+clojure on ubuntu 12.04?
00:10jakkothx
00:14crassusjakko: http://www.tekbot.com/clojure-simple-start.pdf
00:14crassusjakko: http://www.unexpected-vortices.com/clojure/brief-beginners-guide/
02:34eggsbywhat's the simplest way to give a function parameter a default value?
02:40eggsbyspecifically I have a function that takes [[arg OPTIONAL_ARG] some-other &args], how can I say 'if optional arg isnt provided set it at some default value' ?
02:41eggsbyI guess by using :keys and :or ?
02:49jakkocrassus: thank you
02:52zii-primeI have (in essence) (defn called-with-some-sort-of-input [name val] (eval `(def ~name ~(do-processing-on val)))); is there any clean way to avoid the eval? I'm only using it because def is (like) a macro.
02:55michaelr525heya
03:08zii-primein short: Wrapping a macro in a function, like say (fn [& args] (eval `(def ~@args))): is there any clean way to avoid the eval?
03:49muhoosomewhat off-topic, but note the presence of "like" and "dislike" keys on the far right of symbolics lisp keyboards, long before mark zuckerberg was born: http://upload.wikimedia.org/wikipedia/commons/4/47/Space-cadet.jpg
03:54AimHereThe 'It wasn't me, it was that guy next to me' keys below the like and dislike keys have yet to find their implementation on the greater internet even now. Truly, the Lisp machines were ahead of their time
03:57muhooi think those are the "i'm with stupid" keys
03:57muhooindeed, they are coming.
04:17laurusIs there a network analysis library for Clojure?
04:49espeedHow do you use defmulti to create a function that can have zero, one, or two arguments?
04:52thorwilespeed: you don't need defmulti for that, a normal function with several signatures/bodies will do
04:54espeedNormally yes, but I need to use type hinting to distinguish between a single Integer arg and a single Map arg
04:55espeed(I'm wrapping a Java method)
05:03Hali_3031hi! how to :use a protocol? I mean what's the easiest way to :use all methods of a protocol ?
05:13raekHali_3031: if you have (defprotocol P (a ...) (b ...) (c ...)) in namespace foo, then you can access a, b, and c from foo like if they were defns
05:13raekfor example, (ns bar (:use [foo :only [a b c]]))
05:29pooya72hello, i'm trying to compile a simply program, but I get a "NoClassDefFoundError" http://pastebin.com/5FHhRU6t
05:32tomojwhat do you run that produces that error?
05:33pooya72java -cp [programname].standalone.jar "sample text"
05:35pooya72tomoj: java -cp [programname].standalone.jar "sample text"
05:38tomojhhmm
05:39tomojcan you paste the exact command you ran?
05:39tomojthe error seems to be caused by incorrect arguments to java, but what you just wrote looks correct to me..
05:39tomojoh, no
05:40tomojyou need `java -cp scribee-1.0.0-SNAPSHOT.jar class.name.to.run "sample text"` I think
05:40tomojwhere class.name.to.run in your example would be program.core I think
05:41pooya72tomoj: you da man
05:41pooya72it worked
05:42pooya72any way to do it without needing the classname at the command line?
05:42tomojare you using leiningen?
05:42pooya72yes
05:43pooya72lein uberjar
05:43tomojoh, then if you specify :main in your project.clj
05:43tomojit will set up the uberjar main-class
05:43tomojso that you can `java -jar uberjar.jar "sample text"`
05:44pooya72yeah, i have added that
05:44pooya72:main program.core
05:51tomojso using -jar instead of -cp should make what you originally had work
05:52tomojyou should also be able to do `lein run -- "sample text"`
05:52tomojeven without an uberjar
05:54pooya72yeah I didn't know about lein run
05:54pooya72it works perfect with that
05:54pooya72with java it still needs the classname
05:55tomojeven when you use -jar instead of -cp?
05:56tomojit should either say "Failed to load Main-Class manifest attribute..." or run your main class
05:57pooya72tomoj: no you're right, it works fine! thanks!!
05:58tomojdon't thank me, thank təchnomancy :)
05:58pooya72first command line program made http://www.memecreator.net/images/success-kid.jpg !
05:58laurusI am getting the error "Could not find artifact net.sf.jung:jung2:jar:2.0.1 in central (http://repo1.maven.org/maven2)". But according to the web site, it's there. What is wrong?
06:00raeklaurus: what did you put in the :dependencies in your project.clj file?
06:00laurusraek, [net.sf.jung/jung2 "2.0.1"]
06:01tomojthere is no jar there
06:01tomojonly a pom
06:01laurustomoj, oh, weird. Why?
06:01tomojdunno, ask jung.sf.net.. :/
06:01laurusHah. OK. But how do I fix the problem in the meantime?
06:01raekI think it is one of those poms that contains sub-poms
06:02raek(I don't know the correct maven terminology)
06:02tomojyeah..
06:02tomojso.. does that mean you have to go find the actual jars you want and add them to deps manually?
06:02raekI wouldn't expect so
06:03tomojI don't think lein1 can traverse pom dependencies like maven
06:03laurusI am on lein2.
06:03tomojI don't think lein2 can either, but I don't use it and don't know :)
06:03laurustomoj, it's ok. But should I just download the .jar and put it into that directory?
06:03tomojwell, if you can find the jars you really want in http://repo1.maven.org/maven2/net/sf/jung/
06:04tomojyou can just add them to :dependencies like normal
06:04raeklaurus: I think it would be safer to put all the sub-projects in :depednencies instead
06:04raekdownloading jars manually is rarely worth the effort
06:05laurusInteresting. Maybe "jung2" isn't even a real thing, it's just a name for a bunch of smaller libraries.
06:05raekyes, I think so
06:05raeklook at "<modules>" here: http://jarvana.com/jarvana/inspect-pom/net/sf/jung/jung2/2.0.1/jung2-2.0.1.pom
06:06raekit's weird. I'm pretty sure contrib used this approach at one time.
06:07laurusIt's funny, people complain a lot about this Maven stuff, but in some ways it seems better than the Python Package Index in that you can control all this stuff
06:07laurusWith PyPI as I recall if you use easy_install it just installs things right into the OS, making a mess
06:07raekhrm, it has "profiles". maybe you need to qualify the [net.sf.jung/jung2 "2.0.1"] line with "all", "awt, or "j3s" somehow
06:08laurusAh I see that part.
06:08laurusWell it's ok. I'll just use the partial ones for now.
06:08laurusI've never even used this library before so I don't know what I'm doing anyway.
06:08laurus:)
06:10raeklaurus: you can also try asking here (or in #leiningen) again in a couple of hours
06:11raekat this time, it's usually just the europeans who are active
06:11laurusAh ok. :)
06:11laurusThat reminds me of that recent video of Larry Wall when he talks about how they even have a Perl programmer in Antarctica.
06:12fliebelThere must be some sort of algo for generating raster/integer/step/pixel values for a line, right?
06:14tomojfliebel: one is http://en.wikipedia.org/wiki/Bresenham%27s_line_algorithm
06:14fliebeltomoj: Thanks
06:15fliebelWhat I'm trying to do is move 2 stepper motors in a diagonal line. They take input in the form of a byte, with a bit for every motor.
06:16fliebelSo I need to figure out a pattern that will move them the correct angle.
06:19tomojis there a more abstract way to describe that?
06:21laurusI have the jung-api listed in dependencies for the project. I have run lein repl. How do I use that library now? (or is there somewhere that explains this in detail for newcomers?)
06:28fliebeltomoj: Well, I need to translate a line into a sequence of commands like 'wait', 'up', 'down'
06:33fliebelSo of a line goes diagonal, it's just 11,11,11, but it might also need to go 11,10,11,10, or even more elaborate patterns.
06:36tomojI don't see how 11,11,11 corresponds to a diagonal line. each bit is a command to a stepper motor, but what do the commands mean?
06:37fliebeltomoj: Make one step. there is another command to set the direction. So 0 means no step, 1 means step.
06:39fliebelhehe, probabilistic method: make a list of steps al steps in the x and y direction, shuffle it. :D
06:43laurusI am running (:import [edu.uci.ics.jung.graph SparseGraph]) but receiving ClassNotFoundException. However, the library has been properly installed through lein in Maven. What is going on?
06:46tomojlaurus: jar tf deps/the-jar-you-think-the-class-is-in.jar
06:46tomoj(| grep SparseGraph)
06:47tomojalso, did you restart your jvm after installing the dep?
06:48laurustomoj, what is that line of code?
06:48laurusAnd yes I restarted the JVM, thanks.
06:48tomoj`jar tf foo.jar` lists the contents of foo.jar
06:49tomojif you do `jar tf foo.jar | grep SparseGraph` (assuming you're not on windows), it should show you whether or not foo.jar contains a class named SparseGraph
06:49laurusWait a sec. The name of the thing in Maven is different from the package.
06:50laurustomoj, yes, it shows that it does contain it.
06:51tomojand `lein classpath` includes the jar that contains the class?
06:51tomojI can't explain that
06:52laurusLet me check that.
06:52laurusYes, it does contain it.
06:52laurusI'm using inferior-lisp mode. Is that part of the problem?
06:54tomojthe only explanations I can think of are: you didn't restart the jvm, or the class (and package) name you are trying to import does not match the one in the jar
06:54laurusHow do I restart the JVM from the command line?
06:54tomojdunno, how did you start it?
06:54laurusI just ran "lein repl"
06:55tomojthen ctrl+c or ctrl+d should work
06:55laurusRight, let me try that again.
06:55tomojfollowed by `lein repl` again, which I assume you did..
06:55fliebelWow, what a clusterfuck. http://rosettacode.org/wiki/Bitmap/Bresenham's_line_algorithm#Clojure
06:56laurusAh, I see the problem.
06:56laurusHow do I make lein use a dependency for any project?
06:57tomojput the dependency in that project's project.clj?
06:59laurusIt still failed.
06:59laurusBut I'm running "lein repl" from a directory that isn't the one for the project that includes that dependency.
06:59laurusDoes that make a difference?
06:59tomoj..yes
06:59laurusRight, so how do I make lein load a dependency for *any* project?
07:00tomojput the dependency in *that* project's project.clj
07:00laurusHmm. The problem is that I don't know how to control "where" the lein command is run from.
07:00tomojplugins can be installed globally
07:01laurusRight now it's (setq inferior-lisp-program "lein repl")))
07:01laurusWait, plugin?
07:01tomojwhy aren't you using clojure-jack-in?
07:01Hali_3031raek: sorry for the late answer. with regards to protocol :use-ing, importing the method names one by one is what I'd like to avoid. Is there some syntax for importing protocol P and then later referring to P's method with some syntax like P/methodname?
07:02Hali_3031as if P were a namespace
07:02laurustomoj, I never had a problem with just using inferior-lisp mode until now
07:02tomojbecause you never used any dependencies outside the one project that `lein repl` happens to get called in (the place you started emacs?)?
07:02laurustomoj, yeah I guess that's why :)
07:03laurusAlso, I didn't know that people had separated things from SLIME.
07:03tomojdo you have a function called clojure-jack-in available?
07:03laurusNot yet. Let me set that up now
07:04tomojthe readme here is the best I think https://github.com/technomancy/swank-clojure
07:04laurusYes, reading it now, thanks :)
07:05fliebeltomoj: This looks more like it: http://www.cb.uu.se/~cris/blog/index.php/archives/400 Although it does some implicit array magic...
07:05laurusDoes lein2 support this?
07:08fliebelClojure kept giving me syntax errors, until I realized I was in the Python shell.
07:08tomojI haven't upgraded yet, but `lein2 swank` seems to work here
07:09laurusThank goodness. It worked.
07:09laurustomoj, thank you so much!
07:21fliebelhrm, why doesn't Clojure have arithmetic operations on lists? That matlab code looks soo sweet.
07:22Iceland_jackfliebel: what do you mean?
07:22fliebelIceland_jack: http://www.cb.uu.se/~cris/blog/index.php/archives/400
07:22fliebelI need to do all sorts of apply/map/reduce combos.
07:23Iceland_jackFor real...
08:17raekHali_3031: no. the protocol methods are vars in their containing namespace.
08:17raekHali_3031: but you can use the regular 'require' and 'use' to access them more conveniently
08:18raek(ns bar (:require [namespace.that.defines.the.protocol :as p])) (p/method ...)
08:18raek(ns bar (:use [namespace.that.defines.the.protocol :only [method]])) (method ...)
08:18raek(ns bar (:use [namespace.that.defines.the.protocol])) (method ...)
08:18raekthe last one is discouraged
08:19raekI'd recommend going with 'require' and an :as prefix
08:23raekname structure is much more flat in clojure than in languages with classes
08:27BahmanHi all!
08:27BahmanHow can I call a function if I have only its fully qualified name like "someapp.somens.foo"?
08:29raekBahman: if you have the name as a symbol, you can use 'resolve'
08:29raek&(resolve 'clojure.core/print)
08:29lazybotjava.lang.SecurityException: You tripped the alarm! resolve is bad!
08:30Bahmanraek: What if its namespace is not imported/required/used?
08:30raekBahman: beware of the security implications of doing this. there is a good reason that the bots don't allow it.
08:30raekBahman: then you need to require it first
08:30Bahmanraek: I understand. I have it fully under control.
08:30Bahmanraek: But is it possible during runtime?
08:32raekif you have a fully qualified symbol in "sym", it should be as simple as (do (require (namespace sym)) ((resolve sym) ...))
08:32raekBahman: certainly
08:32Bahmanraek: Thank you very much!
08:32_KY_Can someone guide me to install emacs clojure mode on windows?
08:33raek_KY_: sure, have you followed the instructions on https://github.com/technomancy/clojure-mode ?
08:33_KY_I think I did it before... but I forgot
08:33_KY_I'm not even sure if I'm in clojure mode or not
08:34raek_KY_: the mode-line should include "Clojure" when you visit a .clj file if it is installed
08:35_KY_Oh yes... it has (Clojure)
08:38raekyou can also do M-: (clojure-mode-version) <RET> to determine which version you have
08:39raek_KY_: another pointer: when you want to run clojure in emacs, follow the official docs for swank-clojure https://github.com/technomancy/swank-clojure
08:42_KY_Not sure if I have Leiningen yet... can I install it on windows?
08:42raekyes
08:53_KY_Where is my project.clj?
08:54Licenser_KY_ in theory in your poject folder
08:54_KY_Is it emacs?
08:55Bahmanraek: It works wonderfully! https://gist.github.com/2392610
08:56mdeboard_KY_: No it's just a file on your hard drive
08:57_KY_But where is its path?
08:58unlinkIs there a better idiom for this? (if (some-condition) x (-> x (f) (g)))
08:59unlinki.e. conditionally thread x based on
08:59raek_KY_: even if you just want to play with the clojure repl you need to create a project
09:00_KY_I'm talking about this line: Aed [lein-swank "one.4.4"] to the :plugins section of either project.clj or your user profile.
09:00raek_KY_: the project.clj file specifies the version of clojure and libraries to use
09:00raek_KY_: so you need to do something like "lein new tinkering"
09:01_KY_I see... got it...
09:02mdeboardDoes compiling Clojure seem like a brittle process to anyone else?
09:02mdeboardI have a hell of a time getting my standalone jars to run at all, and the error message is never useful
09:03mdeboard"Could not find the main class: datdoop.core. Program will exit."
09:03mdeboardOh ok, thanks
09:03raekmdeboard: is this an uberjar?
09:04raek_KY_: you can add lein-swank both in your user profile or in the project file. it's recommended to keep it in your user settings, but I don't know where that file is on windows
09:05_KY_So it's lein's user profile?
09:05raekon unix-like OSes it is in ~/.lein/profiles.clj
09:06raek_KY_: yes. you want to tell leiningen that you would like to have lein-swank available in all projects you work with
09:06_KY_I see...
09:07raekso profiles.clj should contain {:user {:plugins [[lein-swank "1.4.3"]]}}
09:10raek_KY_: sorry, did you install the stable (1.7.1) or the preview (2.0.0) version?
09:20_KY_I got a "could not start swank server" error in emacs
09:22raek_KY_: profiles is a new fieature of lein2. if you installed the stable version you need to run `lein plugin install lein-swank 1.4.4` instead of adding it to the profiles file
09:24raekthings are a bit messy now in the lein1 -> lein2 transition period
09:25raek_KY_: you could try running `lein swank` in the project directory to see what the error is
09:25_KY_It says unable to find lein-swank:jar:one.4.4 in repository central
09:25raekafter it is solved, you can kill the swank server and go back to clojure-jack-in
09:26raekthat line isn't an error. that just maven spitting out it thoughts.
09:26raek(leiningen searches multiple repositories)
09:26_KY_So it says "created lein-swank-1.4.4.jar
09:27_KY_But when I do "lein swank" in project dir, java throws an exception "no source file"
09:28raek_KY_: can you paste the stacktrace somewhere?
09:28raekwhat does the exception say?
09:28_KY_"Dependencies must be specified as vector:lein-swank"
09:30raeksounds like you wrote :plugins [lein-swank "1.4.4"] instead of :plugins [[lein-swank "1.4.4"]]
09:30_KY_Oh... hold on =)
09:35_KY_Ok it says "connection opened on 4005"
09:36_KY_So "lein swank" works?
09:37_KY_I closed that now
09:37raekgood. yes.
09:37raekclojure-jack-in should work now
09:37_KY_It still doesn't work...
09:37_KY_(Error "Could not start swank server: '$SHELL' is not recognized as an internal or external command,
09:37_KY_Operable program or batch file.
09:40raek_KY_: which version of clojure-mode are you using?
09:41_KY_How do I find out?
09:41raekin emacs, do M-: (clojure-mode-version) <RET>
09:42volton,24
09:42clojurebot24
09:42voltonHi, why doesn't this work?
09:42volton,(def (symbol "fourty two") 42)
09:42clojurebot#<Exception java.lang.Exception: SANBOX DENIED>
09:42voltonwell, you get the point ;-)
09:42llasramvolton: What do you expect it to do?
09:42raekvolton: because the 'def' special form does not evaluate its first argument
09:43voltonraek: A-ha!
09:43voltonand why is that?
09:43raekI don't think def is meant to be called programmatically
09:44raekvolton: are you doing some kind of meta-programming?
09:44_KY_Is that M-:?
09:44raekyeah, alt + colon
09:45voltonraek: No, I just wanted to try if I could bind something to fourty two
09:45raekheh I should have put quotes around that.. :)
09:46voltonwhich would be logical in a way since fourty two is a symbol but illogical in another way since I don't know how you could evaluate that symbol
09:46_KY_"1.11.5"
09:46raekvolton: yeah, clojure does not enforce symbol name rules very strictly
09:47raekyou can do (intern *ns* (symbol "fourty two"))
09:47AimHereI think you can make your own def with (defmacro mydef [a & body] `(def ~(quote a) ~@body))
09:47raekbut you cannot use that var in ordinary code (because of the space)
09:47AimHereThat'll resolve the expression
09:47raeksorry, (intern *ns* (symbol "fourty two") 42)
09:48raekbut you can still access it programmatically: (deref (resolve (symbol "fourty two")))
09:50raek_KY_: I think the error is in clojure-mode, since lein swank started without errors
09:50_KY_It says "Debugger entered--Lisp error: ...."
09:51voltonAimHere: your code leads to 42 getting bound to the symbol a
09:52gfredericksAimHere: yeah I think you meant for ~a not ~(quote a)
09:52gfredericksthough I don't think that macro buys you anything over def
09:53voltonSo I guess the thing to learn here is to always create symbos implicitly and not call (symbol)?
09:53AimHereYeah, I made a mistake
09:53Chousukeyou can use symbol but you have to be careful that the created symbols are valid
09:53Chousukesince there are no checks
09:54raek_KY_: the problem seems to come from here: https://github.com/technomancy/clojure-mode/blob/master/clojure-mode.el#L967
09:55voltonChousuke: that seems illogical to me: why does symbol create invalid symbols?
09:56raek_KY_: is the lein.bat file on the PATH so emacs can find it?
09:56Chousukevolton: because it doesn't check if the input strings are valid
09:56_KY_Ahh... I have lein in cygwin...
09:56_KY_But I'm running emacs in windows
09:56_KY_Could that be the problem?
09:56Chousukevolton: basically, if you give it invalid parameters, you get invalid symbols
09:56voltonChousuke: well and I guess the symbol is not really invalid sine it can be used for intern just fine
09:57Chousukeit is invalid in that your program might stop working one day
09:57Chousukeit's like C's undefined behaviour
09:57Chousukeit executes, but the results are not guaranteed
09:58voltonSo you say that (intern)'s behaviour is not defined in this regard?
09:58Chousukewhat does intern do? :/
09:58raek_KY_: I suspect so. I think all clojure-mode needs is for the lein script to be on the path
09:58Hali_3031raek: yes I know methods are regular functions as seen from the outside, however my problem is the following: I'd like to re-use a specific overloaded version of a protocol method. For example I'd like to call "method" that dispatches on java.lang.String WITHOUT actually having a string. i just know the class, but don't have an instance. is this possible?
09:58volton,(doc intern)
09:58Chousukeanyway, it's just symbol. you can give it strings that have invalid symbol characters in them like spaces
09:58clojurebot"([ns name] [ns name val]); Finds or creates a var named by the symbol name in the namespace ns (which can be a symbol or a namespace), setting its root binding to val if supplied. The namespace must exist. The var will adopt any metadata from the name symbol. Returns the var."
09:59Chousukeright, that can break too if you give it an invalid symbol
09:59Chousukecurrently it works I think but it might not
09:59Chousukeso if you use symbol, you should take care not to create invalid symbols with it
09:59raekHali_3031: I don't think so. not unless the protocol implementation is also available as a function
10:00voltonChousuke: okay :-)
10:00voltonwell I leaned something new today, thanks everybody!
10:01ChousukeI think there's an issue about making symbol validate its input
10:01Chousukebut no-one has got around to doing it.
10:01Hali_3031raek: I see, thanks. I'll look into some workaround then
10:01voltonwell, actually I think that symbol should always return a valid symbol
10:02voltonChousuke: Do you think I should open an issue?
10:02Chousukevolton: there already is one
10:02Chousukevolton: it just doesn't matter enough to get solved
10:03_KY_I started emacs in cygwin, but now clojure mode is lost
10:03Chousukepart of symbol's contract is that you don't call it with invalid input :p
10:03raekah, different environment variables...
10:04voltonwould there be any harm in having (symbol "my pretty symbol") return my-pretty-symbol?
10:05raek_KY_: you could try adding (setenv "PATH" (concat (getenv "PATH") "path/here")) (setq exec-path (append exec-path '("path/here"))) you your non-cygwin emacs configuration
10:05Chousukevolton: yeah, that makes no sense.
10:05Chousukevolton: it's too magical
10:05raekwhere "path/here" is the path to the directory that contains lein.bat
10:06Chousukevolton: symbol should just throw an exception in a case like that
10:06Chousukethere are other invalid symbols too, like "..." or ",,,"
10:06voltonChousuke: You are probably right
10:07raek_KY_: I also think you can use M-x customize-variable <RET> clojure-swank-command
10:07raekand set the command to "C:\path\here\lein.bat jack-in %s"
10:07voltonChousuke: Where can I find the corresponding issue?
10:08_KY_The current command is:
10:08_KY_echo "lein jack-in %s" | $SHELL -l
10:09raekyup. that won't work on windows...
10:09_KY_So I just replace the whole line with yours?
10:09raekif I understand the elisp code correctly, clojure-mode resorts to that approach if it can't find leiningen on the path
10:09raekyeah
10:10_KY_With or without quotes?
10:10raekwithout
10:10raekif you enter it through the customization interface
10:11_KY_But my lein needs cygwin to invoke
10:11_KY_So it's not lein.bat
10:11raekI see
10:11raekthen it's probably wiser to start emacs from cygwin
10:12raekbut with an option that tells it where to find you .emacs files
10:12raekdid you install emacs through cygwin too?
10:13_KY_No emacs was installed in windows I think
10:13groovemonkeyhi guys; having a problem with altering a ref (hashmap):
10:13groovemonkeyclojure.core=> @test
10:13groovemonkey{}
10:13groovemonkeyclojure.core=> (dosync (alter test (assoc-in @test [:new :stuff] ["in here" :now])))
10:13raek(man, why is always so messy to set up dev tools on windows?)
10:13groovemonkeynil
10:13groovemonkeyclojure.core=> @test
10:13groovemonkeynil
10:13volton_KY_: Do you need swank? I find clojure-mode to be sufficient...
10:14_KY_Not sure yet...
10:14groovemonkeyis assoc-in returning nil for some reason and that's being bound to @test?
10:15raekvolton: how do you reload function definitions and try them after you have changed them?
10:15raekgroovemonkey: alter does not take a new value, it takes a function from the old value to the new value
10:16raek(dosync (alter test assoc-in [:new :stuff] ["in here" :now]))
10:16raekor (dosync (alter test (fn [old] (assoc-in old [:new :stuff] ["in here" :now]))))
10:17voltonraek: I don't. I'm a noob :-P
10:17_KY_Maybe I should re-install lein on windows?
10:17groovemonkeyraek: ahhh, thanks. I tried a horrible mix of those two suggestions.
10:17groovemonkeynamely
10:17groovemonkey(dosync (alter test assoc-in @test [:new :stuff] ["in here" :now]))
10:17groovemonkeythanks!!
10:17raekthere is also 'ref-set' which behaves as your "alter" in the first example
10:18raekbut using alter is more ideomatic here
10:18groovemonkeyah, thank you for that tip.
10:18clojurebotHuh?
10:22raek_KY_: probably a good idea. mixing stuff from cygwin-land and windows-land has mostly resulted in pain for me personally
10:27_KY_Now "lein swank" in windows says "this is not a task"
10:29raek_KY_: the location of the .lein directory is probably different
10:30raek_KY_: did you end up using profiles.clj or "lein plugin install ..."?
10:30volton,(clojure.string/split "abc" #"")
10:30_KY_Oh I didn't do that yet
10:31clojurebot["" "a" "b" "c"]
10:31voltonwhy does it return the "" at the front?
10:32raekprobably comes from java
10:32raekyou can also do ##(seq "abc")
10:32lazybot⇒ (\a \b \c)
10:32_KY_Lein plugin install swank-clojure 1.4.4 right?
10:32raeklein-swank, I think
10:32raekdepending on which version you use
10:33voltonraek: that is a lot better, thanks
10:33raekthis has also changed recently :-)
10:33raekor ##(map str "abc") ; if you want the letters as strings
10:33lazybot⇒ ("a" "b" "c")
10:35_KY_Oh I did swank-clojure 1.4.2
10:35_KY_And now emacs clojure-jack-in works
10:36_KY_Should I re-do lein plugin install lein-swank 1.4.4?
10:36_KY_Or just leave it at that?
10:36raekyou could probably just leave it like that
10:37raekif you decide to upgrade, remember to remove the older version
10:37_KY_Ok looks good now... =)
10:37raek_KY_: happy hacking!
10:37_KY_So it lets me evaluate clojure expressions from the buffer?
10:38raekyes
10:38raeka lot of useful commands are listed in the swank-clojure docs
10:38_KY_Ok=)
10:39raekif you did "lein new tinkering", a good place to start playing around is the src/tinkering/core.clj file
10:40raekif you have it open, press C-c C-k to load the contents of it
10:40_KY_I'm already writing my project now... =)
10:40raekand then C-c M-p to cause the repl to be in the tinkering.core namespace
10:41raekwhen you change a def, just press C-M-x while having the point in it to reevaluate it
10:41voltonraek: you are right, clojure.string/split behaves identical to Java :-/
10:58_KY_I can't compile file in emacs swank... any idea?
10:58_KY_"Compilation failed - no warnings"
10:59solussdibdknox: any chance of light table becoming a kickstarter project? I know several people in the clojure community would be more than willing to donate to compensate you for your time (and I personally tihnk that that is important). The kickback would be an open source implementation. I don't know if I can program another day in a world without something like light table being my IDE. :D
11:02zamateriansolussd, ibdknox wrote earlier that he has submitted a kickstart project
11:02solussdzamaterian: ha. I must have missed that!
11:10mdeboardAny cascalog users here?
11:14raek_KY_: are there any messages in the *SLIME Compilation* buffer?
11:14_KY_Compile-load file works
11:15_KY_But "compile file" fails... guess it doesn't matter
11:44autodidaktoonce I add a plugin to lein2's profiles.clj, what command do I run to install (missing) plugins?
11:49krsankyive been doing the 4clojure questions, its cool seeing how other people answer the same problems
11:49mdeboardya
11:50krsankymy 1st ones were super complicated, and id see others with like 2 word answers
11:51krsanky(fn enth [s n] (loop [cnt n sq s] (if (zero? cnt) (first sq) (recur (dec cnt) (rest sq)))))
11:51krsankythats 21 (rewrite nth without nth)
11:54ddlpdear #clojure ... i'm looking at compiler plugins (gcc, ghc, scala) and wondering if is there any plan or work for a clojure compiler plugin API?
12:03autodidaktotechnomancy: Once I add a plugin to profiles.clj, how do I tell lein2 "ok, download it"
12:05mfexautodidakto, often with lein2 the old explicit "lein deps" step happens whenever it is required. Does the plugin not just work already?
12:06autodidaktoit's lein-newnew + a template I'm trying to use
12:07autodidaktoSo, it, like, goes, without checking... the "new" commands doesn't download lein newnew, and it takes my template name to mean project/src/template-name
12:10mfexI haven't used newnew myself, but "lein2 new your-template-name project-name" fails?
12:10autodidaktomfex: for example, with lein1 -> lein plugin install lein-newnew 0.2.6 will download the jar and over-ride lein new right away, but with lein2, adding lein-newnew to profiles doesnt
12:11xeqiautodidakto: does `lein deps` get it?
12:11xeqi*download
12:11mdeboardddlp: What sort of things would you like plugins for?
12:12autodidaktoit does fail, but it lein new is still expecting "Expected ([project-name] [project-name project-dir])"
12:12autodidaktoxeqi: "Couldn't find project.clj, which is needed for deps"
12:12mdeboardddlp: I think (completley ignorant of the topic so this is a guess) if you use leiningen to build your projects, leiningen supports plugins... presumably plugins to effect compile-time behavior
12:13autodidaktoI'll nuke lein1/2 and reinstall to make sure I dont have some weird conflict...
12:22krsanky /statusbar window add usercount
12:22krsankywoops
12:22krsanky<-- irc noob
12:24autodidaktokrsanky: it happens to the best of us
12:25autodidakto /msg Obama I'm tellin you bro, fo' mo' years. It's in the bag
12:26krsankyi pasted my nick password in yesterday :)
12:27yoklovi'm always worried i'll do /join #someotherchannel
12:27yoklovwith a space before it
12:29yoklovhrm, I feel like clojurescript should have some sort of way of making async a bit less awkward.
12:29yoklovcallbacks feel un-idiomatic, but the browser demands it.
12:30ddlpmdeboard: to add or modify new features to the compiler without having to modify the compiler itself
12:32yoklovhm maybe i should use ibdknox's state machine library
12:37ddlpmdeboard: i don't know if lein modifies the compiler itself.
12:38ddlpmdeboard: but, for example, ibdknox mentions using "a modified version of the Clojure compiler" for Light Table.
12:38mdeboardddlp: Ah I see, yeah I don't know. I'm sure he would have an answer for you.
12:39yoklovthe clojurescript compiler's weird to include though. definitely not as seamless integration as, clojure, for example
12:40yoklovplugins to extend compile behavior would be interesting.
12:50ddlpyoklov: yes, a unified api to extend/modify compiler behavior when needed
12:50yokloveh
12:51yoklovactually
12:51yoklovyou know
12:51yoklovthat sounds like it would be un-namespaceable
12:51yoklovand it would make code incompatible with other code
12:52yoklovyou can probably do a large portion of that already with macros too.
12:53yoklovi know in racket, some macros end up being basically compiler extensions/directives, and i don't see why the same thing couldn't be true of clojure, unless you _really_ wanted to change things
12:57autodidaktoOk, so where does lein2 save the plugins to?
13:00raekautodidakto: everything is kept in the .m2 directory
13:00autodidaktoraek: ahh ok, so no more plugins/ directory with lein2?
13:00raekyeah
13:00raekat least this is the case for :dependencies and lib/
13:01autodidaktoand :plugins in .lein/profiles.clj ?
13:02raekit didn't add any plugins there for me
13:02autodidaktosame here. Ok, that helps, thanks
13:02raeklein-swank worked (from :plugins) with an empty .lein/plugins
13:04autodidaktoyeah same here. Making the transition to lein2, and it was really confusing me...
13:07ibdknoxddlp: I modified and rebuilt the compiler
13:07ibdknoxto preserve some metadata
13:08ibdknoxso instead of using clojure 1.3.0 I'm using ibdknox/clojure
13:23autodidaktoxeqi, mfex: I think my hangup was not understanding the lein2 installs to .m2, and I already had the plugins inside .m2 because of installing them previously with lein1
13:24autodidakto"i hear idbknox is going to implement REAL reader macros"
13:24ddlpheh
13:25gfrederickswhat is unreal about clojure's reader macros?
13:26autodidaktotheir nonexistance
13:26autodidakto1.4 will have an alternative
13:26gfredericksso what is #() and #' and etc?
13:26autodidaktobut 1.4 CLOJURE-TO-THE-KNOX, will have REAL reader macros!
13:26autodidaktoyou can't make your own
13:27gfredericksso clojure has reader macros but because it's not extensible we say that clojure does not have reader macros?
13:27autodidaktoor maybe "their existance" is unreal... tricksy...
13:27gfredericksI'm just trying to figure out terminology
13:27autodidaktogfredericks: correct
13:27autodidaktoRich hickey does, we don't... clojure do.does..nt... yeah I think we say "it doesn't"
13:28autodidaktoat least, people will say "CL has reader macros, but clojure doesn't"
13:28autodidakto$seen rhickey
13:28lazybotrhickey was last seen joining on clojure 6 days and 5 hours ago.
13:29autodidaktoI'm gunning for you, rhickey!
13:30_KY_I'm using enclojure and got "Error occurred during initialization of VM" not enough heap space
13:31ddlpibdknox: yes. a compiler plugin api would be useful only for features that are not suitable for inclusion in the main compiler.
13:31ddlpbbl
13:35TimMcgfredericks: People talk about #-stuff being reader macros, but it's really just part of the parser.
13:36gfredericksTimMc: I definitely don't know the diff between "reader" and "parser"
13:36gfredericksunless the reader eats strings and the parser eats tokens
13:36TimMceh
13:37TimMcThe "reader" is an API-level construct.
13:37TimMclexers and parsers are implementation-level
13:38Chousukethe reader is what takes a string and gives you a data structure
13:38Chousukeit's usually implemented with a parser :P
13:38Chousukewell, string or input stream
13:38gfredericksTimMc: I still don't understand your earlier statement then
13:38gfredericksof course something at the API level is "really" just part of a lower level
13:40TimMcHmm. I guess I kind of object to the term "reader macro" in general.
13:40TimMcThey should really be called parser plugins, or lexer plugins.
13:41gfrederickswell. okay.
13:44gfredericksso what does 1.4 have in this area then?
13:44TimMcgfredericks: I actually don't know much about how Clojure's reader works.
13:46autodidaktogfredericks: extensible reader -> http://www.infoq.com/interviews/hickey-clojure-reader
13:46hsteakhello
13:46autodidaktohsteak: yo
13:51gfredericksso is #=() still around?
13:51dnolenbbloom: hey I applied your patch to master but there's a small issue that didn't crop up from just running the tests.
13:53ibdknoxdnolen: are there any thoughts on having compiler modes? E.g. can there be a flag that adds position information on all forms? not just lists.
13:54ibdknoxdnolen: I understand the size issue, so it probably shouldn't be on normally, but for tools..
13:55dnolenibdknox: something like that sounds reasonble to me - still need to happen in the CLJ reader first.
13:56ibdknoxyeah, I'm more interested in the reader anyways
13:57ibdknoxif the analyzer was just better about keeping meta, that would be all that needed to happen
13:57dnolenibdknox: I'm not convinced there's a size issue - we work on code one top level form at a time.
13:58ibdknoxdnolen: having all those meta entries has to take up space at runtime though, right?
13:59dnolenibdknox: those meta entries don't exist at runtime.
13:59ibdknoxoh?
13:59ibdknoxoh right
13:59ibdknoxduh
13:59ibdknoxdnolen: I retract my size statement then
13:59ibdknoxdnolen: can we just have position information on all forms? :D
14:00ibdknoxhaha
14:00dnolenibdknox: yes, want.
14:00ibdknoxdnolen: I started messing around with esprima, their parse trees are so much more complicated ;)
14:00ibdknoxcode rewriting is going to be interesting
14:01dnolenibdknox: heh yeah JS ain't simple.
14:02ibdknoxseems doable, just definitely not a 6 day prototype lol
14:02_KY_Im using Enclojure and maven cannot start the JVM due to insufficient heap space... what should I do?
14:05yoklov#"regex" still doesn't work in cljs, right?
14:06dnolenbbloom: basically the REPL is broken at the moment.
14:06rodnaphanyone got tips for dealing with cljs compile error? there is literally no useful info, and reverting everything I can remember doing in the last few minutes hasn't helped... HELP! :)
14:07dnolenrodnaph: what's the error?
14:07ibdknoxrodnaph: a compile error or a runtime error?
14:07rodnaphjava.lang.UnsupportedOperationException: nth not supported on this type: Symbol
14:08rodnaphi'm using lein cljsbuild and getting that during compile (along with a stacktrace from clojure.* and cljs.*
14:08ibdknoxrodnaph: you probably have an incorrect number of args in a defn
14:08yoklovcheck your function arguments to make sure they're a vector, also try the (:use [foo :only [bar baz]]) forms to make sure [bar baz] is a vector
14:09yoklovusually the later one complains about a seq
14:09rodnaphok thanks yoklov i'll check that!
14:10rodnaphis there any way of getting some more useful info from the compiler though? (file/line/etc...) if not maybe a page of common problems would be helpful, i'll start putting one together
14:10yoklovi don't know of any :/
14:12yoklovtrying stuff out in a repl first helps catch errors
14:12rodnaphGAH! ok i had (:use jayq.core :only [$])
14:12rodnaphthanks yoklov
14:13yoklovnp, you get somewhat used to the errors it throws at you, though better messages would be amazing
14:13yoklovthe weirdest thing is the google closure compiler running out of memory all the time.
14:14ibdknoxI've never had that happen
14:14yoklovno?
14:14clojurebotno is tufflax: there was a question somewhere in there, the answer
14:14yoklovhrm.
14:14rodnaphyah defo - the eternal problem of someone not passing up the message, always bugs me. "unknown error" - SOMEONE BLOODY KNOWS!! hehe
14:14yoklovafter usng lein cljsbuild auto for a while, i'll eventually get "java.lang.OutOfMemoryError: Java heap space" followed by a stack trace deep in the closure compiler
14:15yoklov"TokenStream.java:1256 com.google.javascript.jscomp.mozilla.rhino.TokenStream.getStringFromBuffer" or stuff like that. not the same place always either.
14:16rodnaphibdknox: any idea on when we'll be able to try lighttable out? :)
14:16ibdknoxit'll be a bit
14:16ibdknoxwriting an IDE from scratch is a lot of work
14:16ibdknox2000 people work on Visual Studio ;)
14:16rodnaphis that like when my wife says she'll clean up in a bit? or when by boss says i'll get a payrise in a bit? :D
14:17dnolenbbloom: no worries, I went ahead and fixed the REPL in master
14:17rodnaphyah i bet! well we'll be waiting.
14:17ibdknoxrodnaph: I'm hoping for a solid beta by end of year
14:17ibdknoxbut that's me naively estimating right now
14:17ibdknoxit could be way faster, could be a little longer
14:18rodnaphi understand, well good luck anyway, prototype looks fascinating.
14:18dsantiagoibdknox: Are you using a web view as the display component?
14:19ibdknoxdsantiago: yep, it seems dumb to me not to at this point
14:19ibdknoxit's also the fastest path to something decent
14:19dsantiagoI agree.
14:19dnolenCLJS users - I'm thinking about pushing the static fn optimization into the :advanced opimization phase only. you can of course start up a custom REPL with the static fn optimizations on.
14:19dnolenopinions?
14:20dsantiagoBut I was afraid that it might not be flexible enough to enable a really advanced text editor. But I don't know about that stuff.
14:20ibdknoxdnolen: is it slow? or is it just that it munges code too much?
14:20yoklovdnolen: static fn optimization?
14:20dnolenibdknox: no my main concern is that it stinks for redefinition.
14:21dnolenyoklov: direct calling fns, and well as direct dispatching to a particular arity.
14:21ibdknoxdsantiago: I think it'll work out, it'll take some time, but eh - that's how it goes
14:21ibdknoxdnolen: good point. That sounds reasonable
14:22yoklovdnolen: right, okay. hm. yeah, sounds fairly reasonable
14:30ibdknoxdnolen: is there some trick to getting cljs working with node? I keep getting: Cannot set property 'Unicode' of undefined
14:30clojurebotYou don't have to tell me twice.
14:30dnolenk fn optimizations now only applied under advanced optimizations in CLJ master. Redef in peace.
14:31dnolenCLJS master I mean of course.
14:31dnolenibdknox: yeah you'll see that if you use :simple or :whitespace optimizations I think.
14:32dnolenibdknox: one second while I remind myself of the issue.
14:35dnolenibdknox: yes I think the issue is "goog.global = this;" under Node.js
14:35ibdknoxI see
14:35ibdknoxso I need to use advanced then?
14:38dnolenibdknox: looking seems like you should be able to set goog.global to something else.
14:57dnolenibdknox: I think you just have to avoid using only :whitespace optimizations, :simple works.
14:58dnolenibdknox: the issue is that goog.provide is somewhat meaningless under node
15:08hcumberdaleHi ;)
15:08hcumberdaleI'm getting error messages like "Could not find artifact org.clojure:clojure:pom:1.+ in central (http://repo1.maven.org/maven2)&quot; with lein2
15:22bbloomdnolen: d'oh! Sorry about that
15:24bbloomdnolen: thanks for fixing it. Although the presence of emit-str makes me fear that someone may use it in the compiler itself ;-) I guess we'll just need to get source maps implemented quickly, so that the position tracking logic doesn't have a chance to break :-)
15:25bbloomdnolen: Maybe it should throw an exception if *position* is not nil?
15:33hcumberdaleI do not understand the whole (and (or thing ... https://github.com/kremers/mongodb-session/blob/master/src/hozumi/mongodb_session.clj
15:34dnolenbbloom: emit-str not used in the compiler itself, I think CLJS compiler hackers can figure it out.
15:34bbloomdnolen: fair enough :-)
15:35hcumberdalelet [entity (and key (congo/fetch-one << ?? why "and key" what does it mean
15:36dnolenbbloom: and since you're here, I'm curious about your workflow as you've described on the ML.
15:36antares_hcumberdale: that code seems to guard against nil key values that way. It's not idiomatic Clojure if you ask me.
15:36bbloomyeah, let's talk about it
15:36dnolenbbloom: so I take it you don't watch the files and run the REPL at the same time?
15:36bbloomnope
15:36antares_hcumberdale: if key is nil, and will not evaluate subsequent values
15:36bbloomi like to evaluate individual forms as i work
15:37dnolenbbloom: hmm yeah, that's what I do to avoid the specific situation you're talking about.
15:37bbloombecause sometimes i have various functions in half finished states
15:37antares_hcumberdale: looks like we need to add support for that thing to Monger, huh
15:37dnolenbbloom: but in general I use the REPL a lot as well.
15:37bbloomso in my personal cljs fork, i have dynamic Vars ;-) and those vars implement IWatchable
15:37bbloomso in the little project i'm working on, redefining certain vars can cause parts of the dom to automatically re-render
15:38bbloombut only those rendered by the redefined function!
15:38eggsbyHey #clojure, what sort of questions can I ask about exceptions?
15:38bbloomin order for that to work right, i need to know which symbols go to Var objects and which go to plain old javascript variables
15:39antares_hcumberdale: monger now has a clojure.core.cache implementation which is similar implementation-wise to this session store. Take a look at monger.cache, maybe code there will be easier to follow ;)
15:39eggsbyI'm trying to make an exception logging client and it expects a json dict of 'exception_class', 'backtrace', 'message', 'environment', 'data', and 'url', how could I ask those questions about a given exception?
15:39dnolenbbloom: it's still not clear to me why just watching an re-analyzing the files wouldn't work for you, especially if there was defonce support.
15:40hcumberdaleantares_, thx
15:40antares_hcumberdale: so support for ring session stores will be very similar to support for clojure.core.cache
15:40hcumberdaleantares_, I try to rewrite it
15:40bbloomdnolen: it's got to do with the fact that i don't always recall when i last ran the build process… it may have been HOURS ago :-P so what i do, as part of the build process, is save the analysis results to the "out" directory.
15:40antares_hcumberdale: if you file an issue about this for Monger, I will get to it some time next week
15:41bbloomdnolen: so basically when the browser refreshes, i have a file which matches the state of the browser
15:41hcumberdaleyeah, I try to port the session store so it uses monger
15:41dnolenbbloom: oh so you actually try to debug multiple files?
15:41yokloveggsby: clojure uses its host exceptions, so on the JVM you have java exceptions and in cljs you have JS exceptions
15:41antares_hcumberdale: very nice. Don't worry about code quality, I will be happy to give you advice or rewrite some bits if necessary. It took us all some time to learn.
15:41bbloomdnolen: oh yeah, it's a various file project with various namespaces
15:42antares_hcumberdale: by the way, I think this can go to monger.ring.sessions
15:42dnolenbbloom: so how would source mapping affect that? you could easily debug multiple files even if you have a single file in reality.
15:43hcumberdaleyeah!
15:43bbloomdnolen: it doesn't really matter if it's one or more files. what matters is that when the repl connects to the browser, the repl has some compiler state and the browser assumes some other compiler state
15:43hcumberdaleI'll try me best. The code quality of the existing adapter seems not to be the golden grail
15:43bbloomdnolen: either i can re-analyze what i *think* is the right code. or i can load the exact state that was assumed by the browser
15:44bbloomdnolen: again, consider the debug symbols analogy in the C/C++ world.
15:44bbloomdnolen: I can say "ok, i'm running a release build of commit 12345… so ill git co that version and then rebuild my symbols…. then i'll attach my debugger"
15:45bbloomdnolen: all i'm doing is copying my symbols to the output directory and loading them on attach
15:45bbloomdnolen: make sense?
15:46unlink_When I run lein ring server, it deletes my java-source-file-compiled classes. lein ring war works.
15:46bbloomdnolen: so i have a :repl key in my project.clj and that repl file just has: (reset! compiler/namespaces (read-string (slurp "out/namespaces.clj")))
15:46bbloomdnolen: which is produced by my build code with (spit "out/namespaces.clj" (prn-str @compiler/namespaces))
15:46bbloomdnolen: works a treat :-)
15:48dnolenbbloom: yes, I got that from your ML post - that's pretty interesting. perhaps a feature request for lein-cljsbuild.
15:49dnolenbbloom: I take it you building a largish project in CLJS
15:49bbloomdolen: i'm not using cljsbuild, but only b/c i haven't even looked at it yet
15:50dnolenbbloom: there's lots of stuff better handled by an external tool. I suspected something like lein-cljsbuild could fill holes in what the CLJS compiler provides out of the box. And I think it's turned out to be very true.
15:50bbloomdnolen: and i'd *like to* build a largest project in cljs… but right now, i'm mostly just tinkering with it. my startup runs on ruby, coffeescript, and a hodgepodge of make/bash/sed/awk/whatever, but i'm trying to find an excuse to use some clojure :-)
15:52bbloomdnolen: ok, i'll study cljsbuild a bit
15:52bbloomdnolen: is emezeske the current maintainer?
15:52dnolenbbloom: yes
15:54bbloomdnolen: does he hang out here at all?
15:55bbloomdnolen: anyway, gotta run. thanks for merging my patch! cheers
15:56dnolenbbloom: he does! np, thx much. later.
15:58unlink_with `lein ring server`, I get Exception in thread "main" java.lang.RuntimeException: java.lang.ClassNotFoundException <my java class>
16:00hcumberdaleWhat means _ here? [_ key data]
16:00hcumberdale(parameter list)
16:00unlink_hcumberdale: bind the first argument and ignore the value
16:01Chousukehcumberdale: it's just an idiomatic way to indicate an unused parameter
16:01hcumberdaleahh thx
16:01bpri'm trying to write a function that takes a function f and returns the arglists of f. My first attempt https://refheap.com/paste/2136 doesn't compile, because f isn't a var. I know this is possible, because the slime repl provides agrname hints. Does anyone have any suggestions? Maybe a pointer to the relevant sections of slime/swank?
16:02gfredericksbpr: the metadata for that is stored on the var, not the function
16:02bpryes
16:02gfrederickswhich means if all you have is the function, you can't get much
16:02gfredericksso there's a couple ways to go from there depending on what you can control
16:03bprhow does slime do it then?
16:03gfredericksI assume slime obtains the var one way or another
16:03gfredericksif you know the qualified symbol that points to the var you can get it
16:03gfredericksbut if you just have a function with no name or anything...
16:04bprok. I'm doing this from within a macro, so I should have the qualified symbol
16:04gfredericks,(resolve 'clojure.core/for)
16:04clojurebot#'clojure.core/for
16:05bprthanks
16:05gfrederickswell that does something
16:05gfredericksI'm not 100% sure that's` what you want but it might well be
16:06bprhttps://refheap.com/paste/2136 <-- seems to be good enough for my uses
16:06bprthanks, gfredericks
16:06gfredericksbpr: yep
16:08mfexbpr, this is how (doc ...) does it: https://github.com/clojure/clojure/blob/553f4879cad019dd9dc1727165d8a41c216bd086/src/clj/clojure/repl.clj#L120
16:09bprmfex: nice. thank you
16:10gfredericksooh it _does_ involve resolve :)
16:10bpr:-)
16:13hcumberdalemhhh seems the old mongodb session stuff does rely on another ring version
16:14hcumberdalehttps://github.com/mmcgrana/ring/blob/master/ring-core/src/ring/middleware/session/store.clj << in the tests is something like (write-session store nil {:foo "bar"})
16:15krsankyibdknox still here ?
16:32hcumberdaleantares_, what can lead to java.lang.ClassCastException: clojure.lang.Keyword cannot be cast to java.lang.String ?
16:32antares_hcumberdale: you are passing a keyword somewhere when a string is expected
16:32hcumberdalethe line is: (mng/insert collection-name (merge data { :_id newkey :_date (Date.) }))
16:33antares_possibly collection-name is a keyword
16:33antares_monger always uses strings
16:33hcumberdaleahhh, sec i'll have a look
16:33antares_if you get a keyword somehow, use (name kwd) to turn it into a string
16:33antares_not (str kwd)
16:34hcumberdaleokay, thx antares_...!
16:38hcumberdaleantares_ you were right!
16:39ibdknoxkrsanky: pong
16:52hcumberdalehttps://github.com/kremers/monger-session
16:52mdeboardCan you specify a single test to run with lein test?
16:55hcumberdaleantares_, works with the tests defined for the old congomongo-session things
16:56antares_hcumberdale: woohoo! great job!
16:58hcumberdaleI get addicted
17:00hcumberdaleoO java.lang.IllegalArgumentException: can't serialize class clojure.lang.Keyword
17:00hcumberdale at org.bson.BasicBSONEncoder._putObjectField(BasicBSONEncoder.java:234) ~[mongo-java-driver-2.7.3.jar:na]
17:01espeedHow do you use defmulti to create a function that can have zero, one, or two arguments?
17:01espeed(I'm wrapping a Java method)
17:02mdeboardespeed: This is about the only topic that I think the CLojure docs do a good job of explaining
17:02mdeboardespeed: http://clojure.org/multimethods
17:04hcumberdaleantares_ I thought keywords can be serialized with monger?
17:06antares_hcumberdale: they can
17:06antares_in document values
17:06antares_but you cannot use them as collection names
17:06hcumberdaleokay, I'll try to trace it down
17:12groovemonkeyI'm having a problem where (read-line) works fine at the REPL but when I do 'lein run', the terminal doesn't seem to be registering any input (I don't see any letters as I type, and have to ctrl-c out of the process).
17:12hcumberdaleantares_ what is going to be written:
17:12hcumberdale{:_flash {:login {:form [Username and password do not match!], :form-data {:roles #{:admin}}}}, :_id 6d591e4f-0967-4f30-b2c8-002a489f36e5, :_date #<Date Sun Apr 15 22:55:30 CEST 2012>, :_sandbar_session {:auth-redirect-uri /admin}}
17:12hcumberdalethe data has to be escaped, right?
17:12antares_hcumberdale: from what I see in this example, no
17:13groovemonkeyis stdin mapped differently in a REPL session than when I run from lein?
17:13antares_as long as it is useful as is
17:13ibdknoxgroovemonkey: lein trampoline run
17:13ibdknoxgroovemonkey: you need lein's JVM to get out of the way
17:13dabdI'm trying to create a standalone jar. My -main function has [& args] signature and I want to pass 3 args: one string, one sequence of strings and another string. How can I pass the seq from the linux shell? java -jar myjar "str1" ["a" "b"] "str2" does not work
17:13groovemonkeyd'oh, thanks!
17:14hcumberdaleantares_ here the complete stacktrace: https://refheap.com/paste/2139
17:16hcumberdaleantares_ and here the file. Error occurs on line 24 https://github.com/kremers/monger-session/blob/master/src/kremers/monger_session.clj
17:18antares_hcumberdale: hm…
17:18antares_hcumberdale: can you add a test for monger that stores a similar map and reproduces the issue?
17:18antares_hcumberdale: actually, I'll do it
17:19antares_hcumberdale: keep in mind that once we store a keyword, it will really be stored as a string
17:20antares_hcumberdale: so when loaded back, it will be a string. I think for all intents and purposes, that's fine
17:21antares_hcumberdale: https://github.com/michaelklishin/monger/commit/5c62e47de77717cf22ad1beca8ebe81e13734428
17:21antares_hcumberdale: I pushed a new snapshot, maybe this is something the most recent beta does not support, I don't really remember
17:22espeedmdeboard: thanks. maybe I'm overlooking something, but I don't see anything about defmulti or defmethod taking a variable number of arguments
17:24mdeboardwell, that's what they're for. You define one method per signature, iirc anyway. I've never used them seriously. I'm sure someone else has some better info for you than me
17:31hcumberdaleantares_, okay I'll write a test for you
17:32antares_hcumberdale: I already pushed one :)
17:40hcumberdalehuh antares_ can't find it. Or do you mean the new snapshot?
17:40antares_hcumberdale: https://github.com/michaelklishin/monger/commit/5c62e47de77717cf22ad1beca8ebe81e13734428
17:46hcumberdaleantares_ and it works against the test?
17:46antares_hcumberdale: it does
17:46hcumberdaleantares_: see https://github.com/kremers/monger-session/blob/master/test/kremers/test_mongodb_session.clj
17:47hcumberdale(deftest mongoserializablekeywords
17:47hcumberdalethis is exactly what is generated by sandbar
17:47hcumberdaleI serialized it using (str (binding [*print-dup* true] (prn-str data)))
17:48antares_hcumberdale: that's what I am saying, try with SNAPSHOT
17:48antares_maybe it is something specific to master
17:48antares_I am not sure
17:48hcumberdaleokay, I'll try
17:49hcumberdaleERROR in (mongoserializablekeywords) (BasicBSONEncoder.java:234)
17:49hcumberdaleUncaught exception, not in assertion.
17:50hcumberdaleMy test is still failing, also with the most up to date snapshot
18:01Xorlevclj-zoo-service-tracker -- interesting...
18:08pastimeAny positive experience with incanter (Excel lib) http://clojars.org/incanter/incanter-excel
18:10zenomAnyone familiar with leiningen? I am trying to do lein uberjar and when I run the jar with java -jar <filename> I get NoClassDefFoundError
18:13gfrederickszenom: does your class appear in `jar tf <filename>`?
18:13zenomchecking
18:14zenomhttps://gist.github.com/2395056
18:15zenomits smuggler/core.clj
18:15zenomplus after that is a bunch of more clojure stuff and clojure-contrib
18:15gfrederickszenom: did you set up (:gen-class) for your main ns?
18:15zenomhttps://github.com/zenom/clojure-knapsack
18:16zenomthere is the project right there
18:16zenomI have (ns smuggler.core) in src/smuggler/core.clj
18:16gfredericksthat is handy
18:16gfrederickschange to (ns smuggler.core (:gen-class))
18:17gfredericksthat tells the compiler to generate the class for which your -main function will be the main method
18:17zenomah ok, let me do a clean and re-uberjar :)
18:17S11001001and for a smaller jar, add :clean-non-project-classes true to the project.clj
18:18zenomS11001001: will do
18:18zenomgfredericks: thanks that worked :)
18:18gfrederickszenom: happy smuggling
18:18zenomhehe
18:18zenomits an interesting challenege
18:18zenomnever used clojure before this weekend
18:19zenomwould love to figure out how to streamline some of the code as well
18:19zenomif you have hints :)
18:19S11001001com.keminglabs/c2 sounds like a client for the PPR
18:19S11001001zenom: get-random-number is a slow rand-int
18:19zenomSo once I have the standalone jar I can just send that off to someone right? they don't nee anything else?
18:19S11001001zenom: don't put trailing ) on their own line, ever
18:19zenomS11001001: i just didn't want a 0 possible
18:20S11001001zenom: then add 1
18:20hcumberdaleantares_ have you seen my test case?
18:20gfrederickszenom: yes the uberjar is self-contained
18:20zenomgfredericks: thanks
18:20antares_hcumberdale: no
18:20zenomS11001001: ok , will change up the get-random-number and such
18:20gfrederickszenom: avoid def-ing inside a function; you should be able to replace those with let
18:20S11001001sorry, this is going to be style-wise
18:21S11001001never use _ for your names, always use -
18:21zenomyeah i thought I changed all those, I guess not
18:21zenomeven for vars?
18:21zenomor just methods?
18:21zenom(let [{doll_weight or (let [{doll-weight ?
18:21gfredericksclojure prefers - for everything, unless you have something externally you're coordinating with
18:21zenomgotcha
18:22gfredericksthey're prettier :)
18:22zenomI am a ruby/python guy mostly
18:22zenomso used to _ :)
18:22zenombut will change those
18:22gfredericksyeah
18:22gfredericksmy snooty opinion is that - is better and would be used in other languages except those languages have an incompatible syntax
18:23gfrederickse.g. in ruby foo-bar is equivalent to foo - bar which obviously means something different
18:23zenomright
18:23S11001001truth
18:24zenom(+ (rand-int maxsize) 1))
18:24antares_hcumberdale: just paste me a value
18:24zenomis that bettre than what I had?
18:24gfrederickszenom: you could use inc instead of +1, but otherwise yeah
18:25S11001001(dec maxsize) too
18:25zenomok
18:25gfredericksS11001001: really?
18:25zenomis inc faster / better than + ?
18:25S11001001,(vec (take 20 (repeatedly #(inc (rand-int 10)))))
18:25gfrederickseh, just idiomatic I think
18:25clojurebot[7 10 6 2 2 ...]
18:25S11001001ugh
18:25clojurebotI don't understand.
18:25S11001001so there's a 10 in there
18:26gfredericksS11001001: I assumed maxsize was inclusive
18:26gfredericksso
18:26gfredericksI guess we both know what we're talking about then
18:26S11001001not in original get-random-number
18:26S11001001though I suppose it's up to zenom whether it's meant to be inclusive or exclusive, really
18:26hcumberdaleantares_ see : https://github.com/kremers/monger-session/blob/master/test/kremers/test_mongodb_session.clj
18:26zenombasically when i pass 10, I want 1-10 (inclusive)
18:26S11001001then don't dec
18:27S11001001but also know your original func was inclusive-exclusive :)
18:27dnolenzenom: inc + will be much the same perf wise.
18:27antares_hcumberdale: it may be :roles #{:admin}. I am not sure why you needed to use Java methods to build maps, though
18:28antares_hcumberdale: I will take a look tomorrow
18:28hcumberdaleantares_ it is what sandbar creates
18:30S11001001zenom: you are from ruby, you're familiar with collect, select, and such?
18:31zenomS11001001: collect yes
18:31zenomnever messed with select so much
18:31S11001001these are strongly preferred in clojure
18:31S11001001generate-shipment is (vec (map #(hash-map :name (str "doll-" %) ...) (range 1 (inc total-dolls))))
18:32antares_hcumberdale: I can reproduce it, it is an issue with sets of keywords. I'd recommend that you convert them to strings anyway
18:32zenomwill check that out in a min; trying to clean up my _'s :)
18:32antares_hcumberdale: although I will try to find a solution
18:35hcumberdaleantares_ with (binding [*print-dup* true] (prn-str .. ? or what is the best way to do this?
18:36antares_hcumberdale: I have a fix
18:36antares_hcumberdale: (map str set-of-keywords)
18:36antares_sorry
18:36antares_map by clojure.core/name
18:37hcumberdale(map name set-of-keywords) ?
18:37S11001001,(name 42)
18:37clojurebot#<ClassCastException java.lang.ClassCastException: java.lang.Long cannot be cast to clojure.lang.Named>
18:37S11001001,(name "42")
18:37clojurebot"42"
18:38S11001001following Brucio's REEPL method of understanding lisp, name is clearly a function that checks whether its arg is a string, returning it if so, throwing an exception otherwise
18:40antares_hcumberdale: https://github.com/michaelklishin/monger/commit/6a2698dce2684355fbc2c43b7e580a99c0d2033d
18:40antares_hcumberdale: yes. But I've pushed a new snapshot that should resolve your issue anyway. Good catch.
18:42hcumberdaleokay, pushed new snapshot?
18:43Lajlahcumberdale, you taste like poo.
18:43LajlaBoy, you must get that a lot.
18:46hcumberdaleLajla?
18:47dnolenhcumberdale: Lajla is a troll, just ignore him.
18:48hcumberdaleahhhh
18:49laurusWhy can't I use the doc function in the clojure-jack-in repl?
18:50gfrederickslaurus: (use 'clojure.repl)
18:51laurusgfredericks, thanks. So I have to run that every time?
18:51autodidaktogfredericks: lein-swank doesn't automatically require it? isn't there a line you can add somewhere to make it do that?
18:51autodidaktoI coulda sworn there was...
18:51gfrederickslaurus: I think there's a way that autodidakto is alluding to, but I don't know the details
18:51gfrederickswell more than alluding
18:52gfrederickshe is explicitly talking about it
18:52autodidaktoTurn on the technomany signal! And go through the docs just in cas!
18:52laurusWell this will do for now, thanks! Is there anything else I should include?
18:52laurusclojure.somethingelse I mean
18:52gfrederickstechnomancy: would probably just say to use the emaxy-swank-whatsit functions instead
18:52gfredericksC-x C-d M-x M-u C-d or something
18:52autodidaktolaurus: for doc, no
18:52laurusautodidakto, I mean, for other useful things.
18:53autodidaktogfredericks: lol, i think in this case it goes in your init.clj/project.clj or something
18:53laurusautodidakto, l
18:53autodidaktolaurus: you'll find them in time. pprint is common
18:53laurusclojure.pprint?
18:53autodidaktothink so
18:53gfredericksyeah
18:53laurusThanks.
18:54antares_hcumberdale: does the most recent snapshot work for you?
18:55autodidaktoThe technomancy bat signal -> triggering all his keywords at once -> "technomany, emacs, vim, heroku, xmonads, leingingen, debian" ... hmm what else?
18:55ibdknoxto answer some of the questions on Light Table: http://www.chris-granger.com/2012/04/15/light-tables-numbers/
18:55autodidaktobah, misspelled his name anyways
18:55autodidaktoleiningingiengienge
18:55gfredericks"technomany" is his plural name
18:55autodidaktoMust be slavic
18:56autodidaktoOr his undead computer army
18:56zenomOk, any ideas how to clean up the fill-handbag? :)
18:56zenomhttps://github.com/zenom/clojure-knapsack/blob/master/src/smuggler/core.clj
18:56zenomi cleaned up the rest, and greatly appreciate your help guys
18:57gfredericks(= 0) is (zero?)
18:58zenomok let me look that up, im assuming thats just a helper for = 0
18:58zenombut increases readability
18:58gfredericksyeah that's all
18:59gfredericksthere's a lot of stuff like that when learning clojure
18:59gfredericksnot too important I guess
19:03gfrederickszenom: it's much better than I'd expect for someone starting out
19:03Lajlahcumberdale, it's not from salad fingers?
19:03LajlaTHe cartoon?
19:03LajlaThere's a chatracter called humbert cumberdale in iot
19:03zenomcool, still want to figure out how to clean up fill-handbag, so going to try and look around more
19:03zenomseems bulky to me. like it needs a refactor hehe
19:04hcumberdaleLajla, cartoon spoon
19:05hcumberdaleyes
19:05hcumberdaleIt is from salad fingers
19:07Lajlahcumberdale, ah yes
19:08LajlaWell, Salad Finger says in it 'Ohhh, Huber Cumberdale, you taste like poo' when he tastes him
19:08Lajlawhich, dnolen is by the way why the word 'troll' is completely overrated and nowadays just sprayed around by every person who doesn't understand what some-one means.
19:11hcumberdalehe really said this?
19:12LajlaYes
19:12Lajlain the episode cumberdale was introduced in
19:13Lajlahcumberdale, http://www.youtube.com/watch?v=cuCw5k-Lph0&amp;feature=fvsr seconmd episode apparently
19:17emacs_newbso I recently tried using slime + clojure
19:17emacs_newbmind = blown
19:18emacs_newbit's amazing; I can't believe I haven't used this for the past 10 years
19:18hcumberdaleyeah!
19:18hcumberdaleit works now
19:19emacs_newblife without slime :: life with clojure = using a keyboard :: having computer read my mind
19:19emacs_newbs/clojure/slime
19:19emacs_newbthere's something about having a live repl that just increases flow / focus
19:21hcumberdaleLajla, super awesome
19:24hcumberdaleIs there a tool to get rid of all things I do not use from my .jar files?
19:25hcumberdaleslamhound is nice for imports but it does not work in my project
19:28S11001001hcumberdale: no; clojure tree-shaking is a reduction of the halting problem
19:28hcumberdaleantares_ it's working!
19:28hcumberdaleI pushed the latest version to github and clojars
19:28antares_hcumberdale: cool. We will release next beta soon.
19:31hcumberdaleI also changed it to work with strings ,... ;)
19:31hcumberdalesuper-super-awesome
19:31hcumberdalenow it's time to go to bed
19:31hcumberdale01:26 ...
19:35_KY_Is 2Gb memory too small for Enclojure to compile projects?
19:48zenomdoes clojure 1.3 have a min java version or anything?
19:53septomin_ibdknox: looking forward to seeing the reward tiers
19:53ibdknoxhere's the preview: http://www.kickstarter.com/projects/306316578/698018053?token=27376c21
19:54ibdknoxif there are suggestions for the rewards, I'd be interested in hearing them :)
19:59septomin_hmm, maybe some kind of fancy printed manual
19:59aperiodicstickers!
19:59aperiodiceverybody loves stickers
20:00brehautibdknox: have raynes and amalloy complained about the color scheme yet?
20:01ibdknoxlol
20:01brehaut:)
20:01ibdknoxpeople and their damn colors :p
20:01ibdknoxaperiodic: oo, I did forget stickers...
20:03ibdknoxseptomin_: that's an interesting idea too
20:04ibdknoxwe used to give out shortcut cards for VS
20:17ibdknoxrofl
20:17ibdknoxI just got this email: https://refheap.com/paste/2140
20:21_KY_How can I change directory in the REPL?
20:22brehautibdknox: thats… wow
20:22gfredericks_KY_: jvm doesn't let you change working directory
20:22gfredericks$google github raynes fs
20:22lazybot[Raynes/fs · GitHub] https://github.com/Raynes/fs
20:23Licenseribdknox seriousely?
20:23gfredericksbut that ^ might interest you
20:23LicenserI mean the people thing .NET is a language o.O
20:23Licenser*think
20:23brehauti presume he wants support for .NET IL
20:23devn200k?
20:24ibdknoxbrehaut: that still doesn't really make sense
20:24ibdknoxlol
20:24ibdknoxCLR IL would, I guess
20:25ibdknoxthough you couldn't do anything meaningful with *just* that
20:25ibdknoxin any case I loved the "clojure is outdated"
20:25brehautespecially compared to python
20:26ibdknoxhalf a decade = time to deprecate ;)
20:26brehautin favour of a decade and a half old language
20:27septomin_ibdknox: maybe tutorial videos?
20:27ibdknoxI thought of doing some totally different things
20:27septomin_or an in-person thing, you're in SF right?
20:27ibdknoxyeah I was thinking of something like that
20:27_KY_How do I display the classpath in REPL?
20:27ibdknoxone of the company ones would be have me come in and speak
20:28ibdknoxor more startupy one, use me for a day to solve a problem
20:28ibdknoxnot sure if those are interesting though
20:29TimMc&(find {:a 1 :b 2 :c 3} :b)
20:29lazybot⇒ [:b 2]
20:29TimMcHuh.
20:29ibdknoxdevn: were you questioning the 200k goal?
20:29ibdknox,(doc find)
20:29clojurebot"([map key]); Returns the map entry for key, or nil if key not present."
20:30ibdknoxTimMc: ?
20:30TimMcOh, it's just new to me, that's all.
20:30gfredericks,(-> {:a 1} (find :a) type)
20:30clojurebotclojure.lang.MapEntry
20:30ibdknoxI knew it existed, but have never cared to use it
20:30ibdknoxlol
20:31gfredericksI can't imagine it has any high-level use
20:31gfrederickswell _maaaay_be
20:31TimMcI discovered it when a defn collided with it.
20:31ibdknoxme too
20:31ibdknoxlol
20:31TimMclike an uncharted shoal
20:32bprhaha
20:32gfredericksI guess it might be the easiest way to filter a map by a set of keys?
20:32gfredericksas in (into {} (map #(find m %) my-keys))
20:33ibdknoxgfredericks: select-keys
20:33ibdknox,(doc select-keys)
20:33clojurebot"([map keyseq]); Returns a map containing only those entries in map whose key is in keys"
20:33gfrederickscrap and I even know all about select keys
20:33gfredericksfind has foiled me again
20:33ibdknoxlol
20:34ibdknox,(source select-keys)
20:34clojurebotSource not found
20:34ibdknox&(source select-keys)
20:34lazybotjava.lang.RuntimeException: Unable to resolve symbol: source in this context
20:34ibdknoxaw
20:34gfredericksyou bots are worthless
20:34ibdknoxI was wondering if maybe it used find under the covers
20:34gfredericks$source select-keys
20:34lazybotselect-keys is http://is.gd/SzyhyJ
20:34gfredericksI bet the link goes to the wrong line
20:35ibdknoxyeah not even close
20:35gfredericksibdknox: it does!
20:35gfredericksI mean it does use find
20:35ibdknoxwell there you go
20:35gfredericksbut that contradicts my "high-level" qualification
20:35gfredericksso maybe we're back to it's worthless
20:36gfrederickswell it does keep TimMc from using nice simple function names
20:37ibdknoxso that's a win really :p
20:40_KY_Can someone tell me how to run a simple clj file? just using the REPL or java -cp ?
20:40gfredericksload-file from the repl should work
20:41_KY_Thanks...
21:00Licenserif I've a syntax error in a cljs project can I find out where the problem is?
21:03TimMc_KY_: There's also a one-off plugin for leiningen
21:04krsankyibdknox: nice email u must have fans :P
21:04_KY_I'm trying to use enclojure... but the JVM won't start because of low memory... I have 2GB RAM, dunno why
21:05yoklovLicenser: not really
21:05Licenser:(
21:06septomin_is there a shortcut for (partial keep identity)?
21:06yoklovwhat's the problem?
21:06krsankysry ibdnox im just reading your posts because im all up in noir
21:07ibdknoxkrsanky: lol, I get some weird emails sometimes ;)
21:07yoklovLicenser, i've found that running the repl helps a lot, as does compiling frequently. you also get good at telling what the errors mean
21:07krsankythat means your doing something right !
21:07ibdknoxhaha
21:07ibdknoxdoes anyone know if python devs still outnumber ruby ones?
21:07Licenseryoklov yea I have a bad {} in there somewhere
21:07krsankyi LOVE python
21:08ibdknoxkrsanky: what's your favorite python dev tool?
21:08krsanky?
21:08septomin_that's probably going to depend a lot on how you define "python dev"
21:08krsankyi learned python just for django way back
21:09ibdknoxkrsanky: what editor/IDE did you or do you use for it, is what I was asking :)
21:09krsankybut ii use vim or emacs
21:09ibdknoxseptomin_: I know for the longest time academia pushed it well above ruby
21:09Licenseris there a way to run a remote reply on a node.js deployment?
21:10septomin_ibdknox: well, that and a lot of scripting
21:10ibdknoxalso true
21:10septomin_not many people consider themselves bash devs
21:10krsankyi do!
21:10ibdknoxlol
21:10krsankyim a sysadmin 1st
21:10ibdknoxI'm just thinking around what the next language might be
21:10krsankyclojure duh !
21:11septomin_the python IDEs were all quite bad the last i looked
21:11ibdknoxkrsanky: clojure + JS are first ;)
21:11krsankypython is just easier and doesnt have the startup time problem
21:11yoklovLicenser: hm, no clue, maybe someone else knows. There also might be something in the https://github.com/emezeske/lein-cljsbuild docs.
21:11krsankyclojure makes me smile when i do get it
21:12Licenseryoklov thanks :) sadly not using lein
21:12septomin_i think the main reason is that it's very hard to do static type analysis well in python
21:13krsankydont lisp people shun IDEs ?
21:13ibdknoxlisp has had quite a few interesting dev envs over the years
21:14krsankyyeah i spoke fast i saw an old vid with steele and some others steele liked the IDEs
21:14clojurebotIt's greek to me.
21:15krsankyive only liked using the MS one way back
21:15krsankyeclipse kinda is not fun
21:15yoklovi really like that you can view changes in your code live in eclipse.
21:15yoklovlive == when you save
21:15krsankyis that the counterclockwise one ?
21:15ibdknoxyoklov: hm?
21:15septomin_ibdknox: so generally I think something like lighttable is most interesting where people are mainly using text editors
21:16ivanibdknox: why would you want to suffer the pain of Python?
21:16ivan(and IntelliJ/PyCharm is nice)
21:16ibdknoxseptomin_: I believe that's mostly true
21:17ibdknoxivan: python's a decent enough language :) I was mostly thinking in terms of expanding reach
21:17ibdknoxno one collects good stats on the number of devs for things it seems
21:17yoklovibdknox: if you are running in debug mode, you can edit some method in a class, save the file, and then next time that method gets called, the change occurs. i've found it quite useful for UI/game development
21:17septomin_i'm also kind of skeptical of performance on something like a large C++ project
21:17ivanI have used Python for large applications and you run into pretty much all of the problems that Clojure has solved
21:17ibdknoxI know there are around 6 million .NET folks out there
21:17krsankyibdnox: i dont envy you trying to make a paradigm shifting editor/env
21:17ivanplus it is slow
21:18ivanand does not really compile to JS
21:18ibdknoxyoklov: ah, that
21:18krsankyid for sure try it
21:18ibdknoxkrsanky: I have at least some idea of the mess I've gotten myself into ;)
21:19krsankyibdknox: you can do it!
21:19krsanky:)
21:19septomin_why do you think it is that the state of the art is so bad, anyway
21:20yoklovibdknox: yeah, it's quite limited but still more powerful than a lot of other ways of doing gui development… tragically. (hopefully you'll change that though :)
21:21ibdknoxseptomin_: are you asking me?
21:22ivanibdknox: if you get into Python, #twisted is where the cool people hang out. #python is agony.
21:22ibdknoxI wrote a fair amount of stuff in python a couple years ago
21:22septomin_i just mean in general
21:22kovasbfor clojure the state of the art is emacs, which is showing its age..
21:23kovasbnot great for webdev or graphics
21:23septomin_why we still have largely the same compilation model as in the 70s
21:23ivanSublime Text has brought some really cool editor innovations that no one is copying
21:23yoklovkovas: why do you say its bad for graphics?
21:23ivanmultiple cursors/selections, especially
21:23ivanEmacs can't even keep the cursor outside of the viewport
21:23ibdknoxivan: we had that in VS :)
21:23ivanibdknox: really? did it ship?
21:23ibdknoxseptomin_: a number of reasons
21:23ibdknoxyeah
21:24ivanwhoa. how come it's not on reddit and stuff?
21:24ibdknoxnobody likes VS :p
21:24ibdknoxwell correction, the people on HN and Reddit don't like VS
21:24yoklovkovasb: (whoops, had spelt your name wrong)why do you say emacs is bad for graphics
21:24kovasbyoklov: if you are calling outside packages to render your graphics, that is suboptimal in many ways
21:24ivanibdknox: I see "multiple line". does it handle multiple cursors in the same line?
21:25ibdknoxthat might have ended up as an extension, but it definitely exists
21:25ivanokay
21:25ibdknoxI think it was called multi-stream selection or something
21:25kovasbyoklov: the consequence is that the graphics is no longer integrated into the working environment, its in an outside box somewhere
21:25yoklovkovasb: hm, not quite sure what you mean, outside packages as in… not rendering in an emacs buffer
21:25ibdknoxseptomin_: I think one of the main reasons our tools are the way they are is because only devs care about them and in my experience design and dev are a very rare combination of skill sets
21:26kovasbyoklov: yes, the choice is either to use emacs directly for graphics (which no one does for clojure), or use a JVM-based graphics lib
21:26yoklovkovasb: ah, okay, i agree that that sucks, however i don't know how much better newer tools are for that. (aside from full-blown IDEs)
21:27kovasbyoklov: I used / worked for Mathematica for many years, its light years better
21:27ibdknoxwooooow
21:27ibdknoxwhat a troll
21:27kovasbyoklov: but there are other beefs with emacs besides that. Its just showing its age in many ways
21:28gfredericksI used bananas for eating for many years; they're light years better
21:28kovasblol
21:29ibdknoxhttp://groups.google.com/group/light-table/browse_thread/thread/f3109d5fdfea5f90
21:29ibdknoxit is way too early for that shit
21:29ibdknoxlol
21:29kovasbloool
21:30kovasblooks like the honeymoon is over :)
21:30ibdknoxhaha
21:30yoklovkovasb: i'll agree web development can be a bit awkward, especially if you don't have control over the file (e.g. someone used a <style> or <script> tag, as MuMaMo et al. are awkward)
21:31kovasbyoklov: yeah. I mean I like emacs. But its a problem when you can't natively/easily represent the stuff you are trying to create
21:31gfredericksI like "Chris himself"
21:32kovasbI mean, he has a point about size of market
21:32kovasbbut funny
21:32kovasbhow big is the lua market anyway??
21:32lazybotkovasb: Definitely not.
21:32ibdknoxkovasb: hence JS
21:32kovasbyea exactly
21:33ibdknoxlowest level of annoyance for highest return
21:33ibdknoxsupport JS will be at least one if not two orders of magnitude harder than Clojure
21:34ibdknoxin any case, the more money it raises, the more people I can hire to expand the languages out
21:34ibdknoxthat will address itself
21:34ibdknoxespecially with it being an open platform
21:34gfredericksibdknox: separate kickstarter for each language :)
21:34ibdknoxhaha that would be interesting only in order to see how it played out
21:35ibdknoxit would be a very good way to understand the market associated with each sector of the dev world
21:35ibdknoxbut I have plans for more than just the IDE portion :)
21:36kovasbhenceforth I will refer to myself as "a member of the code writing industry"
21:36kovasbclearly this guy programs in java for a living
21:36ibdknoxlol
21:36kovasbhow many lines of code did you produce today, huh??
21:36lazybotkovasb: Definitely not.
21:37gfrederickskovasb: why do you always have to trigger lazybot's boolean replies???
21:37lazybotgfredericks: Oh, absolutely.
21:38kovasbgfredericks: i haven't read the source yet
21:38kovasbgfredericks: either that or it has it out for me
21:38gfrederickskovasb: I was facetiously complaining; just wanted to trigger it myself. it's just the repeat question makrs at the end
21:39gfredericksright lazybot???
21:39lazybotgfredericks: Yes, 100% for sure.
21:39ivanAre you sure it's just that??
21:39lazybotivan: What are you, crazy? Of course not!
21:39gfredericksI miss sexpbot
21:39yoklovlol
21:39yoklovgreat name
21:39kovasbAnyway I came into the room because I have a serious question
21:40kovasbI'm getting the cljs "Can't recur here" error
21:40ibdknoxyou AOT'd the compiler
21:40kovasbits not the "delete the classes folder" solution
21:40ibdknoxdelete classes
21:40ibdknoxhm
21:40kovasbI'm trying to combine several cljs projects
21:40ibdknoxyou need to add the skip-aot thing too
21:41kovasbok will try that
21:41kovasbbut that error = aot'ing the compiler?
21:42ibdknoxusually
21:42ibdknoxor you're actually recuring someplace you can't
21:42ibdknoxbut that's pretty hard to do
21:42kovasbits weird because it seems transient
21:42ibdknoxit's likely the AOT stuff then
21:42kovasbI'm using noir-cljs and himera
21:42ibdknoxif the cljs compiler gets aot'd terrible things happen
21:42kovasbid did some exclusions and i thought i fixed it..
21:43kovasbibdknox: does noir-cljs do the same thing as the lein cljsbuild once?
21:43ibdknoxno, it watches
21:43kovasbright, but once its starts to compile
21:44kovasbi think i have clojurescript in 3 places here
21:44ibdknoxcould be version mismatches or something then
21:44kovasbcljsbuild, noir-cljs, and himera
21:45kovasbi guess i will try excluding more libs until it works again
21:48ibdknoxI suspect CodeMirror is about to get a shit ton better
21:48ibdknoxlol
21:49kovasbthat would be awesome
21:49kovasbwhat made you choose that over ace?
21:49ibdknoxhaha someone asked that on the latest HN thread: http://news.ycombinator.com/item?id=3845316
21:50ibdknoxtldr: it had better clojure support and wasn't a pain in the ass to setup
21:50ibdknoxeither I was just doing it wrong or the ACE instructions are terrible (haven't checked in a while, maybe it got better)
21:50ibdknoxSomething about the CodeMirror project just made me like it more too
21:52kovasbI spent an evening looking at the various options
21:52kovasbI like how ace highlights closing brackets
21:52ibdknoxso does codemirror :)
21:52ibdknoxyou just have to turn it on
21:52kovasbah :)
21:52ibdknoxI'm really hoping someone writes paredit for it :)
21:53ibdknoxshouldn't be *that* hard
21:53kovasbi was able to get it to work easily but the ace api does look a bit ughly
21:53kovasbi would kill for that
21:53ibdknoxand might be a neat exercise
21:53ibdknoxlol maybe that should be one of the filters for hiring
21:53ibdknoxwrite paredit for CodeMirror
21:54ibdknoxI'm really interested in how the balancing act between open source and business plays out here.
21:54ivanwishlist: variable-width fonts in CodeMirror with automatically fixed alignment
21:55kovasbthere is always the hosting route
21:55kovasbpeople create cool shit with your tool.. want it hosted somewhere
21:55septomin_it might be nice to clarify what a license entails
21:56ibdknoxseptomin_: I agree
21:56kovasbin terms of quick wins, could get bought by heroku/salesforce
21:56ibdknoxlonger term vision is a lot bigger than a quick win, which I think I would want to stick out for
21:57kovasbhow are all these other projects getting funded
21:57kovasbfirebase etc
21:57ibdknoxthey're YC
21:57kovasbah
21:57ibdknoxwhich I may be too, we'll have to see.
21:57ibdknoxseptomin_: I think to download the actual thing (not the source) you will need a license, but ultimately I expect that will probably be a pay what you think it is worth model.
21:58eggsbyI know the biz I work for is really interested in clj, they're pretty ~enterprisey~, then there's stuff like runa too
21:58ibdknoxseptomin_: in terms of the future I think there are plugins that would be worth a lot in specific domains
21:58eggsbyibdknox: just go the jetbrains route of community version and licensed
21:59ibdknoxoh man, I completely forgot they did this
21:59ibdknoxeggsby: good call, I should talk to those guys. I worked with them at MSFT
22:03muhooibdknox: i'd suggest, write it in cljs. do it for clojure. then hire someone to port it to js
22:03gfrederickslicensed version supports vectors and maps
22:03muhoowho wants to do that? someone who actually likes js, that's who.
22:03ivanwhy would you need to port it to JS?
22:04muhoowell, not port it, but add the modules to make it handle editing js
22:04ivanah
22:04muhoobut if you do all the design and productization stuff in cljs, really finish it up, not only will it go faster, and be more fun, but it'll be awesome for all of us :-)
22:05muhoothen, like i said, shouldn't be hard to find someone who just LOOOVES js. they seem to be everywhere. and your cljs code serves as a design document and interface document.
22:06spoon16Anyone know how to get clojurescript to output a comment at the top of the compiled output.js file? http://stackoverflow.com/questions/10167896/building-a-user-script-for-chrome-using-clojurescript-how-can-i-get-the-userscr
22:09echo-areaHow to specify compilerarg for javac-opts in leiningen?
22:14espeedAnyone working with Datomic yet?
22:16kovasbespeed: I'm holding off until the dynamodb version is released
22:17espeedany idea when that will be?
22:19kovasbi hope in the next month or two, but who knows
22:19kovasbthey are probably spending a lot of time on debugging and testing
22:26y3digranger on a roll
22:27unlink_I can't seem to get lein ring war working with leiningen 2. http://dpaste.com/732296/ /cc weavejester
22:28krsankyi am a level 23 magic user and here come the fireballs to the emacs haters
22:29krsankyits one thing to improve in a thing ...
22:29krsankyon*
22:40zenlikeAnyone there? I need a spot of help.
22:40zenlikeCan't figure out how to store functions sequentially...
22:40zenlikethis works fine:
22:40zenlike,(list + - * /)
22:40clojurebot(#<core$_PLUS_ clojure.core$_PLUS_@1b04ab2> #<core$_ clojure.core$_@cbee0d> #<core$_STAR_ clojure.core$_STAR_@91bc33> #<core$_SLASH_ clojure.core$_SLASH_@103cd1b>)
22:41zenlikebut I can't figure out how to get, say, a sin function in that list
22:41zenlikethis works:
22:41zenlike,(Math/sin 3.14)
22:41clojurebot0.0015926529164868282
22:41kovasbMath/sin is not a function
22:41zenlikebut this throws an exception:
22:41gfredericksoh you want a java method
22:41zenlikeit's a java method, not a clojure function?
22:42gfrederickswhat's the function that makes a function from a java method :/
22:42gfrederickszenlike: yeah
22:42kovasbtry #(Math/sin %)
22:42gfrederickswell that'll work
22:42zenlike,(list #(Math/sin %) + - /)
22:42clojurebot(#<sandbox$eval80$fn__81 sandbox$eval80$fn__81@181392b> #<core$_PLUS_ clojure.core$_PLUS_@1b04ab2> #<core$_ clojure.core$_@cbee0d> #<core$_SLASH_ clojure.core$_SLASH_@103cd1b>)
22:42zenlikecool, that seemed to work
22:42zenlikekovasb: care to elaborate a bit on that syntax?
22:42zenlikeor point me to good references?
22:43kovasbyes, thats shorthand for (fn [x] (Math/sin x))
22:43zenlikeinteresting
22:43zenlikeis there info about that in the clojure docs?
22:43zenlikethat shorthand, i mean.
22:43gfredericksthat's generic anonymous function syntax
22:43gfredericksequivalent to (fn [x] (Math/sin x))
22:44kovasbsort of. its under the "reader" section
22:44zenlikegfredericks: So the # demarcates that as a function, and the % is "anonymous args"?
22:44zenlike*demarcates as an anon function
22:44devnzenlike: % is 1 arg
22:45zenlikewould %(+ % %) be for a two argument function?
22:45zenlikewhoops, i meant #(+ % %)
22:45eggsby% is all args isn't it?
22:45eggsbyand %1 %2 %3 for nth of the forms
22:46devn,(#(+ %1 %2 %3) 1 2 3)
22:46gfredericks%& is all
22:46clojurebot6
22:46gfredericks,(#(vector % %1 %2 %3 %&) 1 2 3)
22:46clojurebot[1 1 2 3 nil]
22:46gfrederickshrmph
22:46devn,(#(apply + %&) 1 2 3)
22:46clojurebot6
22:47gfredericks,(#(vector % %1 %2 %3 %&) 1 2 3 4 5 6)
22:47clojurebot[1 1 2 3 (4 5 6)]
22:47kovasbyou repeated %1
22:47kovasb% = %1
22:47gfredericksI guess %& is the rest of the ones you didn't mention
22:47gfredericks,(#(vector %3 %&) 1 2 3 4 5 6)
22:47clojurebot[3 (4 5 6)]
22:47devnyes
22:47devn%& is the same as & args
22:47gfredericksso there isn't an all-the-args form
22:47zenlikeinteresting. thanks for the help.
22:48zenlikeso using that / syntax, as in #(Math/sin %), that "/" indicates a method of a java module, in this case Math?
22:49kovasbits a static method
22:49gfrederickszenlike: the slash indicates a fully-qualified symbol
22:50gfredericksthe first part can be one of several different things
22:50kovasbif Math was a class instance, then you would use (.sin Math x)
22:50zenlikeso what is Math? a library?
22:50TimMcibdknox: I'm getting my introduction to Noir by writing a wedding gift registry site for myself and my fiancée. :-D
22:50gfrederickszenlike: Math is a class
22:50zenlikeah, i see.
22:50zakwilsonNoir is good stuff.
22:50zenlikein java you can just use methods from classes like that without having to make an instance?
22:51zakwilsonStatic methods.
22:51gfrederickszenlike: that's the difference between "static" and "instance" methods
22:51ibdknoxTimMc: nice!
22:51zenlikei see.
22:51TimMcibdknox: and Korma, and Hiccup...
22:52TimMcGonna check out Lobos at some point too.
22:52ibdknoxI love the Clojure community :)
22:52TimMcamen
22:52TimMc200 lines of code, and I almost have a gift registry
22:52TimMcjust need to handle one more POST
22:53kovasbi don't understand why clojure doesn't provide a standard library for all that math stuff
22:53ibdknoxI'd call that a win
22:53TimMcAdding administrative stuff would take a bunch more code, so we'll just edit the SQLite DB directly. :-P
22:53eggsbyHow do you guys write tests for the routes in noir/compojure ?
22:53kovasbwhy require people to learn about java for basic things..
22:54zenlikekovasb: yeah, that kind of confuses me too. do you think it's because the language is still pretty young, or because it's supposed to be set up that way?
22:54TimMcand calling it a night.
22:54eggsbykovasb: meh, it's generally useful information and helps you learn about interoperability features too
22:54zenlikelike, if i didn't have any previous OO or java experience i'd be really lost trying to pick up clojure
22:54gfredericksthe folk don't like wrapping things just for the sake of wrapping them
22:54kovasbzenlike: i think that the core clojure team just doesn't feel the pain of the newbie
22:55ibdknoxI think people just aren't doing that much math?
22:55ibdknoxnot enough for a full-featured lib to exist
22:55zenlikekovasb: haha.
22:55ibdknoxsomeone just needs to get fed up and write it
22:55eggsbyHmm, interesting point kovasb, do you think that clojure would be a suitable first language?
22:55kovasbeggsby: yes, every language has its warts
22:55zenlikeTimMc: So are you going to write ClojureMyAdmin? :)))
22:55eggsbyibdknox: ~clojure in clojure~
22:56kovasbeggsby: clojure makes up for it with simplicity where it counts
22:56ibdknoxnot it
22:56ibdknoxlol
22:56ibdknoxeggsby: absolutely
22:56ibdknoxI think I can teach people to code much faster in Clojure than most other languages
22:56ibdknoxassuming no prior knowledge
22:56gfrederickslet's write an "unhosted-clojure"
22:57ibdknoxlol
22:57zakwilsonYou can avoid the underlying platform leaking through a lot more now than when I started using Clojure.
22:57septomin_do you think their head will explode with the first error message?
22:57gfredericksterrible performance, but ideal everything
22:57zenlikezakwilson: how so?
22:57eggsbythat recent interview with rhickey on infoq, he had some words about clojure in clojure and the work cljs was doing
22:57ibdknoxseptomin_: your first error messages suck no matter what language you're using
22:57zakwilsonzenlike: you don't have to know Java to read a file, for example.
22:57septomin_sure, but some suck more than others
22:58zakwilsonslurp wasn't always in core.
22:58ibdknoxyou haven't yet learned how to understand failure in this case
22:58septomin_i just have flashbacks of trying to use STL as a 16 year old
22:58zenlikezakwilson: I have been trying to figure out how to use slurp.
22:58ibdknoxprogramming is unique in that regard, I think
22:58zenlikeseptomin_: HAHA! I am familiar with that
22:58gfrederickszakwilson: if slurp were a core java method they probably might not have bothered
22:58eggsbyheh, I couldn't get slurp to work how I wanted without declaring a java io resource :)
22:58zakwilsonzenlike: slurp takes a path and returns a string of its contents. What's to figure out?
22:59gfredericks,(slurp "/etc/passwd")
22:59zenlikewhen I try to (slurp "core.clj") i get an exception that says... (hang on please)
22:59zakwilsongfredericks: quite possibly.
22:59clojurebot#<AccessControlException java.security.AccessControlException: access denied (java.io.FilePermission /etc/passwd read)>
22:59zenlikeUnable to resolve slurp, no such file or directory
23:00zenlikeI'm pretty sure I'm in the right directory. What am I missing here?
23:00zakwilsonzenlike: pastebin the whole stacktrace
23:00yoklovmy hunch would be that you're not in the right directory
23:01zenlikeWhat's that code for the stack trace again? (.exception e) or something... sorry, I'm blanking
23:02zakwilsonHow are you running Clojure?
23:02zenlikeIn the leiningen REPL.
23:03zakwilsonI'd expect it to just print the stacktrace when you attempt to run code that throws an exception.
23:04zenlikeI don't get the whole stacktrace, just one line.
23:05zakwilsonI'm not sure about your specific situation, but try giving it a full absolute path to a file you're sure exists.
23:06espeedI'm new to Clojure and am working on getting Clojure 1.3, Datomic, and Leinigen 2.0 to play nicely together, but I'm getting a java.lang.NoSuchMethodError: clojure.lang.Util.equiv(CC)Z error when running lein test.
23:08espeedI put the code in a Datomic Skeleton project on GitHub (https://github.com/espeed/dskel) -- would someone take a look at it and let me know what I'm missing?
23:09zenlikezakwilson: absolute paths did it.
23:10zenlikethanks for the help.
23:11cmajor7how much category theoretical elements are used in clojure? (e.g. applicative functors, monads, semigroups, etc..)
23:11kovasbcmajor7: very few if any
23:12zakwilsonzenlike: You're probably confused as to your current working directory. Try (get (System/getenv) "PWD")
23:12kovasbcmajor: though there are people doing stuff with monads etc
23:12ibdknoxjimduey is preaching the monad gospel, so there's a little
23:12ibdknoxbut not much
23:12ibdknoxthere are other mechanisms that make them less important, I think
23:12ibdknoxbut you should talk to brehaut or someone who knows more than I do on the subject :)
23:12zakwilsonI've found Clojure to be fairly low-theory high-getting-stuff-done.
23:13xeqiespeed: that datomic requires 1.4.0-beta3
23:13cmajor7right, I saw some clojure takes on monad, but it did not really look very monadic.. would that be because of the dynamic dispatch?
23:13cmajor7e.g. no need for higher kinds, etc..
23:13zenlikezakwilson: Yeah, PWD is how I got the absolute path to work, I think it'd just that relative paths don't work at all? or at least don't seem to on my system.
23:13xeqiI've seen that error when I did a 1.4 aot and tried to run it on 1.3
23:13zakwilsonzenlike: relative paths *should* work.
23:14espeedxeqi: ahh...ok
23:14xeqiwith another project
23:14brehautcmajor7: theres a functors somewhere as well as monads, but most of the categorical classes are absent (or implicit)
23:14zakwilsonI have production code using slurp and relying on relative paths.
23:15cmajor7brehaut, I see.. what would be a reason for the absence (dynamic typing)?
23:15zenlikezakwilson: but not in the REPL, I think is what my problem might be? probably will work with code in core.clj but not in the REPL.
23:15brehautcmajor7: theres nothing unmonadic about the clojure monad library though, its a bit more unweildy than haskells (because it has to use dynamic binding and explicit monad declarations rather than return type based polymorphism) but the operations you perform are exactly the same
23:15zenlikebecause my lein is actually is /usr/bin i think
23:15brehautcmajor7: the biggest rason for the absence is that a lot of the uses of monads in particular are needed in clojure because the problems are solved in other ways
23:16zenlikeso maybe paths used in the REPL need to be relative to usr/bin?
23:16zakwilsonzenlike: it should be relative to your current working directory.
23:16cmajor7brehaut: you mean "are _not_ needed"?
23:16brehautcmajor7: there are still times when something like the state or maybe monad is useful and those of us who know about them do reach for them
23:16cmajor7brehaut: would IO monad be one of such cases?
23:16brehautyeah
23:16brehautand yes re:IO
23:17brehautthat also goes for STM and ST
23:17cmajor7right.. STM is a natural monad..
23:17cmajor7interesting
23:17brehauta lot of operations are implictly nil aware so maybe-m isnt as useful
23:17brehaut(and fnil covers a lot of the remaining cases)
23:17brehautfinally we have for which is list comprehensions / monad anyway
23:18cmajor7right..
23:18brehautthe biggest disadvantage is that when you dont use the monadic interface you dont get some of the generality that monads provide
23:18brehauton the other hand, its less unweildy
23:18brehautwhich is great if you dont need that generality
23:18emacs_newbis there any project to implement an editor, say emacs, in clojure?
23:18cmajor7so it seems in clojure, a monad is just something implicit and "not to worry about"
23:18emacs_newbit would be great to have an entire clojure based IDE
23:19cmajor7brehaut: can you give an example (a link is cool), on how an IO monad used on clojure?
23:19brehautcmajor7: there is no IO monad in clojure
23:19emacs_newbyou don't need monads in clojure
23:19kovasbemacs_newb: http://www.chris-granger.com/2012/04/12/light-table---a-new-ide-concept/
23:19emacs_newbyou can do IO without the IO monad
23:19brehautcmajor7: its implicit in the strict evaluation with side effects model
23:20emacs_newbkovasb: I'm throwing my credit card at my monitor, but nothing is happening
23:21cmajor7I see.. "with side effects" => that means it actually does not wrap into an "abstract IO type".. is there any case you would not want that.. I am thinking "something within a transaction" (but not STM, e.g. Transactional Monad)
23:21brehautcmajor7: in clojure you might us a monad when you want an alternative reasoning strategy: eg a backtracking parser (state-t maybe-m) or a logic engine (core.logic has monadic underpinnings, although its not iimplemented in terms of algo.monads for performance reasons)
23:21kovasbemacs_newb: throw it at ibdknox
23:22brehautcmajor7: the io! macro allows you to wrap up side effecting code to cause an error when its used in a transaction
23:22kovasbemacs_newb: there should be a kickstarter announcement imminently
23:22ibdknoxI have no idea how long they take to review them, hopefully it'll be up tomorrow?
23:24brehautcmajor7: have you looked at the tutorials on clojure.net ?
23:25cmajor7brehaut: niice.. (to io! macro and http://www.clojure.net/2012/02/02/Monads-in-Clojure/) reading… but in general, when you say "problems are solved in other ways", would you say these "ways" are more side effect approving/tolerant?
23:26brehautwell the side effecting stuff yes
23:26brehautin particular atoms, agents and stm refs
23:26brehautfor stuff that you would use IO,ST and STM monads for in haskell
23:27cmajor7where I am coming from is "are these other ways" lose the way to be as composable as e.g. with a category pitch languages?
23:28brehauti dont see your argument
23:28brehautif you need monadic composition
23:28brehautuse a monad
23:28brehautand clojures stm without a monad is composable anyway
23:29emacs_newbwithout intending to start a flamewar -- did smalltalk really have all these features?
23:29emacs_newbif so, what caused it to fail, the child-like UI?
23:29emacs_newb(in reference to HN comments on "everything in light table = already existed in smalltalk")
23:29kovasbemacs_newb: there was an extinction event around 1990
23:29kovasbsmalltalk, lisp
23:30emacs_newbkovasb: are you referring to symbolics?
23:30kovasbmuch broader than just that
23:30pipelineemacs_newb: bad vendor support, ai winter, lousy performance
23:30kovasb"ai winter"
23:30kovasbother platforms took off
23:30pipelineemacs_newb: let us not forget: much of lisp's early success in the 80s was based in custom hardware
23:31pipelinekovasb: what platforms took off in the 80s besides as/400
23:31emacs_newbso basically, if the symbolics or smalltalks guys
23:31emacs_newbthought to port their work to java vm
23:31emacs_newbthe world could be a very different place
23:31pipelinesymbolics actually survived the ai winter
23:31pipelinethey were killed off by idiot real estate deals
23:31pipelineand they had a working VM predating the jvm
23:31pipelineaka opengenera
23:31kovasbpossibly, though it took a long time for the JVM to become awesome
23:32cmajor7brehaut: no argument. all questions. the biggest pitch for haskell / scalaz / etc.. is composability => use higher kinds (via e.g. type constructors) / wrap everything into another "pure" type and "fmap" (e.g. tranform) everything to return a wrapped world.. which allows for most if not everything to be referentially transparent. clojure is a lot simpler and cleaner (in my opinion), but what I'd like to understand is "which "other ways" is
23:32pipelinei'm not even kidding here, and a little bit of google can confirm it for you
23:32kovasbalso, programming languages research abandoned that tradition as well
23:32pipelinesymbolics bit it in large part becouse of a bad office real estate deal
23:32kovasbgetting more into type theory, monad stuff :)
23:32pipelineat the time that they bit it, they were selling two of their most compelling products: opengenera, lisp targeting a VM, and embedded ivory processors for network switching
23:34kovasbpipeline: if they were doing well, that wouldn't have killed them tho
23:35kovasbcmajor: clojure is the most composable language i've seen
23:35kovasbcmajor: there is a lot more to it besides nice mathematical properties
23:36kovasbcmajor: check out the "simple made easy" talk by rich hicket
23:36kovasby
23:36cmajor7kovasb: I'd like to agree with you, just wanted some comparative feedback
23:36kovasbcmajor: yeah, totally
23:36kovasbcmajor: rich does talk about certain things that are easier in haskell
23:37kovasbi believe its brought up in the talk, but i don't remember for sure
23:38kovasbthe closest thing to a composability "silver bullet" is immutability
23:38kovasband functions
23:39cmajor7right, but there are also side effects..
23:39kovasbbut beyond that its all about designing a multitude of things right
23:40kovasbside effects can potentially be broken down into classes of problems
23:40espeedxeqi: thanks, it works now.
23:41kovasbtrying to cram the whole space of them into a single solution might not be ideal
23:41kovasbbut I'm just one guy talking
23:41kovasbif your side effect is "change this value in memory" then the stm is a potential solution for that class
23:42kovasbother kinds of side effects might have different solution
23:42kovasblike resource management
23:43kovasbmaybe monads are the best thing for io, but its a problem that does not come up that often for me personally
23:43eggsbyit's a subset of problems, when you need them you need them
23:44eggsbythe guys who work almost exclusively w/ derivatives/trading seem to love them tho
23:47kovasbinteresting. i did not know that
23:47kovasbi thought they generally code in languages that don't support them
23:47kovasbthe guys i know use java, python
23:55cmajor7kovasb: makes sense, thanks for thoughts..
23:55kovasbcmajor7: sure!
23:56yoklovibdknox: is it normal for waltz to say "WARNING: Use of undeclared Var waltz.state/get-in-sm at line 30" the first time it gets compiled?
23:56yoklovweirdly it only complains the first time, and it always works
23:56ibdknoxnever seen that
23:57ibdknoxbut I think I have those off
23:57ibdknoxor rather, they weren't on by default
23:57ibdknoxJS doesn't have the same limitations as Clojure does
23:57ibdknoxso I probably did something stupid clojure-wise
23:57ibdknoxthat works fine in javascript :)
23:57kovasbi think that is a new warning
23:57ibdknoxlikely just need to reorder the var
23:57kovasbi just started seeing it today
23:57yoklovthey catch bugs where i mispell names, i don't think that i have it turned on...
23:58yoklovi'm using cljs master though
23:58yoklovi really like waltz though.
23:59ibdknoxI need to add the deterministic mode
23:59ibdknoxso much to do :)
23:59yoklovyeah, i'm using it as a deterministic fsa