Skip to content
The Hy Transformer
Branch: master
Clone or download
Latest commit a53ca9d May 7, 2019
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
hydiomatic Add tests for new rules and disable old style `let/with` conversion Oct 5, 2018
tests Add tests for new rules and disable old style `let/with` conversion Oct 5, 2018
.gitignore Initial import Jan 19, 2014
.travis.yml Remove Python 3.4 and update Travis file May 7, 2019
GPL Initial import Jan 19, 2014
LGPL
NEWS.md NEWS.md: Convert to Markdown Aug 13, 2015
README.md
requirements.txt Add an explicit monaxhyd dependency Oct 5, 2015
setup.py Remove Python 3.4 and update Travis file May 7, 2019

README.md

Hydiomatic

Build Status Downloads Version

Hydiomatic is a static code analyser for Hy, that can analyse a form, and suggest a simplification, or a more idiomatic alternative.

The software is under heavy development, and has serious limitations, but it can already perform interesting transformations.

Installation

Hydiomatic depends on adderall, and can be installed the usual way with pip:

$ pip install -r requirements.txt

Usage

The library can be used either via the hydiomatic script:

$ hydiomatic -d FILENAME

or programmatically:

(import [hydiomatic.core [*]])

(simplify '(if (not (= 0 (- 1 1)))
             (do (print (+ 1 (+ 2 3)) [a b {"c" (+ a 1)}]))))
;=> (unless (zero? (dec 1))
;     (print (+ 1 2 3) [a b {"c" (inc a)}]))

For more information on what the script can do, run hydiomatic --help.

Example

Here's an example of Hydiomatic updating itself from an older Hy syntax:

$ git show 5d3c958:bin/hydiomatic.hy > old_hydiomatic.hy
$ hydiomatic -d old_hydiomatic.hy

License

All the code is licensed under the GNU Lesser General Public License (v3+).

You can’t perform that action at this time.