#clojure logs

2014-05-25

00:05amalloycatern: why would you care that syntax-quote gives you a seq which is not a list? it's quite rare to need something that's specifically a list
00:06caternamalloy: because you can't check for clojure.lang.Cons with list?
00:07amalloywell, that's fine, because you shouldn't use list? either. if you want to know whether something is listy, seq? is the function to use (it works, among other things, on conses)
00:07caternah, but I want to treat other seqs differently
00:08caternbecause this is a toy interpreter and I'm just making input to it, and maybe I want to use the map or vec types
00:08amalloythose aren't seqs
00:09caternhuh! i thought they were
00:09amalloythey're collections
00:10amalloythere's only like three functions in clojure.core that treat lists differently from other seqs: list?, and pop/peek
00:10caternso what implements ISeq?
00:10amalloyseqs
00:10caternno, I mean besides PersistentList and Cons
00:10amalloyother collections, like maps and vectors, are *seqable*, ie you can produce seqs from them
00:11caternoh, I see
00:11amalloylike a million other things implement ISeq
00:11amalloylazy sequences, ranges, seqs of vectors or maps...
00:12caterncool, then I will switch to using seq?, thanks
00:16amalloyyou're welcome
01:11sm0kehello is there a easy way to launch groovy repl with lein?
03:15adsiscohow do you see the doc-string of a function in emacs?
04:46mercwithamoutho_O
05:47r4vianyone have eldoc mode working with clojurescript or is it going to be a non-starter?
06:18dissipatehow does the ':test' metadata key/value pair work? is the ':test' function run every time the var is evaluated?
06:37mikkerI'm trying to stub out a function from an external library in my test
06:37mikkerAnd I'm using Midje's provided
06:37mikkerBut I'm not doing it right
06:41mikkerI get this error:
06:41mikkervar: #'clostache.parser/render-template is not public
06:42Glenjaminis that the var you're trying to stub?
06:42mikkerI suppose it is
06:43Glenjaminpresumably non-public vars cannot be stubbed - which usually points to stubbing at the incorrect level
06:43Glenjaminas you generally should only stub public interfaces
06:43mikkerBut I'm pretty sure that IS a public interface
06:43mikkerClojure is pretty sure of the opposite though
06:44mikkerI misnamed the function
06:44mikkerLike an idiot
06:44Glenjamin"render" is the public one
06:44mikkerrender-resource was what I was after :)
06:44mikkerThanks
06:46mikkerI'm very new to Clojure so I'm unsure of my every move right now
06:46mikkerI'll probably end up with something resembling OOP
06:57Glenjamini think thats always the way
06:58mikkerprobably is
07:14mercwithamouthddellacosta: hola
07:15ddellacostamercwithamouth: howdy there. :-)
07:17ddellacostamikker: noooo, don't end up with OO...if you want OO just use Java
07:19mikkerddellacosta: I'm trying my best not to
07:19ddellacostamikker: you can do it
07:19mikkerI'm coming from ruby so most of my knowledge is based on OO principles
07:20mikkerTBH clojure just seemed too rock'n'roll to not try it
07:21gfredericksclojurebot: clojure is too rock'n'roll to not try it
07:21clojurebot'Sea, mhuise.
07:26mercwithamouthhmmm how to learn when you don't have a realistic project in mind =(
10:02EClaessonI'm a bit rusty on clojure, so sorry if i'm doing something stupid :) I'm trying to use a java.io.File. (if (.isDirectory file) ... I get "No matching field found: isDirectory for class [Ljava.io.File;"
10:11ambrosebs,(.isDirectory (java.io.File. ""))
10:11clojurebot#<SecurityException java.lang.SecurityException: denied>
10:13ljosEclaesson: that [.. , wouldn't that mean it is an array of java.io.File that you are trying to call .isDirectory on.
10:13ljos?
10:15EClaessonI don't know. But 'file' is just a (File. "path/here/") so i don't think it's an array
10:16ljosEClaesson: I get the same error you get if I call it on an array of files. It works perfectly well if I call the same as ambrosebs wrote.
10:21EClaessonIf i'm not missing something, it's not an array. https://gist.github.com/EClaesson/e60e2fbbe383e4556f32 Line 16 causes the error
10:22EClaessonThat file is run by "lein exec" if that makes any difference
10:24ljosECleasson: .listFiles. The second time around file will be an array of files.
10:24_rcEClaesson: so listFiles returns File[], so your iteration will be taking an array
10:25EClaessonAhm of course. Thanks. I was completely stuck in (defn traverse
10:25ljosEclaesson: Np. We are all here to learn.
11:11arkhwhy use 'complement' instead of 'not' ?
11:13bbloomarkh: complement operates on functions, not operates on booleans
11:13bbloomread their doc strings carefully
11:14arkhbbloom: will do - thanks
11:15fifosineHow can I get a more detailed stack trace? I'm getting this error: http://pastebin.com/QXAJ3UjX but I don't understand it. Supposedly it comes from this file: http://pastebin.com/ket8epP0.
11:17bbloomfifosine: that error has all the info you need
11:17bbloomcaused by handler.clj line 14
11:17bbloomclass can not be cast to ifn
11:18bbloomon line 14, you're trying to evaluate (java.io.File "./db.sql")
11:18bbloomjava.io.File is a class
11:18bbloomnot a function
11:18bbloomyou need to use new:
11:18bbloom(new java.io.File "./db.sql")
11:18bbloombut more commonly, you can use the shorthand:
11:18bbloom(java.io.File. "./db.sql")
11:20fifosinebbloom: Does that mean the book I'm following is wrong? This is the snippet: https://imgur.com/GyyQWCi
11:20bbloomfifosine: look closely
11:20fifosineoh!
11:20fifosineJeez, that period
11:20fifosinewhat does it mean?
11:21bbloom,(macroexpand '(Foo. 1 2 3))
11:21clojurebot(new Foo 1 2 3)
11:21bbloom,(macroexpand '(Foo 1 2 3))
11:21clojurebot(Foo 1 2 3)
11:21arkhbbloom, helping people like fifosine and me with reading comprehension :D (no offense meant at all fifosine)
11:21fifosinenone taken! :)
11:22fifosinebbloom: And what does that ".exists" mean? It applies it to the object?
11:22bbloomfifosine: http://clojure.org/java_interop
11:22arkhit's calling a method of the object
11:23arkh(instance method)
11:23bbloomfifosine: http://clojure.org/documentation is very terse and assumes you have some lisp/functional background, but it's also *very clear* and complete. worth reading in full
11:24fifosinebbloom: If the construction of an object is very expensive and would normally be static in a Java program, how do you analogously make static objects in your clojure program?
11:25bbloomfifosine: clojure files are basically giant static object constructors
11:25bbloom(def x (some-expensive-operation)) will occur once at file load time
11:26fifosineSo in this snippet, the object is created before the method is called? http://pastebin.com/rbd7HrDx
11:27bbloomfifosine: let's be clear here, the only "method" in that code is .format
11:27bbloomformat-time is a function, not a method
11:27fifosineoh gosh, ok, I don't know what the difference between those two are
11:27bbloombut no, that SimpleDateFormat will be constructed every time you call format-time
11:27bbloomin java parlance, methods are on objects
11:28bbloomin clojure, functions are first class and can live on their own
11:28fifosinebbloom: How would I write it so that it's constructed once but I can use it in every format-time call?
11:29bbloomfifosine: https://www.refheap.com/85889
11:29bbloomfifosine: the defs occur when the file is loaded
11:30fifosineGot it
11:39kmicuNew fastload branch… but how fast? ;) https://github.com/clojure/clojure/commit/8b07773ac7582628ca84ccff40ded7c942c79a8c
11:46bbloominteresting
11:57_alejandroDoes anyone have advice on using environ for multiple environments (e.g. test/dev/prod)?
12:02uvtcme.raynes/fs has a base-name function. Why no dir-name?
12:04fifosinedoes "& provide
12:04fifosineoptional parameters?
12:24benmossdoes anyone have any experience with using JavaFX 8? having the same trouble this guy had: http://stackoverflow.com/questions/18089248/load-custom-fonts-in-javafx-clojure
12:26benmossjust doing a simple (import javafx.scene.control.TextField) is throwing a “NoClassDefFoundError”
13:59owl-v-omg javascript++! clojure needs clojure++
14:05pdurbinhuh. this, I guess: http://jspplang.org
14:11owl-v-pdurbin: i was looking at this >> http://jspp.javascript.am/
14:11owl-v-holy crap, Destructors!!!
14:12owl-v-yes, that's what i want in clojure
14:13bbloomsays "explicitly called"
14:13bbloomsame for C#
14:13bbloomi don't know how java doesn't have that... we have finally blocks
14:13bbloomjava has Closable which is effectively the same as Disposable
14:14owl-v-i don't want to use garbage collectors.
14:14owl-v-jspp morphing c++ into javascript >> http://youtu.be/D6stkg2Wm4w
14:14Jaoodwe need clojure on llvm
14:20l3dxI'm trying to call a function recursively for each element in a vector. (map #(recur % :something) [1 2 3]) - I don't expect this exact example to work, but is there something alike that I can use?
14:21owl-v-lol lambda on c++11. c++14 is on the way :-)
14:22owl-v-13dx: make function what use recursive
14:25owl-v-13dx: at the end (recur <argument1, argument2, ...>)
14:26owl-v-13dx: but then u r not going to use 'map'
14:26owl-v-13dx: if u r going to use recur
14:26l3dxno I guess I'd have to pass the vector as a function argument then
14:27owl-v-yes
14:27expez-Why does it not make sense to define take! and put! for channels backed by a dropping-buffer?
14:28owl-v-expez-: u lost me...
14:31expez-owl-v-: (def c (dropping-buffer 1)) (put! c 1) => No implementation of put! exceptoin
14:33owl-v-put! returns true unless port is already closed >> http://clojure.github.io/core.async/#clojure.core.async/put!
14:34owl-v-source >> https://github.com/clojure/core.async/blob/65b2d6c81350ba8b4bb3a8b82ad45ba984c0037c/src/main/clojure/clojure/core/async.clj#L128
14:34owl-v-expez-: ^
14:35expez-Are you saying my newly created channel is closed and that leads to a 'No implementation of method....' exception?
14:40dnolen_expez-: that's not right, buffers are not themselves channels
14:40dnolen_(def c (chan (dropping-buffer 1)))
14:40expez-heh, silly mistake. Thanks!
15:21expez-What does do-alts do? The docstring is unusably terse for beginners :/
15:29dnolen_expez-: do-alts is not really meant to be used directly as far as I know
15:30expez-ok
16:16nopromptif anyone i'm curious what is the best way to approach porting the clojure.lang.IFn portion of clojure.algo.generic.functor/fmap to cljs.
16:21gfredericksfunctions as functors just map the return value amirite?
16:22nopromptgfredericks: it's namely this part https://github.com/clojure/algo.generic/blob/master/src/main/clojure/clojure/algo/generic/functor.clj#L41-L47
16:22nopromptit's dispatching on clojure.lang.IFn which AFAIK you can't do in cljs.
16:22gfredericksI'd be surprised if you couldn't at least do something equivalent
16:23nopromptderive?
16:38amalloyhttps://github.com/clojure/algo.generic/blob/master/src/main/clojure/clojure/algo/generic/functor.clj#L49 seems silly - why isn't it on ISeq?
16:39noprompti was wondering the same thing.
16:48yedifor learning purposes, how does iseq and llazyseq differ
17:21patrickodI'm trying to use core.async in a project but I'm unable to load it in a repl due to the following error https://gist.github.com/patrickod/0f9bb3defee87065838d
17:22patrickodI'm using clojure 1.6.0 with the latest core.async so I'm unsure why I'd be seeing issues with a core namespaced lib
17:26patrickodhttp://dev.clojure.org/jira/browse/CMEMOIZE-14?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel seems like there's an open issue for this :/
17:34yediwhat's the time complexity for a diffing algo? i'm guessing O(n)
17:58gfredericksyedi: that might depend on what you mean by diffing algo?
18:02noprompthmm... this seems like a bit of a rat's nest. i'm drawing a blank here. maybe I'll stick with js/Function and seek guidance in the PR.
18:03yediis there a better way to do: (for [[msg id] (map vector avec (range))] (do stuff))
18:04yedi(pretty much getting the index of a vector as you iterate over it in a for comprehension)
18:04noprompt(map-indexed vector avec)
18:04nopromptthen you can say (for [[id msg] ...)
18:05noprompt,(map-indexed vector [:a :b :c])
18:05clojurebot([0 :a] [1 :b] [2 :c])
18:05nopromptyedi: ^
18:05lodinIs it a bad idea to want to dispatch multimethods on protocols?
18:06nopromptlodin: it depends on what you're doing.
18:06yedinoprompt: that just replaces this part right: (map vector avec (range))
18:06nopromptyedi: yes.
18:06nopromptlodin: it doesn't work in clojurescript. :-(
18:07lodinI have two-three protocols and records that implement them. I want to write a function that takes to records and handle them differently depending on what protocols they implement.
18:08lodinI guess I should set up another is-a hierarchy, but that would be kind of double declaration.
18:09nopromptlodin: there's also the option of "marker" protocols if it makes sense in your case.
18:11lodinYes, but I thought that multimethods use isa? and not extends?, and protocol use extends and not derive. Am I confused?
19:02ToxicFrogWhat's the inverse of (empty?)?
19:10pdk(identity)?
19:15amalloyseq
19:42owl-v-,(next [1 2 3])
19:42clojurebot(2 3)
19:43owl-v-i don't understand this ^
19:43owl-v-i'm expecting a vector as an output... like [2 3]
19:48akhudekowl-v-: next always returns a seq. The difference between next and rest is that next is lazy.
19:49akhudekowl-v-: if you want a vector you can use subvec
19:50owl-v-,(rest [1 2 3 4])
19:50clojurebot(2 3 4)
19:51owl-v-,(subvec (rest [1 2 3 4]))
19:51clojurebot#<ArityException clojure.lang.ArityException: Wrong number of args (1) passed to: core/subvec>
19:52owl-v-,(subvec [1 2 3 4] 1)
19:52clojurebot[2 3 4]
19:52owl-v-ah
19:53hyPiRionjust be aware that subvec leaks memory.
19:53owl-v-but why use (rest) on input vector on (recur) ?
19:53hyPiRionprobably not an issue, just have that in mind
19:54owl-v-oh no. leaky memory is bad in embedded system
19:54owl-v-superBAD!
19:55owl-v-but why (subvec) leaks memory?
19:56hyPiRionbecause it's essentially just an object with an offset and a reference to the old vector
20:02owl-v-hyPiRion:if it's just a reference why does it leak memory?
20:03hyPiRionowl-v-: Java/the JVM cannot detect that the object with the offset will not look at the first or last elements in the vector. So everything in the original vector is kept
20:03ssswdonlooking for a good emacs setup using cider
20:05owl-v-hyPiRion: original is kept as long as something is referencing it. yes, but if the reference is not used anymore?
20:06owl-v-hyPiRion: it will be collected by garbage collector
20:07bbloomit doesn't leak memory
20:07bbloomit simple holds pointers to more memory than it strictly needs to
20:07bbloomit will properly reclaim that memory if you stop pointing to it
20:08bbloomthe official term for that sort of issue is "semantic garbage"
20:08owl-v-so why (subvec) leaks memory?
20:08bbloomhttps://en.wikipedia.org/wiki/Garbage_(computer_science)
20:08hyPiRiontoday I learned about the idiom "semantic garbage"
20:09owl-v-lol
20:09bbloom(doc subvec)
20:09clojurebot"([v start] [v start end]); Returns a persistent vector of the items in vector from start (inclusive) to end (exclusive). If end is not supplied, defaults to (count vector). This operation is O(1) and very fast, as the resulting vector shares structure with the original and no trimming is done."
20:09bbloomowl-v-: read the last phrase: "no trimming is done"
20:09bbloomit shares structure
20:09bbloomit's the same as if you pointed to a linked list of one million items, but only ever looked at the first two
20:09bbloomyou'd "leak" the last million minus two
20:10akhudektechnically not a leak
20:10akhudek“hold onto” is maybe a better term
20:10bbloomakhudek: retain
20:11owl-v-hyPiRion: r u sure (subvec) leaks memory?
20:12hyPiRionowl-v-: it doesn't leak memory, but as bbloom says, it retains objects which can never be referenced from the subvector
20:12hyPiRionI agree with bbloom, I just didn't know the proper name of the "leak"
20:13owl-v-proper name of the 'leak' is leak
20:14owl-v-there is no memory leak in JVM unless JVM itself is leaking memory.
20:14technomancyno *true* scotsman would leak memory
20:15noprompt_bbloom: any ideas on porting this to cljs: https://github.com/clojure/algo.generic/blob/master/src/main/clojure/clojure/algo/generic/functor.clj#L41-L47
20:15noprompt_i've moved most of the low hanging fruit over.
20:16noprompt_i'm debating whether or not to just skip the IFn stuff.
20:16bbloomnoprompt_: what's the issue?
20:16bbloomnoprompt_: can't you just use cljs.core.IFn ?
20:16noprompt_no because afaik you can't dispatch on protocols like that in cljs multimethods
20:16bbloomoh, right, no interface for it
20:17noprompt_is that just a limitation of cljs multimethods?
20:17noprompt_i haven't read through the impl.
20:18bbloomnoprompt_: i'd just special case ifn?
20:19bbloom(defn fmap [f s] (if (ifn? x) ... (-fmap f s)))
20:19bbloomor isntead of -fmap, fmap-method or something else like that
20:20owl-v-what's difference between vector an list in clojure? just the order i want to keep?
20:20bbloom~colls
20:20clojurebotcolls is seqs and colls
20:20noprompt_bbloom: i dunno if it even makes sense for fmap in this case to be a multimethod.
20:20bbloom~seqs
20:20clojurebotseqs is seqs and colls
20:20bbloomfucking bot
20:20bbloom~seqs and colls
20:20clojurebotseqs and colls is http://www.brainonfire.net/files/seqs-and-colls/main.html
20:21bbloomnoprompt_: i'm not convinced that fmap is useful at all
20:21noprompt_yeah, althought (fmap inc {:a 1 :b 2}) is much nicer than the alternative.
20:22bbloomnoprompt_: except that i have no idea if that maps keys or values or key value pairs... and whatever you say, why wouldn't it be the other one?
20:23noprompt_well the result there is {:a 2 :b 3}
20:23bbloomnoprompt_: sure, i guessed that from your choice of inc, but ... why?
20:23bbloomseems like an arbitrary choice
20:23noprompt_honestly, i don't really care about the fmap stuff in this case. i just more or less care about finishing the patch.
20:24bbloomi dunno what patch you're talking about
20:24noprompt_i want clojure.algo.generic to be available in cljs.
20:24bbloomi'd either just inline all the uses of fmap or special case with the ifn? predicate
20:24bbloomok, then go with ifn?
20:25bbloomyou can put that in to the :default case if you want
20:25noprompt_good idea. i'll go that route. that was my last option.
20:27noprompt_this seems a bit useless to me: https://github.com/clojure/algo.generic/blob/master/src/main/clojure/clojure/algo/generic/math_functions.clj#L25
20:27bbloomnoprompt_: agreed
20:28bbloomi think defn- should be deprecated too
20:28noprompt_is ^:private so hard?
20:29bbloomapparently
20:32bbloomfmap seems like almost as bad an idea as CanBuildFrom
20:36bbloomalso those algo/generic impls don't obey the functor laws
20:37bbloom,(defn fmap-set [f s] (into (empty s) (map f s)))
20:37clojurebot#'sandbox/fmap-set
20:38bbloom,(fmap-set (comp #(if (odd? %) (inc %) %) dec) #{1 2 3})
20:38clojurebot#{0 2}
20:38bbloom,(fmap-set #(if (odd? %) (inc %) %) (fmap dec #{1 2 3}))
20:38clojurebot#<CompilerException java.lang.RuntimeException: Unable to resolve symbol: fmap in this context, compiling:(NO_SOURCE_PATH:0:0)>
20:38bbloom,(fmap-set #(if (odd? %) (inc %) %) (fmap-set dec #{1 2 3}))
20:38clojurebot#{0 2}
20:38bbloom,(fmap-set dec (fmap-set #(if (odd? %) (inc %) %) #{1 2 3}))
20:38clojurebot#{1 3}
20:39bbloomer hard to construct an example
20:40bbloompoint is that (fmap (comp f g) s) is not necessarily the same as (fmap f (fmap g s)) because g may create duplicate intermediate values that the intermediate set will eliminate
20:40akhudekthe only thing I’ve used it for is as a map-vals, but there is a map-vals in the prismatic lib, or you can easily write it yourself
20:43bbloomit's generally quite difficult to write correct higher order operations that work over differing data structures and abstract collections
20:43bbloomit's also of highly questionable utility
20:47amalloybbloom: well, it's not so much that the algo.generic implementations don't follow the functor laws, as that it's impossible for a set to be a functor
20:47bbloomamalloy: right
20:48bbloomamalloy: is there ever a time a generic functor is actually useful outside of appeasing a type system?
20:48amalloyhuh?
20:48bbloomie is polymorphic fmap actually useful?
20:49bbloomnot as far as i can tell, curious if you think so
20:50amalloysure. a tree is a useful functor, for example
20:51amalloyand so's maybe; in clojure, we do fmappy things with some-> and so on
20:51bbloomreally? when do you ever want to create an isomorphic tree where each node's value is only ever a function of the node in that position's previous value? surely you want some context
20:52bbloomsurely you'd want to specify pre or post order traversal, and maintain context, potentially changing the shape of the tree... generic fmap seems useless there
20:52bbloomfmappy-things are different than generic fmap
20:52amalloy*shrug* maybe i have a tree of strings and want to parse-int them all. perfectly plausible
20:53bbloomseems highly unlikely to me :-P
20:59amalloybbloom: agents and refs? those are kinda functors, except for the mutation
21:00amalloyer, atoms and refs, i mean
21:00amalloyand it'd be nice to have a single function that worked on them all
21:00bbloomwhy would that be useful? seems like that would be an anti feature.... if i had one function that worked on all of them, then i'd write generic code which may or may not be correct given the semantics of all the possible implemetnations
21:01bbloomie would fmap be commute or alter?
21:01bbloompresumably alter, but then it would need the dosync somehow, which is meaningless for atoms
21:01bbloomsometimes, the lack of generic behavior is every bit as much of a feature as the presence of it
22:10FrozenlockUrr... "java.util.zip.ZipException: duplicate entry <my-file.cljs>" when doing lein jar
22:10FrozenlockAny ideas why? :-/
22:20fifosineHow do I view changes made in a liberator-service project? I've loaded the repl.clj file and am "use"ing it, but when I make changes to home.clj I have to quit the repl and re open and reload everything to see the changes. Is there a better way of doing this?
22:22justinholguinfifosine: I think you want "in-ns" instead of "use"
22:23justinholguinIf you're in the REPL
22:24fifosineIt moves me into the namespace? What happens when I change a function in the ns?
22:24justinholguinIf you change a function in ns x and evaluate it, the change should carry to the REPL session where you called (in-ns x)
22:25fifosineugh, I don't understand why this isn't working. Are you familiar with liberator projects?
22:25justinholguinNot really, sorry. I think I'm out of ideas for this one.
22:26justinholguinAre you using CIDER or fireplace or something?
22:27justinholguinOr are you just saving the changes to the files?
22:29justinholguinfifosine: I think I get what you're running into. Try (use 'namespace :reload-all)
22:29justinholguinI was assuming that you're developing with an active nREPL connection, which is my mistake.
22:30fifosinejustinholguin: No, that doesn't work. I must be reading this wrong
22:31fifosinejustinholguin: Does this make it clear what I should be doing?
22:31fifosinehttps://imgur.com/G2O2A0U
22:32fifosineWhat I've been doing is performing "lein repl" then loading "src/liberator_service/repl.clj" then (use 'liberator-service.repl) then (start-server)
22:32fifosineis that what's expected?
22:33justinholguinThat should work. Does it?
22:34fifosineNot really, because when I change something, I don't see the change
22:35justinholguinWhat kind of change? You might need to run (stop-server) and (start-server) again
22:35fifosineyea I've been doing that :/
22:35fifosineJust a small change, e.g., it starts out saying "Hello World!" just changing those words doesn't show
22:36cbp(require '[foo.repl :refer :all :reload true])
22:36justinholguinEven if you do (stop-server) (use 'liberator-service.repl :reload-all)?
22:36fifosinecbp: Do that instead of (use…) or before?
22:39fifosinecbp: still doesn't work :/
22:40fifosineI'm making changes in another file, do I have to do something else so that that file is reloaded?
22:43cbp_agh
22:43cbp_I had massive lag
22:44cbp_fifosine: can you explain what you're trying to do?
22:44fifosineI'm following along a project in "Web Development with Clojure" but I've hit a snag and can't continue with the tutorial because of it
22:45cbp_well that doesn't tell me much
22:45rhg135fifosine, yes, (require 'the.ns)
22:46cbp_fifosine: when you say "change" you mean you want your repl to use the changed function or your running webserver?
22:46rhg135i use fireplace to invoke this for me when i save to reload my code
22:46fifosinecbp_: I guess both?
22:47cbp_fifosine: uh well, the line I gave you should work for the repl
22:49rhg135unless start-server does somn like resolve all vars at invokation you shouldn't need to restart the server
22:50justinholguinThe author of that book (yogthos) hangs around in here pretty regularly. Guess he's not around now.
22:51fifosinearggggg this is so frustrating, I don't know what's going on
22:52cbp_fifosine: Need to see some code to help you, can't by just guessing what you're trying to do
22:53fifosinecbp_: The thing is there's so much skeleton code, even if I showed something to you, would it be understandable?
22:53cbp_fifosine: probably with just what run-server does
22:54fifosinecbp_: The file I'm changing right now is 'home.clj': http://pastebin.com/sRAq0beM
22:54fifosinethe thing is, when I change the text, I don't see it change
22:55fifosinebut the repl.clj file says that changes should be applied to the server in the comments: http://pastebin.com/6XjGr7xs
22:56fifosinethe way I'm loading it is first (load-file "…repl.clg") then (use 'liberator-service.repl)
22:56fifosine*clj
22:57cbp_fifosine: you don't need to do load-file
22:58fifosineEven still, with exiting the repl, making changes to that small amount of text, reopening repl, re"use"ing repl.clj and reperforming start-server, I don't see the changes
22:59fifosineI think I need to tell it to recompile the file
22:59fifosinebut I don't know how to do that
23:00justinholguinWait, you can't see the changes even after you completely exit the REPL and start it back up again?
23:01fifosinejustinholguin: Ye
23:01fifosines
23:01cbp_fifosine: show me the handler file
23:01fifosinecbp_: http://pastebin.com/B3PjVAz4
23:02fifosinejustinholguin: Actually, that's not necessarily true, sometimes when I restart I see the changes and other times I don't
23:03justinholguinGoing for maximum weirdness
23:05fifosineI think it has to do with not recompiling on save
23:05justinholguinlein compiles that stuff when you load it in the REPl
23:05fifosinebut then it needs to recompile it when I change it
23:06cbp_have you tried doing a hard refresh on your browser?
23:06rhg135require recompiles it then
23:06fifosineHow do I do that?
23:06cbp_uh depends on the browser + os
23:06cbp_usually something like ctrl + shift + r
23:07cbp_it might be liberator caching responses
23:08cbp_the code looks fine
23:08fifosinenow I see the change
23:08fifosineI think it had to do with hard refresh :/
23:08cbp_its liberator doing http caching then
23:08fifosinedo you know how to turn it off?
23:09cbp_maybe on the liberator docs, never used it myself
23:09cbp_then again its not too uncomfortable to hard refresh
23:11cbp_fifosine: anyway, when you do load-file, require or use clojure will compile the file for you if it finds it
23:11cbp_fifosine: of all three require is the only one you should use
23:11fifosineoh, don't use "use"?
23:12cbp_fifosine: no that's just left around for compatibility afaik
23:12fifosineok
23:12cbp_use (require '[foo :refer :all]) instead of (use 'foo)
23:13cbp_fifosine: instead of the steps you were following you should do (require 'liberator-service.repl) followed by (in-ns 'liberator-service.repl)
23:13fifosinewhy is that better?
23:14cbp_fifosine: load-file and require are redundant
23:14cbp_fifosine: i mean load-file and use
23:14fifosinecbp_: hard refresh isn't working anymore :p
23:15cbp_fifosine: eh?
23:16fifosineidk, the changes just aren't appearing
23:17cbp_fifosine: I guess you could ask yogthos once he's back
23:17fifosineok
23:59yediguys
23:59yedidestructuring is so sexy