Commit Graph

9 Commits

Author SHA1 Message Date
Kodi Arfer
14fddbe6c3 Give require the same features as import (#1142)
Give `require` the same features as `import`

You can now do (require foo), (require [foo [a b c]]), (require [foo [*]]), and (require [foo :as bar]). The first and last forms get you macros named foo.a, foo.b, etc. or bar.a, bar.b, etc., respectively. The second form only gets the macros in the list.

Implements #1118 and perhaps partly addresses #277.

N.B. The new meaning of (require foo) will cause all existing code that uses macros to break. Simply replace these forms with (require [foo [*]]) to get your code working again.

There's a bit of a hack involved in the forms (require foo) or (require [foo :as bar]). When you call (foo.a ...) or (bar.a ...), Hy doesn't actually look inside modules. Instead, these (require ...) forms give the macros names that have periods in them, which happens to work fine with the way Hy finds and interprets macro calls.

* Make `require` syntax stricter and add tests

* Update documentation for `require`

* Documentation wording improvements

* Allow :as in `require` name lists
2016-11-03 09:35:58 +02:00
Jakukyo Friel
35de998871 Docs: Fix rst markup in docs/contrib/loop.rst. (#1098)
In RestrutruedText, double backtick quotes (instead of single
backtick quotes in markdown) are used for code span.
2016-09-22 03:33:32 +03:00
Jakub Wilk
b94211251c Use HTTPS for Wikipedia URLs 2016-09-04 22:35:46 +02:00
gilch
e8d26f1067 remove throw in favor of raise 2015-08-09 00:52:42 -06:00
Kevin Yap
8c0ac0862f Adhere to CPython's documentation guidelines
- Inline code is written using ``double backticks``
- Italicized text uses *asterisks* rather than `single backticks`
- Function parameters are italicized rather than written as inline code
2014-12-07 02:09:43 -08:00
Kevin Yap
d657e5eb2d Fixes to contributor module documentation
- Changed "Contrib" to "Contributor"
- Fixed mismatched inline code in list* usage
- Added missing hyperlink targets
2014-12-06 15:47:01 -08:00
Abhishek L
378ffae6f7 Fix versionadded in docs to 0.10.0 release 2014-04-10 23:51:32 +05:30
Bob Tolbert
4798863e0f This change updates the required Pygments version to 1.6, which
supports Hy code.

All code-blocks in the documentation have been changed from
clojure to hy.

Also added docs/make.bat for Windows, so the top-level docs
target now works on Windows as well.
2014-03-14 09:01:47 -04:00
Clinton N. Dreisbach
47d67b0062 Added loop/recur macro for tail-call optimization 2014-01-12 14:02:27 -05:00