Re: Hierarchical logs

2012-02-15 Thread jweiss
custom indenting though > > > > > > > > > > On Tue, Feb 14, 2012 at 6:33 PM, jweiss wrote: > > It occurred to me that ultimately what I want is just a pretty-printed > > output that I can put on a webpage and apply syntaxhighlighter to. > > > I sho

Re: Hierarchical logs

2012-02-14 Thread jweiss
that is getting overly complex. -jeff On Feb 14, 10:14 am, jweiss wrote: > Thanks, Alan, > > The solution I used looks exactly like yours: > > (defn mktree [vz [i out?]] >   (if out? >     (-> vz (zip/append-child i) zip/up ) >     (-> vz (zip/append-chi

Re: Hierarchical logs

2012-02-14 Thread jweiss
you'd want to record multiple top-level calls; if not you > can just call first on the result). > > On Feb 11, 8:39 pm, jweiss wrote: > > > > > > > > > I've been working on a tracing library, that works much like > > clojure.contrib.trace (bas

Hierarchical logs

2012-02-11 Thread jweiss
I've been working on a tracing library, that works much like clojure.contrib.trace (based on it, actually). One sticky problem I've found is, hierarchical logs are really crappy to try to stream to a file. You can't just keep writing to the end of the file - new data needs to be inserted before

Re: clojure.contrib.prxml broken in Clojure 1.3.0

2012-01-18 Thread jweiss
doesn't need CDATA - data.xml just automatically escapes XML > special-characters if it sees them. > > On Jan 17, 4:12 pm, jweiss wrote: > > > > > > > > > By the way, the reason I stuck with prxml is its handling of CDATA, > > which as far as I know, the n

Re: clojure.contrib.prxml broken in Clojure 1.3.0

2012-01-17 Thread jweiss
By the way, the reason I stuck with prxml is its handling of CDATA, which as far as I know, the newer lib doesn't do yet. On Jan 17, 8:10 am, cassiel wrote: > This is straight from the doc string: > > (with-out-str (p/prxml [:p {:class "greet"} [:i "Ladies & > gentlemen"]])) > > Works in Clojure

Re: clojure.contrib.prxml broken in Clojure 1.3.0

2012-01-17 Thread jweiss
I fixed up clojure.contrib.prxml to work with 1.3, at least it's working fine for me. You can get the jar from clojars with [weissjeffm/clojure.prxml "1.3.0-SNAPSHOT"] source is here: https://github.com/weissjeffm/clojure.prxml On Jan 17, 8:10 am, cassiel wrote: > This is straight from the do

Re: Really loving Clooj but..

2011-12-31 Thread jweiss
I use a modified version of tools.trace (or rather the old version called clojure.contrib.trace, but works with 1.3), you might be interested in some of the additions (sorry not well doc'd at the moment): 1) Don't blow up if a function throws an exception (return value shown in the trace will be t

Re: Could be my favourite improvement in 1.4

2011-12-20 Thread jweiss
Even if they did, it's pretty easy to surround the paste with (read- json "... "). On Dec 20, 10:36 am, Alex Baranosky wrote: > For what it's worth, I think colon's as whitespace in maps adds confusion, > without, imo adding a ton of power or readability.  In terms of power, it > gives you the ab

Re: Concurrency design

2011-08-08 Thread jweiss
Ken, Thanks for your response! Those are some great suggestions. Some look quite promising, a few don't fit my purposes. For instance, I can't use pcalls because the user needs to be able to control the number of threads. Your method to skip tests using 'and' works, and is interesting, but I w

Re: Concurrency design

2011-08-08 Thread jweiss
with a "consume" fn. The "consume" fn does the binding, polls the queue and exits when a "done" flag is set. The done flag is set to true when the report finishes. Jeff On Aug 8, 12:59 pm, jweiss wrote: > I'm having some trouble figuring out what clojure con

Concurrency design

2011-08-08 Thread jweiss
I'm having some trouble figuring out what clojure concurrency tools I can use to solve my problem. The application I'm trying to build is a functional test harness, like TestNG but for clojure. It takes an input a tree of tests to run (where child tests don't run unless the parent passed), and ru

Re: Anyone on Google+ yet?

2011-07-17 Thread jweiss
This does bring up an interesting flaw in G+. If I add Clojure people who I don't know personally, how will they know to add me to a Clojure circle? G+ (rightfully) doesn't automatically tell them what circle I added them to. It doesn't appear to be optional to tell them, either. On Jul 14, 7:5

Re: Anyone on Google+ yet?

2011-07-17 Thread jweiss
http://gplus.to/weissjeffm -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this

Re: another question on macros defining functions

2011-06-04 Thread jweiss
If you are connected to a swank server, have you tried C-c C-k to compile the file you're editing? On Jun 4, 1:15 am, nil wrote: > Mark, it turns out that everything I need is known and static at hack- > time. (Sorry for making it sound otherwise) I know all the names, > values, *and* behaviors

Re: another question on macros defining functions

2011-06-03 Thread jweiss
As Ken said, you have to remember macros expand at compile time. Think of a macro call as "folded up code" that the compiler unfolds for you. A macro saves you from writing repetitive code. But if you are trying to define a function whose name isn't known until runtime, that's a whole different t

Re: macro says Can't use qualified name as parameter

2011-05-28 Thread jweiss
stify their use, IMO. Jeff On May 28, 2:04 pm, jweiss wrote: > On May 27, 1:46 pm, nil wrote: > > > > > > > > > > > I was looking > > athttp://saucelabs.com/blog/index.php/2009/12/running-your-selenium-tes... > > and in the comments, :Scott sugge

Re: macro says Can't use qualified name as parameter

2011-05-28 Thread jweiss
On May 27, 1:46 pm, nil wrote: > I was looking > athttp://saucelabs.com/blog/index.php/2009/12/running-your-selenium-tes... > and in the comments, :Scott suggested that a macro could reduce some > of the boilerplate that you see here: > > (def test-google >   { >    :name "google" >    :test (f

Re: Weening myself off of global state - what's the idiomatic way to solve this?

2011-04-14 Thread jweiss
I'd start by making functions that take arguments. For instance (defn draw-ball [ball] ...) On Apr 13, 1:22 pm, Brandon Ferguson wrote: > I'm not sure if this is the place to ask this but I've been struggling > with a few things in the world of Clojure. I've been using Processing > to learn Clo

Re: Clojure Code Highlighting in Presentations

2011-04-04 Thread jweiss
I use emacs, and there's the htmlize feature which will output highlighted code in HTML, looking the same as it does in emacs. It not only preserves highlighting in clojure code or other languages, but in *any* emacs buffer. http://fly.srk.fer.hr/~hniksic/emacs/htmlize.el.cgi On Apr 3, 8:15 pm,

Re: with-timeout... ?

2011-03-10 Thread jweiss
I wrote this macro a little while ago because I need that same construct: https://gist.github.com/701051 On Mar 9, 7:12 am, Sean Allen wrote: > Yesterday I was writing a bit of code that needs to wait for an > external event to happen but if it doesn't happen with X amount of > time, > to timeo

Re: Weird nested macro problem

2011-02-01 Thread jweiss
If I remember right from looking at clojure.contrib.condition's source (which I did because I wrote a similar error handling lib, which has a few extra features but isn't ready for prime time)... "handle" doesn't actually exist as a function or macro. It doesn't expand - the handler-case macro lo

Error handling implementation - looking for criticisms and suggestions

2010-12-17 Thread jweiss
I'd been shopping around for an error handling kit for Clojure. What I needed was: * The ability to specify error handlers at the caller's level, that are accessible all the way up the stack from them. * Ability to include more data in an error than just a message and stack trace. That data shou

Re: parameters destructuring & sets?

2010-12-05 Thread jweiss
On Dec 5, 2:10 pm, Alex Ott wrote: > Re > > jweiss  at "Sun, 5 Dec 2010 10:29:41 -0800 (PST)" wrote: >  j> I'm no expert on this, but i'll take a crack at it. > >  j> I think it's because sets don't (necessarily) impose any order

Re: parameters destructuring & sets?

2010-12-05 Thread jweiss
I'm no expert on this, but i'll take a crack at it. I think it's because sets don't (necessarily) impose any order, so there's no concept of "first" or "nth". So destructuring would essentially be assigning a random item to x, or for join, joining them in random order. I'm curious what the use c