2011-05-14
| 03:06 | grantm | when i try to use case, the REPL tells me that case doesn't exist. which is weird. i'm pretty sure case exists... right? why can't the repl (or clojure for that matter) find it? |
| 03:08 | stirfoo | sometimes I'll fat-finger a namespace and I can't acces core functions, but I have no idea exactly what I did wrong. |
| 03:08 | stirfoo | but clojure.core/case would work |
| 03:09 | stirfoo | <shrug> |
| 03:09 | grantm | oh wait, im using clojure 1.1 and it needs 1.2 |
| 03:09 | grantm | simple :) |
| 03:09 | stirfoo | no case in 1.1? |
| 03:09 | grantm | nope |
| 03:10 | stirfoo | ah, I think I jumped into Clojure after 1.2 was released |
| 03:11 | grantm | me too :) |
| 03:11 | grantm | not sure how i have 1.1 |
| 03:12 | stirfoo | I find it weird that (in-ns 'frumbajimbleooza) does not fail if that namespace does not exist. I think that's how I lose core functions sometimes. |
| 03:15 | amalloy | stirfoo: that's the way namespaces are (usually) created |
| 03:16 | amalloy | ,(macroexpand '(ns tmp)) |
| 03:16 | clojurebot | (do (clojure.core/in-ns (quote tmp)) (clojure.core/with-loading-context (clojure.core/refer (quote clojure.core)))) |
| 03:16 | stirfoo | oh, that's interesting |
| 03:17 | amalloy | you can explicitly create them with ##(create-ns) |
| 03:17 | sexpbot | java.lang.IllegalArgumentException: Wrong number of args (0) passed to: core$create-ns |
| 03:19 | amalloy | i'm not sure if there exists a way to enter a namespace that doesn't implicitly create it. it's hard to imagine it seeing much use, though, since (ns whatever) is supposed to be macro sugar over in-ns/use/require, and if it actually did more than just package them up nicely i think that would cause more confusion |
| 03:19 | amalloy | ~source in-ns |
| 03:19 | amalloy | $source in-ns |
| 03:19 | sexpbot | Source not found. |
| 03:19 | amalloy | really? |
| 03:19 | amalloy | &(doc in-ns) |
| 03:19 | sexpbot | ⟹ "([name]); Sets *ns* to the namespace named by the symbol, creating it if needed." |
| 03:20 | stirfoo | well there it is, 'creating it' if needed |
| 03:22 | stirfoo | I got my copy of Joy of Clojure but I want to get a proper Clojure environment in place before I dig in. I've been using my own scripts handling CLASSPATH, but now I'm trying to get lein working. |
| 03:23 | amalloy | stirfoo: http://stackoverflow.com/questions/5983427/how-to-install-clojure-on-ubuntu-10-04-from-github-repo-with-no-clojure-jar/5984183#5984183 is a super-easy way to get lein running |
| 03:23 | Vinzent | in enlive, is it possible to alter inner tag of the tag which I've selected? |
| 03:24 | Vinzent | like, <div><a ...>, I have to clone-for div and change href attr of a |
| 03:27 | thorwil | Vinzent: if you clone-for :div, you can then just follow on with selecting :a |
| 03:27 | thorwil | [:a] (en/set-attr :href string) |
| 03:28 | thorwil | aside of that, transformations can be nested, so you can always sub-select |
| 03:29 | Vinzent | thorwil, but then all links will have the same href, right? The idea is to build list of links |
| 03:30 | thorwil | Vinzent: that's what the let part of clone-for is |
| 03:30 | thorwil | good for |
| 03:31 | thorwil | (en/clone-for [i (:items arg-from-defsnippet)], then extract the needed data from i |
| 03:32 | stirfoo | thanks amalloy. I had actually gotten that far but if I add [org.clojure/clojure-contrib "1.1.0"] to my project :dependencies, run lein deps, run lein repl, then (require '[clojure.contrib.str-utils2 :as sutils]) I get: java.lang.NoSuchMethodError: clojure.lang.RestFn.<init>(I)V (NO_SOURCE_FILE:0) |
| 03:34 | thorwil | Vinzent: see for example http://paste.pocoo.org/show/388503/ |
| 03:34 | amalloy | (a) 1.1 is way old, as is str-utils2. (b) that's the error message you get for mismatched compiled binaries |
| 03:34 | amalloy | did you build something yourself? |
| 03:35 | stirfoo | amalloy: ah, no I just installed the lein script, created a project, added the contrib dependency. So maybe I should use a different version in the :dependencies vector? |
| 03:36 | amalloy | stirfoo: depend on clojure 1.2.1, and contrib 1.2.0 |
| 03:38 | stirfoo | amalloy: what replaces str-utils2? or have most of those functions been folded into core? |
| 03:38 | amalloy | stirfoo: most of them have been folded into clojure.string |
| 03:38 | stirfoo | amalloy: that worked, thanks! |
| 03:38 | stirfoo | amalloy: ah |
| 03:38 | amalloy | the rest mostly live in clojure.contrib.string, i think |
| 03:42 | Vinzent | thorwil, that's it, thank you very much for the paste! |
| 03:42 | thorwil | np |
| 03:51 | stirfoo | Well all right. Full macro expansion works in swank now, sans namespaces and pretty printed. |
| 03:52 | amalloy | sans namespaces? |
| 03:52 | stirfoo | amalloy: namespaces were included in macro expansions before. I had something wrong, but it's all working now. |
| 03:53 | amalloy | stirfoo: not entirely sure i know what you mean. macroexpansions should have namespaces in them, like ##`x |
| 03:53 | sexpbot | ⟹ clojure.core/x |
| 03:54 | amalloy | anyway glad it's working for you |
| 03:54 | stirfoo | sexpbot: no! I don't want that, it just muddles the output, imo |
| 03:55 | amalloy | stirfoo: too bad, mate. it's there for a reason, to prevent accidental symbol capture, which is heinously difficult to debug |
| 03:57 | stirfoo | If I'm writing a macro and want to see what it expands to, the namespaces just make it harder to read, again, imo. |
| 03:57 | Vinzent | stirfoo, there is clojure-debug that makes macroexpansions pretty |
| 03:58 | amalloy | Vinzent: linkkkkk plz |
| 04:00 | stirfoo | sometimes I like a *fully* recursive expansion as well C-c M-m (slime-macroexpand-all) which seems to work well with lein swank now. Nice an pretty printed with no namespaces. |
| 04:00 | amalloy | stirfoo: you're right in most cases. i wouldn't complain if clojure.core/inc printed as inc when macroexpanding |
| 04:01 | amalloy | but if you have a symbol you accidentally namespace-qualify and didn't intend to, it seems like you're asking for pain if you cause the macroexpansion-printer to hide the ns |
| 04:01 | stirfoo | No, I agree. I depends on the complexity of the macro I suppose. |
| 04:02 | amalloy | stirfoo: the usual mistake is qualified let-bindings: ##`(let [x 1] (inc x)) |
| 04:02 | sexpbot | ⟹ (clojure.core/let [clojure.core/x 1] (clojure.core/inc clojure.core/x)) |
| 04:02 | amalloy | when what is really *meant* is ##`(let [x# 1] (inc x)) |
| 04:02 | sexpbot | ⟹ (clojure.core/let [x__10202__auto__ 1] (clojure.core/inc clojure.core/x)) |
| 04:02 | amalloy | haha, except with the # in both places :P |
| 04:02 | stirfoo | amalloy: I've gotten used to `(let [x# 1] ...), which is really cool ;) |
| 04:03 | amalloy | yeah |
| 04:03 | stirfoo | I don't think I've used (gensym) yet |
| 04:03 | stirfoo | I don't think I'*had* to use (gensym) |
| 04:03 | amalloy | but especially devious is ##`(do `(let [x# 1] x#)) |
| 04:03 | sexpbot | ⟹ (do (clojure.core/seq (clojure.core/concat (clojure.core/list (quote clojure.core/let)) (clojure.core/list (clojure.core/apply clojure.core/vector (clojure.core/seq (clojure.core/concat (clojure.core/list (quote clojure.core/x__10210__auto__)) (clojure.core/list 1)))... http://gist.github.com/972036 |
| 04:04 | amalloy | where the outermost ` form qualifies the gensym produced by the inner one |
| 04:04 | amalloy | stirfoo: i've found a couple reasons to use gensym, but not many |
| 04:19 | Vinzent | amalloy, well, actually I don't know what exactly does that :) I can paste my (messy) emacs config if you want |
| 04:20 | amalloy | Vinzent: eh. i don't really use C-C C-m that often; i just call macroexpand from the repl |
| 04:23 | Vinzent | amalloy, why? imo hit C-c RET on the form is much more convenient |
| 04:23 | stirfoo | that's what I always use, and the extra C-c M-m sometimes |
| 04:24 | Vinzent | http://imgpaste.com/i/cgdlr.png |
| 04:24 | amalloy | yeah, it is, i'm sure. i just never really got into the habit, and i most often test macroexpansions while i'm developing something in the repl anyway |
| 04:24 | stirfoo | and you can C-c RET in that buffer to do surgical strikes |
| 04:27 | amalloy | $mail dnolen https://github.com/technomancy/clojure-mode/pull/17 |
| 04:27 | sexpbot | Message saved. |
| 04:33 | Vinzent | btw, I haven't solved my yesterday's problem: when doing java -cp ./lib;my.jar my.ns i've got Failed to load Main-Class manifest attribute from... Indeed, there is no such atribute in lein-created jars, but then how should i run it correctly? |
| 04:40 | amalloy | Vinzent: set the :main attribute in project.clj to my.ns |
| 04:44 | Vinzent | amalloy, Could not find the main class... |
| 05:24 | terom | &(doc find-ns) |
| 05:24 | sexpbot | ⟹ "([sym]); Returns the namespace named by the symbol or nil if it doesn't exist." |
| 05:26 | yayitswei | is there an easy way to stop a hung process without killing the REPL? I'm using clojure.contrib.shell-out and am trying to debug a process that keeps freezing |
| 09:21 | technomancy | amalloy_: nice; thanks for the fix |
| 12:15 | TimMc | yayitswei is gone, but... my suggestion would have been Ctrl-Z, then ps -e --forest | grep rlwrap -A 5 |
| 12:15 | TimMc | Anybody have a better approach? |
| 12:43 | robonobo | Is there a function that gives back every pair of two given colls? so (f (range 3) (range 3)) -> ([0 0] [0 1] [0 2] [1 0] [1 1] ...) |
| 12:44 | Vinzent | for? |
| 12:44 | clojurebot | for is not used often enough. |
| 12:45 | robonobo | ,(for [i (range 3)] (map #(vector % 4) (range 3))) |
| 12:45 | clojurebot | (([0 4] [1 4] [2 4]) ([0 4] [1 4] [2 4]) ([0 4] [1 4] [2 4])) |
| 12:45 | robonobo | but |
| 12:45 | robonobo | ,(flatten (for [i (range 3)] (map #(vector % 4) (range 3)))) |
| 12:45 | clojurebot | (0 4 1 4 2 4 0 4 1 4 ...) |
| 12:46 | ampleyfly | $help findfn |
| 12:46 | sexpbot | ampleyfly: Finds the clojure fns which, given your input, produce your output. |
| 12:46 | ampleyfly | hmm |
| 12:46 | Vinzent | ,(for [i (range 3) j (range 3)] [i j]) |
| 12:46 | clojurebot | ([0 0] [0 1] [0 2] [1 0] [1 1] [1 2] [2 0] [2 1] [2 2]) |
| 12:46 | robonobo | ofcourse |
| 12:46 | robonobo | Vinzent: thanks |
| 12:46 | Vinzent | robonobo, np |
| 14:19 | stirfoo | if I wanted to set (javadoc foo) to look for a local copy of the docs, I could put it in ~/.lein/init.clj? |
| 14:19 | stirfoo | something like: (dosync |
| 14:19 | stirfoo | (ref-set clojure.java.javadoc/*local-javadocs* '("/usr/share/doc/openjdk\ |
| 14:20 | stirfoo | -6-jdk/api/"))) |
| 14:20 | stirfoo | sorry for the multiline crap-ola |
| 14:20 | stirfoo | would that just go at the top level of init.clj? |
| 14:25 | tomoj | wonder why that's a ref |
| 14:27 | stirfoo | I don't know, I've only used atoms and dynamic vars, not refs |
| 14:27 | stirfoo | I had to look up how to set it ;) |
| 14:28 | tomoj | looks like there is an add-local-javadoc there for you too |
| 14:34 | stirfoo | tomoj: do you know how to add that to ~/.lein/init.clj? I tried to require clojure.java.javadoc, then use add-local-javadoc, but lein swank fails to start |
| 14:37 | tomoj | not sure why it would fail, but I don't think it will help anyway |
| 14:37 | tomoj | init.clj runs in leiningen's jvm |
| 14:38 | stirfoo | so how would I append to *local-javadocs* globally (for lein repl or lein swank) |
| 14:38 | tomoj | :repl-init seems like it would work |
| 14:38 | tomoj | but then you need the code in a namespace that you either add to every project or depend on for every project |
| 14:39 | stirfoo | that doesn't sound fun |
| 14:59 | thorwil | i'm trying to get rid of some repetition, but this doesn't seem exactly elegant: http://paste.pocoo.org/show/388899/ any ideas how to express that conciser? |
| 15:02 | arohner | thorwil: one possibility is to make title a keyword argument. then use a let block to say [title (or title (:title content#))] |
| 15:03 | arohner | nm, I'm not sure which part you don't like |
| 15:04 | thorwil | arohner: the repetition of the "name title transformation" sequence |
| 15:05 | arohner | thorwil: in the reworked defview? |
| 15:05 | thorwil | yes |
| 15:06 | thorwil | in the other case, it's the almost exact same body. no big issue, but there maybe something to learn here |
| 15:09 | arohner | http://paste.pocoo.org/show/388908/ |
| 15:09 | arohner | that changes the calling function a little, I don't know if you care about that |
| 15:10 | arohner | (defview name transformation :title :foo) |
| 15:11 | thorwil | arohner: i actually had to look up how keyword args are supposed to work and that looks like what i just started to imagine. thanks! |
| 15:12 | arohner | np |
| 15:12 | steven | do any of you use TextMate for clojure? |
| 15:12 | thorwil | hmm, i guess i can get rid of the let with an :or in the signature |
| 15:14 | arohner | thorwil: maybe. I wasn't sure what the defn was called with. |
| 15:15 | arohner | do you have access to (:title content) when the macro is run? |
| 15:16 | stirfoo | does anyone have a sample ~/.lein/init.clj I could take a peek at? |
| 15:18 | tomoj | still trying to add the local javadoc? |
| 15:20 | thorwil | arohner: no, would have to work put into the macro as string. experimenting |
| 15:23 | stirfoo | tomoj: yes |
| 15:23 | arohner | man, zip-filter.xml is great until it doesn't work |
| 15:23 | stirfoo | if I try use or require in init.clj lein repl fails |
| 15:25 | tomoj | stirfoo: good luck, just worried what you will find if you get it to work :) |
| 15:25 | arohner | stirfoo: what are you trying to use/require? something in lein's classpath, or something in your project? |
| 15:25 | tomoj | if you get it to work I suspect that it will only be changed in lein's jvm, which won't help at all in your jvm |
| 15:26 | stirfoo | arohner: I'm tryin to point javadoc to a local directory, but I want to to be globally set |
| 15:26 | arohner | stirfoo: yes, but what are you trying to require? |
| 15:26 | stirfoo | (use '[clojure.java.javadoc :only (add-local-javadoc)]) |
| 15:26 | stirfoo | or require |
| 15:27 | arohner | what's the exception? |
| 15:27 | stirfoo | Exception in thread "main" java.lang.ExceptionInInitializerError (init.clj:1) |
| 15:28 | arohner | can you paste all of it? on gist or pastie or something? |
| 15:28 | stirfoo | which pastebin? |
| 15:28 | arohner | stirfoo: any of them. https://gist.github.com/ |
| 15:28 | stirfoo | ok, give me a sec... |
| 15:32 | stirfoo | https://gist.github.com/972546 |
| 15:35 | stirfoo | is that require syntax correct? |
| 15:36 | arohner | stirfoo: yeah. Looks like lein has a problem loading clojure.java.javadoc. the line (:use [clojure.java.browse :only (browse-url)]) |
| 15:36 | arohner | not sure why |
| 15:37 | stirfoo | I think learning how to read tracebacks is going to take a while ;) |
| 15:52 | arohner | stirfoo: add a (require 'clojure.java.shell) and (require 'clojure.java.browse) before requiring clojure.java.javadoc |
| 15:52 | arohner | I really don't understand why that works, but it does |
| 16:02 | stirfoo | arohner: well that kept the repl from crashing, but it's not setting *local-javadocs*. It's still an empty list which may be what tomoj was alluding to. |
| 16:02 | arohner | stirfoo: leiningen always starts in it's own JVM. when it starts the repl, it spawns a second JVM that contains all your project code |
| 16:02 | stirfoo | lein's resetting it afterwords |
| 16:03 | arohner | how do you know? |
| 16:03 | stirfoo | user=> clojure.java.javadoc/*local-javadocs* |
| 16:03 | stirfoo | #<Ref@7a4fe91e: ()> |
| 16:05 | arohner | that shows local-javadocs is empty, in your repl JVM. it doesn't prove lein reset it. |
| 16:05 | arohner | as I said, you have two JVMs. the one lein is running in, and the one your project is running in |
| 16:06 | arohner | lein init modifies lein's JVM |
| 16:06 | stirfoo | arohner: true |
| 16:06 | arohner | "The ~/.lein/init.clj file will be loaded every time Leiningen launches; any arbitrary code may go there. This code is executed inside Leiningen itself, not in your project. Set the :repl-init key in project.clj to point to a namespace if you want code executed inside your project." |
| 16:06 | stirfoo | I tried that as well, but I'm quite sure I didn't know what I was doing ;) |
| 16:07 | arohner | do you have a project yet? i.e. a directory with a project.clj in it? |
| 16:07 | stirfoo | yes setler/, I'm running lein from within that dir |
| 16:08 | arohner | so in that project.clj, add ':repl-init setler.init' |
| 16:08 | arohner | then make a setler.init namespace |
| 16:08 | arohner | then stick your add-local-javadoc stuff there |
| 16:09 | stirfoo | arohner: so I'd need to create setler/init.clj with: (ns setler.init (require ...)) (add-local-javadoc "...") |
| 16:10 | arohner | right |
| 16:10 | stirfoo | ok, let me try that |
| 16:10 | arohner | you know clojure files need to be in src/, right? |
| 16:10 | stirfoo | no |
| 16:10 | arohner | if you have setler/project.clj |
| 16:10 | stirfoo | yes |
| 16:10 | arohner | then all clojure source needs to be in setler/src/setler/init |
| 16:11 | arohner | because setler/src is the root of the classpath, and then namespaces need to have directories that match the parse of the ns name |
| 16:14 | stirfoo | well all right. thanks arohner (and tomoj) |
| 16:15 | stirfoo | I only had to require clojure.java.javadoc as well, not the others (shell, browser) |
| 16:15 | stirfoo | boilerplate code sux |
| 16:15 | arohner | stirfoo: yeah, needing the others was some kind of weirdness w/ how ~/.lein/init loads. Not sure why |
| 16:16 | stirfoo | what would be the point of ~/.lein/init.clj? If I wanted to modify the behavior of lein itself? |
| 16:16 | arohner | stirfoo: yeah |
| 16:17 | arohner | chouser: when using zf-xml, I always seem to need to use zf/descendants to get anything to work. The examples in zf-xml work on atom1, but they don't work on my own XML and I don't understand why. |
| 16:20 | robonobo | so I have this function that generates a random nr between an upper and a lower limit (defn r [low upp] (+ low (* (- upp low) (Math/random))))), that seems to always return a rounded number when it's defined in a file, but not when it's defined in the REPL. Is there anyway I'm not hallucinating? |
| 16:20 | arohner | robonobo: I'd make sure you're calling what you think you're calling. There's no way file vs. repl would cause that |
| 16:21 | arohner | robonobo: maybe you're calling an old version or one defined somewhere else? |
| 16:21 | robonobo | arohner: i've restarted swank a couple of times. |
| 16:21 | robonobo | or would that not help? |
| 16:21 | robonobo | the function used to contain a Math/ceil call, so it's probably because of that |
| 16:22 | arohner | robonobo: swank lives in emacs, and talks to the clojure JVM over a socket. are you restarting emacs or the JVM? |
| 16:22 | arohner | restarting swank won't affect the JVM |
| 16:22 | robonobo | the jvm |
| 16:23 | arohner | add a println in the function. like (println "I'm calling it!"). |
| 16:24 | arohner | yeah, floor & ceil would fix it. random returns a double. double * int is a double. double + int is a double. so what you have pasted should always return a double |
| 16:26 | robonobo | ugh. I swear i've restarted swank a couple of times, but now, trying it after i've asked #clojure, it magically works. damn computers. |
| 16:29 | stirfoo | ,sayoonara should kill the server as well, yes? |
| 16:29 | clojurebot | java.lang.Exception: Unable to resolve symbol: sayoonara in this context |
| 16:29 | stirfoo | hehe, down boy! |
| 16:32 | stirfoo | well, :repl-init only works for the REPL, not swank, so now (javadoc ...) uses the URL, not the local doc |
| 16:33 | stirfoo | that's why I need to set it globally... somehow. that and I really don't want to have to add the boilerplate to every project. lein repl doesn't require a project too. |
| 16:40 | stirfoo | looks like alexott merged a patch to address that problem 6 months ago |
| 16:44 | stirfoo | have to use the deprecated :repl-init-script for it to work with swank |
| 18:07 | fmw | bit of a weird channel for this question, but here we go: anyone found a good alternative to the Aloha rich text editor (I'm working in an Apache licensed CMS in Clojure and don't want to force the AGPL on people)? |
| 18:08 | fmw | I've been trying a few, but have been rather underwhelmed |
| 18:09 | fmw | of course, I rather use markdown/rst for markup, but will need something WYSIWYG for typical users |
| 18:29 | lucian | fmw: ckeditor? tinymce? |
| 18:31 | fmw | lucian: thanks for the suggestions. those seem a bit bloated to me, but I might try them anyway. right new I'm testing the YUI editor, which seems to be quite decent |
| 18:31 | lucian | i've never seen a good wysiwyg editor in a browser |
| 18:31 | lucian | or anywhere else, for that matter |
| 18:31 | fmw | lucian: me neither |
| 18:32 | fmw | lucian: I would personally never use one either, but for non-technical users its quite nice. |
| 18:32 | lucian | i'm not convinced of that |
| 18:32 | lucian | but yeah, people expect one |
| 18:33 | fmw | indeed, I'd like to try and convince them something like markdown is easy to learn, but there is a whole group of people that says "WHAT!? it doesn't look like Microsoft Word so how am I going to make sense of this?" |
| 18:34 | fmw | no point arguing with that |
| 18:37 | technomancy | stirfoo: there's a bug in Clojure where classes in jars on the bootclasspath can't transitively require |
| 18:43 | technomancy | that's why you have to require shell/browser before javadoc works. |
| 18:43 | stirfoo | technomancy: ok. how would I go about modifying what `lein new' writes? Is there some template mechanism? |
| 18:43 | technomancy | but the bootclasspath shaves like half a second off boot time, so it's worth putting up with its annoyances |
| 18:44 | technomancy | stirfoo: there's a plugin called "spawn" that does that |
| 18:44 | technomancy | something like that may be added to leiningen itself in a future version |
| 18:44 | stirfoo | ah, ok I'll check that out. |
| 18:44 | stirfoo | technomancy: swank is working great so far, thanks for the effort |
| 18:45 | technomancy | cool |
| 18:45 | technomancy | crap... I thought I had added :repl-init support to swank in 1.3; I guess I missed it =\ |
| 18:46 | stirfoo | technomancy: yes, I had to use the deprecated keyword, but it does work |
| 19:21 | amalloy | technomancy: i think my patch breaks some things |
| 19:22 | steven | do any of you use TextMate for writing clojure code? if so, which plugin do you use? |
| 19:22 | amalloy | in particular [[]|] - a backspace there deleted the innermost ] |
| 19:23 | amalloy | and i assume that's because C-M-b there skips to before the first [ |
| 19:29 | amalloy | but i can't figure out why. ideas? |
| 19:31 | tomoj | 3fba516 is good? |
| 19:32 | stirfoo | [[]|] C-M-b [|[]] on my setup, no paredit, just basic emacs with clojure-mode |
| 19:32 | amalloy | tomoj: afaik |
| 19:33 | amalloy | stirfoo: with or without the commit i made last night to clojure mode? https://github.com/technomancy/clojure-mode/commit/4495e3 |
| 19:34 | stirfoo | amalloy: probably before that, I've had clojure-mode installed for a couple weeks |
| 19:35 | stirfoo | amalloy: yes, my local version does not have that 'forward-sexp-function line |
| 19:37 | stirfoo | does | have any special meaning in Clojure? I wonder if slime-repl is still parsing that char as common lisp. It messes with the repl. |
| 19:37 | stirfoo | I think it's for escaping symbols in cl |
| 19:37 | amalloy | right, and not meaningful in clojure |
| 19:38 | stirfoo | so, slime-repl would need to be hacked, or slime proper maybe? |
| 19:38 | amalloy | i'd argue you need to stop using |. i don't know if it's a valid symbol character anyway |
| 19:40 | tomoj | I think that signifies point? |
| 19:40 | stirfoo | I have a macro named op|, which means 'alternate' (x | y | z) (op| x y z). I think I did look and couldn't determine if it was legal syntax or not |
| 19:41 | amalloy | $google clojure symbol reader |
| 19:41 | sexpbot | First out of 1540 results is: Clojure - reader |
| 19:41 | sexpbot | http://clojure.org/reader |
| 19:41 | tomoj | oh |
| 19:41 | amalloy | Symbols begin with a non-numeric character and can contain alphanumeric characters and *, +, !, -, _, and ? (other characters will be allowed eventually, but not all macro characters have been determined) |
| 19:41 | dnolen | | is definitely a valid symbol character in Clojure. |
| 19:41 | stirfoo | $ is another I use that isn't listed |
| 19:42 | amalloy | there are a lot of valid ones it doesn't mention |
| 19:42 | amalloy | so it's not a very helpful reference |
| 19:42 | amalloy | dnolen: evidence? |
| 19:42 | dnolen | ,(first '(|a|)) |
| 19:42 | clojurebot | |a| |
| 19:43 | dnolen | amalloy: rhickey even talked about supporting it more explicitly. |
| 19:43 | amalloy | that's evidence that it works now |
| 19:43 | stirfoo | yes, it works nicely, just not with the slime repl |
| 19:43 | amalloy | stirfoo: that's weird |
| 19:43 | stirfoo | unless you C-u RET |
| 19:45 | stirfoo | well, since I have a good installation now (not my bubble-gum version) maybe it works. |
| 19:46 | stirfoo | user> (op| \x \y \z) RET => mini-buffer message [input not complete] |
| 19:47 | amalloy | i see. yeah, probably slime-repl then |
| 19:47 | stirfoo | just need to rip out the code that is intercepting the | |
| 19:59 | dnolen | steven: I maintain it very sporadically, https://github.com/swannodette/textmate-clojure |
| 20:00 | dnolen | steven: it's quite easy to hack on, yet few people send in patches. |
| 20:04 | steven | cool thanks |
| 20:18 | aav | does anyone know if there any changes with exception handling in 1.3? it seems that try/catch does not work for me, as it did in 1.2 |
| 20:25 | alandipert | aav: what have you noticed? |
| 20:26 | aav | alandipert: it seems that ClassNotFoundException get's wrapped into RuntimeException without any notice |
| 20:27 | aav | (try |
| 20:27 | aav | (.loadClass *bundle* cname) |
| 20:27 | aav | (catch Exception e |
| 20:27 | aav | (when osgi-debug |
| 20:27 | aav | (println "class not found: " cname)))) |
| 20:27 | aav | that's what i have |
| 20:27 | aav | and this code works now |
| 20:28 | aav | but before (under 1.2) i had it working with (catch ClassNotFountException e |
| 20:29 | alandipert | yes, there have been changes that explain that |
| 20:30 | aav | alandipert: any hint where to read? |
| 20:30 | alandipert | https://github.com/clojure/clojure/commit/8fda34e4c77cac079b711da59d5fe49b74605553 |
| 20:32 | aav | alandipert: i see. thank you! |
| 20:33 | alandipert | no problem |
| 20:35 | symbole | How does one create a variable, local to a prarticular namespace? |
| 20:35 | dnolen | symbole: w/ def |
| 20:36 | symbole | dnolen: It would still be refrencable from another namespace though. |
| 20:37 | dnolen | symbole: you can use metadata to make it private to the namespace if you like. |
| 20:37 | amalloy | but someone can still use it if they feel like ignoring the private meta |
| 20:37 | amalloy | just fyi |
| 20:40 | dnolen | nary inline in alpha7 is sick. |
| 20:40 | dnolen | finally (+ 1 2 3 4 5) is not dog slow. |
| 20:42 | dnolen | 1.3.0 is going to be a tasty release. |
| 20:44 | TheMoonMaster | When will 1.3 be out? |
| 20:44 | dnolen | TheMoonMaster: unknown, but I'm sensing we're nearing beta. |
| 20:45 | TheMoonMaster | dnolen: Awesome, wish there was some sort of release schedule |
| 20:50 | symbole | From what I can see, while there is defn- which would prevent "use" from exporting the symbol, there's no equivalent macro for vars. Why is that? |
| 20:51 | scottj | symbole: there's a really long thread in the mailing lists's history about this |
| 20:51 | scottj | symbole: basically there's ^:private and some ppl don't want private to be encouraged too much |
| 20:53 | symbole | scottj: I'm intersted in reading it. I imagine it could be very useful to have this local data, and prevent pollution if someone just did (use 'foo). |
| 20:54 | scottj | symbole: then (def ^:private foo ..) |
| 20:55 | dnolen | clojurebot: use |
| 20:55 | clojurebot | chouser: I really did wonder why you had all those photobombers on slide 2.... audio is so useful :) |
| 20:55 | dnolen | heh |
| 20:56 | scottj | symbole: that is for 1.3, older versions require (def ^{:private true} foo...) |
| 20:57 | symbole | scottj: Maybe what I am trying to do is just misguided? Do most people simply rely on users to use :only? |
| 20:57 | dnolen | symbole: exactly. |
| 21:01 | scottj | dnolen: in your recent recorded talk you mentioned type systems, maybe https://bitbucket.org/tarballs_are_good/lisp-random/src/b03568c1f295/HindleyMilner/tests.lisp would interest you |
| 21:02 | symbole | Seems to be more of an idiomatic approach to establishing an interface compared to what Common Lisp has. I'll roll with it. :-) |
| 21:02 | alandipert | dnolen's nyc lisp talk was recorded? |
| 21:03 | scottj | alandipert: yeah |
| 21:03 | alandipert | oh awesome |
| 21:03 | dnolen | alandipert: not the logic one no, a short talk about Scheme vs. Clojure |
| 21:03 | scottj | oh no wait maybe it was a scheme talk |
| 21:03 | dnolen | scottj: that is interesting though I'm more interested in post-HM type inference. |
| 21:06 | alandipert | dnolen: really enjoyed logic-tutorial btw, core.logic is a super cool library |
| 21:07 | dnolen | alandipert: thank you! still need to sit down and really flesh out the logic-tutorial. |
| 21:11 | dnolen | scottj: it's funny I'm interested in the type system stuff, but I can't even begin to understand how a type checker might be written for the predicate dispatch stuff I'm interested in. |
| 21:35 | aav | is there a way to control which classloader is used by (import ... ? |
| 21:37 | aav | it seems, that Compiler.ImportExpr generates code, that uses some default classloader |
| 22:33 | yayitswei | TimMC: thanks for your suggestion on using Ctrl-Z to pause a hung REPL. could you elaborate? ps -e --forest on my mac yields "illegal option -- -" |
| 22:35 | TimMc | yayitswei: Well, you may have a different ps binary. CHeck the man page for available options. Anyway, just find the process ID of the spwaned process and kill it. |
| 22:36 | yayitswei | TimMc: and how do you resume the thread that you paused? |
| 22:37 | TimMc | Oh, that depends on your shell, I guess. Let me see... |
| 22:37 | TimMc | fg should work |
| 22:38 | TimMc | You may have to check the job control features of your shell. |
| 22:41 | TimMc | yayitswei: echo $SHELL # What shell are you using? |
| 22:42 | yayitswei | bash |
| 22:44 | TimMc | OK, cool. You can find out more about job control in bash's documentation. You won't need most of it -- ^Z, %, fg, bg, and jobs are the main things to know. |
| 22:46 | yayitswei | cool, thanks!! |
| 22:49 | wastrel | pstree maybe |
| 22:49 | wastrel | i dunno if they have that for mac |
| 23:27 | yayitswei | thanks guys, the suspend-and-resume technique is working perfectly. any suggestions on how to view stdout while the command is running? currently if the process hangs in the REPL i have no additional information on why it's hanging |