2012-02-15
| 01:51 | emezeske | Anyone know of a tool that can turn a javascript library into a "nice" externs file for the google closure compiler? (by "nice" I mean "doesn't generate a ton of warnings") |
| 03:00 | clj_newb | for classpath instead of saying foo/1.jar, foo/2.jar, foo/3.jar, ... is it possible to say foo/*.jar ? |
| 03:00 | clj_newb | [I tried foo/*.jar in zshrc, and it did not work; but I feel like there sholud be a way to do it] |
| 03:01 | alexyk_ | i.e. convert nil to 0 and leave non-nils alone |
| 03:09 | bbloom | I'm only a few days into to "real" work with clojure… and I think I'm forever spoiled |
| 03:09 | bbloom | I never want to write a line of code again without a live running compilation environment…. |
| 03:10 | bbloom | I've even got some crazy ideas of cool macros I can write with the clojurescript analyzer |
| 03:17 | lnostdal | hum, is *print-level* being bound to "no limit" (i.e. NIL) by default (root level) really a good idea? .. when debugging and looking at stacktraces and error messages, it sometimes causes the error message or stack trace to in-turn cause a stack-overflow x) |
| 03:29 | muhoo | hmm. midje or clojure.test ? |
| 04:06 | mrsep | #e |
| 04:31 | amalloy | $mail alexyk it looks like you were having connectivity problems, so i didn't catch your whole question, but you probably want fnil |
| 04:31 | lazybot | Message saved. |
| 04:42 | jrobie | what's the best emacs mode for clojure? |
| 04:42 | vijaykiran | clojure-mode ? |
| 04:43 | jrobie | thanks, vijaykiran - i'm just ramping up to play with the language |
| 04:44 | vijaykiran | if you are using any of the emacs-starter-kit or perlude etc, it should come with clojure-mode |
| 04:46 | jrobie | vijaykiran, i don't know about emacs-starter-kit or perlude |
| 04:47 | jrobie | ah, google says http://dev.clojure.org/display/doc/Getting+Started+with+Emacs |
| 04:50 | vijaykiran | which version of emacs are you using ? |
| 04:57 | jrobie | vijaykiran, GNU Emacs 23.3.1 |
| 04:57 | jrobie | vijaykiran, it does not seem to know clojure-mode |
| 05:00 | vijaykiran | jrobie: you may want to use the package.el to load the starter kit, I'm not sure if you have any customizations already, otherwise, just download and start with starter-kit |
| 05:01 | vijaykiran | jrobie: the wiki page seems to have the info ( in the comments) |
| 05:02 | jrobie | thanks, vijaykiran |
| 05:46 | alexyk | hmm |
| 05:46 | alexyk | lazybot: ? |
| 06:06 | Raynes | lazybot: kill |
| 06:06 | lazybot | KILL IT WITH FIRE! |
| 06:07 | clgv | alexyk: use $mail to get your mail |
| 06:07 | clgv | lazybot: kill |
| 06:07 | lazybot | KILL IT WITH FIRE! |
| 06:10 | alexyk | clgv: privately to /lazybot? |
| 06:14 | clgv | |
| 06:14 | lazybot | You have no messages. |
| 07:08 | Raynes | Yay for income tax. |
| 07:12 | ejackson | Raynes: amen. |
| 08:31 | osa1 | what is "root value" of a var? I'm trying to understand `defonce` |
| 08:31 | ordnungswidrig | osa1: vars can be rebound locally, e.g. using "binding" |
| 08:32 | ordnungswidrig | osa1: ...if the var is declared as dynamic |
| 08:32 | Raynes | *Some* vars. |
| 08:32 | TimMc | Raynes: I believe that all vars, deep inside, have the capacity for change. |
| 08:33 | raek | osa1: the value you usually deal with. the exception is when the var is dynamically rebound using 'binding', as ordnungswidrig mentioned |
| 08:33 | Raynes | TimMc: That's very glass half full of you, man. |
| 08:33 | Raynes | TimMc: I want to be more like you. I want to see good in the world. |
| 08:34 | TimMc | Raynes: Well, you're in luck. I believe that all IRC users, deep inside, have the capacity for change. |
| 08:35 | ordnungswidrig | I was defonced and I to not want to be rebound. |
| 08:36 | Raynes | ordnungswidrig: Put that on a tshirt. |
| 08:36 | ordnungswidrig | s/to/do/ |
| 08:48 | TimMc | &(do (do (do (require '[clojure.string :as s5])) (do s5/join))) |
| 08:48 | lazybot | ⇒ #<string$join clojure.string$join@548695> |
| 08:48 | TimMc | \o/ |
| 08:49 | TimMc | So nested top-level 'do forms are also unrolled. |
| 08:49 | TimMc | That takes a load off. |
| 08:54 | TimMc | Argh, I can't run deftest in a separate namespace for some reason... |
| 08:56 | TimMc | ...and I can't run the contents in a different namespace, since that's not the top level. |
| 09:12 | clgv | TimMc: why? |
| 09:23 | TimMc | clgv: I want to run tests that are sandboxed in their own namespaces such that they can play with custom variations of 'import and 'require |
| 09:24 | TimMc | deftest is apparently not compatible with this. |
| 09:25 | clgv | ah ok. |
| 09:49 | aidy | What does the <int>M print syntax mean? |
| 09:51 | Raynes | &(type 1M) |
| 09:51 | lazybot | ⇒ java.math.BigDecimal |
| 09:52 | aidy | thanks :) |
| 10:00 | babilen | Hi all. I would be grateful if you could criticize my code at http://paste.debian.net/156333/ . I need a function that splits a sequence at a subsequence and came up with the pasted solution, but am not sure if that approach is idiomatic or if there are better ways to do it. Thanks a lot! |
| 10:00 | babilen | I'd also like to have another function that splits at variable numbers of subsequences (in order), but I'd like to get the single sequence case right first. :) |
| 10:01 | tsdh | babilen: Instead of (empty? someseq), it's idiomatic to use (seq someseq) which returns nil for empty collections, so it's the other way round. |
| 10:03 | Raynes | Holy crap |
| 10:03 | Raynes | I'm starting to feel bad for contributing another pastebin to the world. |
| 10:03 | Raynes | There are obviously more pastebins than websites of any other sort combined. |
| 10:03 | babilen | Indeed :) |
| 10:03 | Raynes | At least mine isn't bright pink. |
| 10:04 | bhenry | can someone point me in the direction of the clojurescript one example (i think by brenton) that shows the commands to send expressions to the two different repls? |
| 10:05 | babilen | tsdh: Thanks - I'll use seq in that case. I am fairly new to clojure so I am not sure if loop+logic is the best way to handle this. I primarily want to have a function that removes a subsequence (if present) from a sequence and returns both prefix/suffix of that subsequence. |
| 10:05 | bhenry | Raynes: there's no need for another pastebin when you have gist. |
| 10:05 | babilen | I might use take-while/drop-while but process element-wise now. |
| 10:06 | Raynes | bhenry: Well, I obviously disagree. |
| 10:06 | bhenry | Raynes: well prove me wrong. |
| 10:06 | TimMc | Raynes: I WARNED YOU ABOUT PASTEBINS BRO!!!! |
| 10:06 | Raynes | Isn't really the goal I was aiming for, but I'll certainly try. |
| 10:06 | TimMc | I TOLD YOU DOG! |
| 10:07 | TimMc | I told you man. I TOLD you about pastebins! |
| 10:07 | Raynes | You did. You really did. |
| 10:08 | TimMc | http://www.mspaintadventures.com/sweetbroandhellajeff/ for anyone who didn't get the reference and probably still won't after they follow the link |
| 10:08 | babilen | Ok, excuse me for initiating this discussion about pastebins and their merits, but is the approach I am using correct? |
| 10:09 | Raynes | I don't know. I'm still trying to get past your pink pastebin. |
| 10:09 | Raynes | I've used up my quota for today. |
| 10:10 | babilen | Raynes: Hehe, ok. I happily paste it somewhere else if that helps ;) |
| 10:10 | Raynes | I think you're okay. |
| 10:12 | ivan | someone should write a program that backs up all of the pastebins incrementally |
| 10:13 | ivan | except for pastebin.com, that's all crap |
| 10:14 | babilen | tsdh: How would I implement line 7 using seq? That is (or (seq []) (seq [1])) obviously evaluates to (1), which is not what I want. I am also reluctand to split this into multiple ifs. |
| 10:16 | TimMc | babilen: You're building up an awful lot of nested concats there. |
| 10:16 | Raynes | I like cats. |
| 10:16 | TimMc | I see a StackOverflowError in your future. |
| 10:16 | TimMc | Raynes: How do you feel about turtles? |
| 10:16 | Raynes | www.youtube.com/watch?v=CMNry4PE93Y |
| 10:17 | tsdh | babilen: DeMorgans law, (and (seq sub-seq) (seq s')) and reverse the branches of the if. |
| 10:17 | babilen | TimMc: True, but that is what I have so far. What would be a better approach? |
| 10:17 | babilen | tsdh: ta! |
| 10:17 | TimMc | babilen: No need for s', you can just call it s. |
| 10:18 | babilen | yeah, had that on my list already |
| 10:18 | tsdh | babilen: Maybe it's better to convert to a vector before and then use the fast subvec function. Then it should be linear. |
| 10:21 | babilen | tsdh: Ok, I'll investigate that. Thanks for the input so far! |
| 10:21 | tsdh | babilen: I mean, recur thru the vector v (= (vec s)) and check if the (subvec v 0 (count sub-seq)) equals subvec. if so, then that's the position and (subvec v (count sub-seq)) is the rest you need to concat to the beginning. |
| 10:21 | tsdh | babilen: You're welcome. |
| 10:22 | babilen | tsdh: That would essentially get rid of the backtracking, yes. |
| 10:23 | TimMc | babilen: I take it you want the subsequences to be lazy as well? |
| 10:23 | babilen | TimMc: That would be nice |
| 10:24 | babilen | Just criticize and give me some pointers, I am merely looking for other ideas or things that I unwillingly screwed up :) |
| 10:24 | TimMc | e.g. (first (first (split-at-subsequence (range) [10 10]))) => 0 |
| 10:25 | babilen | exactly |
| 10:25 | Raynes | babilen: You're loud and your voice is annoying. |
| 10:25 | Raynes | Oh, you mean code? |
| 10:26 | TimMc | Raynes: You're over-quota. o\__/o |
| 10:26 | Raynes | Damn! |
| 10:26 | Raynes | TimMc: So, what's up with trycljs? |
| 10:26 | TimMc | Nothing. |
| 10:26 | Raynes | Guys, you've got to WORK on it. :( |
| 10:27 | TimMc | Hey, if *you* have any brilliant ideas on how to get it to compile correctly, let me know! |
| 10:27 | TimMc | s/compile/compile CLJS/ |
| 10:27 | babilen | TimMc: So, how to be lazy? |
| 10:27 | Raynes | TimMc: You should get dnolen on board. |
| 10:28 | TimMc | Raynes: THat would certainly fix everything. |
| 10:28 | TimMc | "Pull requests welcome (especially from dnolen)" |
| 10:31 | Raynes | TimMc: Sounds legit. |
| 10:36 | pandeiro | is there a way to disable the property access syntax warnings with the ClojureScript REPL? |
| 10:38 | TimMc | Why? |
| 10:38 | clojurebot | #<ClassCastException java.lang.ClassCastException: clojure.lang.Cons cannot be cast to clojure.lang.IPersistentStack> |
| 10:38 | TimMc | Nuts to you, clojurebot. |
| 10:39 | pandeiro | TimMc: dunno minor annoyance |
| 10:39 | pandeiro | if it were warning that I was using antiquated syntax, that would be one thing... it's warning me that i'm using the new, correct syntax |
| 10:45 | TimMc | Oh, weird. |
| 10:47 | clj_newb | is tehre a way to take my *.clj, compiel them into a *.jar, so I don't have to recompile on every load? |
| 10:47 | clj_newb | (I've done writing my editor; and am argely using it now) |
| 10:48 | clj_newb | and don't want to go through the recompilation process on every use |
| 10:48 | TimMc | babilen: Maybe you could have a first pass that converts split-points into (Object.) sentinals, and then a second pass that splits into subsequences? |
| 10:48 | TimMc | clj_newb: lein uberjar? |
| 10:49 | babilen | TimMc: I'll see what I can come up with. I tried a lazy-seq approach first, but my clojure-fu was too weak and .. well .. You saw what my best attempt was :) |
| 10:49 | clj_newb | I don't have lein |
| 10:49 | clj_newb | I have been coding i the repl athis whole time |
| 10:56 | cemerick | clj_newb: get lein :-) |
| 10:58 | TimMc | clj_newb: Dare I ask how you've been downloading dependencies, executing your code, running tests... |
| 10:58 | TimMc | I dursn't. |
| 11:11 | TimMc | babilen: First write a fn that checks if a seq is a prefix of another seq. |
| 11:13 | TimMc | babilen: Then write a fn that uses lazy-seq to iteratively either skip a prefix and cons on a sentinal or cons on the next element. |
| 11:14 | babilen | TimMc: Thanks -- I've incidentally started working on the first one just now. Great help and may you have a nice day :) |
| 11:15 | TimMc | babilen: Finally, write a fn to split on sentinals. |
| 11:15 | TimMc | :-) |
| 11:20 | babilen | TimMc: Hmm, what is the best approach to achieve the "iteratively" part? |
| 11:24 | TimMc | babilen: (source partition-by) Look at the call to lazy-seq, which contains some conditionals, which contains calls to cons, which then contains calls to partition-by again |
| 11:25 | TimMc | (It look recursive, but lazy-seq actually makes it iterative.) |
| 11:26 | babilen | TimMc: Oh, perfect example and exactly what I need. Wonderful :) |
| 11:39 | TimMc | clgv: Actually, the problem with sandboxing deftest seems to be that with deftest itself in a pocket namespace. lein test doesn't see it. >_< |
| 11:40 | clgv | TimMc: cant you just write a macro that doest the actual execution in another namespace and use that within a deftest? |
| 11:41 | TimMc | clgv: import, require, and other name-resolution or evaluation modifiers have to be in preceding top-level forms to the stuff they modify. |
| 11:41 | TimMc | I'm going to try using eval, actually. |
| 11:42 | clgv | TimMc: you do not need to use these |
| 11:42 | TimMc | hmm? |
| 11:42 | clgv | TimMc: you can intern the symbols for the testnamespace yourself |
| 11:42 | clgv | TimMc: have a look at the namespace related function in core |
| 11:43 | TimMc | clgv: I'm testing a lib that manipulates namespaces. |
| 11:46 | TimMc | clgv: It manipulates the namespace via various methods -- I would like it if the test cases could capture and confine that manipulation. |
| 11:48 | clgv | TimMc: sounds like a bootstraping problem then ;) |
| 11:49 | TimMc | sort of? |
| 12:19 | jkdufair | because i think in smalltalk and/or lisp, I can't help conclude, with forehead against keyboard during my day job that oo design patterns are nothing more than language feature workarounds |
| 12:19 | gtrak | norvig has a good site about that |
| 12:20 | gtrak | jkdufair: http://norvig.com/design-patterns/ |
| 12:20 | clgv | jkdufair: they are as well vocabulary ;) |
| 12:21 | jkdufair | yeah, a good vocabulary is essential |
| 12:21 | gtrak | a pattern is something repetitive, what do we do when things are repetitive? |
| 12:21 | jkdufair | i get the impression in clojure there are fewer design patterns and more idioms |
| 12:21 | `fogus | write a macro |
| 12:21 | gtrak | wait for fogus to write a macro :-) |
| 12:21 | clgv | gtrak: name them? ;) |
| 12:23 | jkdufair | yeah macros are sort of the anti-design pattern |
| 12:23 | gtrak | just, abstraction in general |
| 12:24 | jkdufair | i think i'd seen that norvig bit before. at least the part about 16 of the 23 design patterns are simplified in dynamic languages |
| 12:24 | jkdufair | i think c# is like the cute girl/boy in choir in high school. hot & talented but you always end up in tears in the end |
| 12:26 | jkdufair | thx all for letting me rant |
| 12:26 | xorola | @jkdufair:How ? i am referring to c# |
| 12:26 | jkdufair | how what? |
| 12:27 | TimMc | xorola is asking you to explain your analogy. |
| 12:27 | jkdufair | oh it's a weak one :-) |
| 12:27 | xorola | :) |
| 12:28 | jkdufair | all these libraries and fast JITs and such. but when i want a class instance var like smalltalk it says "sorry, i don't do that" |
| 12:28 | jkdufair | you walk away a bit... blue |
| 12:29 | jkdufair | and i could probably start doing inner classes and whatever voodoo clojure probably has to do to kick things up a notch. but zawinski's law starts coming into play |
| 12:29 | jkdufair | guess it's not zawinski |
| 12:30 | jkdufair | greenspun |
| 12:30 | technomancy | the tyranny of greenspun is inescapable |
| 12:31 | jkdufair | tyranny is right |
| 12:32 | dnolen | jkdufair: I'm of the opinion that OO is powerful stuff - but like mutability - too easy to get wrong. I think Clojure's strategy of putting the OO stuff at the bottom (instead of at the surface) of the language is a killer, killer idea. |
| 12:32 | jkdufair | yeah i suppose i don't disagree with OO's power. smalltalk is still a great love of mine. half-baked OO like Java and C# make me cry. |
| 12:33 | jkdufair | and i wholeheartedly agree with clojure's strategy |
| 12:33 | jkdufair | of course, then you put JavaScript at the bottom and you wonder if someone put something funny in your drink |
| 12:33 | `fogus | (inc dnolen) |
| 12:33 | lazybot | ⇒ 4 |
| 12:34 | technomancy | MenTaLguY: any luck with that lein deps hack you were trying? |
| 12:34 | technomancy | I have a feeling it might be nicer on lein2 |
| 12:34 | dnolen | jkdufair: the story is more complicated then that I think. I don't think Smalltalk is all that ideal either - C# and Java bring good stuff to the table. |
| 12:34 | xorola | can somebody tell me how smalltalk OO is different from C# or Java OO? a resource is helpful |
| 12:35 | xorola | i dunno smalltalk |
| 12:35 | TimMc | $google greenspun's law |
| 12:35 | lazybot | [Greenspun's tenth rule - Wikipedia, the free encyclopedia] http://en.wikipedia.org/wiki/Greenspun's_tenth_rule |
| 12:35 | TimMc | haha, that one |
| 12:35 | jkdufair | in smalltalk, everything is an object. all the way down. so classes themselves are objects |
| 12:35 | dnolen | xorola: the purple Smalltalk-80 book is good, download Squeak |
| 12:36 | jkdufair | it's just more consistent |
| 12:36 | jkdufair | dnolen: i don't disagree. plenty of good stuff. and most of the time i like my day job. just not today |
| 12:36 | xorola | it sounds more like python OO, am i right? |
| 12:36 | technomancy | xorola: smalltalk is all about passing messages to objects |
| 12:36 | technomancy | rather than objects being a bucket full of methods where you reach in and find what you want to call |
| 12:37 | jkdufair | yeah python has many of the same design constraints as smalltalk |
| 12:37 | technomancy | python uses the bucket-o-methods approach, ruby uses smalltalk's approach |
| 12:37 | technomancy | more or less |
| 12:37 | jkdufair | ah i had them backwards |
| 12:39 | technomancy | self and IO I guess, depending on how far you want to stretch the definition of mainstream-ish |
| 12:39 | technomancy | Io |
| 12:39 | dnolen | technomancy: Objective-C |
| 12:39 | technomancy | oh, of course |
| 12:39 | chewbranca | erlang ;-) |
| 12:40 | `fogus | not everything in Smalltalk is an object |
| 12:41 | jkdufair | primitives may not be, but they can be treated as such |
| 12:41 | kurtharriger | in leiningen I'm trying to specify 2 sperate hooks, :hooks [leiningen.hooks.groovyc leiningen.hooks.junit] but this results in a Caused by: java.lang.IllegalArgumentException: argument type mismatch if the list only contains one hook it works |
| 12:41 | `fogus | jkdufair: not talking about primitives |
| 12:41 | jkdufair | hmm. what have i forgotten? |
| 12:42 | `fogus | What is the Smalltalk object type of |x y z| ? |
| 12:42 | technomancy | kurtharriger: :hooks is just a declarative shorthand for requiring a namespace, so as a workaround you can just slap (require 'leiningen.hooks.groovyc leiningen.hooks.junit) after your defproject form. |
| 12:42 | jkdufair | alas. all values are objects :-) |
| 12:42 | technomancy | kurtharriger: but if you could paste your full project.clj I could attempt repro and see if we should open an isue |
| 12:43 | kurtharriger | ok, actually it might be something wrong with my junit plugin compile fails if that hook is included but test works |
| 12:44 | kurtharriger | I thought maybe I had the syntax for hooks wrong but might be something else |
| 12:44 | `fogus | jkdufair: One could say that I'm just picking nits ;-) |
| 12:44 | jkdufair | :-) it's an important distinction. one i wouldn't have gotten without learning clojure. more specifically having read Joy of Clojure :-) |
| 12:45 | jkdufair | awesome book, btw |
| 12:45 | jkdufair | just curious - do you get the same royalties whether i buy it from manning or amazon? |
| 12:45 | `fogus | jkdufair: Just buy from wherever is cheapest. I'm not getting rich in either case. |
| 12:46 | jkdufair | `fogus: bought it from amazon. just wanted to gauge how much guilt to feel |
| 12:46 | jkdufair | anyway, thx for writing it |
| 12:47 | `fogus | jkdufair: You should feel about $0.43 worth of guilt |
| 12:47 | jkdufair | haha |
| 12:47 | xorola | fogus:heard jeff ritcher and joshua bloch royalties are high ,is it true? |
| 12:47 | ibdknox | how far the writing industry has fallen :( |
| 12:47 | `fogus | no idea |
| 12:49 | kurtharriger | technomancy: figured it out, the first groovyc is in a jar and on classpath, I had changed my project classpath to src/clj but still had my leiningen hook in src/leiningen so it wasn't on the classpath |
| 12:49 | technomancy | tricky |
| 12:50 | kurtharriger | the exception changed when I tried the require form to the much more obvious class not found |
| 12:50 | babilen | Hi all -- I am a bit baffled by the behaviour you can see on http://paste.debian.net/156370/. What am I missing or doing wrong? |
| 12:50 | technomancy | hm; that is a pretty strange exceptino |
| 12:52 | cemerick | Barring a miracle, I'm sure I'd self-publish if I were to ever write another book (or any other for-pay content). |
| 12:52 | technomancy | I'm afraid I must have been less than totally clear; he says he wants to try out "my lisp implementation" o_O |
| 12:52 | kurtharriger | the werid thing is the plugin itself worked just not the hook |
| 12:52 | technomancy | cemerick: peepcode does all the video recording, payment handling, and promotion but still gives you half. |
| 12:53 | kurtharriger | At clojure conj I saw a guy riding a bike with a t-shirt reading "one less car" |
| 12:53 | cemerick | technomancy: I've never considered doing screencasts. Maybe that should change. *shrug* |
| 12:53 | technomancy | it's ridiculous |
| 12:53 | ibdknox | cemerick: as someone who might do that... I'd love to hear why :) |
| 12:54 | TimMc | babilen: partition 2 interleave is just map vector |
| 12:54 | `fogus | technomancy: ridiculous == lucrative? |
| 12:54 | cemerick | ibdknox: I'm reserving full judgement for a year, but you can ask me for details so far next month if you like. |
| 12:54 | babilen | TimMc: Right, but still -- Why the difference? |
| 12:54 | ibdknox | will do |
| 12:54 | TimMc | babilen: and this approach of counting, welll... better off doing a loop recur, I think |
| 12:54 | technomancy | `fogus: yes, but I was thinking more in terms of comparing it to the rest of the industry |
| 12:55 | ibdknox | cemerick: I would've thought that with oreilley's reach it'd be worth it |
| 12:55 | TimMc | Also, the subseq should be the first arg, I think... |
| 12:55 | ibdknox | -e |
| 12:55 | cemerick | ibdknox: well, that's why I'm reserving judgement :-) |
| 12:55 | mi6_x3m | hello, am I right that a clojure form is just executable data? |
| 12:55 | cemerick | technomancy: I think the prags do 50/50 too |
| 12:55 | babilen | TimMc: I am just playing around, but do not understand the difference in the behaviour. (which might highlight a more general misunderstanding I have) |
| 12:55 | technomancy | cemerick: oh, really? that's fantastic. |
| 12:56 | semperos | reading through the congomongo code, looking at how the set-connection! function "resets" a var; can someone explain why both alter-var-root and set! are used like this? |
| 12:56 | semperos | https://github.com/aboekhoff/congomongo/blob/master/src/somnium/congomongo.clj#L133 |
| 12:56 | `fogus | Prags are notoriously generous |
| 12:57 | cemerick | technomancy: http://pragdave.blogs.pragprog.com/pragdave/2009/10/pragmatic-bookshelf-royalty-rates.html |
| 12:57 | ibdknox | but truthfully writing a book, especially a technical one, will never amass a fortune |
| 12:57 | technomancy | cool |
| 12:57 | ibdknox | it's the cred that's the reward ;) |
| 12:57 | `fogus | ibdknox: Maybe not, but certain authors can live comfortably |
| 12:57 | cemerick | ibdknox: Nevermind fortune, it's probably rare to make minimum wage. |
| 12:58 | technomancy | ibdknox: considering it only took me a month and I still get checks every quarter, both my peepcode screencasts were an excellent investment of my time economically |
| 12:58 | ibdknox | `fogus: I suspect they're the exception? |
| 12:58 | ibdknox | technomancy: I'll have to check out this peepcode thing :) |
| 12:58 | `fogus | ibdknox: Flanagan was living off of his JS: TDG for many years as I understand it |
| 12:59 | `fogus | ibdknox: Yes, he's an exception |
| 12:59 | cemerick | technomancy: is yours the only Clojure vid they have? |
| 12:59 | technomancy | my situation was maybe somewhat unique given that I was between jobs at the time |
| 12:59 | technomancy | cemerick: yeah, but I also did the Emacs one |
| 12:59 | technomancy | they've been focusing on JS a lot recently |
| 13:00 | cemerick | That's probably a big factor: if you're not busy otherwise, a book/video/etc is a great investment. |
| 13:00 | babilen | TimMc: Sorry, have to run now. If you have any idea why it works in the repl, but not as functions let me know. I'll be back later and grateful for all your tips and help so far :) |
| 13:00 | ibdknox | yeah |
| 13:00 | xorola | exception in the sense,js everywhere :) |
| 13:00 | xorola | so many buy flanagan's books |
| 13:00 | ibdknox | cemerick: anything that generates passive income |
| 13:00 | `fogus | cemerick: cross-sells? |
| 13:01 | technomancy | mine came out a couple weeks before the prags', so it was technically the first commercial Clojure documentation released =) |
| 13:01 | cemerick | `fogus: going to bring the atlas up to date and a general polishing; buy the book, get the atlas for $X |
| 13:01 | `fogus | Ahhh |
| 13:02 | `fogus | I only have Marginalia and Trammel to offer :-( |
| 13:02 | cemerick | Between that and amazon affiliate chits… |
| 13:02 | ibdknox | cemerick's building a little empire ;) |
| 13:02 | technomancy | every time I see Trammel my mind autocorrects it to Pummel |
| 13:02 | ibdknox | lol |
| 13:02 | cemerick | emphasis on *little* |
| 13:02 | `fogus | cemerick: Yes! I get one free book per year thanks to affiliate links. :p |
| 13:03 | cemerick | really? |
| 13:03 | `fogus | technomancy: That about sums it up |
| 13:03 | cemerick | `fogus: Is your only affiliate link on http://joyofclojure.com/buy-joc/ ? |
| 13:03 | arohner | semperos: alter-var-root doesn't change a thread local binding, I believe |
| 13:04 | `fogus | cemerick: that among 2 or 3 others |
| 13:04 | cemerick | oh, didn't see the amazon icon at the bottom of the home page |
| 13:04 | cemerick | `fogus: should put an amazon link right below the book cover on blog.fogus.me |
| 13:05 | technomancy | the word "pummel" has such a great background |
| 13:05 | technomancy | comes from "pommel", which is the non-pointy end of a sword |
| 13:05 | semperos | arohner: I understand that alter-var-root atomically changes the root binding |
| 13:05 | semperos | but I guess I don't understand why both of those operations are stringed together |
| 13:06 | `fogus | technomancy: We created a function named pummel in JoC :-) |
| 13:06 | semperos | as the root binding is used by default |
| 13:06 | technomancy | `fogus: refresh my memory? |
| 13:06 | arohner | semperos: a var can have two values: the 'root' value, which is what you see if the current thread is not using (binding), and the thread local value |
| 13:06 | arohner | alter-var-root sets the root value, but not the thread-local value |
| 13:07 | arohner | mongo uses both, set-connection! sets the root value, with-mongo sets the thread-local value |
| 13:07 | `fogus | technomancy: It just throws a bunch of mutations against a reference across a bunch of threads. |
| 13:08 | technomancy | nice |
| 13:09 | semperos | arohner: so it's just setting the root value, which will be shared by all threads not having a local binding, as well as the thread local value, just to have the local one set explicitly? |
| 13:09 | arohner | semperos: right |
| 13:10 | semperos | is it just to be explicit? am I wrong in understanding that the root value would be defaulted to anyway? |
| 13:10 | semperos | (sorry for beating this, just want to make sure I understand the nuances) |
| 13:11 | arohner | notice the check for a thread binding. If the the user did (with-mongo …. (set-connection!)), they wouldn't see a change in the local thread, because the previous thread-local would still be in effect |
| 13:13 | semperos | right, so after changing the root binding, it checks to make sure it's bound locally as well, and only if that's the case, changes the thread-local binding as well? |
| 13:13 | arohner | semperos: right |
| 13:14 | semperos | arohner: thanks for the hand-holding, I think I've got a better grip now |
| 13:14 | `fogus | OMG That video is awesome |
| 13:15 | hugod | `fogus: any plans for a marginalia release? |
| 13:16 | `fogus | hugod: I want to have 0.7.0 out before CljWest |
| 13:17 | hugod | `fogus: ok, thanks (I would love to have a 1.3 compatible goal for marginalia in zi) |
| 13:17 | jaimef | so you point lein directly at the clojure.jar via the env var CLOJURE_JAR and it bombs with ClassNotFoundException: clojure.main |
| 13:17 | technomancy | jaimef: yeah, don't do that |
| 13:17 | `fogus | hugod: Any feedback for v0.7.0-SNAPSHOT? |
| 13:17 | technomancy | CLOJURE_JAR is an implementation detail |
| 13:18 | jaimef | yeah well I unset it, it downloads it, then gets the same error :P |
| 13:18 | technomancy | jaimef: oh, crap. =( |
| 13:18 | jaimef | oddly was fine on bsd just bombing on linux |
| 13:18 | technomancy | I have checksumming in there to protect against corrupted downloads |
| 13:19 | hugod | `fogus: haven't tried it, since I can't run it from zi ;) - I should give it a go... |
| 13:19 | technomancy | jaimef: can you rm the jar, retry, and see if it gives a checksum warning? |
| 13:19 | jaimef | it download to ~/.m2? |
| 13:19 | technomancy | jaimef: yeah |
| 13:19 | jaimef | enoent |
| 13:20 | jaimef | ok nuked ~/.lein |
| 13:20 | jaimef | reran, it downloads the standalone jar for lein, then bombs with Exception in thread "main" java.io.FileNotFoundException: Could not locate leiningen/core/main__init.class or leiningen/core/main.clj on classpath: |
| 13:20 | jaimef | |
| 13:21 | technomancy | jaimef: oh, you're using lein2? |
| 13:21 | jaimef | leiningen-2.0.0-SNAPSHOT-standalone.jar guessing so |
| 13:21 | technomancy | on purpose? =) |
| 13:21 | jaimef | yeah LEIN_VERSION is 2.0.0-SNAPSHOT |
| 13:21 | jaimef | obviously I don't know better :P |
| 13:21 | technomancy | hehe; ok. |
| 13:21 | technomancy | if you just want to get stuff done, you should use the stable branch |
| 13:22 | jaimef | yeah pulled it from github |
| 13:22 | jaimef | thanks |
| 13:26 | technomancy | yeah, I have a warning in the readme about the master branch, but it's easy to miss |
| 13:28 | technomancy | would be happy to have help testing out lein2, but if you just want to get stuff done it's not the most convenient right now |
| 13:29 | jaimef | sure |
| 13:31 | jaimef | odd M-x slime asks to download items. |
| 13:31 | technomancy | that would be from swank-clojure.el; you want either M-x slime-connect or M-x clojure-jack-in |
| 13:31 | technomancy | M-x slime has been deprecated for Clojure for ... I want to say 2 years? |
| 13:33 | sorenmacbeth | technomancy: Is there an equivalent to clojure-jack-in when you want to kill your repl session, something like clojure-jack-off (sorry, couldn't resist)? |
| 13:33 | sorenmacbeth | I usually just kill the swank and repl buffers |
| 13:34 | technomancy | I just re-run M-x clojure-jack-in |
| 13:34 | technomancy | it knows to kill the existing connection |
| 13:34 | sorenmacbeth | ok, that is what I tend to do as well |
| 13:34 | sorenmacbeth | cheers |
| 13:39 | tmciver | sorenmacbeth: you can also comma "," followed by quit, in the repl, but as I may have mentioned here in the past (technomancy), the follow up clojure-jack-in occasionally fails in which case I must restart emacs. |
| 13:39 | technomancy | hm; haven't seen that myself |
| 13:41 | tmciver | technomancy: doesn't bother me much but I would be interested to know what's going on there. Could be my setup though I don't believe I'm doing anything very strange. Running emacs 23, if that could matter. |
| 13:41 | technomancy | could be why I'm not seeing it |
| 13:41 | sorenmacbeth | tmciver: I see, that closes the repl, but leave the swank server running in the *swank* buffer |
| 13:42 | Null-A | Has anyone gotten autodoc working with emacs24? |
| 13:42 | sorenmacbeth | The typical reason I want to close my repl session is because it can hog a ton of ram (because I have it configure to do so in my project.clj) |
| 13:43 | jaimef | slime -> "Clojure is not installed do you want to download?" Y-> fails, N-> Exception noclassdef for clojure/main |
| 13:43 | sorenmacbeth | tmciver: Hi, btw =) |
| 13:43 | tmciver | Hello! |
| 13:43 | tmciver | Did you get my email? |
| 13:43 | sorenmacbeth | tmciver: I did, that time should be fine |
| 13:43 | jaimef | odd thing is the same emacs config works on one system. |
| 13:43 | sorenmacbeth | I'll reply to the email now though |
| 13:44 | technomancy | jaimef: see above; that's been deprecated for about two years |
| 13:44 | jaimef | technomancy: yeah tried jack-in same error |
| 13:44 | tmciver | sorenmacbeth: concerning the swank buffer, I see that it is still there for me as well, but I don't get a complaint from emacs when I quit as I will if I don't kill slime. |
| 13:44 | jaimef | rather exits with error code 1 |
| 13:44 | technomancy | jaimef: need to get rid of the swank-clojure emacs lisp package |
| 13:45 | jaimef | yeah already installed |
| 13:45 | jaimef | ahhh so it runs "cd /home/jaimef && lein jack-in 2621" but the error is "That's not a task Use "lein help" to list all tasks" |
| 13:46 | technomancy | it only works from a project |
| 13:46 | technomancy | plus you need swank-clojure as a lein plugin, not an emacs plugin |
| 13:47 | jaimef | yes I already ran lein plugin install swank-clojure |
| 13:48 | jaimef | will double check my ~/.m2 dirs between the two |
| 13:48 | jaimef | so "M-x slime" was replaced with "M-x clojure-jack-in" which only works on projects? |
| 13:48 | tmciver | technomancy: does the existence of the swank buffer in emacs imply that the swank server is still running? |
| 13:48 | technomancy | tmciver: no, the swank buffer stays open after the project exits |
| 13:49 | tmciver | OK |
| 13:49 | technomancy | jaimef: more or less; you can use slime-connect to work outside a project |
| 13:49 | jaimef | hmm ~/.m2 is the same on both. same contents. clj-stacktrace, org, swank-clojure. same emacs config, and emacs version. including same clojure.jar location. |
| 13:50 | jaimef | jre is different |
| 13:50 | technomancy | if it says "that's not a task" then you don't have the swank-clojure plugin |
| 13:50 | jaimef | ok I can rerun plugin install |
| 13:55 | mrevil` | for Leiningen projects is there a best practice for a directory location to store test data? Sorta like a resources dir, but for test. I need to store an XML file that is normally fetched by an HTTP GET in order to mock some functionality. |
| 13:56 | technomancy | mrevil`: dev-resources should do the trick |
| 13:56 | jaimef | rinse repeat |
| 13:57 | mrevil` | sweet, ty |
| 13:58 | technomancy | maybe it has to be test-resources in lein1; can't remember |
| 14:32 | dnolen | jaimef ? |
| 14:34 | jaimef | dnolen: ? |
| 14:34 | dnolen | jaimef: what are you asking? |
| 14:34 | jaimef | ahh more context. |
| 14:35 | jaimef | in ruby you can take any object and run .class to see what type of object it is, e.g. int, float, array, hash |
| 14:35 | cemerick | ,(class 5) |
| 14:35 | clojurebot | java.lang.Long |
| 14:36 | cemerick | jamiei: ^ |
| 14:37 | dnolen | ,(class :foo) |
| 14:37 | clojurebot | clojure.lang.Keyword |
| 14:37 | dnolen | ,(bases (class :foo)) |
| 14:37 | clojurebot | (java.lang.Object clojure.lang.IFn java.lang.Comparable clojure.lang.Named java.io.Serializable) |
| 14:48 | jaimef | thanks |
| 15:08 | duck1123 | Keep in mind, with clojure, you want to think more in interfaces and basic abstractions than in concrete class names |
| 15:18 | TimMc | &(class (list* 3 nil)) |
| 15:18 | lazybot | ⇒ clojure.lang.PersistentList |
| 15:18 | TimMc | &(class (list* 3 (range 5))) |
| 15:18 | lazybot | ⇒ clojure.lang.Cons |
| 15:18 | TimMc | :> |
| 15:22 | Null-A | when I call str on a lazyseq, it returns "clojure.lang.LazySeq@c0dddfb" even with a doall |
| 15:23 | tmciver | Null-A: (apply str mylazyseq) |
| 15:24 | Null-A | hm, what if I have a seq of lazyseq? |
| 15:24 | Null-A | i'll try that first |
| 15:25 | Null-A | Here's the code (defn fail [format-str & args] |
| 15:25 | Null-A | (throw (Exception. (apply format format-str args)))) |
| 15:25 | Null-A | args is a seq of lazyseqs |
| 15:27 | Null-A | this works: |
| 15:27 | tmciver | what do you want returned? A string? seq of strings? |
| 15:27 | Null-A | (defn fail [format-str & args] |
| 15:27 | Null-A | (throw (Exception. (apply format format-str (doall (map #(apply str %) args)))))) |
| 15:27 | Null-A | I want the exception to not print lazyseq@xxxx |
| 15:27 | jondot_ | i'm seeing this for clojure koans, https://github.com/functional-koans/clojure-koans --> from amount of watchers i deduce its good, right? |
| 15:27 | Null-A | that works though |
| 15:31 | Raynes | $max |
| 15:31 | Raynes | ~max |
| 15:31 | clojurebot | Titim gan éirí ort. |
| 15:31 | Raynes | Damn it. |
| 15:33 | cemerick | seems like a new-ish high, huh? |
| 15:35 | amalloy | pr-str, Null-A |
| 15:35 | amalloy | &(pr-str (range 3)) |
| 15:35 | lazybot | ⇒ "(0 1 2)" |
| 15:35 | Null-A | amalloy: ah thanks |
| 15:42 | foodoo | dnolen: I just watched your Conj video on match. Where can I find documentation for your module? |
| 15:43 | dnolen | foodoo: https://github.com/clojure/core.match, still pretty alpha, but the final puzzle pieces are falling into place |
| 15:44 | foodoo | dnolen: thanks. I wish clojars.org had a link to the homepages of the projects (I even searched github, but couldn't find it) |
| 15:46 | emezeske | foodoo: clojars *will* link to project homepages, if those projects include a :url |
| 15:46 | Null-A | Is it possible to change the toString implementation of an existing object? |
| 15:46 | emezeske | foodoo: so it's not clojars' fault, it's projects that omit the :url entry |
| 15:47 | dnolen | foodoo: core.match isn't provided via clojars, i should probably remove core.match from clojars. |
| 15:48 | dnolen | Null-A: in Clojure? no |
| 15:48 | Null-A | dnolen: I thought so, thanks |
| 15:48 | foodoo | dnolen: I think the good thing about clojars is that Leiningen can easily pull dependencies from it. I don't know if it supports git urls. |
| 15:50 | Null-A | dnolen: Is there any way to reset relation and index state in core logic? like retract-all-facts? |
| 15:50 | dnolen | foodoo: [org.clojure/core.match ...] will work fine |
| 15:50 | dnolen | Null-A: just redef the relation |
| 15:50 | Null-A | dnolen: hm, i tried that, but it didn''t work, i'll try again |
| 15:50 | dnolen | Null-A: there's no way besides that at the moment |
| 15:53 | zakwilson_ | ibdknox: does korma know anything about postgres hstore? |
| 15:55 | Null-A | dnolen: Yah I get null pointer exception with var-get, then fact in stack trace |
| 15:55 | Null-A | dnolen: I put the defrel inside a function |
| 15:55 | dnolen | Null-A: probably not a good idea, defrel is meant to be top level |
| 15:56 | Null-A | hm, makes it hard to retract facts then dynamically |
| 15:56 | Null-A | i wrote a hack to do it anyways |
| 15:56 | Null-A | but it's not patch worthy |
| 15:57 | tscheibl | from a functional programming standpoint, is it wise to adhere to the "with" paradigm as e.g. applied in clojure/java.jdbc? ... or is it generally better to pass explicit arguments to functions and use dynamic var binding for commonly required data in a local context where you often just split functionality over separate functions not to facilitate code reuse but to increase readability? |
| 15:57 | dnolen | Null-A: patch welcome, the defrel/fact stuff could use some attention from someone - don' t have the bandwidth for it at the moment |
| 15:58 | Null-A | dnolen: actually I just got it working by binding *ns* |
| 15:58 | Null-A | I guess *ns* is not available during runtime |
| 16:05 | tscheibl | dnolen: btw, would you consider it better to fix the ClojureScript Compiler to not convert the \u unicode notation to utf-8 when compiling without optimizations or rather consider it as an undocumented Microsoft(tm) extension to Javascript that IE takes the utf-8 equvalents of \uFDD0 up to \uFDEF as equal and stick to the proposed fix (workaround, hack?) by replacing \uFDD0 and \uFDD1 with \uFDF0 and \FDF1 respectively? |
| 16:13 | dnolen | tscheibl: http://stackoverflow.com/questions/5188679/whats-the-purpose-of-the-noncharacters-ufdd0-to-ufdef |
| 16:14 | dnolen | tscheibl: I'd rather not apply the patch given ^ |
| 16:15 | tscheibl | dnolen: so it would be more adequate to fix the compiler? |
| 16:15 | ivan | Google will tell you that putting non-ASCII in your .js is wrong |
| 16:15 | ivan | IE does Noncharacter->replacement char in other places as well, like XDomainRequest responses. seems to hate them. |
| 16:16 | Null-A | dnolen: just submitted two patches on jira |
| 16:16 | dnolen | tscheibl: I'm not clear on what has to be done - do you have a proposal? |
| 16:16 | dnolen | Null-A: thx |
| 16:20 | dakrone | tb |
| 16:21 | tscheibl | dnolen: as you can see by running the tests I've attached it only happens when the code does not get optimized by the google closure compiler. So ClojureScript somehow converts the \u unicode representations to their utf-8 equivalents which makes (only) IE behave the described way (considering the "characters" of the mentioned unicode range as equal). What I would do is to fix the ClojureScript to Java compiler not to do the converion as it happens when |
| 16:21 | tscheibl | switched to a google closure optimization mode. |
| 16:21 | Null-A | i've noticed C-xC-k is much faster in emacs24 |
| 16:21 | Null-A | C-cC-k* |
| 16:22 | tscheibl | dnolen: otherwise it's not possible to test non trivial ClojureScript apps in "development mode" on IE |
| 16:24 | tscheibl | dnolen "non trivial" was probably not the correct phrase... it starts to fail when it has to distinguish between symbols and keywords |
| 16:25 | tscheibl | e.g. when doing read-string containing keywords |
| 16:25 | dnolen | tscheibl: I agree it's a big problem. Just not clear to me where the problem is occurring in Compiler. Perhaps an artifact of Java strings? |
| 16:29 | tscheibl | dnolen: I could have a look at the ClojureScript compiler (in the meantime I should be fit enough with Clojure to understand what's going on) when I find some time, the next 2 days I will be quite busy in trying to satisfy a "nasty" customer.. but afterwards |
| 16:30 | dnolen | tscheibl: please do, what precisely does GClosure do to those chars under optimization? |
| 16:30 | tscheibl | nothing.. that'S the point |
| 16:30 | tscheibl | dnolen: it leaves the /u notation untouched |
| 16:30 | ivan | I think GClosure turns all UTF-8 into \u escapes |
| 16:31 | tscheibl | .. or maybe reencodes it from the utf-8 strings the ClojureScript compiler produces |
| 16:31 | ivan | can't you stick more backslashes in ClojureScript somewhere? ;) |
| 16:31 | mi6_x3m | can someone explain to me exactly what keywords are |
| 16:31 | mi6_x3m | I know they resolve to themselves |
| 16:31 | tscheibl | ivan: nah.. it's not Windows :D |
| 16:32 | mi6_x3m | what is their type |
| 16:32 | dnolen | tscheibl: oh ok, then probably a result of not escaping Java strings seems like an easy fix. Will look into, thanks for the clarification |
| 16:33 | dnolen | ,(class :foo) |
| 16:33 | clojurebot | clojure.lang.Keyword |
| 16:33 | dnolen | mi6_x3m: ^ |
| 16:33 | mi6_x3m | dnolen: do you happen to know what the type consists of? |
| 16:33 | mi6_x3m | some string description of the keyword? |
| 16:33 | mi6_x3m | some identifier? |
| 16:34 | dnolen | mi6_x3m: https://github.com/clojure/clojure/blob/master/src/jvm/clojure/lang/Keyword.java |
| 16:34 | mi6_x3m | dnolen: ah, okay, sorry, I am all new to this stuff |
| 16:39 | ibdknox | zakwilson: it knows no vendor specific things |
| 16:40 | zakwilson | ibdknox: I thought not. It seemed very confused by my attempt to give an hstore field a map. |
| 17:12 | mrevil` | what should I be googling to find examples of mocking in midje? |
| 17:12 | TimMc | mrevil`: Alex Baranosky's email address. |
| 17:20 | Null-A | i'm having font-lock issues with emacs24 while editing clojure, has anyone else run into this? |
| 17:24 | wthidden | Null-A: what plateform is emacs running on? |
| 17:24 | Null-A | wthidden: osx |
| 17:25 | Null-A | it's odd, it wasn't happening until I recompiled clojure-mode |
| 17:25 | Null-A | slime* |
| 17:25 | Null-A | i might have upgraded slime in the process |
| 17:25 | dnolen | Null-A: I've had no problems |
| 17:25 | Null-A | hm |
| 17:25 | Null-A | i'll keep playing |
| 17:26 | wthidden | Null-A: hmmm, i've had little experience with OSX. I've had some issues in the past with linux |
| 17:26 | wthidden | Null-A: what is the error/symptom? |
| 17:26 | Null-A | wthidden: The coloring gets messed up as I type stuff |
| 17:26 | Null-A | wthidden: e.g. it doesn't really fix coloring when I use paredit to unquote strings |
| 17:26 | wthidden | Null-A: are you using color-themes? |
| 17:27 | Null-A | wthidden: yes but I tried without , and no difference |
| 17:28 | wthidden | Null-A: do you have some font-lock setting set in the customize section of your .emacs? |
| 17:28 | Null-A | oh I might |
| 17:28 | Null-A | i'll try removing it |
| 17:29 | wthidden | Null-A: I sometimes get over zealous with customize setting ... and thus conflicts |
| 17:33 | Null-A | wthidden: it's working now, but I need to wait longer to make sure |
| 17:35 | mi6_x3m | can someone explain to me whz |
| 17:35 | mi6_x3m | why* (def myfunc (fn [w] (count w))) is different than |
| 17:35 | wthidden | Null-A:good luck. |
| 17:35 | mi6_x3m | (defn myfunc (count w)) |
| 17:35 | Null-A | wthidden: thanks |
| 17:39 | wthidden | mi6_x3m: well the first thing that jumps out to me is that your defn is form is ill-formed. |
| 17:39 | mi6_x3m | wthidden: yes, I know I missed [w] |
| 17:39 | mi6_x3m | it's a general question |
| 17:40 | brehaut | ,(macroexpand '(defn mf [x] (count c))) ; mi6_x3m |
| 17:41 | technomancy | mi6_x3m: defn will give you better stack traces |
| 17:41 | clojurebot | #<Exception java.lang.Exception: SANBOX DENIED> |
| 17:41 | brehaut | ,(macroexpand '(defn mf [x] (count x))) |
| 17:41 | clojurebot | #<Exception java.lang.Exception: SANBOX DENIED> |
| 17:41 | technomancy | the only practical difference is the metadata attached to the function |
| 17:41 | brehaut | bah, ##(macroexpand '(defn mf [x] (count c))) |
| 17:41 | lazybot | ⇒ (def mf (clojure.core/fn ([x] (count c)))) |
| 17:41 | mi6_x3m | technomancy: OK, thank you very much |
| 17:45 | dhmdhm | /_dhm |
| 17:49 | amalloy | technomancy: better stacktraces, really? |
| 17:49 | technomancy | amalloy: well, you could put a name inside your fn as well |
| 17:50 | ibdknox | you get the name of the function |
| 17:50 | technomancy | but a nameless fn sucks to see in a stack trace |
| 17:50 | pandeiro | is it possible to test cljs macros at the browser repl? |
| 17:50 | ibdknox | not that I'm aware of |
| 17:51 | pandeiro | ibdknox: can't get defpartial to work and dunno how to debug it |
| 17:51 | amalloy | mmmm, i don't think that's true, technomancy |
| 17:51 | dnolen | pandeiro: something that could be solved by some kind of reflection facility |
| 17:51 | ibdknox | pandeiro: get the latest crate |
| 17:51 | amalloy | (def f (fn ...)) compiles the function into a class named user$f |
| 17:52 | ibdknox | pandeiro: there was a bug in defpartial |
| 17:52 | amalloy | there's special magic in the compiler's handling of (def ...), that checks if the value is a (fn) literal and calls compileForDefn instead of just compile |
| 17:52 | pandeiro | ibdknox: thanks |
| 17:54 | technomancy | amalloy: huh; I guess that makes sense |
| 17:54 | technomancy | I wish it went the other way where the fn would get the metadata from the var =( |
| 17:54 | ibdknox | +1 |
| 17:55 | technomancy | no arglists make for sad pandas |
| 17:56 | pandeiro | ibdknox: what are the special crate group attrs useful for? |
| 17:56 | ibdknox | pandeiro: if you use jayq you can then do things like ($ my-partial) |
| 17:57 | ibdknox | and bind events, or animate, or whatever |
| 17:57 | ibdknox | and it will take effect on anything that is created by that partial function |
| 18:06 | pandeiro | ibdknox: still no luck w/ defpartial |
| 18:06 | ibdknox | maybe I didn't push |
| 18:06 | pandeiro | looks like it's expanding into a call to crate.html() |
| 18:06 | pandeiro | but it returns undefined |
| 18:07 | emezeske | pandeiro: do you have a (:require crate.core :as whatever) ? |
| 18:07 | pandeiro | emezeske: yep |
| 18:07 | emezeske | pandeiro: nm then! that's bitten me before. :/ |
| 18:07 | pandeiro | but not sure i would need it right? |
| 18:07 | ibdknox | you do |
| 18:07 | pandeiro | k |
| 18:08 | emezeske | yeah, anything that the macro's output references must be available :( |
| 18:08 | ibdknox | pandeiro: you restarted cljsbuild and and saved that file to get it to recompile, right? |
| 18:08 | emezeske | pandeiro: could also do a "lein cljsbuild clean" first |
| 18:08 | pandeiro | ibdknox: still hacking on top of one but yeah it has a handler that rebuilds cljs every time |
| 18:08 | pandeiro | let me empty the browser cache too (for some reason chromium is caching js randomly) |
| 18:09 | ibdknox | pandeiro: I have this crate and it works: crate-0.1.0-20120214.022223-8.jar |
| 18:10 | pandeiro | ibdknox: i have the master from github as of now, should be good? |
| 18:10 | ibdknox | hm |
| 18:10 | ibdknox | yes |
| 18:11 | ibdknox | actually |
| 18:11 | ibdknox | no |
| 18:11 | pandeiro | ibdknox: k |
| 18:11 | ibdknox | pandeiro: pull |
| 18:12 | ibdknox | I should automate that so that I can't lein push without commiting and pushing |
| 18:12 | ibdknox | committing* |
| 18:13 | ibdknox | people haven't been working against my source much, so it's never been an issue before |
| 18:13 | pandeiro | ibdknox: something's weird, the js looks fine but it still returns undefined... probabl something on my end |
| 18:14 | pandeiro | ibdknox: i am still working on something with one, soon i'll mix up my workflow for cljsbuild and jars and stuff |
| 18:14 | ibdknox | pandeiro: it's pretty darn easy these days |
| 18:15 | ibdknox | especially with the classpath stuff it's even easy to do the externs and whatnot |
| 18:15 | pandeiro | ibdknox: i admit the externs convo scared me |
| 18:15 | babilen | Hi all -- I am a bit baffled by the behaviour you can see on http://paste.debian.net/156370/. What am I missing or doing wrong? |
| 18:15 | ibdknox | pandeiro: it's easy :) |
| 18:16 | ibdknox | pandeiro: just have to add :externs ["externs/jquery.js"] to your cljsbuild params |
| 18:16 | pandeiro | ibdknox: you are pushing the jayq pretty hard :) |
| 18:16 | ibdknox | and done |
| 18:16 | ibdknox | eh, not really |
| 18:16 | ibdknox | just trying to convince people that things have gotten better/much easier |
| 18:17 | pandeiro | ibdknox: i will definitely try it, tell me though can it automate compiling a dev and production version like one does? |
| 18:18 | ibdknox | the only difference is :advanced vs. :simple, right? |
| 18:18 | pandeiro | yeah |
| 18:18 | ibdknox | sure |
| 18:18 | pandeiro | i run into some weird stuff with :advanced so i'm testing it every commit to avoid having to track down stuff after |
| 18:19 | ibdknox | you just need to switch a keyword in your project file |
| 18:19 | ibdknox | it's easy enough to have that happen based on env vars or something |
| 18:19 | technomancy | babilen: (range) is infinite |
| 18:19 | pandeiro | ibdknox: yeah could be in the repl module maybe |
| 18:19 | technomancy | if you interleave a finite seq with an infinite seq, you get an infinite seq =) |
| 18:20 | pandeiro | but i think one had an interesting idea putting that scaffolding around the app in the browser |
| 18:20 | technomancy | which is weird because map operates on two seqs but stops when one runs out |
| 18:20 | ibdknox | pandeiro: what do you mean? |
| 18:21 | pandeiro | ibdknox: well they have a handler doing advanced compilation wired up to a link on the top bar |
| 18:21 | technomancy | hm; I guess it should still work with laziness though |
| 18:21 | ibdknox | oh |
| 18:21 | pandeiro | so when you test dev, you just right click a link to test advanced in another tab, done |
| 18:21 | ibdknox | I see |
| 18:21 | pandeiro | it's clever since you have to be at the browser anyway to test |
| 18:22 | pandeiro | rather than having to go into the repl or project.clj specifically just to do that |
| 18:22 | emezeske | ibdknox: I just had an idea. What if I made lein-cljsbuild hook into the "lein deps" task, and clean/rebuild when that happened |
| 18:22 | emezeske | ibdknox: Would that make life easier when dealing with rapidly changing upstream jars? |
| 18:22 | babilen | technomancy: Yes, sure. But why does it work when I run it in the repl? And shouldn't all these functions return lazy-seqs anyway? (so the indefiniteness doesn't matter) -- I mean "(take-while #(= (first %) (second %)) (partition 2 (interleave (range) [0 1 2 2])))" works fine. |
| 18:23 | ibdknox | emezeske: you should talk to technomancy, not sure if things are supposed to hook deps |
| 18:23 | ibdknox | emezeske: it seems like a good idea to me though |
| 18:23 | ibdknox | pandeiro: something like that would have to operate closer to the server level |
| 18:23 | emezeske | ibdknox: thanks |
| 18:23 | pandeiro | ibdknox: yeah exactly, one is doing all compilation at the server |
| 18:24 | ibdknox | pandeiro: I've been considering bringing noir-cljs back, which could easily mimic that behavior |
| 18:24 | emezeske | technomancy: see my note above about cljsbuild hooking into "lein deps" ? does that make sense? |
| 18:24 | pandeiro | ibdknox: just tie it altogether into the ultimate framework, man :) |
| 18:24 | ibdknox | lol |
| 18:24 | babilen | technomancy: I just don't understand the difference in behaviour (emacs, clojure-jack-in, clojure 1.3 if that matters) |
| 18:24 | ibdknox | pandeiro: if I had more time I would ;) |
| 18:24 | technomancy | babilen: aha |
| 18:24 | technomancy | you got slimed |
| 18:24 | TimMc | :-D |
| 18:24 | technomancy | babilen: starts-with-seq? vs starts-with-subseq? |
| 18:25 | technomancy | must have had a stale definition left in the repl |
| 18:25 | babilen | *sigh* |
| 18:25 | technomancy | happens to everyone =) |
| 18:25 | babilen | damn |
| 18:25 | technomancy | emezeske: seems reasonable |
| 18:26 | babilen | technomancy: Thanks -- At least I am not crazy, just tired. |
| 18:26 | technomancy | emezeske: in lein2 there's a way to register your task as something that runs before every eval-in-project form. would that be sufficient for your use case? |
| 18:27 | emezeske | technomancy: yeah, I think that could work, although it might be overkill |
| 18:27 | emezeske | technomancy: thanks. |
| 18:27 | technomancy | emezeske: you could keep a checksum and only rebuild if you detect a change |
| 18:29 | emezeske | technomancy: you are some kind of genuius |
| 18:29 | emezeske | technomancy: and a genuius is better than a genius |
| 18:29 | emezeske | technomancy: why didn't I think of that? *sigh* |
| 18:30 | emezeske | technomancy: thanks! that will make things way better. |
| 18:30 | technomancy | emezeske: heh, well it's a bit more work, but if the delay is noticeable then it's worth the bother |
| 18:30 | technomancy | emezeske: we do a checksumming of :dependencies in lein deps in 1.x; feel free to steal the codes =) |
| 18:31 | emezeske | technomancy: the problem people have with cljsbuild now is that if an upstream jar containing cljs is updated, it doesn't trigger a rebuild |
| 18:31 | emezeske | technomancy: using a checksum will make that work like it should |
| 18:31 | emezeske | technomancy: cool, I'll peek at that code! |
| 18:31 | muhoo | geeeeeenius |
| 19:38 | TimMc | OK, am I wrong to believe that proxy can handle multiple overrides of the same method name? https://refheap.com/paste/761 |
| 19:40 | TimMc | Can't push? |
| 19:40 | emezeske | Haven't tried that, but I'm getting 500s on the web ui :/ |
| 19:40 | brehaut | TimMc: i recall hiredman saying that you have to do the dispatch yourself somehow for proxies in that situation |
| 19:40 | TimMc | brehaut: Huh? |
| 19:40 | dgrnbrg | Is there a protocol I can implement so that I can work w/ keywords as map accessors? |
| 19:41 | brehaut | TimMc: unfortunately it was a few weeks ago so i have forgotten the details |
| 19:41 | TimMc | Was this in this channel? |
| 19:41 | brehaut | yeah |
| 19:42 | gtrak` | anyone managed to get the midi example working with overtone? I can't tell if it's taking in notes, and I can't get the defsynth to play on its own |
| 19:43 | TimMc | brehaut: Found it, but that's about overriding, not overloading. |
| 19:43 | brehaut | TimMc: oh, sorry my bad |
| 19:44 | brehaut | TimMc: im pretty sure proxies are a map under the hood; (as you can monkey patch the methods later) its possible you need to provide a single function that implements both overloads |
| 19:45 | TimMc | ugh |
| 19:45 | brehaut | (invokePrim ([^long p_312] …) ([^double …] …)) ? |
| 19:45 | TimMc | Let me try that. |
| 19:45 | TimMc | Wait... that doesn't make sense, does it? |
| 19:45 | TimMc | THat only allows one return type. |
| 19:46 | brehaut | that does appear to be a downside of that approach |
| 19:46 | TimMc | brehaut: "CompilerException java.lang.RuntimeException: Can't have 2 overloads with same arity" |
| 19:47 | brehaut | timm: oh of course. sorry :/ |
| 19:49 | amalloy | dgrnbrg: ILookup or Associative or something. just check the source of clojure.lang.* |
| 19:49 | brehaut | TimMc: it defintely looks like it collects up all the methods as functions and sticks them into a map |
| 19:50 | amalloy | yes, ILookup |
| 19:50 | dgrnbrg | amalloy: thanks |
| 19:50 | dgrnbrg | but eit! github is down |
| 19:51 | dgrnbrg | where else is the sourceR? |
| 19:52 | amalloy | cloned on your machine, i strongly suggest (in future). way easier to navigate your local filesystem than a bunch of point-and-click on github's web ui |
| 19:53 | TimMc | yup |
| 19:53 | TimMc | Got tired of clicking around, finally cloned EVERYTHING. |
| 20:05 | dgrnbrg | I like clicking :) |
| 20:05 | dgrnbrg | i have rsi; it's a nice break |
| 20:07 | TimMc | OK. WELL THEN. |
| 20:08 | TimMc | brehaut: Any idea how to get around this? |
| 20:09 | brehaut | TimMc: no sorry. i got lost spelunking into the innards. you'll need to find someone more knowledgable i think |
| 20:09 | TimMc | I think deftype will allow hinting... |
| 20:09 | brehaut | that does sound right |
| 20:09 | amalloy | deftype allows the same things reify does, right? |
| 20:09 | TimMc | I'll need to redo the same stuff AFn does for IFn, but whatever... :-( |
| 20:10 | amalloy | i wouldn't deftype here unless you have to; they both have the same relevant features |
| 20:11 | TimMc | Ah, reify gives an object back, I see. |
| 20:13 | mdeboard | amalloy: Is that you introducing cemerick here http://blip.tv/clojure/chas-emerick-modeling-the-world-probabilistically-using-bayesian-networks-in-clojure-5953843 |
| 20:13 | amalloy | no |
| 20:14 | brehaut | stuart sierra isn't it? |
| 20:14 | amalloy | right |
| 20:14 | brehaut | also is the full vid of that up yet? |
| 20:14 | mdeboard | brehaut: of? |
| 20:15 | brehaut | cemerick's presentation; it was abbreviated by accident i think |
| 20:15 | mdeboard | no idea where these talks were held |
| 20:15 | mdeboard | oh yeah looks like it's 13min long |
| 20:15 | brehaut | clojure conj 2011, in reaiaealeigh NC i think |
| 20:15 | mdeboard | oic |
| 20:17 | amalloy | good hedging there |
| 20:19 | amalloy | or maybe you were just making fun of pronunciation? i thought you were unsure which mess of vowels to use |
| 20:20 | brehaut | amalloy: i have _no idea_ how its pronounced at all |
| 20:20 | brehaut | and i can never remember how its spelt |
| 20:21 | amalloy | raleigh, pronounced rah-lay or rah-lee, by geography |
| 20:21 | amalloy | not that there's any reason you should care, i suppose |
| 20:21 | brehaut | oh right. thanks |
| 20:21 | brehaut | i hear it has a cool lemur zoo |
| 20:22 | TimMc | R'lyah |
| 20:22 | brehaut | F'tagn TimMc |
| 20:50 | citizenparker | emezeske: You around? Had some questions on lein-cljsbuild |
| 20:50 | citizenparker | (which is great, btw) |
| 20:55 | emezeske | citizenparker: Yeah, what's up? |
| 20:57 | citizenparker | I noticed you have an open issue around the possibility of incorporating a repl command into that plugin |
| 20:57 | citizenparker | Have you actually going a ClojureScript repl to work with files built from cljsbuild today? |
| 20:57 | emezeske | citizenparker: Funny you should bring that up; I was just thinking about working on it tonight |
| 20:57 | citizenparker | Ha! |
| 20:57 | emezeske | citizenparker: No, I haven't messed with CLJS repls yet |
| 20:57 | emezeske | citizenparker: But I am forming a plan |
| 20:58 | citizenparker | Some solution would be great. I love the plugin, but I haven't managed to get a repl connected via the generated files |
| 20:58 | citizenparker | I'm guessing it's because cljsbuild compiles them all down into one file, which the clojurescript wiki advises against |
| 20:59 | emezeske | citizenparker: Do you have a link to the "advises against" part? |
| 20:59 | citizenparker | Yeah, one sec |
| 20:59 | ibdknox | citizenparker: that shouldn't matter |
| 20:59 | ibdknox | I've definitely run the REPL after it's compiled everything into one file :) |
| 21:00 | citizenparker | https://github.com/clojure/clojurescript/wiki/The-REPL-and-Evaluation-Environments - in the example, it shows the files broken out |
| 21:00 | citizenparker | ibdknox: Oh? Maybe I'm missing something obvious then, hmm |
| 21:00 | citizenparker | ibdknox: with cljsbuild? or with clojurescript proper? |
| 21:01 | ibdknox | with cljs-watch, but that's equivalent to cljsbuild at this point |
| 21:01 | ibdknox | either way though, the files shouldn't really matter so long as that call to start the repl exists :) |
| 21:02 | citizenparker | Good to know! I'll recheck my work again. When I was trying with the cljsbuild output, I was getting some truly obscure JS errors upon loading the page |
| 21:03 | citizenparker | I thought that went away when I went to a pure clojurescript approach, but I could have changed something else along the way |
| 21:03 | emezeske | citizenparker: If you check back later, I plan to have something basic working in cljsbuild soon to make repls easy |
| 21:03 | citizenparker | Oh man, that would be dreamy |
| 21:04 | citizenparker | And I think would really help ease the barrier to cljs adoption |
| 21:05 | emezeske | Yeah, should be handy |
| 21:10 | cjfrisz | So it seems that function definitions with "defn" created inside the scope of another function are visible outside the enclosing function's scope in Clojure. |
| 21:11 | cjfrisz | This doesn't jive with my notions from Scheme that a procedure defined in the scope of another is only visible within the enclosing scope. |
| 21:11 | cjfrisz | Is this a feature or a bug in Clojure? |
| 21:11 | technomancy | in Clojure anything that starts with "def" shouldn't be called anywhere but the top level |
| 21:11 | amalloy | a bug in scheme </troll> |
| 21:11 | technomancy | if you want locals, use let. |
| 21:12 | technomancy | the difference between locals and "globals" in Clojure is much bigger than it is in most languages |
| 21:12 | amalloy | cjfrisz: that's a special-case rule in scheme that only applies to defines at the *very beginning* of a procedure, to avoid having to write a let or something |
| 21:12 | amalloy | which is pretty gross imo |
| 21:13 | cjfrisz | amalloy: Er...that's not true |
| 21:13 | cjfrisz | It doesn't have to be the very beginning of a procedure. |
| 21:14 | zakwilson | I've seen defun used non-toplevel in Common Lisp a few times. Those are global and were intended to be by the programmer in question. |
| 21:14 | cjfrisz | And it's just a stylistic difference as to whether that looks nice ;-) |
| 21:14 | shaunxcode | I think he means not nested lower? |
| 21:14 | amalloy | it's only guaranteed to behave the way you want at the beginning. scheme implementations may choose to make it work elsewhere, but it's not standard-compatible. that's my understanding from reading SICP, but i'm not a scheme expert |
| 21:15 | cjfrisz | I don't think that's true, but I'm not 100% sure, either. |
| 21:15 | amalloy | some quick googling confirms, with text like: Some implementations of Scheme permit definitions to occur at the beginning of a <body> (that is, the body of a lambda, let, let*, letrec, ordefine expression) |
| 21:15 | arohner | cjfrisz: in clojure, def and let have different semantics in clojure, so they're named differently. def always creates a global, regardless of where you call it |
| 21:16 | amalloy | There's a restriction on internal defines--they must be at the beginning of the procedure body (or the beginning of another body, like a letbody, before the normal executable expressions in the body. |
| 21:16 | cjfrisz | amalloy: They still don't break lexical scoping, which is the issue I'm concerned with |
| 21:17 | amalloy | "break" |
| 21:17 | amalloy | there is no breaking going on. you're using def, which is for globals. in scheme, some define forms happen to not define globals; i don't see how either of these involves breaking anything |
| 21:18 | cjfrisz | Ahh, ok |
| 21:18 | cjfrisz | arohner's answer is the one I was looking for. |
| 21:19 | cjfrisz | That was not intended as a troll, btw |
| 21:19 | cjfrisz | I'm sorry if it came off that way. |
| 21:20 | cjfrisz | I wasn't aware of the distinction of def for globals and was seriously concerned about the sanctity of lexical scope. |
| 21:20 | amalloy | no, i was </troll>ing myself for saying it's a bug in scheme |
| 21:21 | amalloy | it's obviously not, it's just a feature i don't like the flavor of |
| 21:21 | cjfrisz | I'm a recent Clojure convert and I'm noticing that there's a marked difference between Scheme and Clojure style. |
| 21:22 | cjfrisz | Schemers find internal defines to be perfectly nice. |
| 21:22 | cjfrisz | Not that either is wrong! |
| 21:40 | gtrak | success with the midi! |
| 21:45 | jkdufair | technomancy: I believe i have a fix for lein and cygwin. what's the best way to test? lein jar of swank-clojure then just copy to plugins dir? or is it more complicated than that? |
| 21:45 | jkdufair | i should say for swank-clojure and cygwin |
| 21:59 | dgrnbrg | Is it possible to get all the semantics of defrecord but override the ILookup interface provision? |
| 22:01 | cjfrisz | Stylistic question: is it standard to do all function-level documentation as docstrings? |
| 22:02 | cjfrisz | I've got some namespace-local functions, and I can't tell if it's silly to document them with docstrings instead of comments.' |
| 22:03 | duck1123 | if you use docstrings, then those docs can be accessed from c.repl/doc and others |
| 22:04 | TimMc | cjfrisz: docstrings are standard |
| 22:04 | duck1123 | so even if it's a private function, it's still worth it to put it in the docstring when you document |
| 22:04 | cjfrisz | Alright |
| 22:04 | cjfrisz | Thanks |
| 22:04 | TimMc | Comments can't be retrieved programmatically. |
| 22:11 | dgrnbrg | How do you override a function with multiple arities with deftype? |
| 22:12 | dgrnbrg | (deftype … IProtocol (fnname ([arglist1] body1) (arglist2 body))) doesn't seem to work |
| 22:19 | dgrnbrg | this is very sticky…I want all the features of defrecord except for the ILookup |
| 22:19 | dgrnbrg | but if I use deftype, I have to write a tremendous amount of code that should be autogenerated |
| 22:22 | alexbaranosky | one option might be to make your on macro for it if you have to do it more than once |
| 22:22 | dgrnbrg | I could copy the code out of clojure.core |
| 22:22 | dgrnbrg | but that seems unfortunate |
| 22:22 | dgrnbrg | is there a good way to delegate with reify? |
| 22:22 | dgrnbrg | or some other macro/lib, similar to Groovy's @Delegate? |
| 22:23 | alexbaranosky | nothing like @Delegate as far as I know |
| 22:23 | dgrnbrg | hack it is, then |
| 22:27 | TimMc | OMG, what the hell is clojure.lang.Util/ret1 doing |
| 22:27 | TimMc | and why does clojure.lang.AFn/applyTo use it? |
| 22:27 | TimMc | Is that some sort of bizarre GC trick? |
| 22:29 | alexbaranosky | TimMc, you're in the belly of the beast, man |
| 22:31 | TimMc | Anyone know if fn args undergo locals clearing like let bindings do? |
| 22:32 | cemerick | TimMc: I believe so, yes. |
| 22:34 | TimMc | Phew, I think that I can ignore Util/reet1 then. |
| 22:34 | TimMc | *ret1 |
| 22:35 | TimMc | Context: There's a "tail call" in a Clojure core Java file which includes Util.ret1(arglist,arglist = null) -- arglist is one of the function's arguments. |
| 22:35 | TimMc | Util.ret1 simply returns the first argument. |
| 22:42 | amalloy | TimMc: that's how locals clearing is accomplished |
| 22:43 | amalloy | on the java side, that is (i believe. not sure about any of this) |
| 22:43 | amalloy | you call ret1, passing it a pointer to your thing, and then clearing your own pointer to it |
| 22:44 | amalloy | String x = "data"; someMethod(x); // x can't be GCed until someMethod finishes, because it's in your scope |
| 22:45 | amalloy | String x = "data"; someMethod(ret1(x, x = null)); // now x isn't referred to locally anymore when someMethod is running |
| 22:45 | cemerick | what amalloy said |
| 22:46 | amalloy | cemerick: you saved me the trouble of "just in case cemerick says anything, he'll be right" |
| 22:47 | cemerick | ha! |
| 22:47 | clojurebot | Pardon? |
| 22:47 | cemerick | I fall down faster than anyone else I know. |
| 22:51 | Tcepsa | I'm a little confused, if you're up for explaining this a little further. While I realize that x no longer points to whatever it was x pointed to (e.g. the string "data"), won't that thing still be ineligible for GC while someMethod is on the stack? If so, then what's the point? (If not, how come?) |
| 22:52 | amalloy | someMethod might decide it no longer needs its reference to data, clear it, and then keep doing other work |
| 22:52 | Tcepsa | Oh! At which point it can be GC'ed because the calling function no longer has a reference to it. Got it, thanks! ^_^ |
| 22:56 | amalloy | right. that's an important part of how lazy sequences work - otherwise the closures they create would keep references to the closed-over variables indefinitely |
| 22:58 | TimMc | I was partly having trouble with order-of-operations in the call to ret1. |
| 22:58 | TimMc | But that's Java for you. -.- |
| 22:58 | amalloy | function calls go left-to-right |
| 22:58 | amalloy | just like in clojure |
| 22:58 | TimMc | I eventually decided that there was only one interpretation that would be useful, so I went with that... |
| 22:59 | amalloy | i was actually surprised in both cases that the left-to-right order is guaranteed |
| 23:01 | TimMc | I guess the JVM is putting evaluated args on the stack left to right, then invoking the method. |
| 23:22 | TimMc | java.lang.ClassNotFoundException: Object |
| 23:23 | TimMc | I should really be going to bed. |
| 23:24 | TimMc | (Yes, it should be java.lang.Object) |