hylang/hy — pull request #255 by rwtolbert (2013-07-16 14:54:17+00:00)
Title: Add first pass at a hydoc commandline app

This adds hydoc as a new script that is a parallel to
pydoc. The main differnce is that it rewrites function
signatures to use Hy syntax instead of Python.

For example, 'pydoc hy.core.language' produces this:

FUNCTIONS
drop(count, coll)
Drop `count` elements from `coll` and return the iter

take(count, what)
Take `count` elements from `what`, or the whole set if the total
number of entries in `what` is less than `count`.

where 'hydoc hy.core.language' produces

FUNCTIONS
(drop count coll)
Drop `count` elements from `coll` and return the iter

(take count what)
Take `count` elements from `what`, or the whole set if the total
number of entries in `what` is less than `count`.

Functions with optional args get re-written like:

(foo x y &optional z=10)

Member functions get re-written something like ;:

(.bar self a b)

This also re-writes class declarations from:

class HyREPL(code.InteractiveConsole) to:

(defclass HyREPL [code.InteractiveConsole] ...

also, note for now that in the REPL (help foo) will call pydoc.
But if you (import hy.hydoc) then (help foo) will call hydoc.