Commit Graph

13 Commits

Author SHA1 Message Date
Kodi Arfer
62638b44a3 Update copyright years 2019-02-07 08:57:35 -05:00
Kodi Arfer
6de7ddfee5 Update copyright years 2018-01-01 10:38:33 -05:00
Kodi Arfer
75e4ad8304 Remove uses of apply from /hy 2017-07-17 13:34:42 -07:00
Kodi Arfer
2eb81864df Make all files comply with license-header policy 2017-04-27 14:16:57 -07:00
Kodi Arfer
18acfe6495 Revert the extension of with-decorator to setv
This is no longer necessary now that `defn` always produces a `FunctionDef`.

To compensate, I've made small edits to two contrib modules and reverted a small test change.
2017-04-13 06:36:00 +03:00
Kodi Arfer
5aadeba3fe Fix bug: loop replaced strings equal to "recur" 2017-03-30 15:49:10 -07:00
Kodi Arfer
99638ba2df Remove uses of let from /hy 2017-02-03 17:06:26 -08:00
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
Gergely Nagy
9f88e07e1d Drop a set of brackets from let.
This changes let to use a flat list of symbol-value pairs instead of a
vector of vectors. One side effect is that (let [[a 1] z]) is not
expressible now, and one will explicitly need to set a nil value for z,
such as: (let [a 1 z nil]).

Closes #713.

Signed-off-by: Gergely Nagy <algernon@madhouse-project.org>
2015-10-01 10:08:04 +02:00
gilch
4cdfdfbafe remove defun in favor of defn 2015-08-09 01:09:52 -06:00
Paul Tagliamonte
5a64f18726 Refactor (loop) in terms of fnr; change to use decorator. 2014-01-13 20:37:25 -05:00
Paul Tagliamonte
0afbbeb68c Add (recur) for functions and stuff. 2014-01-12 18:53:08 -05:00
Clinton N. Dreisbach
47d67b0062 Added loop/recur macro for tail-call optimization 2014-01-12 14:02:27 -05:00