From babea242cc884a4d733ff09e635ec4a0d0a94e66 Mon Sep 17 00:00:00 2001 From: jlangch Date: Sat, 30 Mar 2024 10:41:13 +0100 Subject: [PATCH] improved trace module doc --- .../com/github/jlangch/venice/trace.venice | 36 +++++++++++-------- 1 file changed, 22 insertions(+), 14 deletions(-) diff --git a/src/main/resources/com/github/jlangch/venice/trace.venice b/src/main/resources/com/github/jlangch/venice/trace.venice index 6ae94abd2..83f018d36 100644 --- a/src/main/resources/com/github/jlangch/venice/trace.venice +++ b/src/main/resources/com/github/jlangch/venice/trace.venice @@ -145,21 +145,23 @@ :examples '( """ (do - (load-module :trace) + (load-module :trace ['trace :as 't]) + + (t/trace-var +) - (trace/trace-var +) (+ 1 2)) """ """ (do - (load-module :trace) + (load-module :trace ['trace :as 't]) (defn foo [x] (+ x 2)) - (defn bar [x] (foo x)) + (defn zoo [x] (foo x)) + (defn bar [x] (zoo x)) - (trace/trace-var +) - (trace/trace-var foo) - (trace/trace-var bar) + (t/trace-var +) + (t/trace-var foo) + (t/trace-var bar) (bar 5)) """ ) @@ -213,11 +215,13 @@ :examples '( """ (do + (load-module :trace ['trace :as 't]) + (-> 5 (+ 3) - trace/tee + t/tee (/ 2) - trace/tee + t/tee (- 1))) """) :see-also '( @@ -235,11 +239,13 @@ :examples '( """ (do + (load-module :trace ['trace :as 't]) + (-> 5 (+ 3) - (trace/tee-> #(println "trace:" %)) + (t/tee-> #(println "trace:" %)) (/ 2) - (trace/tee-> #(println "trace:" %)) + (t/tee-> #(println "trace:" %)) (- 1))) """) :see-also '( @@ -252,16 +258,18 @@ (defn - ^{ :arglists '( "(tee->> x f!)" ) + ^{ :arglists '( "(tee->> f! x)" ) :doc "Allows to branch off values passed through the form of a `->>` macro" :examples '( """ (do + (load-module :trace ['trace :as 't]) + (->> 5 (+ 3) - (trace/tee->> #(println "trace:" %)) + (t/tee->> #(println "trace:" %)) (/ 32) - (trace/tee->> #(println "trace:" %)) + (t/tee->> #(println "trace:" %)) (- 1))) """) :see-also '(