#clojure logs

2015-12-28

01:32BRODUSsay i have a data shaped like this, [{:k1 [{:k2 v]} ...} ...] . is there a succinct way to update every k2 ?
01:33BRODUSlike this i mean [{:k1 [{:k2 v} ...]} ...]
01:33jeayeWhere are the other k2s?
01:33jeayeAll in that one vector under :k1?
01:34BRODUSeach element in each vector have the same keys
01:34jeayegot it
01:34jeayeI'd use map and update-in, I think.
01:38jeaye,(let [m [{:k1 [{:k2 42}]} {:k1 [{:k2 77}]}]] (map #(update % :k1 (fn [_] [{:k2 :meow}]))))
01:38clojurebot#object[clojure.core$map$fn__4537 0x1bfa7223 "clojure.core$map$fn__4537@1bfa7223"]
01:39jeayegah
01:39jeaye,(let [m [{:k1 [{:k2 42}]} {:k1 [{:k2 77}]}]] (map #(update % :k1 (fn [_] [{:k2 :meow}])) m))
01:39clojurebot({:k1 [{:k2 :meow}]} {:k1 [{:k2 :meow}]})
01:40jeayeBRODUS: ^ given each k2, run a function on it to update it to :meow
01:40jeayeIs that what you're looking for?
01:40BRODUShmmm
01:41jeayeOf course, the function could do anything with the value.
01:42jeaye,(let [m [{:k1 [{:k2 42}]} {:k1 [{:k2 77}]}]] (map #(update % :k1 (fn [v] [{:k2 (* 2 (:k2 (first v)))}])) m))
01:42clojurebot({:k1 [{:k2 84}]} {:k1 [{:k2 154}]})
01:42jeayeDoubles each value, for example.
01:43BRODUStheres more than 1 element k1's collection
01:43BRODUSsorry, should have made that clearer
01:43jeayeAnd you only want to mess with the k2s, right?
01:43BRODUSright
01:44BRODUSi was thinking there would be a more succinct way than map and update, theres still lots of core functions i don't know
01:45jeayesame
01:46jeayeBRODUS: Well, if you don't want to toy with update, which is your best bet, I think, there's always https://github.com/nathanmarz/specter
01:46jeayeThough I've found its documentation to be hit-and-miss.
01:46BRODUSnice
01:49jeayeBRODUS: If you know the index of the k2s, you can do this:
01:49domgetterBRODUS: There aren't very many succinct ways to dig into nested data structures in Clojure. That's why the author of Spectre made that tool
01:49jeaye,(let [m [{:k1 [{:k2 42}]} {:k1 [{:k2 77}]}]] (map #(update-in % [:k1 0 :k2] (fn [_] :meow)) m))
01:50clojurebot({:k1 [{:k2 :meow}]} {:k1 [{:k2 :meow}]})
01:50jeayeBRODUS: The above will dig into :k1, then the zeroth element, then pull out :k2. You may be able to change 0 into some logic for that entry to get the right index.
01:50jeayeAssuming you're looking to just use core functions.
01:51BRODUSthanks for the help, i'll try it out when i get home
01:51jeayedomgetter: It's one of my biggest gripes with clojure. Unfortunately, specter hasn't been very approachable.
02:02jmibanezI'm migrating a system to Clojure; one of the bits I have to port is the domain model (and the entities for it). Our domain model has some entities which use single table inheritance. I've been looking at sqlkorma, and there doesn't seem to be any explicit support for single table inheritance (or inheritance for that matter). What's the best way to support this?
02:02jmibanez(Or at least, what alternatives are there to sqlkorma that have some support for single table inheritance?)
02:04domgetterjmibanez: https://github.com/razum2um/awesome-clojure#orm-and-sql-generation
02:05jmibanezdomgetter: Awesome, thanks
02:05jmibanez(pun intended)
02:07jmibanezHmm... sqlkorma seems to be my best bet for what I need... reading more docs now
02:09domgetterI'm surprised I've never heard of anyone try to do ORM from the other side. That is, have some sort of object model in SQL to interact with an OO language.
02:10jmibanezdomgetter: very difficult if you're coming from SQL. ORMs are a bit of a hack IMHO, but sort of necessary
02:17domgetteralso, it doesn't make sense from a dependency perspective. A database doesn't depend on a webapp, but the webapp depends on the database.
03:12visofhi guys
03:13visofis there anybody using imagez or anything similiar?
03:13visofall what i want to do is to iterate over pixels of the image?
03:39TEttingervisof: in real time, when serving an image, what's the context?
03:42visofTEttinger: just get the pixels of the image to binarize the image, i'm doing this as example for learning
03:43visofTEttinger: so the ultimate goal isn't binarization but howto deal with the image
03:43TEttingerah ok
03:43TEttingerjava2d isn't that bad, surprisingly
03:43visofi found imagez use get-pixels and return array for it
03:43TEttingerI haven't used imagez
03:43visofarray of ints
03:43visofTEttinger: what did you use?
03:43TEttingermore likely it's returning an array of bytes
03:44TEttingerI'd be kinda surprised if it was ints, though I guess I could see it
03:44visofyeah but how can i use it, i suppose it should be 2D array
03:44TEttingerno
03:45visofTEttinger: how can the pixels aligened in 1D array?
03:45visofthe image is 2D array
03:45TEttingertypically the internal representation of pixels in a lot of image formats is a 1D array of bytes, where a single row is a fixed length
03:45TEttingerso you might have a 10x10 image, that uses 400 bytes in a 1D array
03:46TEttingerevery 4 bytes are red, green, blue, alpha. then that repeats
03:46TEttingerso the first 40 bytes are the first row
03:47TEttingerthis is a common trick in a lot of heavily optimized array-based code, since in Java and lots of other languages, a 2D array stores an array per row, and then one more array for all the rows
03:47TEttingerthat uses more memory, or for file formats, wastes space
03:47domgettervisof: it's generally "faster" to represent images as single array of integers and then when you actually put it on the screen, check how "wide" the image is, and then wrap around and keep putting pixels on the screen
03:47TEttingeryep
03:48TEttingerimages are pretty much always rectangular, so it works
03:48domgetterSo when doing low-level graphics you have to constantly keep two versions of the image in your head. The long list of integers, and the pixels those integers represent when they're put on the screen.
03:48visofdomgetter: TEttinger i found the values as negatives
03:49domgettervisof: what's the file format
03:49visof(doseq [i pixels)] (prn i))
03:49TEttingeralso how big or small are the values
03:49visofi'm doing this
03:49TEttinger-128 to 127 probably?
03:49TEttingeror is there anything in the many-thousands range
03:50domgettervisof: depending on the format of the image, it uses different integers to represent colors
03:50domgetteralso, it may be using all kinds of compression, so you can't just look at the raw data
03:51domgetterComputerphile on Youtube has a great set of videos explaining how JPEG works. Here's one: https://www.youtube.com/watch?v=n_uNPbdenRs
03:52domgetterDon't be discouraged by the complexity, though. JPEG is designed to solve a certain problem. "raw" image formats don't do anything tricky to the pixel integers
03:52TEttingeryou may be dealing with a byte array, and bytes almost always represent 0-255 in most formats. Java in its infinite "wisdom" does not allow that, and all bytes go from -128 minimum to 127 max. you can easily turn negative numbers into the correct versions (and leave already correct numbers unchanged) with
03:52TEttinger,(bit-and -128 255)
03:52clojurebot128
03:52TEttinger,(bit-and -1 255)
03:52clojurebot255
03:52TEttinger,(bit-and 1 255)
03:52clojurebot1
03:53TEttinger,(bit-and 127 255)
03:53clojurebot127
03:53TEttingerif you are dealing with file formats, you shouldn't be at an early step in learning a programming language
03:53TEttingerthere's probably a simpler way
03:54visofTEttinger: domgetter part of the pixels https://www.refheap.com/113183
03:54visofdomgetter: i have tried gif and jpg
03:54domgettervisof: Yea jpeg isn't going to be intelligible
03:54TEttinger,(Long/toHexString -14803426
03:54clojurebot#<RuntimeException java.lang.RuntimeException: EOF while reading>
03:55TEttinger,(Long/toHexString -14803426)
03:55clojurebot"ffffffffff1e1e1e"
03:55TEttingerthat's interesting
03:55domgetterIt's using compression to save the bytes in a tricky way
03:55TEttinger,(Integer/toHexString -14803426)
03:55clojurebot"ff1e1e1e"
03:55TEttingera ha!
03:55TEttingeryeah it isn't compressing at all, domgetter
03:55TEttingerthat's either ARGB or ABGR
03:55domgetteroh I guess you're right
03:56domgettermy money is that it's agbr and it's grey
03:56domgetteroh
03:56TEttingerI hope you're wrong
03:56TEttingerbecause gbr is going to be a new invention :)
03:56domgetternvm
03:56domgetterhaha
03:56TEttingerbut yeah, looks dark gray, fully opaque
03:57domgettervisof: the reason we can tell is that FF1E1E1E is using 2 characters for every color
03:57domgetterso FF is 255 for alpha (fully visible), 1E is 30 for R, G, and B
03:58TEttinger,[0xFF 0x1E 0x1E 0x1E]
03:58domgetterjust like in css it's 0-255
03:58clojurebot[255 30 30 30]
04:00TEttingerI've started to really enjoy working on compression and related stuff. I took great pleasure in the fact that some choices I made allowed 8.5 GB of mostly images (not including OS overhead for 2.4 million files) to compress down to 53 MB with 7-zip
04:00TEttingerless than 1% the size
04:06visofTEttinger: so each value represent 1 pixel, not as 40 bytes for the first row right?
04:06visofTEttinger: i mean in this case
04:06TEttingercorrect
04:06visofTEttinger: thanks man
04:07TEttingerit's storing alpha (transparency, 255 is opaque, 0 is clear) first.
04:07TEttingerthen either red green blue, or blur green red
04:07TEttinger*blue green red
04:07TEttingerI can't really tell without seeing an image
04:07TEttingerif you try it on an all-red image, that would tell me
04:08TEttinger(even a 1x1 pixel image of 1 red pixel)
04:41visofTEttinger: there?
04:42TEttingerhello!
04:42visofhi
04:43ded(Newb.) I'm running a ring/compojure server from within lein repl. How can I set a breakpoint in a route handler?
04:43visofwhen i apply Long/toHexString i got this https://www.refheap.com/113184
04:43visofTEttinger: so its divided into 4 bytes?
04:44TEttingeryep
04:44TEttingeralso, I think they are integers, so Long/toHexString (when you call it on a negative number) will fill an extra 8 F in there
04:45TEttingeryou may want Integer/toHexString
04:47visofTEttinger: ah that work, now i got 8
04:47TEttingercool
05:24blthow might I traverse a nested persistentarraymap, returning a nested persistentarraymep of the keys all the way down?
05:47justin_smithof the keys mapped to what?
05:48bltjustin_smith: i would just like to see the hierarchy of keys from a map
05:48bltnested map*
05:49justin_smithbut you said you wanted a map of the keys, so what are they mapped to?
05:49justin_smithI can show you how to get a nested list of the keys
05:49justin_smithbut you need to map them to something in order to have a map
05:49bltjustin_smith: that would be cool
05:49bltno requirements, just tinkering
05:51bltjustin_smith: perhaps a map isn't the best way to represent it anyhow
05:53bltjustin_smith: i sort of suck at thinking about traversing trees, collecting data from nodes, and building up other representations. grrr
05:53justin_smith,(->> {:a {:b 0} :c {:d {:e 1}}} (tree-seq coll? seq) (filter map?) (mapcat keys))
05:53clojurebot(:a :c :b :d :e)
05:53justin_smithmaybe that isn't what you want though
05:57bltjustin_smith: i imagined there would be a way to maintain the hierarchy of the keys.
05:57justin_smithI'm sure there is
05:57bltperhaps returning a list of paths to every key would work though
05:58justin_smithoh, that's one of the 4clojure problems...
05:59bltjustin_smith: cool, i'll dig around on it. i'll drop a line if i come up w/ anything
05:59bltthanks for the tree-seq sample. that's neat
06:00justin_smithI'm looking for it now - I know I solved it but don't have it handy
06:01justin_smithblt: http://www.4clojure.com/problem/146
06:08bltjustin_smith: thanks for grabbing that. i'm looking it over now
06:08justin_smith,(#(into {} (map (fn [where] [where (get-in % where)]) (mapcat (fn [k] (map (fn [k'] [k k']) (keys (get % k)))) (keys %)))) '{m {1 [a b c] 3 nil}})
06:08clojurebot{[m 1] [a b c], [m 3] nil}
06:08justin_smiththat solution works for the examples, but blows up for some other hash-maps I fed it, so it is imperfect
06:08justin_smithit's actually not great code, it could be improved
06:10justin_smithlooks like it only works for nestings two deep :( - I need to fix that
06:56anti-freezeHi everyone, how would one modify a core.async channel so that every time a take is made, the value is passed through a function?
06:57BRODUSanti-freeze, why can't you just apply the function on the output of the take?
06:58BRODUS(f (<! channel))
06:58anti-freezeBRODUS: Thanks. I'm just having some difficulty figuring out how to architect core.async stuff in clojurescript, where blocking is a no no
06:59BRODUSanti-freeze: NP, if you've got an hour to spare I would watch this video, https://www.youtube.com/watch?v=VrmfuuHW_6w
06:59BRODUSits a great run through of core async
07:00BRODUSand in clojurescript you would be using go blocks since there are no threads to block
07:01anti-freezeBRODUS: Oh thanks! I've already watched the one by Rich Hickey and the one by the guy that wrote the go macro, but I still have difficulty understanding how I would pipe a whole bunch of go blocks in to something I could use.
07:03BRODUSif you skip to ~25:40 in that video it shows the ways you can connect channels together
07:04anti-freezeBRODUS: Nice, I'll watch the whole thing now. My unfamiliarity with core.async basically the only thing holding me back from finishing this app quickly.
07:04BRODUSare you using Om?
07:06troydmguys can anyone explain me why the code that I'm trying to profile when used with time like this: (time (myfunc)) says it runs in 0.8131313 msecs but actually takes roughtly 10 seconds to run?
07:07anti-freezeBRODUS: reagent, using it has actually been the easiest part. I just expose an interface that returns a channel with USB devices and then when that channel is processed, I update a reagent atom and then everything just works. Its the only part where something in a go block modifies shared state
07:07troydmis time measuring actual time and not CPU time right?
07:10BRODUSanti-freeze: cool. how do you get device information through the browser?
07:12anti-freezeBRODUS: I'm using electron on node, so it's just a simple (js/require "usb"). I'm using this USB library (https://github.com/nonolith/node-usb) and a macro to convert JS callbacks in to async channels (https://github.com/gilbertw1/cljs-asynchronize).
07:23tekacsquestion: is 13s with no profiles.clj a 'normal' startup time for 'lein repl'?
07:26tekacs(I'm aware it's supposed to be 'slow', but I'm just checking to get a ballpark, since figures I've seen were more like 2-3s)
07:31troydmdnolen: I think I've found the root cause of slow down issue related to http://dev.clojure.org/jira/browse/LOGIC-177 but I need you also to look at the code just to be sure I'm on correct train of thoughts
07:38TEttinger,(let[L #(if(< % 0)%2 %3)rh #(mod % 1.0)rl(comp double int)mix(fn[S C](let[R #(int(mod % 2.0))](fn[x y](*(L y -1 1)(+(L x 0.5 0)((nth(iterate (fn[[v m a b]](let[X(C(S a 0.5))Y(C(S b 0.5))][(+(S(bit-or(*(R a)2)(R b))m)v)(* m 4)X Y]))[0 1.0(Math/abs x)(Math/abs y)])32)0))))))morty #(*(+((mix * identity)% %2)((mix / identity)% %2))0.5)] (morty 1.5 -1.5))
07:38clojurebot-3.375
08:09visofhi guys
08:09visofis there anybody use clojure + openbsd?
08:42dnolentroydm: that's how it's supposed to work - that issue doesn't have any new information yet
08:55troydmdnolen: I've added a comment on the JIRA
08:56dnolentroydm: the comment doesn't tell me anyting at all
08:56dnolenthere's no explanation of what the perceived issue is to be
08:56dnolenzero analysis
08:57troydmdnolen: sorry, well it's recursive call of walk-term both from walk* and walk-term itself
08:57dnolentroydm: that also doesn't tell me anything
08:57dnolenrecursive walk is fine if you'
08:57dnolenre not visiting the same node
08:58troydmdnolen: that's the problem, it's visiting child nodes multiple times
08:58dnolentroydm: so explain how you believe it is
08:58dnolenthere's no explanation of the issue in the comments
08:59dnolenassume I haven't look at this code in a while :)
09:00troydmdnolen: walk* is if the tree-term is found which calls walk-term again however, walk-term is called outside of it
09:00dnolentroydm: not here - please do this in the comments now
09:00troydmdnolen: ohh okey
09:01dnolenthanks
09:06visof,(apply merge-with conj [{:hello [1]} {:hello [2]}]
09:06clojurebot#<RuntimeException java.lang.RuntimeException: EOF while reading>
09:06visof,(apply merge-with conj [{:hello [1]} {:hello [2]}
09:06clojurebot#<RuntimeException java.lang.RuntimeException: EOF while reading>
09:06visof,(apply merge-with conj [{:hello [1]} {:hello [2]})
09:06clojurebot#<RuntimeException java.lang.RuntimeException: Unmatched delimiter: )>
09:07visof,(apply merge-with conj [{:hello [1]} {:hello [2]}])
09:07clojurebot{:hello [1 [2]]}
09:07visof,(apply merge-with (comp conj flatten) [{:hello [1]} {:hello [2]}])
09:07clojurebot#error {\n :cause "Wrong number of args (2) passed to: core/flatten"\n :via\n [{:type clojure.lang.ArityException\n :message "Wrong number of args (2) passed to: core/flatten"\n :at [clojure.lang.AFn throwArity "AFn.java" 429]}]\n :trace\n [[clojure.lang.AFn throwArity "AFn.java" 429]\n [clojure.lang.AFn invoke "AFn.java" 36]\n [clojure.core$comp$fn__4483 invoke "core.clj" 2442]\n [clojure....
09:07visof,(apply merge-with (comp flatten conj) [{:hello [1]} {:hello [2]}])
09:07clojurebot{:hello (1 2)}
09:08visof,(apply merge-with (comp flatten conj (partial into [])) [{:hello 1} {:hello 2}])
09:08clojurebot#error {\n :cause "java.lang.Long cannot be cast to clojure.lang.IFn"\n :via\n [{:type java.lang.ClassCastException\n :message "java.lang.Long cannot be cast to clojure.lang.IFn"\n :at [clojure.core$transduce invokeStatic "core.clj" 6575]}]\n :trace\n [[clojure.core$transduce invokeStatic "core.clj" 6575]\n [clojure.core$into invokeStatic "core.clj" 6591]\n [clojure.core$into invoke "core.cl...
09:09troydmdnolen: okey I've edited the comment, not sure if I'm correct in explaining it but it's easier understood if u put println call at the start of walk* function and try calling it yourself
09:11visof,(apply merge-with (comp flatten conj (partial conj [])) [{:hello 1} {:hello 2}])
09:11clojurebot{:hello (1 2)}
09:12dnolentroydm: thanks, already looks more informative :) I will take a deeper look when I have time
09:12troydmdnolen: sure np
09:15augustlseems I broke mori.hash.. https://gist.github.com/augustl/828ec7ce730610054f3b
09:16augustlthe 2nd conj and subsequent conjs on the value returned from mori.remove changes the value but does not change the hash code
09:17augustlany mori or cljs users around that has seen similar behaviour?
09:18pvinishello. i have a lazy seq, and i want to see if it has more than 5 items, should i do count? or should i try to not realize the whole thing if there are 5 items already?
09:18pvinisalso, how would i do that? with take?
09:19ridcully,(count (take 5 (range)))
09:19clojurebot5
09:19ridcully,(count (take 5 (range 2)))
09:19clojurebot2
09:19BRODUS,(count (take 6 [1 2 3 4 5]))
09:19clojurebot5
09:20pvinisaha. so just put a take before the count then?
09:20augustlperhaps I should try to build mori myself, no release has been made in npm after this commit https://github.com/swannodette/mori/commit/46c9194b3c4bc93fc4b402925b9417add3b0a3ba
09:20pvinisthat makes sense..
09:20pvinisthanks
09:38TimMcaugustl: Wow, that's pretty bad.
09:41TimMcaugustl: What happens if you conj 5 instead?
09:41TimMc(Is it possible you just lucked out?)
09:57augustlTimMc: ah, I'll check :)
10:00augustlTimMc: unfortunately not https://gist.github.com/augustl/7701d965c6e2f7484d69
10:00TimMcOK, so not a cool party trick then.
10:00augustlwould have been neat :)
10:01augustlt-shirt idea: I used a value, but all I got was borked value semantics
10:03augustlmy fancy React based gui suddenly stopped updating when my state changed :)
10:05augustlIt seems that mori.hash doesn't compute anything, it just reads a property on the mori object
10:05augustlso my prime suspect is cache invalidation :)
10:47TimMcfun
11:12sm0keHi any boot users here?
11:12sm0keI recently updated to boot 2.5.x and hell broke lose
11:13sm0keany hints on how to use the `target` task?
11:58engblomCould someone find out why the clj-gpio library does not work as unprivileged user. I am not skilled enough to understand everything in the code. Using "spit" and "slurp" I sucessfully manipulate the GPIO as an unprivileged user, so the clj-gpio should not have any problem either
11:59engblom(spit "/sys/class/gpio/export" "4") (spit "/sys/class/gpio/gpio4/direction" "out") (spit "/sys/class/gpio/gpio4/value" "1") <---- These 3 lines successfully puts the led to shine.
12:00engblomI am not able to do it with help of the library
12:21TimMcengblom: If you poke around in the code, does it just try to write to file the same way you are?
12:21TimMcand what is the failure mode?
12:22engblom(def port (open-port 4))
12:22engblomCompilerException java.io.FileNotFoundException: /sys/class/gpio/gpio4/value (Permission denied), compiling:(form-init7914451877660249273.clj:1:11)
12:23justin_smithyeah, only root can use a port number that low
12:23justin_smithoh wait, that's gpio? never mind
12:23engblomjustin_smith: it is about GPIO port numper
12:23engblomnumber*
12:23TimMcmumble mumble file type and what flags are used for opening it
12:24engblomTimMc: https://github.com/peterschwarz/clj-gpio/blob/master/src/main/clojure/gpio/core.clj
12:24engblomTimMc: There you find the open-port function
12:25TimMcIt's opening a RandomAccess file, that's my guess as to the issue.
12:25engblomTimMc: It is opened as rw according to the source
12:26TimMcI don't know *why* it would be the problem, since I don't know enough about unix file handles and such, but that's where I'd start poking around.
12:26engblomI do not even know why RandomAccessFile is used at all in this library.
12:27engblomThe file is anyway only one byte, with either 1 or 0.
12:27justin_smithI wouldn't expect opening a device file random access to make any sense
12:28justin_smithyou read from it or write to it, keeping it open randomaccess feels weird
12:29engblomIf this library would work as it is supposed to do, I would use it in the school where I am teaching. The school has been ordering 10 raspberry pi
12:30engblomIt looks like I will have to drop the idea of using Clojure together with the raspberry pi
12:31justin_smithwhat about just a slurp/spit to the device file instead of opening random access?
12:32engblomjustin_smith: That library had a event listener. With it I would be able to wait for a gpio-button press without busy looping
12:32engblomjustin_smith: That is the feature I was hoping for to use
13:12TimMcengblom: Might be worth forking the library.
13:14banjiewenIs there any way to make a deftype's fields private without making them mutable?
13:17justin_smithbanjiewen: not that I know of, but you could make a constructor function that closes over whatever data you like.
13:18justin_smithbut I guess that wouldn't be visible to the methods in the type, so never mind
13:18banjiewenThanks, no worries.
13:19justin_smithbanjiewen: while I realize there is more nuance than this, the general idea with clojure is often that immutable data doesn't need to be hidden.
13:19justin_smithif you need something that contradicts that, you'll likely need to do something by hand (eg. gen-class), the clojure conveniences won't help much
13:20tdammershiding stuff at the module level should be enough usually
13:20tdammers(in terms of encapsulating complexity locally, that is)
13:20justin_smithit's kind of a difference between lisp culture and java culture, where clojure goes a bit more to the lisp side
13:23banjiewenWell, this case is mostly a style concern - I'm implementing a Java interface that defines getters with names matching the "expected" field names
13:24banjiewenDoesn't seem to be a way to avoid just changing the field name with deftype, unfortunately
13:24justin_smithahh - so the normal way to do it would be to have private fields exposed by the getters
13:24banjiewenWell, at least to hide the implementation detail of the override, right
13:25banjiewenI'd hoped that the field access provided by deftype would cover the interface's implementation, but it turns out that it doesn't - I get `AbstractMethodError`s at runtime.
13:26justin_smithyeah, it's not magic at all
13:26banjiewenTrivially avoided by using a different name for the fields and writing the interface implementation manually, but I'd like to hide that detail.
13:26justin_smithmy temptation would be to use a field called _name that is exposed by the getName method
13:27justin_smithand since it's immutable, you know the client can't break it (without extensive effort), and it's their own obvious fault if they start using the feild
13:28banjiewenYep, that's where I'm headed
13:28justin_smithon the other hand, there is gen-class, which can have exactly the semantics you describe (which would be normal in java), but it's a bigger pain in the ass to use
13:29banjiewenThanks for the tip. Maybe down the road.
13:43engblomIf I would want to watch two files for changes (not busy waiting) and regardless of which one of those two had a change I would want the content of both, what library should I look into?
13:44justin_smithengblom: one moment - I contributed to a lib that does this via nio, but am forgetting the name, grubbing my github for it...
13:47justin_smithengblom: this lib does file watchers https://github.com/ToBeReplaced/nio.file
13:47engblomjustin_smith: Thanks!
13:50justin_smiththis is the specific function https://github.com/ToBeReplaced/nio.file/blob/master/src/org/tobereplaced/nio/file.clj#L187 - there is a function above it to make a watcher
13:50justin_smith(you would make one watcher, and register both paths to it)
13:53justin_smithsorry, the watcher arg wants a WatchService, returned by the watch-service function (it's been a while since I played with this)
13:56engblomjustin_smith: Without documentation, it seem to be too difficult for me... :/
14:00augustlCreated a leiningen repo demonstrating the mori issue from earlier today: https://github.com/augustl/cljs-issue-filter-conj-hashcode cc TimMc
14:00augustlas the README demonstrates, the issue occurs in cljs as well (obviously, I guess)
14:04TimMcAnd that's the latest released cljs, isn't it? I'd file a Jira ticket.
14:09TimMchttps://github.com/clojure/clojurescript/wiki/Reporting-Issues
14:09TimMcUrgh, why does Emacs sometimes color blocks of code red as I edit it?
14:10TimMcIt's sticky, too -- I can't cut and paste it back in without it keeping the color.
14:11justin_smithTimMc: yeah, fontification in emacs is of two varieties - overlays which disappear with copy/paste and porperties which are kept with copy/paste iirc
14:12TimMcIs there a way to ask for a recoloring?
14:12justin_smithoverlays are for transitive UI, properties are used by eg. syntax highlighting
14:12justin_smithm-x font-lock-fontify-buffer
14:12justin_smithit can be lazy about re-calculating, but that forces it
14:12augustlTimMc: http://dev.clojure.org/jira/browse/CLJS-1524 :)
14:12augustlyeah that's the latest cljs afaik
14:20justin_smithI have to say, I'm so glad I downloaded cljs.jar and figured out how to directly run cljs.jar with java and generate the js from a repl - it's good to take a peek at the man behind the curtain
14:21justin_smithand to know exactly how much your tooling is doing, as opposed to what the underlying functionality it's wrapping does, etc.
14:27TimMcjustin_smith: Thanks! I'll give that a shot next time.
14:32NewbieHello
14:33Guest14595there is any chance to learn clojure for making mud games like with dice rolling or chat with dices?
14:33Guest14595I do not have background in the coding tho. I just want to learn it rather like a hobby
14:33Guest14595and to do my game for me as part of learning. :3
14:34justin_smithGuest14595: I think clojure would be a great platform for making a mud, though it would require a bit of learning about network / socket stuff
14:35justin_smith,(defn d [count sides] (apply + (repeatedly count (inc (rand-int sides)))))
14:35clojurebot#'sandbox/d
14:36justin_smith,(d 3 6) ; 3d6
14:36Guest14595that's great. but how I can use clojure language for use? I mean. as an app, or browser stuff?
14:36clojurebot#error {\n :cause "java.lang.Long cannot be cast to clojure.lang.IFn"\n :via\n [{:type java.lang.ClassCastException\n :message "java.lang.Long cannot be cast to clojure.lang.IFn"\n :at [clojure.core$repeatedly$fn__5099 invoke "core.clj" 4924]}]\n :trace\n [[clojure.core$repeatedly$fn__5099 invoke "core.clj" 4924]\n [clojure.lang.LazySeq sval "LazySeq.java" 40]\n [clojure.lang.LazySeq seq "La...
14:36justin_smitherr
14:36justin_smith,(defn d [count sides] (apply + (repeatedly count #(inc (rand-int sides)))))
14:36clojurebot#'sandbox/d
14:36justin_smith,(d 3 6) ; 3d6
14:36clojurebot9
14:36Guest14595wow
14:37justin_smith,(zipmap [:int :dex :wis :con :str :cha] (repeatedly #(d 3 6)))
14:37clojurebot{:int 13, :dex 12, :wis 11, :con 10, :str 11, ...}
14:37pilneafter many hours of pondering at work, i've decided to stick with clojure as the basis for my near/mid (and possibly long) term development, and just enjoy learning haskell for the enlightenment it offers.
14:37Guest14595justin_smith thank you. i see you can even use stats! :D
14:37Guest14595awesome
14:37pilnethe sexy jvm libraries and.. "simpler" thought process (for me) of coding in a lisp are just too hard to walk away from
14:38justin_smithGuest14595: that sort of thing is very easy in clojure - there are still a few hard things to learn to use clojure well though :)
14:38Guest14595but still the question in my mind how to use it as a usable thing? is conjure can be like used in web-browsed, or just app as so to speak .exe? :D
14:38justin_smithpilne: yeah, clojure seems to fit my iterative way of making things (and I feel like if I were smarter I could do the haskell way...)
14:39justin_smithGuest14595: clojure is good for web apps, but it could also be the classic kind of mud server you telnet to as well
14:40justin_smithprobably, when first starting, you could just run the initial version in a terminal
14:40pilnesame (: i just don't have the time (right now) to *stop the world* and dedicate all my efforts to haskell. I had a lot of drinks one night and realized it is ok to like both LMAO
14:40newbie112Hmm... interesting.
14:40justin_smithconnect it to the network later
14:40pilneheck, i even discovered forth... and think it is way cooler than "c" for low level stuff >.<
14:41newbie112Thank you, I will just start with that free book http://www.braveclojure.com/getting-started/ - is that good for beginner? I do not have background in any coding besides script kidding in html, lol.
14:41justin_smithheh - forth is fun. also, when a haskell guy calls js or clojure untyped I'm like erm... forth is untyped, these other langs are just typed at the last minute
14:41justin_smithnewbie112: yeah, if you don't mind the silly tone, braveclojure is a decent intro
14:42justin_smithpilne: like, the difference between "that's a number not a function", and just going ahead and calling the memory location that number maps to
14:42newbie112No worries, when learning stuff I do not mind anything. You have better ones to start with?
14:42pilnetypes are not the be-all and end-all, good code comes from the programmer, not the language (unless we're talking code-monkey corporate blueprint/boilerplate stuff... the it is kinda just "procedure")
14:43pilnea really quick and fun intro is "casting spels in clojure" (no, that isn't a typo for spells)
14:43justin_smithpilne: I do sometimes miss the kind of silly stuff even the c compiler catches for me when refactoring especially, that clojure won't ever catch until runtime
14:43pilneit kinda glosses over a few things... but it gives you a feel for the language
14:43justin_smithnewbie112: oh yeah, the spels in clojure one is probably right up your alley
14:44pilneand while the haskell community is uber friendly and helpful, the clojure community (at least on freenode) seems to be a lot more... jovial
14:44pilneand i'm a fuggin goofball
14:44newbie112justin_smith sorry for bothering, you mean that one ? http://www.lisperati.com/clojure-spels/casting.html
14:45pilneyeup (: it is a clojure-ized version of a classic by Mr. Barski
14:46justin_smithyup - smart suggestion on that one pilne I forgot
14:46justin_smithnewbie112: that one ends up being like a single person mud as you work on it
14:46pilnenp, it was probably the most enjoyable tutorial i ever did regardless of the language
14:46pilneso it kinda sticks out in my mind (like an arrow to the knee?)
14:47justin_smithpilne: someone should really make some of this stuff more idiomatic for clojure
14:47justin_smithlike - calling hash-map and using symbols as keys? wow
14:47justin_smithhaha
14:48newbie112wow
14:48pilnequick and dirty lol
14:48newbie112its really funny way to learn stuff
14:48pilnelike my ex girlfriend
14:49pilneat least he admits where he isn't being idiomatic
14:49pilneplus, he's making it all "type into the repl" so that probably effected his choices
14:50justin_smithsure, but (hash-map 'foo "a" 'bar "b") as opposed to {:foo "a" :bar "b"}
14:50pilneyeah... i cringed a bit, maybe it was targeted at an earlier version of clojure originally? i only started at 1.7 myself
14:51justin_smithpilne: I think the whole symbols thing is required - maybe '{foo "a" bar "b"} would be the best translation
14:51justin_smithdoesn't break the other code - I don't think this is a clojure version issue at all, we've had hash-map literals for ages.
14:53pilnemaybe that is more of an idiomatic CL way to do it... and since that's his original love??? idk, maybe i'll email him >.< just for poops and laugs
14:53pilnelaughs*
14:54justin_smithyeah, it's probably just a least-effort direct translation from CL
14:54justin_smiththat's what it looks like
14:56pilnewhat i like most about clojure, is that (in theory) i can dip into say kotlin or scala as a "include" if they can do something in an easier/better way (: (kotlin because it claims 100% compatibility with java, and... straight up java rustles my jimmies)
14:57justin_smithpilne: scala is weird - it's easy to go back and forth with frege but it's pretty much one way scala calling clojure if you want to use them together
14:57pilnehmmm, noted
14:57justin_smithalso frege has the cool things from scala :P
14:58justin_smithpilne: scala adds weird abstractions outside of what the jvm defines (where clojure works very hard to be vanilla jvm compatible in comparison)
14:59pilneahhh, so... not to sound too... silly, scala is kinda jvm++ whereas clojure tries to be jvm
14:59justin_smithyou can easily use clojure from java, java from clojure; with scala it's only use java from scala, use clojure from scala, the other direction isn't really feasible
14:59clojurebotCool story bro.
14:59pilneso since kotlin is 100% java interop either direction, it *should* work in place of java (in theory)
15:00justin_smithpilne: yeah, something like that. They add abstractions that aren't made accessible from outside scala itself, and they add restrictions that are hard to work with from outside their lang.
15:00pilnevery good to know, ty (:
15:00justin_smithpilne: yeah, if java->kotlin and kotlin->java are both easy, clojure->kotlin kotlin->clojure should both be easy as well
15:01pilnehrm
15:01pilnefrege is at jdk9
15:01pilnelooks like daddy needs to find a ppa
15:01justin_smithalso if you've been playing with haskell and have scala on the radar, definitely check out frege
15:01justin_smithhaha
15:01justin_smithreally, frege needs 9?
15:01pilnesays "should run" digging for a minimum requirement
15:02justin_smithpilne: they generate byte code iirc, so they should be very explicit about what minimum version they target (and I would be super surprised if it was 9)
15:03pilneahhh, there was a problem with jdk9 if it was detected as the only environment
15:04justin_smithlooks like it supports 1.7 ?
15:04pilne7 is the minimum
15:04justin_smithconfirmed!
15:05pilnealthough this probably means i need to get purescript for my javascript side of things *grumbles about the gf and her webapps
15:05justin_smithheh
15:07pilneshe's a frickin artistic genius, and has a lot of good ideas, but since i "like" coding it is something "we can do together honey" >.< a wise man (my father) once told me "happy wife, happy life" and since she'd be my wife if we lived in a common-law marriage state...
15:11pilnei did however put my foot down at 1) owning an apple computer and 2) paying for the priviledge of deploying to iOS until we can actually see some decent monetary income from these projects she has
15:11pilnethe couch was pretty comfy that week
16:17tolstoyKotlin. Interesting. Does it seem to be going places?
16:19tolstoyDefault to immutability?
16:19tolstoyLooks reasonably clean.
16:36justin_smithtolstoy: I don't think it defaults to immutability anywhere, it's just an attempt to be a less boiler-plate java on the jvm
16:36pilneboiler-plate, the TPS reports of programming >.<
16:40pilnewhy are the "heavyweight" IDEs so popular in the java world?
16:41justin_smithinstead of making a less clumsy language, they try to make the editor do the tedious stuff automatically
16:41tolstoyPilne: because there are just so many files. Every little concept is yet another file and the IDE's are pretty good at managing that.
16:41tdammersactually the language is kind of designed with an IDE in mind
16:41tdammersverbose syntax, because the IDE takes care of most of the typing for you anyway
16:42justin_smiththere is an equal and opposite problem in the haskell world - people think that any tooling is a symptom of a defect in the language, so there isn't a really strong IDE
16:42tolstoyThe root of all evil are huge code bases, but that's a minority opinion, I guess. If your app needs and IDE, it's too big. ;)
16:42tdammersefforts are being made, but I believe the reason why no strong IDE exists is because nobody finds the lack of one painful enough
16:43pilnemeh, i've *never* had a good experience with eclipse, intellij, or netbeans
16:43tolstoyDo you work on 10-year cash-cow legacy apps?
16:44pilnemoi? no, i work on my own crap-tastic code (or tutorials) 100% of the time (so far)
16:44tolstoyI've worked with people who do amazing things with Intellij digging around ancient code bases.
16:44tdammersthe situation in Haskell is that while a good IDE would make the situation better, everyone who is capable of writing one has a much easier and cheaper way at hand for solving their immediate problems
16:44tolstoyLike digging through the levels of Troy.
16:45tdammerswhy write an IDE when you can write a library
16:45tdammers(likewise, why maintain a code snippets database in your IDE when you have macros built right into the language)
16:46tolstoyAn IDE is partly about the language, but it's also all that other stuff, like a database inspector, test runner, build machine integrationer, Jira ticket whateverer and Agile Scrum burner downer.
16:46visofhi guys
16:46tolstoySome people really like that kind of thing.
16:47visof,(apply merge-with (partial conj []) [{:hello 1} {:hello 3} {:hello 4}])))
16:47clojurebot{:hello [[1 3] 4]}
16:47visof,(apply merge-with (comp flatten (partial conj [])) [{:hello 1} {:hello 3} {:hello 4}])))
16:47clojurebot{:hello (1 3 4)}
16:47visofwhen i apply the last expression to very big list i got stackoverflow
16:47visofis there an efficient alternative to do the same?
16:48tdammerswell, at least in the Windows world, IDEs often make up for the lack of modularity and composability in the OS itself
16:48visofi guess the problem in comp
16:49tolstoyI used to say that Linux made a pretty good IDE and a pretty good App Server.
16:50allenj12do i need a macro for this http://pastebin.com/G8eEpKrS? or is there a function out there im missing?
16:52visofallenj12: get-in https://clojuredocs.org/clojure.core/get-in
16:52justin_smith(let [in [{:hello 1} {:hello 3} {:hello 4}] ks (distinct (mapcat keys in)) init (zipmap ks (repeat []))] (apply merge-with conj init in))
16:52allenj12visof: oh thank you!
16:52justin_smith,(let [in [{:hello 1} {:hello 3} {:hello 4}] ks (distinct (mapcat keys in)) init (zipmap ks (repeat []))] (apply merge-with conj init in)) ; visof
16:52clojurebot{:hello [1 3 4]}
16:54visofjustin_smith: do you think it's efficient than (apply merge-with (comp flatten (partial conj [])) [{:hello 1} {:hello 3} {:hello 4}]))) ?
16:54visofjustin_smith: also do you know why i got this stackOverFlow error?
16:54justin_smithvisof: yes, and unlike flatten it is well behaved
16:54justin_smithvisof: because flatten sucks
16:54visof,(time (apply merge-with (comp flatten (partial conj [])) [{:hello 1} {:hello 3} {:hello 4}]))))
16:54clojurebot"Elapsed time: 0.293985 msecs"\n{:hello (1 3 4)}
16:55visof,(time (let [in [{:hello 1} {:hello 3} {:hello 4}] ks (distinct (mapcat keys in)) init (zipmap ks (repeat []))] (apply merge-with conj init in))
16:55clojurebot#<RuntimeException java.lang.RuntimeException: EOF while reading>
16:55visof,(time (let [in [{:hello 1} {:hello 3} {:hello 4}] ks (distinct (mapcat keys in)) init (zipmap ks (repeat []))] (apply merge-with conj init in)))
16:55clojurebot"Elapsed time: 0.39815 msecs"\n{:hello [1 3 4]}
16:55justin_smithvisof: also, unlike the flatten version, you don't need conditionals on all your other code to figure out if the values were put in a collection or not
16:55ridcully,(time (apply merge-with #(conj (if (vector? %1) %1 [%1]) %2) [{:hello 1} {:hello 3} {:hello 4}]))
16:55clojurebot"Elapsed time: 0.245 msecs"\n{:hello [1 3 4]}
16:56justin_smithridcully: what I don't like about that is that spawns a whole bunch of if checks, seeing if you have combined values or not for a given key
16:56ridcullyyeay it feels very clumsy
16:56amalloyalso it doesn't work if you want your map to store vectors
16:56justin_smithif you plan on ever using the return value that is
16:56ridcullyat least it's flatten-less
16:56justin_smithamalloy: excellent point
16:57amalloyjust like (apply merge (for [m ms, [k v] m] {k [v]}))
16:57justin_smith,(let [in [{:hello [1]} {:hello [3]} {:hello [4]}] ks (distinct (mapcat keys in)) init (zipmap ks (repeat []))] (apply merge-with conj init in)) ; other versions break here
16:57clojurebot{:hello [[1] [3] [4]]}
16:57amalloyer
16:57amalloyapply merge-with conj, of course
16:57justin_smithamalloy: nice
16:58amalloyinto
16:58amalloynot conj. jeez
16:58amalloyjustin_smith: it's kinda a classic
16:58amalloyi'm just too scatter-brained right now to remember it correctly all at once apparently :P
16:59justin_smith,(apply merge-with into (for [m [{:hello 1} {:hello 3} {:hello 4}] [k v] m] {k [v]}))
16:59clojurebot{:hello [1 3 4]}
16:59justin_smithamalloy: I think into is the right answer, and that's awesome I hope I remember it next time I need it
17:01justin_smithvisof: amalloy 's answer is the right one
17:01justin_smith,(time (apply merge-with into (for [m [{:hello 1} {:hello 3} {:hello 4}] [k v] m] {k [v]})))
17:01clojurebot"Elapsed time: 0.837625 msecs"\n{:hello [1 3 4]}
17:01amalloymy christmas gift to you, justin_smith
17:01justin_smithaww, shucks
17:05pilnehrm, maybe i'll give intellij another shot.... seems like it is the only ide out there that can support clojure/kotlin/frege (and of course java, scala, and ceylon (scala and ceylon being things i want to "understand" if not use).
17:06tolstoyThere's always Emacs. ;)
17:07pilneif i were to go the emacs way, i'd be hard pressed not to use "spacemacs" :p
18:13allenj12how do you type hint for vectors?
18:14allenj12^Vector does not work but ^String does which i find weird
18:14justin_smithallenj12: clojure.lang is not in scope by default
18:15justin_smith,(defn v [^clojure.lang.Vector x] x)
18:15clojurebot#error {\n :cause "clojure.lang.Vector"\n :via\n [{:type clojure.lang.Compiler$CompilerException\n :message "java.lang.ClassNotFoundException: clojure.lang.Vector, compiling:(NO_SOURCE_PATH:0:0)"\n :at [clojure.lang.Compiler analyzeSeq "Compiler.java" 6891]}\n {:type java.lang.ClassNotFoundException\n :message "clojure.lang.Vector"\n :at [java.net.URLClassLoader$1 run "URLClassLoader.java...
18:15justin_smith,(defn v [^clojure.lang.PersistentVector x] x)
18:15clojurebot#'sandbox/v
18:15justin_smithone also needs to get the class name right of course
18:17allenj12justin_smith: ah i see so ^clojure.lang.PersistantVector
18:17allenj12justin_smith: thank you
18:17justin_smithyeah, np
18:17allenj12,(defn v [^clojure.lang.PersistentVector x] x)
18:17clojurebot#'sandbox/v
18:18justin_smiththat might be less ugly if you import the class in your ns, of course
18:20supersymHow would I iterate a CopyOnWriteArrayList iterator in Clojure? (third party Java lib interop :( )
18:20supersymseq won't work on it
18:21justin_smithsupersym: have you tried iterator-seq ?
18:35devth_can a record refer to itself?
18:36TimMcOnly through shenanigans, I think.
18:36devthoh wait, i just remembered it's the 1st param to every fn O_O
18:36TimMclulz
18:36devthmust be the ipa
18:36TimMc:-)
18:37justin_smith,(defrecord Shenanigans [] Object (toString [this] (Shenanigans.)))
18:37clojurebotsandbox.Shenanigans
18:38justin_smith,(str (Shenanigans.))
18:38clojurebot#error {\n :cause "sandbox.Shenanigans cannot be cast to java.lang.String"\n :via\n [{:type java.lang.ClassCastException\n :message "sandbox.Shenanigans cannot be cast to java.lang.String"\n :at [sandbox.Shenanigans toString "NO_SOURCE_FILE" -1]}]\n :trace\n [[sandbox.Shenanigans toString "NO_SOURCE_FILE" -1]\n [clojure.core$str invokeStatic "core.clj" 529]\n [clojure.core$str invoke "core.c...
18:38justin_smithsee, that's the right error!
18:38justin_smithI should have picked a better method though
18:41justin_smith,(defrecord Shenanigans [] Object (clone [this] (Shenanigans.))) ; much tidier
18:41clojurebotsandbox.Shenanigans
18:41justin_smith,(.clone (Shenanigans.))
18:41clojurebot#sandbox.Shenanigans{}
18:41justin_smithTimMc: see, it can totally refer to itself
19:03supersymjustin_smith: nope... thanks
19:05supersymworks perfect *tips his hat*
19:05justin_smithcool
19:12{blake}OK, got a Java object (CellRangeAddressList) which implements java.util.list<CellRangeAddress>...how do I clojureize that? (Or does the template screw things up?)
19:13justin_smith{blake}: generics are a fiction that only javac believes in, they don't exist in the vm
19:13{blake}So, you're saying there is no spoon?
19:13justin_smithexactly - you can use into or vec to put it in a vector
19:14justin_smith{blake}: javac will enforce generics, just like it does checked exceptions, neither of which are enforced on the level clojure interacts with the vm
19:14{blake}justin_smith: Huh. Well, I've been trying that. Vec, into, seq...
19:15{blake}"Unable to convert: class org.apache.poi.ss.util.CellRangeAddressList to Object[]"
19:15justin_smithif it implements List it will work with into...
19:15justin_smithhmm
19:15devthjust realized i don't know whether clojure uses javac or if it has its own compiler that emits jvm bytecode. can someone enlighten me?
19:16justin_smithdevth: clojure has its own bytecode emitter
19:16{blake}For "into []" I get "Don't know how to create ISeq from: org.apache.poi.ss.util.CellRangeAddressList"
19:16justin_smithdevth: there are java files in clojure.core, and javac is used for those, of course
19:16devthjustin_smith: ok cool. are they used in separate phases?
19:16justin_smithdevth: right, the javac compiling only happens when compiling clojure.core itself from source
19:17justin_smithdevth: at runtime, clojure uses its own bytecode emitter, and doesn't use javac at all
19:17devthah. makes sense. thanks
19:17justin_smith{blake}: according to the javadoc org.apache.poi.ss.util.CellRangeAddressList does not implement List https://poi.apache.org/apidocs/org/apache/poi/ss/util/CellRangeAddressList.html
19:18TEttingerhttps://poi.apache.org/apidocs/org/apache/poi/ss/util/CellRangeAddressList.html#getCellRangeAddresses()
19:18justin_smith{blake}: that class is bad and the people who implemented it should feel bad
19:18{blake}justin_smith: Wut? Isn't that what...
19:18TEttingerindeed
19:19TEttinger{blake}: extends Object .
19:19justin_smith{blake}: read it and weep, it inherits directly from Object
19:19{blake}Oh, crap, it's the underlying, hidden _list field that implements list.
19:19TEttingeryou can get an array with https://poi.apache.org/apidocs/org/apache/poi/ss/util/CellRangeAddressList.html#getCellRangeAddresses()
19:20{blake}Which is what I was looking at and which is completely inaccessible. Y
19:20TEttingerwhich should work with into
19:20justin_smithyup, that should be the trick
19:20justin_smithone of those apis that makes you say WAT
19:20TEttinger{blake}: am I coming through OK? is there static on the line?
19:21{blake}TEttinger: Yeah! Thanks!
19:21TEttingerwoo
19:21{blake}lotta poi
19:21pilnescrew it all... just gonna use atom because it is comfortable, and use a terminal for a repl, screw these smeggin IDEs >.<
19:21{blake}in my life
19:22pilnealthough i need to hope someone will write a grammar for ceylon by the time i decide to start futzing around with it >.<
19:22justin_smithpilne: I have three terminals open for my three repls, it works nicely
19:22justin_smithpilne: why would you need a grammar?
19:23pilnefor syntax hilighting.... i feel like a blind lesbian in a fish market without it >.<
19:24justin_smithpilne: I know you are just trying to joke around but I can't help noticing how many of your jokes are about women and seem sexual in nature, and that's OK among your friends I'm sure but it's not the appropriate kind of joking for this forum.
19:24pilnei apologise and will tone it down
19:26TEttingeralternatively: I feel like I'm pitching a no-hitter on LSD; things keep happening and I don't know why
19:26TEttingerhttps://www.youtube.com/watch?v=_vUhSYLRw14
19:26justin_smithTEttinger: lol
19:26TEttingerit happened once!
19:26justin_smithTEttinger: classic story, if that link goes where I think it does
19:26TEttingeryes
19:27TEttinger"performance reducing drugs"
19:30TEttingerellis' remark about "I only saw signals, like a traffic light" reminded me of highlighting gone haywire
19:49justin_smithTEttinger: now I want to make a "word salad highlighter" that would just randomly shift colors of parts of a buffer over time
19:49justin_smithscreen saver style
19:50justin_smithperhaps forming 2d shapes that have no relation to the content of the file
19:51Bronsajustin_smith: ever tried M-x zone?
19:51justin_smithBronsa: is that the one that makes the text drip and such?
19:52Bronsayeah
19:54justin_smithnice, my buffer's dripping
19:54Bronsazone-when-idle after 1s is a fun way to mess with a coworker leaving their laptop unlocked
19:54justin_smithoh man, I'll have to remember that one
20:07pilneall i have to do to mess with my coworkers is re-arrange the bookmarks in the shared IE (ugh), or the desktop... such funzies lol
21:07TEttingerjustin_smith: already implemented in my text-based game lib. http://i.imgur.com/SEw2LXe.gifv
21:08TEttingerI really want to get to finishing this lib's latest version; once there's a non-beta I think I could write a more idiomatic clojure binding
21:13BRODUSi get that its really bad style, but is there any other reason why you shouldn't use a def within a function?
21:24TEttingerBRODUS: there are times when there's no way around it. but the problem is the defined thing is unusable until that fn is called, though "declare" can help somewhat, and there's no way to tell other than checking the name if it has the right value (from the fn executing successfully and defining your thing).
21:24TEttingerit's also more than a little confusing
21:25TEttinger"why do I need to call X before I ever do anything with Y?" "why doesn't Y have top-level documentation?"
21:31BRODUSTEttinger2: Thanks
21:35ben_vulpesBRODUS: AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
21:36BRODUS?
21:36ben_vulpesdef-in-defn
21:37ben_vulpesit's going to break important stuff like `doc' and `src'
21:40BRODUSim not doing it, i was putting a function inside a let and it raised a few questions for me
21:49pilneok, i was truly scarred working in java (1.2 or 1.3) in college, is it "not as bad" now to use it from clojure where needed (so i can abandon my search for a language to use in its place?)
21:50pilneit was j2se 1.2 or 1.3 for further clarification
21:54amalloypilne: 1.5 introduced a few big quality-of-life features. the language is still broadly the same though
21:54neoncontrailspilne: it's verrry different. I don't know about better, but the generic types are a really substantial change to the langauge
21:54neoncontrails*language
21:55pilnehrm... maybe i'll just cross my fingers and hope that between clojure and frege i won't have to use "pure" java >.< kotlin seem to be a pita unless i want to sell my soul to jetbrains/intellij >.< (too bad for them there is nothing to buy)
21:56neoncontrailspilne: I've always considered Clojure an alternate syntax for Java, rather than a stand-alone language — it helps keep my expectations low :)
21:59pilneheh (: