Skip to content

Commit

Permalink
Add a pretty/simplify macro to utils
Browse files Browse the repository at this point in the history
Also require hydiomatic.utils in bin/hydiomatic.hy, so that it will be
available on the REPL.

Signed-off-by: Gergely Nagy <algernon@madhouse-project.org>
  • Loading branch information
algernon committed Oct 11, 2015
1 parent 101f0f7 commit 7eeb70b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion bin/hydiomatic.hy
Expand Up @@ -33,7 +33,7 @@

(with [(completion)]
(setv hr (HyREPL))
(.runsource hr "(import [hydiomatic.core [*]] [hydiomatic.rules[*]])")
(.runsource hr "(import [hydiomatic.core [*]] [hydiomatic.rules [*]]) (require hydiomatic.utils)")
(.interact hr "hydiomatic")))

(defn process-file [transform printer fn rules]
Expand Down
3 changes: 3 additions & 0 deletions hydiomatic/utils.hy
Expand Up @@ -58,3 +58,6 @@
(if outermost
(list (map hypformat form))
(+ (-pprint form) "\n")))

(defmacro pretty/simplify [expr &rest args]
`(hypprint (simplify '~expr ~@args)))

0 comments on commit 7eeb70b

Please sign in to comment.