Commit Graph

138 Commits

Author SHA1 Message Date
Kodi Arfer 80eb27906a Update copyright years 2020-01-09 14:05:12 -05:00
Kodi Arfer 8872f0b44c Remove hy.contrib.multi 2019-11-18 20:06:17 -05:00
Kodi Arfer 7aaece3725 Use #* assignments instead of `head-tail` 2019-08-18 09:44:29 -04:00
Kodi Arfer 52c0e4e221 Add explicit checks for HyList 2019-08-18 09:43:02 -04:00
Kodi Arfer dce0e10f3f Use `nonlocal` instead of a singleton list 2019-08-18 09:43:02 -04:00
Kodi Arfer 4a40ff3d7e Check for HySequence in hy.contrib.walk 2019-08-18 09:43:02 -04:00
Kodi Arfer 95ad5a01c8 Avoid mutating HyLists in hy.contrib 2019-08-18 09:43:02 -04:00
Kodi Arfer 6bc9e842e1 Clean up whitespace 2019-07-17 14:34:31 -04:00
Kodi Arfer 308bedbebe Remove uses of `defclass` attribute lists 2019-07-17 14:34:31 -04:00
Kodi Arfer 6af6a2945a Remove `if-python2` and its uses 2019-06-04 14:01:59 -04:00
Kodi Arfer bba97ab2a6 Remove hy._compat's type aliases 2019-06-04 14:01:59 -04:00
Tristan Cacqueray 1c7ca7ac1f update contrib and macro to use the new list? function 2019-04-09 00:07:10 +00:00
Kodi Arfer 62638b44a3 Update copyright years 2019-02-07 08:57:35 -05:00
Brandon T. Willard 144a7fa240 Produce Python AST for `require` statements and skip self `require`s
Closes hylang/hy#1211.
2018-11-08 22:57:17 -06:00
Brandon T. Willard 87a5b117a1 Implement new importer using PEP-302 semantics
Python 3.x is patched in a way that integrates `.hy` source files into
Pythons default `importlib` machinery.  In Python 2.7, a PEP-302 "importer"
and "loader" is implemented according to the standard `import` logic (via
`pkgutil` and later pure-Python `imp` package code).

In both cases, the entry-point for the loaders is through `sys.path_hooks` only.
As well, the import semantics have been updated all throughout to utilize
`importlib` and follow aspects of PEP-420.  This, along with some light
patches, should allow for basic use of `runpy`, `py_compile` and `reload`.

In all cases, if a `.hy` file is shadowed by a `.py`, Hy will silently use
`.hy`.
2018-08-25 22:50:38 -05:00
Kodi Arfer 7ba2105a2b Fix date and time hy-reprs on Windows 2018-08-08 09:26:20 -04:00
Brandon T. Willard 33f2b4a91a Compile `require`s 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