#clojure logs

2014-06-06

07:58clgvhmm, I want something like prismatic/plumbing for more complex calculations involving similar calculations on nested sequence of maps ^^
07:59clgvcurrently I wire together several levels of runs of functions generated with it on different collections
07:59borkdudelol, for the first time in years I wrote (130 - y) instead of (- 130 y)
08:02borkdudenumbers don't implement IFn and apply a function argument to themselves and the rest of the args? I'm disappointed now
08:02borkdude:P
08:03clgvborkdude: :P
08:03clgvborkdude: if IFn were a protocol you could fix that for java.lang.Long ;)
08:03borkdudeyeah :)
08:04clgvall numbers evaluate to themselves except 42 which evals to the universe and everything ;)
08:05borkdude:)
08:08gfredericksclgv: changelog done
08:09gfredericksborkdude: just yesterday somebody wanted numbers-as-ifn to do repeat; I don't think there's any obvious impl
08:11clgvgfredericks: :D
08:11clgvgfredericks: we were just fooling around ;)
08:12gfredericksyou should all be ashamed of yourselves!
08:12gfrederickswhat if rich came in here and saw that kind of speculation!!??!
08:13clgvgfredericks: chances of that happening are not that high concluded from my sample data over the last months ;)
08:13clgvat least not at this time ;)
08:39gfredericksclgv: I started thinking more about this locals idea
08:39gfredericksI realized you could have macros that add more locals to existing exceptions
08:40gfrederickshmm
08:40Glenjaminis this some sort of throw macro that does more work in dev builds?
08:40gfredericksactually you can't quite do that without messing with the stacktrace
08:40gfredericksGlenjamin: no just in a library
08:41clgvgfredericks: you mean adding them on the way up the callstack when they "pass through" your new macro? that was exactly my use case then ;)
08:41Glenjaminyeah, but you'd set a dynamic var or something and it does locals capture and things
08:41gfredericksclgv: yes that -- but you can't easily replace the map on an ExceptionInfo object I don't think
08:42clgvgfredericks: ah well, not to bad to create a new ExceptioInfo since that documents where these locals come from
08:42gfredericksGlenjamin: macros have access to locals without modifying clojure
08:42clgvgfredericks: I'd call it rethrow or similar
08:42Glenjaminbut you're talking about attaching to the exception object?
08:42gfredericksclgv: yeah but then you lose or at least obscure the original stacktrace
08:42gfredericksGlenjamin: sure
08:42gfredericksex-info lets you attach arbitrary anything
08:43clgvgfredericks: well you create an indirection, but you'd expect that from the source provided you know what "rethrow" does
08:43gfredericksclgv: not very good for "adding this just in case I need it" uses
08:43clgvgfredericks: that's a macro I wanted to write myself but even better if it ends up in catch-data
08:43gfredericksclgv: now if throw+ added a bit of mutability to the map...
08:44clgvgfredericks: I dont understand the problem with creating a new exceptioninfo object that gets the old as cause and as the current locals
08:45gfredericksclgv: depends on how obscured the original stacktrace is
08:46clgvgfredericks: I usually dont care about how complicated exceptions are. but then again I cheat since I have a graphical view similar to clojure's inspector that I use to view exceptions ;)
08:47gfredericksclgv: I just mean it shouldn't be any more difficult to find out where the original exception was thrown
08:47gfredericksI feel like having a length-20 cause-chain could make that difficult
08:48clgvbut you only get additional exceptions added when you use the macro...
08:48gfredericksyes
08:49clgvotherwise you need to substructure the locals meta to provide information about the call site
08:49gfredericksI guess you're thinking it would only be added during debugging?
08:49chouser_loghaving trouble with the computer that logs this channel ...will be offline for a while.
08:49clgvcurrently, this is not the case but could be added...