I took some inspiration from Tim Baldridge's code-walking macro youtube
video (http://www.youtube.com/watch?v=HXfDK1OYpco) and updated print-foo's
`print-sexp` macro to intelligently expand the code it surrounds.

print.foo=> (print-sexp (str (+ 3 4) (+ 5 (* 6 2)) 4))3 34 4(+ 3 4) 75
56 62 2(* 6 2) 12(+ 5 (* 6 2)) 174 4(str (+ 3 4) (+ 5 (* 6 2)) 4)
"7174"

;; `print-sexp` replaces normal code like ->, ->>, let, cond, if, ;;
etc, where possible with print.foo versions
print.foo=> (pprint (macroexpand '(print-sexp (str (+ 3 4) (-> 5 (* 6)
(* 2)) 4))))(print.foo/print-and-return
 '(str (+ 3 4) (-> 5 (* 6) (* 2)) 4)
 " "
 (str
  (print.foo/print-and-return
   '(+ 3 4)
   " "
   (+
    (print.foo/print-and-return '3 " " 3)
    (print.foo/print-and-return '4 " " 4)))
  (print.foo/print-> 5 (* 6) (* 2))
  (print.foo/print-and-return '4 " " 4)))

As of now the latest version is 0.4.2.
https://github.com/AlexBaranosky/print-foo
https://clojars.org/print-foo

Best
Alex


On Thu, Mar 28, 2013 at 12:13 PM, Alex Baranosky <
alexander.barano...@gmail.com> wrote:

> Jim,
>
> No reason I left out loop/recur.  I just didn't get around to it.  Pull
> requests accepted.
>
>
> On Thu, Mar 28, 2013 at 12:07 PM, Alex Baranosky <
> alexander.barano...@gmail.com> wrote:
>
>> adrians,
>>
>> https://clojars.org/print-foo
>>
>> I've got to deploy it with proper signing.
>>
>>
>> On Thu, Mar 28, 2013 at 11:59 AM, adrians <nman...@gmail.com> wrote:
>>
>>> Alex, print-foo *is* the correct artifact name, no? It seemed to be
>>> pulled down fine by pomegranate.
>>>
>>>
>>> On Thursday, March 28, 2013 2:35:31 PM UTC-4, Alex Baranosky wrote:
>>>>
>>>> Let me fix the README, the library should be required like this
>>>> (:require [print.foo :refer :all])
>>>>
>>>  --
>>> --
>>> 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 group, send email to
>>> clojure+unsubscr...@googlegroups.com
>>> For more options, visit this group at
>>> http://groups.google.com/group/clojure?hl=en
>>> ---
>>> You received this message because you are subscribed to the Google
>>> Groups "Clojure" group.
>>> To unsubscribe from this group and stop receiving emails from it, send
>>> an email to clojure+unsubscr...@googlegroups.com.
>>> For more options, visit https://groups.google.com/groups/opt_out.
>>>
>>>
>>>
>>
>>
>

-- 
-- 
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 group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to