Re: (pprint template) gives me an exception

2013-04-27 Thread Gary Verhaegen
Most probably, your template is a lazy seq and pprint forces its evaluation, which is why the error happens at the pprint point. On 17 April 2013 08:33, Tassilo Horn wrote: > larry google groups writes: > >> (println (pp/pprint template)) > > Aside from the original problem: pprint already pri

Re: (pprint template) gives me an exception

2013-04-16 Thread Tassilo Horn
larry google groups writes: > (println (pp/pprint template)) Aside from the original problem: pprint already prints to *out* and only returns nil, so the code above first prints template, and then the println will also print the nil returned from pprint. Bye, Tassilo -- -- You received thi

Re: (pprint template) gives me an exception

2013-04-16 Thread larry google groups
Oh, I see. I had just changed :admin-text to hold a keyword instead of text. I should have seen that sooner. But I am still confused why a keyword would cause pprint to throw an exception. And why at that point in the code, and not sooner? On Apr 16, 10:05 am, larry google groups wrote: > The

Re: (pprint template) gives me an exception

2013-04-16 Thread larry google groups
The function before the previously mentioned function is this: (defn add-public-text-to-top-banner-and-return-as-new-template [template item] (println "entering add-public-text-to-top-banner-and-return-as-new- template") (println (pp/pprint template)) (enlive/transform template [:#content :>

Re: pprint

2009-07-10 Thread Tom Faulhaber
Hey Laurent, Making this more comprehensible is part of my plan for documenting how to create dispatch. You don't really need to understand the whole XP paper to know enough to understand how pretty print works. Let me lay out a quick overview here: High-level concepts Top-level concept: the pr

Re: pprint

2009-07-09 Thread Laurent PETIT
Hi Tom, 2009/7/2 Tom Faulhaber : > > > >> Are you suggesting that "clojure reader parsed code" could be first >> translated back to String and reinjected to the "source code reader" ? >> Indeed that could simplify final implementation. I don't know what the >> impact on performance would be, thou

Re: pprint

2009-07-01 Thread Tom Faulhaber
> Are you suggesting that "clojure reader parsed code" could be first > translated back to String and reinjected to the "source code reader" ? > Indeed that could simplify final implementation. I don't know what the > impact on performance would be, though. No, that wouldn't work because the cl

Re: pprint

2009-07-01 Thread Laurent PETIT
Hi Philip, 2009/7/1 philip.hazel...@gmail.com : > > On Jul 1, 9:52 am, Laurent PETIT wrote: >> As far as IDE integration is concerned, i would not bother (at first) >> about incremental thing. I rather intend to always parse the entire >> edited file content (of course if this causes a performan

Re: pprint

2009-07-01 Thread Laurent PETIT
Hi Tom, 2009/7/1 Tom Faulhaber : > > Laurent, > > Sounds like a good plan. > > To answer your questions: > >> I'll play with your code. Do you have a first pass over the clojure >> reader to attach other meta information as you go, or do you directly >> consume the clojure data structures the rea

Re: pprint

2009-07-01 Thread philip.hazel...@gmail.com
On Jul 1, 9:52 am, Laurent PETIT wrote: > As far as IDE integration is concerned, i would not bother (at first) > about incremental thing. I rather intend to always parse the entire > edited file content (of course if this causes a performance problem, I > might rethink about it). For performance

Re: pprint

2009-07-01 Thread Tom Faulhaber
Laurent, Sounds like a good plan. To answer your questions: > I'll play with your code. Do you have a first pass over the clojure > reader to attach other meta information as you go, or do you directly > consume the clojure data structures the reader passes to you ? pprint operates on clojure

Re: pprint

2009-07-01 Thread Laurent PETIT
Hi Tom, Thanks for the answer. I already have some embryonic antlr grammar for clojure, but I'm willing to give pprint a thourough try. I'll play with your code. Do you have a first pass over the clojure reader to attach other meta information as you go, or do you directly consume the clojure da

Re: pprint

2009-06-30 Thread Tom Faulhaber
Hi Laurent, I think that pprint might be a good foundation for what you are doing, but there are a couple of issues that need to be dealt with first. First, pprint works directly on Clojure objects and not strings, so the code will need to be read first. Second, the Clojure reader is lossy - it