Commit Graph

122 Commits

Author SHA1 Message Date
Brandon T. Willard
33f2b4a91a Compile requires in the body of a macro
This change enables further macro expansion for cases in which a macro
`require`s other macros within its body.
2018-07-25 17:20:19 -05:00
gilch
8c79015b40 Fix let rebind bug. 2018-06-27 23:41:49 -06:00
gilch
4b0e318997 Remove outdated comment in walk. 2018-06-27 23:39:44 -06:00
Kodi Arfer
cf0dafef9b Update uses of the old comprehension forms 2018-06-13 17:31:08 -07:00
Kodi Arfer
210086c7ca Clean up the decorators used in the compiler 2018-05-20 14:11:35 -07:00
gilch
049c78f5d5 Fix bug in let's handle-dot. 2018-05-18 10:40:59 -07:00
gilch
e7ac4ec859
fix botsbuildbots for #1582
This is preventing Hy from installing.

Closes #1599

#1601 would make this moot, but fixing it is the more conservative change. Pick one or the other. This `botsbuildsbots` doesn't do anything important. It's just one of our Easter eggs.
2018-05-06 19:55:16 -06:00
gilch
9d1304aacd Remove lambda list unpacking handling in let. 2018-05-04 10:40:22 -07:00
Kodi Arfer
a605936651 Remove &key
It's redundant with &optional.
2018-04-19 09:26:02 -07:00
Kodi Arfer
c93a60ede0 Remove support for cons cells 2018-04-12 16:45:17 -07:00
Simon Gomizelj
1b7dfd2839 Make HyKeyword a first class objects
HyKeywords are no longer an instances of string with a particular
prefix, but a completely separate object.

This means keywords no longer trip isinstance str checks, adding a
little bit of type safety to the compiler.

It also means that HyKeywords evaluate to themselves.

Closes #1352
2018-04-07 22:29:20 -07:00
Kodi Arfer
85968e70dd Add mangle and unmangle as core functions 2018-03-13 14:55:55 -04:00
Kodi Arfer
0c8c5dc830 Mangle special forms 2018-03-13 14:55:55 -04:00
Kodi Arfer
d501d4d806 Mangle symbols at compile-time instead of parse-time
This means that a HySymbol remembers its original name. That is, `a-b` and `a_b` are different symbols although `(setv a-b 1)` and `(setv a_b 1)` set the same variable (namely, `a_b`).

Most of the edits in this commit are to switch underscores to hyphens in places where mangling hasn't happened yet.

I removed some lexer tests since the lexer no longer does any mangling.
2018-03-13 14:55:15 -04:00
Kodi Arfer
0574e275b5 Make hy-repr support some collections classes 2018-03-10 18:11:07 -08:00
Kodi Arfer
38f461890d Make hy-repr support DateTime objects 2018-03-10 18:11:07 -08:00
Kodi Arfer
3dbe05302e Make hy-repr support regex match objects 2018-03-10 18:11:07 -08:00
Kodi Arfer
f7ab9a6e7c Make hy-repr support dictionary views 2018-03-10 18:11:07 -08:00
Kodi Arfer
90a09b5b44 Make hy-repr use double spaces for dictionaries 2018-03-10 18:11:07 -08:00
Kodi Arfer
83c4f63bc2 Reimplement hy-repr with registered functions
This removes a lot of hy-reprs that were hard-coded into the hy-repr function itself. It also allows you to add a hy-repr for an existing class without monkey-patching the class.
2018-03-10 18:11:07 -08:00
Simon Gomizelj
be6ddd4bb2 Fix deprecation warning triggered by PEP 479 2018-02-14 16:05:31 -05:00
Tuukka Turto
5c720c0110
Merge pull request #1473 from Kodiologist/new-year-2018
Update copyright years
2018-02-05 15:11:59 +02:00
Simon Gomizelj
0cd4df3898 Remove def and standardize on setv 2018-01-21 00:25:33 -05:00
Kodi Arfer
6de7ddfee5 Update copyright years 2018-01-01 10:38:33 -05:00
Jakub Wilk
e2e1b04ea3 Fix typos 2017-11-26 00:44:03 +01:00
gilch
a4dd344ebd protect eval-and-compile/eval-when-compile in let 2017-10-30 20:24:09 -06:00
gilch
e90f082baf back let with dict for better defclass behavior 2017-10-30 20:23:57 -06:00
gilch
a54f6aa38b add hidden &name parameter to macros
The module name allows macros to preexpand their body in the proper
context.
2017-09-23 14:59:43 -06:00
gilch
5bbf4d9894 fix premature binding in let 2017-09-22 20:07:48 -06:00
gilch
081a6e2575 factor out smacrolet from let 2017-09-18 23:01:13 -06:00
gilch
bcc93fb1fe refactor let symbol expansion to a class 2017-09-18 21:01:42 -06:00
gilch
20b4342d40 support (global) in let 2017-09-18 14:54:08 -06:00
gilch
ba898aa8d8 support (nonlocal) in let 2017-09-18 13:51:32 -06:00
gilch
34038ff433 implement let 2017-09-18 12:21:42 -06:00
gilch
7674bf3267 proper reprs for Hy models 2017-09-07 11:50:16 -07:00
David Schaefer
432d560310 No TypeError from multi-arity defn returning None 2017-08-04 17:08:41 +02:00
Kodi Arfer
eea8cf1061 hy-repr: Fix a crash when given a NumPy array 2017-07-20 08:46:42 -07:00
Kodi Arfer
7b94c45e16 Remove an extra parenthesis in hy.contrib.profile 2017-07-20 08:46:37 -07:00
Kodi Arfer
0bbb5f8e34 hy-repr: Support #* and #** 2017-07-19 10:25:24 -07:00
Kodi Arfer
75e4ad8304 Remove uses of apply from /hy 2017-07-17 13:34:42 -07:00
Kodi Arfer
5a1e6a7c6a hy-repr: Support NaN and Inf 2017-07-10 08:50:49 -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
bf2f90a0d9 Add hy.contrib.hy-repr 2017-03-24 08:43:53 -07:00
Kodi Arfer
8b6a45e43a Remove car and cdr in favor of first and rest (#1241)
* Remove uses of `car` and `cdr` in /hy

* Remove uses of `car` and `cdr` in quote tests

* Remove `car` and `cdr` in favor of `first` and `rest`

I beefed up the documentation and tests for `first` and `rest` while I was at it.

I defined `car` and `cdr` in native_tests.cons so the tests read a bit more naturally.
2017-03-06 10:34:40 -06:00
Kodi Arfer
ace125ee9b Consolidate hy.models.* and tests/models/* into one file apiece
They were a lot of similar, tiny files.
2017-02-16 19:43:00 -08:00
Kodi Arfer
99638ba2df Remove uses of let from /hy 2017-02-03 17:06:26 -08:00
Kodi Arfer
91b26d1fdd Remove contrib.meth
This seems to be specific to Flask, a web framework.
2016-12-29 08:35:54 -08:00
Kodi Arfer
407a79591a Remove contrib.flow
It's not tested, and sure enough, a glance at the code suggests that `case` and `switch` will evaluate their first argument once for every clause, which is unlikely to be desirable. I say remove it, but if anybody wants to fix and test and re-add `case` (and change it to a square-bracket syntax like `cond`), be my guest.
2016-12-29 08:35:54 -08:00