2012-05-27
| 00:10 | emezeske | lynaghk`: All you should have to do is clone it and then run bin/test-install.sh |
| 00:10 | emezeske | lynaghk`: It might complain at the end if you don't have phantomjs installed, but that's no biggie |
| 00:11 | emezeske | lynaghk`: I've gotta reboot into windows for some diablo; I'll probably be back tomorrow sometime |
| 00:16 | lynaghk` | emezeske: okay, rad |
| 00:28 | amalloy | $mail emezeske have you tried vmware? it's a lot more convenient than dual-booting |
| 00:28 | lazybot | Message saved. |
| 00:28 | Raynes | amalloy: Yeah, but doesn't that have a significant impact on performance? |
| 00:29 | amalloy | you don't need a ton of CPU and RAM to run emacs, dude |
| 00:29 | Raynes | Oh, you run Ubuntu from Windows? |
| 00:30 | Raynes | That's evil and sick. |
| 00:30 | amalloy | yes |
| 00:30 | muhoo | almost, but the :tr's are lists not vectors: https://www.refheap.com/paste/2884 |
| 00:30 | Raynes | You're not worthy of your computer nor your monitor. |
| 00:31 | muhoo | running ubuntu from windows is fairly common. if you need windoze for games, but ubuntu for work, bob's yer uncle |
| 00:31 | gfredericks | I run ubuntu vm from a macbook pro at work; it's plenty fast |
| 00:31 | amalloy | what in...muhoo, what the hell is that |
| 00:32 | muhoo | amalloy: brain fart, after reading that little table thing above |
| 00:32 | muhoo | give it a vector of vectors, and get an html table. maybe. |
| 00:32 | scottj | can you guys move windows on linux guest w/o redraw lag? |
| 00:32 | Raynes | muhoo: I don't think you're calling vector enough. |
| 00:32 | amalloy | scottj: yeah |
| 00:32 | muhoo | amalloy: is there a less ugly way to force everything to be dam vector, not a list? |
| 00:33 | amalloy | i run it in seamless mode with no problem |
| 00:33 | amalloy | (defn tablify [head vv] [:table [:th head] (for [r vv] [:tr [:td r]])])? |
| 00:33 | Raynes | amalloy: I guess if you run it full screen, you can't really tell you're in Windows? |
| 00:33 | gfredericks | scottj: I use xmonad so the question doesn't really apply |
| 00:33 | Raynes | amalloy: Don't you mean (vec (for ..))? |
| 00:34 | amalloy | no, i don't because that would be incorrect |
| 00:34 | Raynes | But why do you need a vector all over the place? |
| 00:34 | muhoo | into maybe |
| 00:34 | amalloy | you want that to absolutely NOT be a vector, which is why muhoo's snippet is so bizarre |
| 00:34 | muhoo | amalloy: that's it |
| 00:35 | muhoo | amalloy: no, actually that's wrong |
| 00:35 | muhoo | almost. i need each item to be it's own td, is how i ended up with that bizarre mess |
| 00:36 | gfredericks | so just one tr? |
| 00:36 | scottj | amalloy: do you have a regular integrated video card? |
| 00:36 | amalloy | scottj: no, i have a recent gaming card |
| 00:36 | amalloy | though until recently i had a three-year-old gaming card and that was fine too |
| 00:37 | scottj | amalloy: ahh, cause I tried it on a brand new pretty good laptop with integrated card recently and wasn't able to get it to be smooth |
| 00:37 | amalloy | muhoo: the point is to only use vectors to denote new tags |
| 00:37 | amalloy | use lists to group content inside of existing tags |
| 00:37 | Raynes | amalloy: It doesn't need to be a vector, but puppies will continue to live it is one. You confused me when you implied that it wouldn't work at all if it was a vector. |
| 00:38 | Raynes | It *would*, indeed, continue to work if it was a vector, right? |
| 00:38 | amalloy | no |
| 00:38 | Raynes | What are we working with here? Hiccup? |
| 00:38 | muhoo | &&(let [vv [[1 2] [3 4] [5 6]]] [:table [:th "head"] (for [r vv] [:tr (for [i r] [:td i])])]) |
| 00:38 | lazybot | java.lang.RuntimeException: Unable to resolve symbol: & in this context |
| 00:38 | muhoo | &(let [vv [[1 2] [3 4] [5 6]]] [:table [:th "head"] (for [r vv] [:tr (for [i r] [:td i])])]) |
| 00:38 | lazybot | ⇒ [:table [:th "head"] ([:tr ([:td 1] [:td 2])] [:tr ([:td 3] [:td 4])] [:tr ([:td 5] [:td 6])])] |
| 00:38 | muhoo | hiccup |
| 00:38 | Raynes | I guess I don't know how hiccup works then. |
| 00:38 | amalloy | [:table [[:tr ...] [:tr ...]]] is incorrect hiccup markup |
| 00:39 | muhoo | right, it should be [:table [:tr [:td 1] [:td 2]] .. |
| 00:39 | amalloy | muhoo: looks fine |
| 00:39 | muhoo | not [:table ([:tr ([:td 1.... |
| 00:39 | amalloy | muhoo: doesn't matter |
| 00:40 | amalloy | try it |
| 00:40 | muhoo | haha, great, you're right! thanks! |
| 00:41 | amalloy | if you like, you can imagine that hiccup throws away all the ()s in the forms before rendering thme |
| 00:41 | muhoo | that's very helpful, thanks, did not know that |
| 00:41 | omasanori | scottj: I'm using Core i3 (probably SandyBridge) laptop with Ubuntu guest on VirtualBox w/o (almost) lag |
| 00:44 | hiredman | something about 20,000 |
| 01:25 | muhoo | is this clever or insane: https://www.refheap.com/paste/2885 |
| 01:42 | serpent223 | hi |
| 01:43 | serpent223 | can't get this example to run: http://pastebin.com/ae1dHJTS |
| 01:43 | serpent223 | error is ClassCastException clojure.lang.PersistentArrayMap cannot be cast to clojure.lang.IRef for the defmulti |
| 01:43 | serpent223 | any idea? |
| 01:44 | serpent223 | tried clojure 1.[2-4].0 |
| 01:44 | muhoo | it wants an atom |
| 01:45 | muhoo | or something that can be dereferenced, a var maybe? |
| 01:46 | serpent223 | would probably make sense to store the hierarchy in an atom... |
| 01:48 | serpent223 | yes, does work with an atom -- thx! |
| 01:48 | serpent223 | a hint in the docs would be nice though... :) |
| 03:14 | amalloy | muhoo: it's a clever approach, but surely just using an atom would be easier than repeatedly def-ing stuff |
| 03:16 | amalloy | (defn reloader [f] (let [srv (atom nil)] (fn [] (when @srv (.stop @srv)) (reset! srv (f)))))...(def reload (reloader -main)) (reload) (reload)... |
| 03:18 | amalloy | not actually a threadsafe use of an atom, but since you're just doing it at the repl it should be fine |
| 04:45 | PKHG | hallo, new to clojure and esp. lein on Vista, some help needed to be able to start ;-) |
| 04:47 | PKHG | ... going to coffee .. ==> afk for a while |
| 05:01 | `rand` | pkhg_afk: you'll enjoy playing with Clojure--and Leiningen is a great build tool. Are you using Emacs? |
| 05:04 | PKHG | rand: back and thanks for giving a sign of life... yes Emacs user I am .. |
| 05:05 | `rand` | Great! Do you have swank-clojure installed? |
| 05:06 | PKHG | yes it worked ... if I use Mx slime |
| 05:07 | PKHG | clojure ? no not swank-clojure |
| 05:07 | PKHG | slime use SBCL (steel commen lisp or so) |
| 05:08 | PKHG | so how to use clojure in Emacs? |
| 05:08 | scottj | PKHG: M-x clojure-jack-in or lein swank and then M-x slime-connect |
| 05:09 | PKHG | hmm can try clojure-jack-in but do not know if emacs does know ... |
| 05:09 | `rand` | pkhg: Install swank-clojure by typing lein plugin install swank-clojure 1.3.4, then what scottj said. :) |
| 05:10 | Dvyjones | clojure-jack-in made learning emacs worth it by itself. |
| 05:10 | PKHG | but LEIN does not yet work nice on Vista (I am not Linux) .. |
| 05:10 | `rand` | er, 1.4.2 |
| 05:11 | `rand` | Ugh--install Virtualbox. |
| 05:12 | Raynes | And why would you use Vista? |
| 05:12 | PKHG | too slow ... (have Ubuntu, but that behaves not good either ... sometimes it does something without seeing what and why and how long) |
| 05:12 | Raynes | That's like the antiOS, isn't it? |
| 05:12 | raek | PKHG: do you get an error when you try to install it? |
| 05:12 | PKHG | Raynes: don't let us talk about that ;-) |
| 05:13 | `rand` | try Arch or Mint. |
| 05:15 | PKHG | TC:\Astro_PKHG>lein.bat install swank-clojure |
| 05:15 | PKHG | Wrong number of arguments to install task. |
| 05:15 | PKHG | Expected ([project] [project-name version]) |
| 05:15 | raek | (whether you are using Emacs or not you need Leiningen) |
| 05:15 | `rand` | lein plugin install swank-clojure 1.4.2 |
| 05:15 | Dvyjones | PKHG: lein.bat plugin install swank=clojure 1.4.2 |
| 05:15 | Dvyjones | PKHG: Remember the "plugin". |
| 05:15 | Dvyjones | Also, s/=/-/ :P |
| 05:16 | PKHG | trying ... |
| 05:16 | raek | if you use lein2, you install plugins in another way |
| 05:16 | raek | PKHG: are you using 1.x or 2 preview? |
| 05:16 | PKHG | seems I need maven Caused by: org.apache.maven.wagon.ResourceDoesNotExistException: Unable to download the artifact from any repository |
| 05:17 | PKHG | ??? no idea waht 1.x or 2 meand (newbie: clojure since this morning ) |
| 05:17 | `rand` | ah--have you run self-install yet? |
| 05:17 | PKHG | I think I have to install maven first ... |
| 05:18 | Dvyjones | PKHG: Try lein.bat self-install |
| 05:18 | PKHG | C:\Astro_PKHG>lein.bat self-install |
| 05:18 | PKHG | "C:\Users\Peter\.lein\self-installs\leiningen-1.7.1-standalone.jar" already exists. Delete and retry. |
| 05:18 | PKHG | C:\Astro_PKHG> |
| 05:18 | PKHG | really delete? |
| 05:18 | PKHG | oh will rename .. |
| 05:18 | raek | it looks like you have already done that step |
| 05:19 | `rand` | lein deps, maybe? |
| 05:19 | raek | PKHG: can you run "lein repl" and get a repl? |
| 05:19 | PKHG | moment |
| 05:19 | PKHG | yes ;-) |
| 05:19 | PKHG | and (exit) works too ;-) |
| 05:20 | raek | also, the "Unable to download the artifact from any repository" message could be cause by a typo. are you sure you typed "lein plugin install swank-clojure 1.4.2" exactly like that? |
| 05:20 | PKHG | I think exact ... |
| 05:20 | raek | PKHG: ok, then lein 1.7.1 shold be installed ok |
| 05:20 | PKHG | but I do not have maven yet |
| 05:20 | raek | I think those part is included in lein's jar file |
| 05:20 | raek | but I'm not 100% sure on that |
| 05:21 | `rand` | part: you do, thus the error. |
| 05:21 | `rand` | er, pkhg |
| 05:21 | PKHG | confused ... |
| 05:22 | PKHG | hm you mean in the jar maven is included? |
| 05:22 | raek | yes |
| 05:22 | PKHG | ok good to know ... |
| 05:22 | raek | the exception comes from "org.apache.maven.wagon.ResourceDoesNotExistException". thus it must be somewhere on your computer |
| 05:22 | PKHG | so I have some lein working (the one with cloned with git does not work) .. |
| 05:23 | raek | don't use the bleeding edge development version if you are just going to use it |
| 05:23 | raek | you also need lein ro build it... :-) |
| 05:23 | raek | *to |
| 05:24 | PKHG | oh maybe I had a typing error swanj-cloure-1.4.2.jar is created ... (tried again lein plugin install swank-clojure 1.4.2) |
| 05:24 | PKHG | so now I do what in emacs? |
| 05:24 | PKHG | and have to find it first where that jar lives ... moment |
| 05:25 | raek | PKHG: you only need to install one emacs package: clojure-mode |
| 05:25 | `rand` | M-x clojure-jack-in |
| 05:25 | PKHG | clojure-mode needs el files ... searching or do you have a link raek? |
| 05:26 | raek | PKHG: do you have emacs-starter-kit, ELPA or some other package.el? |
| 05:26 | `rand` | M-x package-list-packages |
| 05:26 | PKHG | never used start kit (so I do no know) |
| 05:26 | raek | if you have, all you need to do is M-x package-install RET clojure-mode RET |
| 05:26 | PKHG | will look for list-packages ... moment |
| 05:27 | raek | if not, install package.el using these instructions: http://marmalade-repo.org/ |
| 05:27 | PKHG | no Mx pac gives nothing ... |
| 05:27 | PKHG | ok ... looking (trying) ... takes some time |
| 05:28 | madsy | PKHG: Novice-tip for SLIME: C-c C-c interrupts swank if the REPL hangs up. C-c M-o clears the REPL history. |
| 05:28 | madsy | And set *print-length* to something sensible so you don't get spammed :-) |
| 05:29 | PKHG | packag-list-packages works! ... so now (reading advice ... moment) |
| 05:30 | `rand` | I on clojure-mode, then x |
| 05:31 | raek | a buffer with compilation errors may pop up when you install clojure-mode. this is normal |
| 05:31 | PKHG | raek: install package does not know about clojure ;-( so more help needed ;-) |
| 05:32 | `rand` | C-c C-o clears just the last output, which can be useful. |
| 05:32 | raek | brb 5 mins |
| 05:32 | PKHG | brb = ... (going to coffee?) |
| 05:32 | `rand` | pkhg: clojure-mode isn't listed? |
| 05:33 | PKHG | no |
| 05:33 | `rand` | argh! |
| 05:33 | PKHG | yes but will be solved ... ;-) |
| 05:33 | PKHG | sooner or later ... |
| 05:33 | `rand` | try M-x package-install, as raek suggested |
| 05:34 | PKHG | https://github.com/jochu/clojure-mode a good link/ |
| 05:34 | PKHG | ? |
| 05:35 | `rand` | M-x package-install RET clojure-mode |
| 05:35 | `rand` | RET |
| 05:36 | PKHG | rand: will try your suggestion ... with RET |
| 05:36 | PKHG | no match ... |
| 05:37 | `rand` | You could clone that repo and add it to your load path--not sure where that is on Windows. |
| 05:37 | `rand` | What's in your .emacs? |
| 05:38 | PKHG | cd c:/Users/Peter/AppData/Roaming/test && lein jack-in 1187: exited abnormally with code 1. so it is directory problem |
| 05:38 | PKHG | cd c:/Users/Peter/AppData/Roaming/test && lein jack-in 1187: exited abnormally with code 1. directory problems |
| 05:39 | PKHG | sorry for twice .. |
| 05:39 | `rand` | np |
| 05:40 | PKHG | rand: What's in your emacs? do not understand what you mean with this question ... |
| 05:40 | PKHG | coming closer ;-) |
| 05:40 | `rand` | Were you in a clojure buffer when you ran clojure-jack-in? |
| 05:41 | PKHG | probably not ... |
| 05:41 | `rand` | .emacs is the emacs config file |
| 05:41 | PKHG | How to do .. |
| 05:41 | `rand` | Is Roaming a lein project? |
| 05:42 | `rand` | e.g., lein new Roaming |
| 05:42 | PKHG | hmm ?? I have a running lime.bat using /users/peter/.lime but emacs uses */Appdata/Roaming .. I think that is the problem .. how to tell emacs to use as home /users/Peter ??? |
| 05:42 | lazybot | PKHG: Yes, 100% for sure. |
| 05:43 | `rand` | Vista uses AppData/ |
| 05:44 | PKHG | yes and no ... |
| 05:45 | PKHG | depends on software ... |
| 05:46 | `rand` | Modify your Emacs shortcut, change the Start in folder. |
| 05:48 | raek | PKHG: I think you need to set your emacs exec-path so it can find lein |
| 05:48 | PKHG | yes sound good ... |
| 05:49 | PKHG | trying to save this chat file ... for your advices ;-) (not yet succeeded) |
| 05:49 | PKHG | succes ;-) |
| 05:50 | PKHG | thanks guys ... I am close and will report later ;-) |
| 05:51 | PKHG | (by the way am 70+ retired mathatician ;-) |
| 05:51 | PKHG_afk | ... |
| 05:51 | `rand` | Cool--I'm using Clojure right now for math. ^_^ |
| 05:52 | aperiodic | PKHG_afk: what did you focus in? |
| 05:52 | PKHG | rand: and I am on a course 'machine-learning' of Stanford U ;-) |
| 05:52 | PKHG | Blender |
| 05:53 | `rand` | Very cool--love OCW. |
| 05:53 | PKHG | not stirring eating things but the 3D Blender ... |
| 05:54 | PKHG | rand: translate for me OCW = ??? |
| 05:54 | lazybot | PKHG: Oh, absolutely. |
| 05:56 | `rand` | Open Courseware |
| 05:57 | `rand` | the Stanford course is OCW, I think |
| 05:57 | progo | always loved the pun :) |
| 05:58 | PKHG | ahh yes, by the way, if one has no know how about matrics and vectors it is rather difficult (it was not for me ;-) as you can guess) |
| 05:58 | PKHG | it is ocw but started already ... and is near the finish |
| 05:59 | PKHG | programming tasks ==> 100% up to now ... questions between 50 5 and 95 % ;-) |
| 05:59 | PKHG | 5 = % |
| 05:59 | `rand` | MIT has a ton of good OCW courses |
| 06:00 | PKHG | will have a look too ;-) (good for old brain ...) |
| 06:00 | `rand` | ...and check Yale |
| 06:00 | PKHG | http://ocw.mit.edu/index.htm |
| 06:01 | `rand` | That's it. |
| 06:01 | PKHG | Yale too? oooo soooo muccch to learn ... |
| 06:01 | `rand` | Harvard may have some as well. |
| 06:03 | PKHG | ... ok ... will first see how to persuade emacs to use clojure ... ;-) bye and see you later (I think ...) |
| 06:03 | raek | PKHG: when the path is set up correctly, you should be able to do "M-! lein version RET" and get the version info in the echo area |
| 06:04 | raek | http://emacswiki.org/emacs/ExecPath |
| 06:04 | `rand` | good luck! |
| 06:04 | PKHG | ... fine (looking at ExecPaht .._ thanks raek!!!_ |
| 06:04 | raek | PKHG: after that you need to create a clojure project using "lein new tinkering" (where "tinkering") is your project name |
| 06:05 | raek | you always do everything in a project |
| 06:05 | PKHG | ... clear ... |
| 06:05 | raek | then you visit a file in the tinkering/ directory (for example tinkering/src/tinkering/core.clj) |
| 06:05 | raek | and do M-x clojure-jack-in |
| 06:06 | raek | you should then get a repl that can use any source files in the project and any libraries you have declared in the project.clj file |
| 06:07 | raek | (also, "RET" stands for the return key) |
| 06:08 | PKHG | bye guys leaving ... |
| 07:36 | alexyakushev | Could someone please help? I have macro called `with-activity` that binds the dynamic var *activity*. Then I have another macro called `do-ui` that executes it's body on the UI thread. |
| 07:36 | alexyakushev | So when I call (do-ui (with-activity foo ....)) all is well. |
| 07:37 | alexyakushev | But when I call (with-activity foo (do-ui .....)) the *activity* is unbound |
| 07:38 | alexyakushev | Any way to solve this? |
| 07:39 | alexyakushev | Oh, I understand now. Because dynamic scope is thread-local, so the *activity* is not authomatically transfered to the other thread. Am I right? |
| 07:49 | ivan | alexyakushev: that or the bindings were not captured |
| 08:01 | alexyakushev | I've solved this by grabbing *activity* to the lexical scope (by let'ting it in the beginning of `do-ui` macro) and then binding it again to the dynamic scope at the beginning of the new thread |
| 08:26 | mittchel | Is it possible to use clojure color codes in a word document?;o |
| 08:38 | mittchel | Is there an easy way to obtain the last item in a list? |
| 08:38 | progo | last |
| 08:38 | scottj | &(last '(1 2)) |
| 08:38 | lazybot | ⇒ 2 |
| 08:38 | mittchel | isn't that for sequences only? |
| 08:39 | progo | what is a list then :) |
| 08:39 | mittchel | Where is that ' for? |
| 08:39 | scottj | mittchel: so it doesn't think 1 is a function |
| 08:39 | mittchel | When I'm not using that it gives me an error. Cause I've tried last without ' |
| 08:39 | mittchel | ahh |
| 08:40 | mittchel | he doesn't evaluate right? |
| 08:40 | scottj | he? |
| 08:41 | scottj | &(quote (1 2 3)) |
| 08:41 | lazybot | ⇒ (1 2 3) |
| 08:41 | scottj | &(1 2 3) |
| 08:41 | lazybot | java.lang.ClassCastException: java.lang.Long cannot be cast to clojure.lang.IFn |
| 08:41 | mittchel | ah |
| 08:41 | mittchel | I'm still confused.. () is list and [] is sequences right? |
| 08:41 | scottj | [] is a vector |
| 08:42 | scottj | you can make sequences out of many things, including lists and vectors |
| 08:42 | mittchel | ah |
| 08:42 | scottj | you can quote many things too |
| 08:42 | scottj | &foo |
| 08:42 | lazybot | java.lang.RuntimeException: Unable to resolve symbol: foo in this context |
| 08:42 | scottj | &'foo |
| 08:42 | lazybot | ⇒ foo |
| 08:42 | mittchel | hmm thanks scottj |
| 08:43 | scottj | mittchel: I take it you haven't gotten to macros yet? |
| 08:43 | mittchel | By the way, is destructuring only possible on vectors? |
| 08:43 | scottj | no, lists and maps are supported too |
| 08:43 | mittchel | scottj: Very basic.. going to do that in a sec.. studying my course got an exam about clojure soon ;D |
| 08:43 | scottj | &(let [{:a a} {:a 1}] a) |
| 08:43 | lazybot | java.lang.Exception: Unsupported binding form: :a |
| 08:43 | scottj | &(let [{a :a} {:a 1}] a) |
| 08:43 | lazybot | ⇒ 1 |
| 08:44 | mittchel | (defn myfun [[x y]] (print x) (print y)) |
| 08:44 | mittchel | this is restructuring too right? |
| 08:44 | scottj | &(let [[a b] '(1 2 3)] a) |
| 08:44 | lazybot | ⇒ 1 |
| 08:44 | mittchel | de* |
| 08:44 | mittchel | but on a vector |
| 08:44 | scottj | its destructuring on a sequence. in destructing [] means sequence not vector |
| 08:45 | mittchel | alright |
| 08:45 | mittchel | LEts say I want the same function to work with a list.. how should it be then? |
| 08:46 | scottj | you just going down your list of homework problems? |
| 08:46 | scottj | (myfun '(1 2)) |
| 08:46 | scottj | or (myfun (list 1 2)) |
| 08:47 | scottj | you should figure out the difference between those two |
| 08:47 | mittchel | No it just describes sequences and I wanted to find out on lists too but had to be sure since I'm writing myself a summary |
| 08:47 | mittchel | Yea but when I use this: (defn myfun [[x y]] (print x) (print y)) can i call it by: (my fun '(1 2))? since you use [] inside the defn |
| 08:48 | mittchel | That's the only issue I've problems with to be honest.. I thought when you use [] you can only use vectors/sequences since thats the format for a vector (with destructuring a sequence) |
| 08:50 | mittchel | Hm got it now :P found it out thanks |
| 08:51 | Vinzent | mittchel, it doesn't matter whether the argument is a list or a vector or something else; clojure has the sequence abstraction which hide differences between them. Thus, you can use your [[x y]] destructing for any seqable thing |
| 08:52 | mittchel | Vinzent: Thanks :D that really helped me lol I think I'm used to Java since they are strict in this |
| 08:52 | mittchel | A string is a string and nothing else |
| 08:52 | scottj | Vinzent: almost, I think. anything that's sequential, not that you can call seq on. |
| 08:53 | scottj | &(map seq [[1] '(1) {:a 1} "foo"]) |
| 08:53 | lazybot | ⇒ ((1) (1) ([:a 1]) (\f \o \o)) |
| 08:53 | scottj | &(map sequential? [[1] '(1) {:a 1} "foo"]) |
| 08:53 | lazybot | ⇒ (true true false false) |
| 08:53 | scottj | [] destructuring will only work on sequential? things I think |
| 08:54 | Vinzent | it works on strings |
| 08:54 | scottj | ahh, apologies |
| 08:55 | Vinzent | ,(let [[[k v] entry] {:a 1 :b 2}] [k v entry]) |
| 08:55 | clojurebot | #<UnsupportedOperationException java.lang.UnsupportedOperationException: nth not supported on this type: PersistentArrayMap> |
| 08:55 | Vinzent | hah, but not on maps |
| 09:53 | serpent213 | hi |
| 09:53 | serpent213 | where did clojure.contrib.ns-utils/immigrate go? |
| 09:53 | serpent213 | i try to write a simple wrapper... |
| 09:55 | kmicu | serpent213: http://clojure.github.com/clojure-contrib/ns-utils-api.html |
| 09:57 | serpent213 | is this still valid for clojure >= 1.3? |
| 10:00 | kmicu | serpent213: from clojure-contrib readme file |
| 10:00 | kmicu | = Clojure-contrib Versions = Versions of clojure-contrib are matched to versions of Clojure. If you are using Clojure 1.0, use clojure-contrib 1.0.* If you are using Clojure 1.1, use clojure-contrib 1.1.* If you are using Clojure from the "master" branch on Github, use clojure-contrib from the "master" branch on Github. If you are using Clojure from the "new" branch on Github, use clojure-contrib from the "new" branch on Github. |
| 10:01 | scottj | serpent213: I don't think that contrib was migrated to new contrib. that function may happen to work though. I suspect it won't be. |
| 10:01 | scottj | won't be migrated, since I think some people disapproved of immigrate |
| 10:02 | kmicu | serpent213: it exists in 1.3.0-alpha |
| 10:03 | scottj | it was written for compojure which I don't think uses it since migration to ring |
| 10:06 | serpent213 | hmmm... i'm trying something like: http://pastie.org/3976825 |
| 10:06 | serpent213 | maybe immigrate is not the right way...? |
| 10:07 | serpent213 | i would like to use my http-client instead of clj-http.client, as a drop in |
| 10:14 | scottj | clj-http has middleware for this kind of thing, I'm not sure exactly how to use it though |
| 10:20 | scottj | serpent213: something like http://jaderholm.com/paste/wrap-user-agent.clj.html |
| 10:22 | borkdude | ,(type (list* 1 2 3)) |
| 10:22 | clojurebot | #<IllegalArgumentException java.lang.IllegalArgumentException: Don't know how to create ISeq from: java.lang.Long> |
| 10:22 | borkdude | ,(doc list*) |
| 10:22 | clojurebot | "([args] [a args] [a b args] [a b c args] [a b c d & ...]); Creates a new list containing the items prepended to the rest, the last of which will be treated as a sequence." |
| 10:22 | scottj | serpent213: scratch that, that doesn't help with the other request methods. clj-oauth2/client.clj has a macro and redefines get/post/etc |
| 10:24 | borkdude | ,(type (list* 1 2 3 nil)) |
| 10:24 | clojurebot | clojure.lang.Cons |
| 10:24 | borkdude | ,(type (cons 1 nil)) |
| 10:24 | clojurebot | clojure.lang.PersistentList |
| 10:24 | borkdude | ,(type (cons 1 (range 10))) |
| 10:24 | clojurebot | clojure.lang.Cons |
| 10:24 | borkdude | ?? |
| 10:24 | lazybot | borkdude: What are you, crazy? Of course not! |
| 10:25 | serpent213 | scottj: thanks, i'll have a look! :) |
| 10:25 | borkdude | cemerick I'm rading your book about cons and list* now |
| 10:25 | borkdude | cemerick I don't totally get what you mean with "creating a seq" directly |
| 10:26 | borkdude | cemerick (or one of the other authors, I don't know who wrote what of course) |
| 10:28 | borkdude | ,(type (rest (cons 1 (range 10)))) |
| 10:28 | clojurebot | clojure.lang.LazySeq |
| 10:29 | borkdude | ,(type (cons 1 (range 10))) |
| 10:29 | clojurebot | clojure.lang.Cons |
| 10:29 | borkdude | ok |
| 10:30 | borkdude | so why does (cons 1 nil) return a persistentlist? |
| 10:33 | AimHere | ,(rest '()) |
| 10:33 | clojurebot | () |
| 10:35 | AimHere | ,(concat nil nil) |
| 10:35 | clojurebot | () |
| 10:35 | AimHere | nil seems to standin for the empty list sometimes |
| 10:35 | pandeiro | the other day i asked if there was a way to emulate a 'for x in obj...' loop in cljs - anyone know? |
| 10:35 | borkdude | ,(type (cons 1 '())) |
| 10:35 | clojurebot | clojure.lang.Cons |
| 10:35 | borkdude | ,(type (cons 1 nil)) |
| 10:35 | clojurebot | clojure.lang.PersistentList |
| 10:36 | borkdude | pandeiro I wrote a macro for it |
| 10:36 | borkdude | pandeiro you can easily define your own, using for and range |
| 10:36 | borkdude | pandeiro o wait, for is already that |
| 10:36 | pandeiro | borkdude: cool, but working with js objects right, not maps? |
| 10:37 | borkdude | pandeiro ah.. wait.. cljs... |
| 10:37 | borkdude | pandeiro I don't know about cljs, but if the obj is seqable it should work I think |
| 10:37 | pandeiro | borkdude: not seqable |
| 10:37 | pandeiro | at least not by default |
| 10:37 | borkdude | pandeiro then extend-type it? |
| 10:38 | pandeiro | borkdude: it's time i learned how to do that, you're right :) |
| 10:38 | pandeiro | i'm still not sure how one would implement it |
| 10:38 | pandeiro | beyond just the clojure extend-type semantics, i don't know what if anything implements the 'in' special form of js |
| 10:38 | cemerick | Borkdude: I don't have a PDF in front of me right now. |
| 10:39 | cemerick | But, cons creates a seq, list* creates a list. |
| 10:39 | cemerick | The fact that lists are themselves seqs, and that cons sometimes returns lists is an implementation detail fundamentally. |
| 10:41 | borkdude | cemerick I'm slightly confused by the sentence "there are two ways to <it>create</it> a seq: <tt>cons</tt> and <tt>list*</tt> |
| 10:41 | borkdude | " |
| 10:41 | borkdude | cemerick create as in, from scratch? |
| 10:42 | borkdude | cemerick nm, I'll read on ;) |
| 10:44 | cemerick | "from scratch" is a bit ambiguous :-) |
| 10:45 | borkdude | cemerick create as in "the most fundamental seq using only scalar values and not other collections" ? |
| 10:46 | cemerick | There is no "most fundamental seq" |
| 10:46 | cemerick | that is, there is no ground or base case |
| 10:47 | gfredericks | ,(time (first (cons a (range 100000)))) |
| 10:47 | clojurebot | #<CompilerException java.lang.RuntimeException: Unable to resolve symbol: a in this context, compiling:(NO_SOURCE_PATH:0)> |
| 10:47 | gfredericks | ,(time (first (cons :a (range 100000)))) |
| 10:47 | clojurebot | "Elapsed time: 0.099 msecs" |
| 10:47 | clojurebot | :a |
| 10:47 | gfredericks | ,(time (first (list* :a (range 100000)))) |
| 10:47 | clojurebot | "Elapsed time: 0.105 msecs" |
| 10:47 | clojurebot | :a |
| 10:48 | gfredericks | cemerick: doesn't "creating a list" imply that the rest has to be realized? |
| 10:48 | gfredericks | ,(type (list* :a (range 1000000))) |
| 10:48 | clojurebot | clojure.lang.Cons |
| 10:48 | gfredericks | ,(type (cons :a (range 1000000))) |
| 10:48 | clojurebot | clojure.lang.Cons |
| 10:48 | borkdude | a footnote on page 93 says list* does *not* return a list |
| 10:49 | gfredericks | I've always thought of list* as just a generalization of cons |
| 10:49 | borkdude | cemerick the text seems to make a distinction between "producing" and "creating" seqs and for the latter there are only two ways: cons and list* |
| 10:51 | borkdude | "you can think of cons always 'prepending' to the tail collection's sequence' .. |
| 10:51 | borkdude | tail collection? |
| 10:52 | borkdude | the tail meaning, the future tail right? |
| 10:53 | borkdude | nm… I think I understand most of it |
| 10:53 | gfredericks | ,(type (apply list (range 100000))) |
| 10:53 | clojurebot | clojure.lang.PersistentList |
| 10:55 | borkdude | The book says cons has little to do with other Lisps cons cells |
| 10:55 | borkdude | but is Cons.java not what a cons cell really is all about: a value and a tail? |
| 10:56 | borkdude | the only difference is that the tail always has to be a seq |
| 11:01 | cemerick | Borkdude: I think it's fair to distinguish between creation and production, where the latter more accurately characterizes lazy seqs. |
| 11:01 | cemerick | gfredericks: yes |
| 11:02 | cemerick | Borkdude: AFAIK, if you can't create a dotted pair, it's not a cons cell. |
| 11:02 | cemerick | but, I'm by no means a CL expert. |
| 11:02 | borkdude | cemerick "it has little to nothing to do with it", of course it has to do with it ;) |
| 11:04 | cemerick | In terms of heritage, sure. |
| 11:04 | borkdude | cemerick "you can create a lazy sequence" p93 |
| 11:06 | hyPiRion | Well, a main difference is that you can represent leaves in a CL cons, but cannot in Clojure. |
| 11:06 | borkdude | hyPiRion that's basically the main difference yes |
| 11:06 | hyPiRion | And, of course, you cannot change the values, but in CL, you can. |
| 11:08 | borkdude | cemerick I'm just dealing with details here, don't worry |
| 11:09 | borkdude | cemerick I like the book very much so far |
| 11:10 | cemerick | Borkdude: Sure; of course, details are important. Don't get too hung up on the creates/produces thing though. :-) |
| 11:10 | borkdude | cemerick I can keep a list for little improvements for the next edition if you'd appreciate it |
| 11:43 | logaan | is it possible to use protocols without using deftype or defrecord? |
| 11:44 | logaan | perhaps by setting the :type metadata of a clojure datastructure? |
| 11:44 | AimHere | Well you can extend protocols to data structures that are already created |
| 11:44 | AimHere | ,(doc extend) |
| 11:44 | clojurebot | "([atype & proto+mmaps]); Implementations of protocol methods can be provided using the extend construct: (extend AType AProtocol {:foo an-existing-fn :bar (fn [a b] ...) :baz (fn ([a]...) ([a b] ...)...)} BProtocol {...} ...) extend takes a type/class (or interface, see below), and one or more protocol + method map pairs. It will extend the polymorphism of the protocol's methods to call the suppl... |
| 11:45 | logaan | i would like some instances of clojure's map to behave in one way and other instances to behave in another way |
| 11:45 | logaan | as i understand it, extending types would cause all instances to behave in the same way |
| 11:47 | logaan | i've implemented using multimethods for now. but it feels like protocols would be a perfect fit. |
| 11:47 | AimHere | You mean you want different things to happen when you call objects of the same type? |
| 11:47 | logaan | yes |
| 11:48 | AimHere | That sounds more like a multimethod thing |
| 11:48 | gfredericks | protocols dispatch on type |
| 11:49 | logaan | @gfredericks type as returned by the type function? or do you mean class? |
| 11:49 | gfredericks | class |
| 11:49 | AimHere | The choice is between multimethods dispatching on whatever-the-hell-you-like and being relatively inefficient, and protocols dispatching on type and being efficient |
| 11:50 | logaan | https://github.com/logaan/orm-untangled/blob/master/src/orm_untangled/validation_types.clj this is the file where i'm using multimethods if you're curious |
| 11:50 | logaan | ok i guess that makes sense |
| 11:51 | gfredericks | are extend-type'd protocol dispatches more efficient than multimethods? |
| 11:52 | logaan | at the very least they'd be dropping a call to the dispatch function you define with defmulti |
| 11:52 | logaan | and i imagine they could be more efficient in addition to that as they line up with the underlying architecture |
| 11:55 | gfredericks | I mean extend-type'd as opposed to types that were created with the protocol implementation in place |
| 11:57 | AimHere | I'd guess they'd be pretty close to any normal function dispatch |
| 11:57 | AimHere | You can use defn to overload any bog-standard function type multiple argument types |
| 11:59 | AimHere | I can't see how extend is going to be much more inefficient than whatever defn is doing already |
| 12:26 | wink | anyone knows if the change of syntax highlighting in CCW 0.8 was intentional? Can I get the old colors back without manually doing it? |
| 12:52 | kilon_alios | aloha guys |
| 12:53 | kilon_alios | anyone can recommend me a link to show how to install and setup slime for clojure in emacs ? |
| 13:13 | kmicu | kilon_alios: https://github.com/technomancy/swank-clojure |
| 13:15 | kilon_alios | kmicu: thanks follow the instruction there when i issue jack-in it reports error "erro in process filter: Symbol's definition is void :define-slime-contrib", any idea how to fix this ? |
| 13:16 | kmicu | kilon_alios: what version of os, emacs, lein, swank-clojure do you have? |
| 13:16 | kilon_alios | what i did with lein was this 1) create a folder, and do a lien new |
| 13:16 | kilon_alios | and then take the project.clj and add this line in the end |
| 13:16 | kilon_alios | :plugins [[lein-swank "1.4.4"]] |
| 13:17 | kilon_alios | kmicu: i got emacs 24 , macos lion , latest clojure and lein |
| 13:17 | kilon_alios | I have also installed JDK |
| 13:17 | kilon_alios | the latest one from apple |
| 13:17 | kmicu | kilon_alios: lein 2 or lein 1.7? |
| 13:18 | kilon_alios | kmicu: https://github.com/technomancy/leiningen |
| 13:18 | kilon_alios | is that 2 or 1.7 ? |
| 13:19 | konr | Is there a function/macro that expands like (foobar 5 inc 10) -> (-> 10 inc inc inc inc inc)? |
| 13:19 | kmicu | 1.7.1 currently |
| 13:19 | kilon_alios | sorry my emacs and lisp kung fu is very weak, can you guid me through |
| 13:19 | kilon_alios | ? |
| 13:21 | semperos | can anyone interpret this stracktrace and provide any info? https://gist.github.com/2815145 |
| 13:22 | semperos | happens when I compile ClojureScript |
| 13:22 | semperos | been making edits on my codebase for a while now, so not exactly sure what's caused it yet |
| 13:24 | konr | In case anybody got curious, (defmacro run-n-times [initial fun times] `(-> ~initial ~@(repeat times fun))) |
| 13:25 | gfredericks | konr: if you're just using functions, you could use comp |
| 13:25 | gfredericks | ,((apply comp (repeat 20 inc)) 1) |
| 13:25 | clojurebot | 21 |
| 13:26 | konr | gfredericks: even better! Thanks! |
| 13:29 | coventry | In the code at http://pastebin.com/inpNCR8x if I replace "takeends" in the definition of endstarts with what I think is the corresponding anonymous function, #(vec (last (last %)) (last (first %))), I get "Wrong number of args (2) passed to: core$vec". Why is that? |
| 13:32 | alexyakushev | ,(doc vec) |
| 13:32 | clojurebot | "([coll]); Creates a new vector containing the contents of coll." |
| 13:32 | alexyakushev | You want to use a vector: ,(doc vector) |
| 13:32 | alexyakushev | ,(doc vector) |
| 13:32 | clojurebot | "([] [a] [a b] [a b c] [a b c d] ...); Creates a new vector containing the args." |
| 13:33 | alexyakushev | Could someone please explain this behavior? http://pastie.org/3977918 |
| 13:34 | bordatoue | Is it possible to make an executable jar from clojure project similar to java project within eclipse |
| 13:35 | gfredericks | bordatoue: are you using lein? or are you asking how to do it in eclipse? |
| 13:35 | gfredericks | alexyakushev: what're you trying to do? |
| 13:36 | bordatoue | no I am not using lein, is there a plugin for eclipse |
| 13:36 | gfredericks | I could explain why it does that if you're really after understanding, but it's a little subtle |
| 13:37 | bordatoue | I just want to make an executable jar for clojure project in eclipse , what would be the best way to do it |
| 13:37 | coventry | alexyakushev: Thanks, I was getting its signature confused with that of list. |
| 13:37 | alexyakushev | gfredericks: This is a condensed example. My real macro extracts an anonymous function from a map in the compile time (using the arguments user provides) and then calls this function |
| 13:38 | gfredericks | alexyakushev: so the short answer is that macros have to return s-expressions. You're trying to return a list containing a function; a function is not an s-expression |
| 13:38 | gfredericks | alexyakushev: you want to "call this function" at compile-time or runtime? |
| 13:38 | loliveira | hi, i'm trying to create a macro to wrap include-js hiccup helper but something is wrong: (defmacro include-backbone [] |
| 13:39 | loliveira | (defmacro include-backbone [] |
| 13:39 | coventry | Followup question: Why does (#([1 2])) fail with an arity exception? (I'll know to use an extra vec in there in future, though.) |
| 13:40 | gfredericks | coventry: you're calling the vector as a function; vectors take 1 arg |
| 13:40 | gfredericks | ,([1 2] 1) |
| 13:40 | clojurebot | 2 |
| 13:40 | coventry | Oh, beautiful. Thanks. |
| 13:41 | alexyakushev | gfreederick: Why, no, I return a list with that function inside, basically I want to call this function in runtime |
| 13:41 | gfredericks | loliveira: try using refheap.com |
| 13:41 | gfredericks | alexyakushev: note if you add a backtick to your function form on line 2 it should work |
| 13:41 | bordatoue | how is any documentation on creating a clojure binary distribution |
| 13:42 | gfredericks | alexyakushev: whether or not that helps you is a separate issue I'm not sure about |
| 13:42 | alexyakushev | gfreedericks: Do you mean before the "let"? |
| 13:42 | gfredericks | (let [macro-clojure `(fn [] ~macro-argument)] |
| 13:42 | gfredericks | forgot the ~ as well |
| 13:42 | loliveira | ty gfredericks |
| 13:42 | alexyakushev | gfreedericks: But I want to create the closure at the runtime, not just its definition |
| 13:43 | alexyakushev | *compile-time, sorry |
| 13:43 | gfredericks | so you want that function to return the quoted code that is the argument to the macro? |
| 13:43 | loliveira | https://www.refheap.com/paste/2888 |
| 13:43 | loliveira | include-jquery works fine |
| 13:44 | loliveira | but include-backbone does not. |
| 13:44 | gfredericks | loliveira: extra parens? |
| 13:44 | gfredericks | well I guess it's more complex than that |
| 13:44 | gfredericks | does include-js let you give multiple args? |
| 13:44 | loliveira | don't work even without them |
| 13:45 | alexyakushev | gfreedericks: basically yes, I want a closure that returns just the argument to the macro |
| 13:45 | gfredericks | (let [macro-clojure `(fn [] ~(list 'quote macro-argument))] |
| 13:45 | loliveira | gfredericks, yes |
| 13:45 | loliveira | nice idea. |
| 13:46 | alexyakushev | gfredericks: But once again, this one would be just a list, it won't be evaluated in the compile-time this way |
| 13:47 | loliveira | it worked, ty. but what could i do if include-js didn't support multiple args? |
| 13:47 | alexyakushev | gfredericks: But thanks so far, I don't dare to waste your time anymore |
| 13:48 | gfredericks | loliveira: this is hiccup? |
| 13:48 | loliveira | yes |
| 13:48 | gfredericks | alexyakushev: no I like these kinds of questions |
| 13:49 | gfredericks | loliveira: you could replace the outer parens with square-brackets for a vector, and then splice them into your calling hiccup forms with concat or something like that |
| 13:49 | gfredericks | loliveira: you want to call the function at compile-time? |
| 13:49 | bordatoue | can anyone please tell me the preferred way to compile clojure to an executable |
| 13:49 | loliveira | gfredericks: yes |
| 13:50 | gfredericks | bordatoue: does your project have a project.clj? I'm not familiar with how eclipse handles clojure |
| 13:50 | gfredericks | loliveira: then what do you want to do with the return value from the function? |
| 13:50 | loliveira | i am looking for a C macro expansion behavior. |
| 13:50 | bordatoue | so what is the preferred way, I don't mind changing it |
| 13:51 | gfredericks | loliveira: oh like you have a map somewhere defining all possible expansions? |
| 13:51 | loliveira | this is the client code: https://www.refheap.com/paste/2889 |
| 13:52 | loliveira | i'd like (include-backbone) were being replaced by that 2 functions calls (underscore and backbone) |
| 13:52 | gfredericks | bordatoue: if you use leiningen, you'll need to specify your main namespace as the :main key in the project.clj, then add (:gen-class) to the ns-decl in that file, and make sure there is a function called -main |
| 13:53 | gfredericks | alexyakushev: you want to call the function at compile-time? |
| 13:53 | gfredericks | loliveira: sorry I just mixed you up with alexyakushev. did you still have a question? |
| 13:53 | loliveira | i think i don't have this map. |
| 13:53 | alexyakushev | gfredericks: No, generate at the compile-time, but call at the runtime. |
| 13:54 | gfredericks | alexyakushev: then why did you say previously that my solution wouldn't call the function at compile time? |
| 13:54 | bordatoue | does clojure have an entry point method, similar to public static void main in java |
| 13:54 | gfredericks | (i.e., why is that a problem if you don't want to do it?) |
| 13:54 | gfredericks | bordatoue: yes I just described for you how to set that up |
| 13:54 | gfredericks | using (:gen-class) to make sure a class gets generated and a -main function for the public static void main |
| 13:54 | loliveira | yes, i still have. |
| 13:55 | loliveira | =) |
| 13:55 | gfredericks | loliveira: okay -- was the using-a-vector-and-splicing-in comment not clear? |
| 13:55 | gfredericks | or have you not asked the question yet? |
| 13:56 | alexyakushev | gfredericks: because macroexpand of your solution looks like ((clojure.core/fn [] (quote "sample-argument"))) |
| 13:56 | loliveira | can you pls point me some comment not clear? |
| 13:56 | loliveira | <gfredericks> or have you not asked the q |
| 13:56 | gfredericks | alexyakushev: and why doesn't that do what you want? You said you wanted the function to return the argument to the macro |
| 13:56 | loliveira | can you pls point me some using-a-vector-and-splicing-in exemple? |
| 13:56 | loliveira | example* |
| 13:56 | gfredericks | loliveira: I said: |
| 13:56 | gfredericks | <gfredericks> loliveira: you could replace the outer parens with |
| 13:56 | gfredericks | square-brackets for a vector, and then splice them into your |
| 13:56 | gfredericks | calling hiccup forms with concat or something like that [13:45] |
| 13:56 | gfredericks | |
| 13:57 | loliveira | i will try, but i don't know how to do that yet. |
| 13:58 | alexyakushev | gfredericks: Because in my actual example I do a lot more than just wrap the macro-argument in a fn, so I want to save time by running this in compile-time |
| 13:58 | gfredericks | loliveira: another thing you could try is wrapping them both in a :div -- I don't know if that's legal in a <head> though |
| 13:59 | gfredericks | alexyakushev: maybe I'd have an easier time if you gave me an example of the macro being called and what it should expand to |
| 14:00 | loliveira | i dont think is legal using div inside head. |
| 14:00 | loliveira | thank you soo much |
| 14:01 | gfredericks | loliveira: so [:html (vec (cons :head (include-backbone)))] would work I think |
| 14:01 | gfredericks | or wait no |
| 14:01 | gfredericks | you can just return a list from include-backbone and it should work naturally now that I think about it |
| 14:02 | gfredericks | so (defmacro include-backbone [] `(list (include-js ...) (include-js ...))) would do it |
| 14:02 | loliveira | i will try, 1 sec |
| 14:04 | loliveira | ir worked! =D |
| 14:04 | loliveira | ir = it |
| 14:04 | loliveira | ty gfredericks |
| 14:04 | gfredericks | np |
| 14:06 | gfredericks | alexyakushev: also you might find something helpful in clojure.tools.macro |
| 14:09 | antares_ | Quartzite documentation site is up: http://clojurequartz.info/ (very much WIP but I feel it may be already useful) |
| 14:09 | jblomo | anyone familiar with the new reducers code? |
| 14:20 | alexyakushev | gfredericks: Thanks again. My actual problem was that I tried to transfer an Object from compile-time to the runtime |
| 14:23 | pandeiro | where is let implemented in cljs? |
| 14:33 | kilon_alios | who wants to listen to my new ambient track ? raise hands now ! |
| 14:34 | konr | I do |
| 14:34 | konr | composed with clojure tools? :) |
| 14:34 | kilon_alios | no sorry i use mainly hardware synthesizers |
| 14:34 | kilon_alios | konr: here -> http://www.mediafire.com/?cgi2g3dojlgof97 , sorry for the unkowning ads |
| 14:35 | kilon_alios | but i plan to start using Overtone , i hope soon enough |
| 14:35 | kilon_alios | oh the track is still WIP |
| 14:37 | kmicu | pandeiro: https://github.com/clojure/clojurescript/blob/master/src/clj/cljs/core.clj |
| 14:38 | kilon_alios | konr: dont be afraid not to like it, i love all critics ;) |
| 14:41 | konr | kilon_alios: it's interesting. Not very familiar with ambient music, although I used to listen to Aghast, Maison close et al |
| 14:42 | kilon_alios | konr: thanks, glad you like it |
| 14:42 | bartiosze | Hi! is this a proper place to ask ClojureScript/ClojureScriptOne related questions? |
| 14:43 | kmicu | bartiosze: clojure google group or here :) |
| 14:44 | bartiosze | ok, then maybe my answer is already on the group. ;-) |
| 14:44 | kmicu | bartiosze: I make project based on ClojureScript One, maybe I can help |
| 14:45 | pandeiro | kmicu: what line? |
| 14:46 | kmicu | pandeiro: from 28 to 45 I guess |
| 14:46 | kmicu | pandeiro: its imported from clojure.core |
| 14:47 | pandeiro | ok so it's not defined in clojurescript at all? |
| 14:47 | kmicu | pandeiro: I can't confirm that :) |
| 14:50 | kmicu | pandeiro: but from code it looks like 'let' macro is imported from clojure.core |
| 14:56 | pandeiro | kmicu: ok thanks |
| 15:01 | pandeiro | are non-blocking fns possible in clojure? ie (do (prn 1) (slow-async-prn 2) (prn 3)) ;=> 1 3 2 |
| 15:04 | gfredericks | pandeiro: try future |
| 15:15 | upwardindex | Raynes: I just translated the js in tryclojure to cljs, I sent you a pull request, let me know if you'd like me to improve anything |
| 15:17 | Dvyjones | How do I round of a rational number to the nearest integer? (Or just always round down, either works) |
| 15:17 | upwardindex | ,(Math/round 3.4) |
| 15:17 | clojurebot | 3 |
| 15:17 | Dvyjones | Duh. |
| 15:18 | Dvyjones | I keep forgetting I have Java :P |
| 15:18 | Dvyjones | ,(Math/round 22/7) |
| 15:18 | clojurebot | #<IllegalArgumentException java.lang.IllegalArgumentException: No matching method found: round> |
| 15:18 | Dvyjones | :( |
| 15:19 | upwardindex | Dvyjones: java doesn't know rationals, I'm afraid |
| 15:19 | Dvyjones | upwardindex: Figured. How do I round those? |
| 15:20 | upwardindex | ,(Math/round (float 22/7)) |
| 15:20 | clojurebot | 3 |
| 15:20 | gfredericks | there's an exact way too, that'll work for arbitrarily large rationals |
| 15:21 | tmciver | ,(int 22/7) ;; rounds down |
| 15:21 | clojurebot | 3 |
| 15:21 | borkdude | I tend to do just (int 3.1516) |
| 15:31 | Raynes | upwardindex: Cool stuff. Not sure I actually want to use ClojureScript there though. I'll take a look shortly. |
| 15:32 | upwardindex | Raynes: why not? |
| 15:33 | Raynes | Because we don't really gain anything besides a compile step from it and I haven't used cljs enough to know how any of that stuff works which could end up making it difficult to make simple changes in the future. *shrug* |
| 15:34 | Raynes | But that doesn't mean I wont take the pull request. Just going to think about it. |
| 15:35 | upwardindex | I'll let you have a look, I'm sure you'll be pleasantly surprised at how much it looks like your original code :) |
| 15:35 | Raynes | Most of that code was actually someone else's. |
| 15:36 | Nibble | Raynes, what happened to 9b? |
| 15:36 | Raynes | A lovely fellow who added the dynamic tutorial thingy. |
| 15:36 | Raynes | Nibble: The IRC network? It's 10b now. |
| 15:37 | Nibble | Raynes, zc00gii still around? |
| 15:37 | Raynes | Nibble: No. |
| 15:37 | Nibble | d'awww |
| 15:37 | Nibble | Raynes, nixeagle? |
| 15:38 | Raynes | upwardindex: That's kind of my point though, really. The code is pretty much the same either way. But I'm probably just being an asshole. I've always been apprehensive about cljs. |
| 15:38 | Raynes | Nibble: Once every few months. |
| 15:38 | Nibble | kk |
| 15:38 | upwardindex | Raynes: last week you asked me for cljs code to work with jquery console, but I was at work |
| 15:39 | Raynes | Indeed! |
| 15:39 | Raynes | upwardindex: What does (clj->js ..) do? |
| 15:39 | upwardindex | Raynes: transforms clojure data in javascript data |
| 15:40 | Raynes | So Clojure to JSON? |
| 15:40 | gfredericks | probably javascript objects rather than a serialized string |
| 15:40 | gfredericks | so "to JSON" would be misleading |
| 15:40 | upwardindex | what gfredericks said |
| 15:41 | Raynes | Seems odd that ClojureScript wouldn't do that itself. |
| 15:42 | gfredericks | when would clojurescript do that? |
| 15:43 | Raynes | Uh, I don't know. |
| 15:43 | gfredericks | or you mean provide the function instead of jayq |
| 15:44 | Raynes | No, I would have expected ClojureScript to make the conversion under the covers, since the map would be being passed to a javascript function. I'm sure there are technical reasons that that is stupid, but I'm ignorant enough about javascript and friends to mention it anyways. |
| 15:45 | gfredericks | I think that would be kind of unexpected |
| 15:45 | gfredericks | like asking why clojure doesn't auto-convert seqs to arrays if you call an array-expecting function |
| 15:46 | gfredericks | and I doubt there's a foolproof way to know for sure if you're calling a js function vs a cljs function |
| 15:46 | ibdknox | a cljs function *is* a js function |
| 15:46 | gfredericks | that last point is probably the real issue |
| 15:46 | gfredericks | ibdknox: yes; thus they're hard to tell apart :) |
| 15:47 | Raynes | I was thinking more along the lines of how you can pass maps to Java that expects a HashMap, but no conversion actually happens there IIRC. |
| 15:47 | y3di | ibdknox: did you start devving lighttable in lighttable yet? |
| 15:48 | ibdknox | y3di: been working on the playground first :) |
| 15:48 | anonymoose_ | hello, new clj user here, is there a definitive tidy utility for clojure? I love using tidy for all my blocks. |
| 15:49 | kilon_alios | wow did not know light table uses clojure o_O |
| 15:50 | ibdknox | kilon_alios: it's written entirely in Clojure |
| 15:50 | ibdknox | and CLJS |
| 15:50 | kilon_alios | ibdknox: wow, I am actually making a similar project and I wanted to unite with project doing similar things |
| 15:51 | kilon_alios | mine is more a GUI and a visual programming language |
| 15:51 | anonymoose_ | Hi Chris! Great work on light table! |
| 15:51 | ibdknox | thanks :) |
| 15:51 | kilon_alios | but i wanted IDE capabilities like the ones you implement |
| 15:51 | kilon_alios | ibdknox: are you aware of field ? its JVM but jython |
| 15:51 | ibdknox | I am |
| 15:52 | kilon_alios | do you intend for visual coding too ? |
| 15:52 | anonymoose_ | anybody know of a tidy utility for clj? i.e. reformatter? also, is there and official style guide somewhere? |
| 15:52 | ibdknox | it's intended to be a general surface, so absolutely |
| 15:53 | kilon_alios | very interesting |
| 15:53 | borkdude | ibdknox support for touch interfaces? (don't know how, but sounds cool ;)) |
| 15:53 | ibdknox | borkdude: should get it for "free" |
| 15:54 | ibdknox | borkdude: since it uses a webview |
| 15:54 | kilon_alios | this is my project --> https://github.com/kilon/Ephestos |
| 15:54 | ibdknox | borkdude: but yeah, that's something I really want to explore later on |
| 15:54 | kilon_alios | its basically just a blender addon for now (new GUI for blender) but i am also doing the rest with clojure |
| 15:55 | kilon_alios | *considering doing the rest |
| 15:55 | borkdude | ibdknox touching and moving s-expressions around is easier than remembering paredit key bindings |
| 15:55 | ibdknox | kilon_alios: cool |
| 15:55 | kilon_alios | i mean lighttable sorry :D |
| 15:56 | ibdknox | borkdude: yeah, I think there's some really neat stuff that could be done there. Unfortunately the hardware issues haven't really been addressed yet |
| 15:56 | cljn00b | anybody? tidy for clj? |
| 15:56 | ibdknox | borkdude: if Light Table really takes off, I'd love to help push in that direction |
| 15:56 | upwardindex | cljn00b: what does that do? |
| 15:56 | gfredericks | Raynes: methods expecting a HashMap specifically? or just a Map? |
| 15:57 | ibdknox | borkdude: finding a way to mix a keyboard centric interface with touch elements would be awesome |
| 15:57 | ibdknox | most people just use the indent rules from emacs as gospel I think |
| 15:57 | cljn00b | tidy is a reformatter for code, normalizes indents and newlines from unformatted code. |
| 15:57 | ibdknox | vim has similar indenting though it's slightly different |
| 15:57 | Raynes | Emacs and Vim can both do that. |
| 15:58 | Raynes | Well, unless you write the whole thing on a single line. |
| 15:58 | Raynes | It can fix indentation. |
| 15:58 | cljn00b | yah, I'm looking for something I can pipe a block of clj to and have consistent style enforced by the util. |
| 15:58 | cljn00b | like perltidy or other variants. |
| 15:59 | pandeiro | could anyone point me a naive impl of a let macro? |
| 15:59 | kilon_alios | ibdknox: is there a download i can try, sorry i am very new with clojure |
| 16:00 | ibdknox | kilon_alios: it's not out yet |
| 16:00 | kilon_alios | ok so it wont be free and open source ? |
| 16:00 | eduard | how to write short: (map (fn [a b] [a b]) coll) ? |
| 16:01 | gfredericks | (map vector coll) |
| 16:01 | borkdude | Raynes cljn00b do I feel a new leiningen plugin coming up? (lein tidy) |
| 16:02 | eduard | gfredericks, Thanks |
| 16:03 | kilon_alios | ah ok the info is in the kickstarter |
| 16:03 | ibdknox | kilon_alios: it will be once it's built |
| 16:03 | kilon_alios | sorry :D |
| 16:03 | ibdknox | no worries :) |
| 16:04 | borkdude | ibdknox any thoughts on scripting abilities? clojure? |
| 16:04 | ibdknox | borkdude: GUI scripting will be CLJS |
| 16:04 | reisio | looking for a copy of the image that was here: http://clojure.googlegroups.com/web/Clojure-logo.png |
| 16:05 | ibdknox | the language backends can be written in anything that can do TCP and JSON :) |
| 16:05 | ibdknox | which enables a lot of *really* cool stuff |
| 16:05 | ibdknox | the sql and benchmarking modes that I showed were only about 100 lines of CLJS each |
| 16:07 | Raynes | borkdude: Nope. |
| 16:07 | cljn00b | made a gist for what I'm looking for. Please let me know if anybody knows about a tidy util for clojure. https://gist.github.com/2815682 |
| 16:08 | Raynes | Yeah, I don't think there is anything that can do that. |
| 16:08 | Raynes | Those rules are entirely arbitrary. |
| 16:08 | kilon_alios | oh python support is close too :) |
| 16:08 | kilon_alios | nice |
| 16:08 | reisio | cljn00b: not a lint? |
| 16:09 | cljn00b | if linting implies reformatting, yes. I thought linting was just syntax checking. |
| 16:09 | reisio | I've seen some that reformat, too |
| 16:09 | ibdknox | that kind of reformatting is incorrect |
| 16:09 | reisio | there's at least one clojure lint tool, might check it |
| 16:09 | cljn00b | I'm hoping for a perltidy analogue. |
| 16:09 | ibdknox | or rather "not correct" |
| 16:09 | ibdknox | lol |
| 16:10 | ibdknox | I don't think it'd be meaningful to have such a thing |
| 16:10 | ibdknox | for clojure, that is |
| 16:11 | cljn00b | for consistency across developers in a shared project, I'd think style enforcement would be a good thing. |
| 16:11 | reisio | don't really need a tool for that |
| 16:11 | cljn00b | my incorrect newlines not withstanding. |
| 16:11 | reisio | though obviously one would be useful |
| 16:12 | kilon_alios | oh a lot of requests for python, did not know python is so popular |
| 16:12 | ibdknox | the problem is that what should and should not be on the next line is highly context dependent |
| 16:12 | reisio | kilon_alios: half are probably to do with pornography :p |
| 16:12 | ibdknox | kilon_alios: it's consistently the highest rated language on most general tech sites |
| 16:13 | cljn00b | which is why I was hoping for a clojure style guide to help me figure the newlines out. |
| 16:13 | ibdknox | cljn00b: I mean that to the point where it depends on what the function/macro does |
| 16:13 | reisio | I assume if it parses there are no rules |
| 16:13 | kilon_alios | really ? i thought people hated because of whitespaces and slow execution. I am a big fan of python myself |
| 16:14 | kilon_alios | i know of course its fairly popular and people love it for the small learning curve |
| 16:14 | zakwilson | There are Lisp style guides to be found. They don't vary much. |
| 16:14 | cljn00b | ibdknox, what would be the idiomatic indentation for my sample? |
| 16:15 | reisio | I used to hate it just because of the white space, but for even more reasons now :p |
| 16:15 | ibdknox | haha probably the way you have it to begin with :) |
| 16:16 | cljn00b | oh. |
| 16:16 | borkdude | global variables in for loops are really a weird property of Python |
| 16:16 | ibdknox | that's all a single context describing a single output |
| 16:17 | ibdknox | those things usually end up on one line |
| 16:17 | ibdknox | though that would probably be wrapped in a function and hopefully you wouldn't embed the vectors there |
| 16:17 | ibdknox | it'd be much smaller if you didn't |
| 16:18 | cljn00b | thank you ibdknox. |
| 16:18 | zakwilson | ibdknox: I hear you had dinner with someone I sort of know last night. You kept him from an online meeting about a game in development. |
| 16:18 | cljn00b | (this is just tutorial code here) |
| 16:18 | ibdknox | zakwilson: haha I see |
| 16:18 | borkdude | but I like Python and a fantasic IDE for it would be great |
| 16:19 | ibdknox | zakwilson: yeah a friend of a friend sort of thing |
| 16:19 | zakwilson | Yeah, that's what he said. He thought Lighttable sounds interesting. |
| 16:19 | reisio | looking for a copy of the image that was here if someone's got it: http://clojure.googlegroups.com/web/Clojure-logo.png |
| 16:20 | borkdude | real time debugging in light table will maybe convert more "statically typed" fans to dynamic languages? |
| 16:20 | ibdknox | with clang |
| 16:20 | ibdknox | you could do the same thing with C :) |
| 16:20 | kilon_alios | realtime debugging style common lisp ? |
| 16:20 | kilon_alios | and smalltalk ? |
| 16:21 | kilon_alios | inject live objects, compile and decompile, inspect, modify source and resume etc |
| 16:22 | zakwilson | Lisp and Smalltalk environments have had features along those lines for ages. If Lighttable only gets people to start using them in Python, it will be huge. |
| 16:22 | kilon_alios | and Clojure ;) |
| 16:22 | ibdknox | LT has definitely helped spread Clojure around some :) |
| 16:22 | zakwilson | I really don't understand why people still develop such languages in an essentially batch-mode style instead of talking to a running program with their editor. |
| 16:23 | borkdude | ibdknox I mean the real time debugging thing will maybe give them the same (or better) sense of safety a type checker does now for them |
| 16:23 | kilon_alios | its sad when some of those best technologies are left behind, I am working on Morphic GUI, the very first to implement visual coding on low level with self programming language and then smalltalk |
| 16:23 | Raynes | ibdknox: Maybe light table is that 'killer app' crap people talk about. |
| 16:23 | ibdknox | maybe |
| 16:23 | ibdknox | who knows |
| 16:24 | ibdknox | It'd be nice to push Clojure out to more folks though |
| 16:24 | kilon_alios | 40 years after, GUIs are inferior in design :D |
| 16:24 | kilon_alios | make you scratch your head a bit |
| 16:24 | zakwilson | I already thought of something I want to bulid on top of it - a web-based SASS editor for client projects and such where somebody might want to change the CSS but not instal SASS tooling. |
| 16:28 | kilon_alios | well its nice at least that all programming languages and software return back to the roots of software revolution |
| 16:30 | pandeiro | how can i make a macro take let bindings and then execute its body form with those same let symbols bound to recomputed values? |
| 16:33 | borkdude | pandeiro a bit like this? https://www.refheap.com/paste/2700 |
| 16:33 | amalloy | pandeiro: i suspect if you start by writing down one specific example input and the output you want it to expand to it'll be much clearer |
| 16:33 | Raynes | borkdude: You got paste 2700. Congratulations, you win nothing. |
| 16:34 | borkdude | Raynes great, maybe an air guitar? |
| 16:34 | michaelr` | hello |
| 16:35 | eduard | how to swap two values at defined indexes in vector? |
| 16:36 | pandeiro | amalloy: like this? (let*2 [a 1 b 2] (+ a b)) ;=> 6 |
| 16:37 | borkdude | eduard I guess taking the subvectors and then concatting them back with the swapped values in between, but there might be a better way… |
| 16:37 | amalloy | well, it surely won't just straight-up expand to six |
| 16:37 | pandeiro | amalloy: right, that logic would be in the macro |
| 16:37 | amalloy | it'll expand to (let [a (* 2 1) b (* 2 2)] (+ a b)) |
| 16:38 | pandeiro | amalloy: k let me think about that; borkdude: thanks i am also looking at your example |
| 16:39 | eduard | borkdude, assoc found http://stackoverflow.com/questions/5979538/what-is-the-idiomatic-way-to-swap-two-elements-in-a-vector |
| 16:40 | borkdude | eduard of course, assoc.. I was confused by an example I did earlier: removing an element from a vector |
| 16:44 | ag90 | Is there a macro/function similar to -> for functions? That is, instead of inserting the value of a form as the first value in the next, it assumes that the next form is a function and calls it? |
| 16:45 | ag90 | I think I recall a function that did that, but cannot seem to remember the name. |
| 16:45 | amalloy | &(doc comp) |
| 16:45 | lazybot | ⇒ "([] [f] [f g] [f g h] [f1 f2 f3 & fs]); Takes a set of functions and returns a fn that is the composition of those fns. The returned fn takes a variable number of args, applies the rightmost of fns to the args, the next fn (right-to-left) to the result, etc." |
| 16:45 | Raynes | comp |
| 16:45 | ag90 | Ah! |
| 16:45 | Raynes | amalloy: I hate you. |
| 16:45 | ag90 | Thanks! |
| 16:46 | amalloy | man, imagine if comp actually did take a set of functions |
| 16:49 | Raynes | amalloy: Well, it actually can. |
| 16:49 | amalloy | okay, fair enoguh |
| 16:49 | borkdude | set as function or of functions? |
| 16:51 | ag90 | borkdude: I think he was suggesting in jest that if comp accepted a set of functions (which it does), it would really ruin everything because sets are unordered. |
| 16:51 | ag90 | (and you need the functions to be ordered for a functional composition) |
| 16:51 | borkdude | ag90 I know about the order, but does it really take a set of functions? |
| 16:52 | borkdude | ag90: highly doubt it |
| 16:52 | ag90 | Well, a set of functions is still a seq. So, the order it evaluates them in is probably one that you won't like. |
| 16:52 | borkdude | ag90: without apply I mean |
| 16:52 | ag90 | Oh, yes, with apply. |
| 16:53 | borkdude | apply doesn't count |
| 16:53 | ag90 | Though, if you think about it, a set of functions is a set which is a function too. |
| 16:53 | borkdude | ag90: finally, I (we?) got it |
| 16:53 | ag90 | heh |
| 16:54 | borkdude | ,((comp #{+ - *}) +) |
| 16:54 | clojurebot | #<core$_PLUS_ clojure.core$_PLUS_@2f47a2> |
| 17:01 | borkdude | composing sets can actually be useful: https://www.refheap.com/paste/2890 |
| 17:10 | pandeiro | there's no way to do something like (let-async-resource [foo "http://foo.com"] (.log js/console foo)) ;=> "<html><head>..." with cljs, is there? to abstract away async via a macro? |
| 17:11 | p_l | write in CPS? |
| 17:14 | pandeiro | p_l: like javascript? |
| 17:16 | p_l | well, it doesn't come from javascript, but it also makes it possible |
| 17:16 | p_l | no idea how hard CPS would be in Clojure |
| 17:34 | kab3wm | pandeiro: http://brianmckenna.org/blog/cps_transform_js |
| 17:38 | pandeiro | kab3wm: thanks |
| 18:04 | brainproxy | so vec (as opposed to vector) will consider a string argument to be a collection of chars? |
| 18:05 | brainproxy | playing in the REPL w/ examples from the Cloj Prog book ... just making sure I understand correctly |
| 18:08 | tmciver | brainproxy: it would appear so. ##(source vec) |
| 18:08 | lazybot | java.lang.RuntimeException: Unable to resolve symbol: source in this context |
| 18:08 | coventry | brainproxy: Yes. Let me see if I can use this clojurebot. ,(set (map type (vec "test"))) |
| 18:08 | coventry | Oh, that didn't work. |
| 18:08 | tmciver | &(clojure.repl/source vec) |
| 18:08 | lazybot | ⇒ Source not found nil |
| 18:09 | tmciver | bah |
| 18:10 | tmciver | Well, vec calls to-array on its arg if (instance? java.util.Collection arg) is false |
| 18:10 | tmciver | &(instance? java.util.Collection "test) |
| 18:10 | lazybot | java.lang.RuntimeException: EOF while reading string |
| 18:10 | hyPiRion | heh |
| 18:10 | tmciver | &(instance? java.util.Collection "test") |
| 18:10 | lazybot | ⇒ false |
| 18:11 | coventry | I'm using swank, and when it drops me into the sldb buffer, I'll type "e", then an expression, and I always get back "nil". Even for constant exrpressions like "1". I checked the *Messages* buffer, and there's nothing extra in there. Anything else I should try? |
| 18:11 | brainproxy | tmciver: thanks, was just looking at the source via clojureatlas and learning how it works |
| 18:12 | brainproxy | sometimes I forget I can look at the source for most of the builtins |
| 18:12 | brainproxy | but you reminded me with your invocation of the bot |
| 18:42 | amalloy | coventry: a lot of swank features aren't implemented in the clojure swank server. that's probably one of them |
| 18:42 | coventry | Ah, thanks. |
| 18:48 | amalloy | my understanding is that nobody knows how swank-clojure works, and it's a miracle that it still does |
| 18:49 | danlarkin | that's pretty accurate |
| 19:07 | velvia | Newbie here trying to set up emacs / clojure-mode / slime etc. I followed a bunch of different blogs, but how can I tell that my setup works? I just see a bunch of different warnings when I try to do "clojure-jack-in". |
| 19:10 | amalloy | ~swank |
| 19:10 | clojurebot | swank is trust the readme and the readme only. all others will lead you astray. |
| 19:14 | velvia | @clojurebot: so follow the README at github swank-clojure? |
| 19:14 | velvia | Has anybody had experience with clooj, or La Clojure (IntelliJ plugin)? Are those any good? |
| 19:40 | wink | La Clojure sadly only works on IDEA and not on PHPStorm, so couldn't test it for lack of licence :( |
| 19:40 | wink | (at least back when I tried) but seems sensible, given lack of Java stuff |
| 19:43 | scottj | wink: works on free intellij |
| 19:44 | scottj | velvia: eclipse is most actively developed of non-emacs plugins. |
| 19:45 | scottj | velvia: following readme at swank-clojure is best, yes |
| 19:45 | velvia | @scottj, thanks |
| 19:47 | scottj | coventry: same behavior here. I think that works in ritz though |
| 20:19 | emezeske | amalloy: That mail about vmware I just got, was that in regards to me rebooting to play diablo 3? |
| 20:21 | amalloy | yes |
| 20:22 | emezeske | I dunno about running games in a VM |
| 20:22 | emezeske | And there's no way I'm making windows my base OS :) |
| 20:23 | lynaghk | emezeske: The only reason I'm on linux is for Xmonad. |
| 20:23 | emezeske | lynaghk: I didn't know you were a fellow xmonader! |
| 20:23 | lynaghk | emezeske: I ran windows for years; you just learn to love PuTTY and do lots and lots with VMs. Which is actually a pretty good habit, ops-wise. |
| 20:24 | emezeske | lynaghk: Yeah I do lots in VMs, but I like running my editor/etc on raw hardware |
| 20:24 | lynaghk | emezeske: yep. My primary machine is something like 5 years old now. Running linux with three montiors. |
| 20:25 | seancorfield | Windows belongs in a VM, safely locked up where it can't do any harm! |
| 20:25 | lynaghk | emezeske: thanks for getting that lein cljsbuild out so quickly, by the way. |
| 20:25 | emezeske | lynaghk: Yeah, no problem, I'd wanted that for a long time but never saw a simple solution |
| 20:25 | emezeske | seancorfield: :) |
| 20:26 | seancorfield | emezeske: new version of lein-cljsbuild? what's new/cool in it? |
| 20:26 | emezeske | Oh, nothing major, probably my favorite new feature is that it reloads *.clj files in the clojurescript source dir (for macros) |
| 20:26 | seancorfield | i'm not doing anything with clojurescript yet except playing but cljsbuild is my drug of choice for that :) |
| 20:26 | seancorfield | nice |
| 20:27 | emezeske | Also, it is faster most of the time, in auto mode |
| 20:27 | lynaghk | seancorfield: Also upstream authors can now package JavaScript + Externs that'll get sucked in automatically without end users needing to pass in custom ClojureScript compiler options |
| 20:28 | lynaghk | so basically, I'm going to get everyone to eat highly mutable raw JavaScript and never know it = ) |
| 20:28 | emezeske | Bwahaha! |
| 20:30 | lynaghk | emezeske: what are you working on in cljs, anyway? You are doing all of this rad work with the toolchain, but don't seem to have any public projects |
| 20:30 | lynaghk | weren't you making a game or some such? |
| 20:31 | emezeske | I'm building a website to help school teachers build seating charts |
| 20:31 | emezeske | It is all closed-source, which is a bummer, because I want to show it off! |
| 20:31 | xeqi | they don't just use alphabetical order? |
| 20:32 | emezeske | The uninspired ones do |
| 20:32 | lynaghk | xeqi: problems with children whose names can be coerced to numbers. |
| 20:32 | emezeske | The tool I'm making lets teachers assign students to groups, and it will build randomized charts that keep loudmouths away from one another, for instance |
| 20:33 | emezeske | Good teachers engineer their charts like that, and mix them up on a regular basis so kids have to work with new people |
| 20:33 | emezeske | But that is a huge pain in the ass. |
| 20:38 | pipeline | do you expect teachers to mark children as "loudmouths" |
| 20:38 | pipeline | in a written record ? |
| 20:39 | gfredericks | perhaps as "Group A" |
| 20:39 | pipeline | how will you advertise the feature |
| 20:39 | pipeline | haha |
| 20:39 | gfredericks | where A has a "dispersed" characteristic |
| 20:39 | emezeske | You'll just have to see how it works once it's out :) |
| 20:40 | emezeske | I'm sure I'll talk it up on the ML as a finished commercial project using clj/cljs :) |
| 21:55 | brainproxy | is there an emacs command (within some mode, i mean) that will "prettify" a region, e.g. a large hash-map literal I've copied over from the REPL |
| 22:02 | brainproxy | nvm, found clojure.pprint/pprint |
| 22:06 | _KY_ | #{(1 2 3) (4 5)} is a set with 2 elements, right? |
| 22:06 | _KY_ | ,(conj #{(1 2 3) (4 5)} '(6 7)) |
| 22:06 | clojurebot | #<ClassCastException java.lang.ClassCastException: java.lang.Long cannot be cast to clojure.lang.IFn> |
| 22:06 | _KY_ | How come that doesn't work? |
| 22:07 | Iceland_jack | _KY_: You ness to do '(1 2 3) or (list 1 2 3) |
| 22:07 | Iceland_jack | ,(count #{(list 1 2 3) (list 4 5)} |
| 22:07 | clojurebot | #<ExecutionException java.util.concurrent.ExecutionException: java.lang.RuntimeException: EOF while reading> |
| 22:07 | Iceland_jack | bah |
| 22:07 | Iceland_jack | ,(count #{(list 1 2 3) (list 4 5)}) |
| 22:07 | clojurebot | 2 |
| 22:08 | _KY_ | I see... |
| 22:08 | _KY_ | So what was that? |
| 22:08 | _KY_ | Without "list" |
| 22:08 | Iceland_jack | a function call |
| 22:08 | _KY_ | Ahhh I see =) |
| 22:08 | Iceland_jack | Lisps assume that the first element of a list is the function |
| 22:09 | Iceland_jack | or something that will eval to a function |
| 22:10 | Iceland_jack | Lists aren't nearly as idiomatic in Clojure as they were in older Lisps though |
| 22:11 | Iceland_jack | ,(conj #{[1 2] [10 20]} [100 200]}) |
| 22:11 | clojurebot | #<ExecutionException java.util.concurrent.ExecutionException: java.lang.RuntimeException: Unmatched delimiter: }> |
| 22:11 | Iceland_jack | hah, every time |
| 22:11 | Iceland_jack | ,(conj #{[1 2] [10 20]} [100 200]) |
| 22:11 | clojurebot | #{[1 2] [100 200] [10 20]} |
| 23:10 | gfredericks | what do CLers and schemers do when they want to do [(+ x y) (* a b)]? Do they have to (list (+ x y) (* a b))? (i.e., no data literal for it) |
| 23:19 | amalloy | gfredericks: there may be other options, but that's common |
| 23:21 | amalloy | or `(~(+ x y) ~(* a b)), i suppose |
| 23:22 | gfredericks | ah |
| 23:23 | gfredericks | well thank you rich hickey for vectors. |
| 23:31 | amalloy | of course, in any other lisp you can write a reader macro for it |
| 23:31 | amalloy | CL probably has some kind of reader syntax for vectors |
| 23:32 | amalloy | but they're not as interchangeable with lists as clojure's are, i suspect |