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