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
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
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
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 :>
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
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
> 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
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
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
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
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
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
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
13 matches
Mail list logo