Kodi Arfer
e344ac1fd6
Fix the management of _stdlib
...
_stdlib is a global variable, so core modules could use it, contrary to our intention, so long as they happened to be compiled after a non-core module. I've added a compiler attribute to track whether we can use _stdlib.
This fix exposed some cases where hy.core.shadow tried to use a core function, so I fixed those.
I've also added an `if not _stdlib` to `load_stdlib` so that we only bother to actually load _stdlib once.
2018-05-24 17:51:21 -07:00
Kodi Arfer
370563567a
Merge pull request #1593 from Kodiologist/compiler-pattern-matching
...
Pattern-matching compiler
2018-05-20 14:24:24 -07:00
Kodi Arfer
9f454f0228
Test complex numbers in test_hy2py
2018-05-20 14:11:35 -07:00
Kodi Arfer
0a5bc21fcf
Simplify compile_numeric_literal for new astor
2018-05-20 14:11:35 -07:00
Kodi Arfer
906b470499
Move test assertions into a test function
2018-05-20 14:11:35 -07:00
Kodi Arfer
38fdcc2114
Don't let HySymbol inherit from HyString
2018-05-20 14:11:35 -07:00
Kodi Arfer
210086c7ca
Clean up the decorators used in the compiler
2018-05-20 14:11:35 -07:00
Kodi Arfer
98fbdcfc50
Move @builds(HyExpression) next to other @builds
2018-05-20 14:11:35 -07:00
Kodi Arfer
a933646bdd
Use model patterns for the remaining special forms
2018-05-20 14:11:35 -07:00
Kodi Arfer
8b2733e921
Use model patterns for comprehensions
...
I haven't bothered to refine the patterns for these since I intend to completely overhaul the comprehension forms in the near future.
2018-05-20 14:11:35 -07:00
Kodi Arfer
41d3f26001
Use model patterns for comparison and math ops
2018-05-20 14:11:35 -07:00
Kodi Arfer
57b5fa49b1
Unify illegal special forms
2018-05-20 14:11:31 -07:00
Kodi Arfer
45e8783997
Use model patterns for fn
2018-05-20 14:07:44 -07:00
Kodi Arfer
3ebff987e0
Use model patterns for defclass
2018-05-20 14:07:44 -07:00
Kodi Arfer
9368e4bc4e
Use model patterns for import
and require
...
In the process, I've banned the syntax `(import [foo])` in favor of `(import foo)`.
2018-05-20 14:07:44 -07:00
Kodi Arfer
11f1c149ef
Use model patterns for try
2018-05-20 14:07:44 -07:00
Kodi Arfer
79c02514b9
Introduce the use of model patterns
2018-05-20 14:07:44 -07:00
Kodi Arfer
b4185e7665
Merge pull request #1606 from pyx/fix-1605
...
Fixes #1605 : remove macros ap-pipe and ap-compose
2018-05-20 13:53:40 -07:00
Philip Xu
8a83d0c1ea
Fixes #1605 : remove macros ap-pipe and ap-compose
...
Anaphoric macros do not work well with point-free style programming, in
which case both threading macros and `comp` are more adequate.
2018-05-20 13:52:51 -07:00
Kodi Arfer
6db03ab3b6
Merge pull request #1603 from gilch/let-handle-dot
...
Fix bug in let's handle-dot.
2018-05-18 10:47:08 -07:00
gilch
049c78f5d5
Fix bug in let's handle-dot.
2018-05-18 10:40:59 -07:00
Kodi Arfer
60c0f60a32
Merge pull request #1609 from pyx/fix-doc-typo
...
Documentation improvement
2018-05-16 15:22:59 -07:00
Philip Xu
0b08916174
Fix typos and improve code examples
2018-05-16 18:25:53 -04:00
Philip Xu
643196c2b8
Remove mixtures of tabs and spaces
2018-05-15 23:29:07 -04:00
Ryan Gonzalez
eec4a178b8
Merge pull request #1604 from hylang/fix-bots
...
fix botsbuildbots for #1582
2018-05-06 21:18:31 -05: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
Kodi Arfer
7a80aa92be
Merge pull request #1590 from Kodiologist/no-lambda-unpacking
...
Remove tuple unpacking in lambda lists
2018-05-04 11:11:06 -07:00
gilch
9d1304aacd
Remove lambda list unpacking handling in let
.
2018-05-04 10:40:22 -07:00
Kodi Arfer
a2aeca2338
Remove tuple unpacking in lambda lists
2018-05-04 10:40:22 -07:00
Kodi Arfer
bb10921ace
Merge pull request #1579 from vodik/splicing-typo
...
Fix a bug where the compiler doesn't properly handle unquote-splice
2018-04-30 09:46:42 -07:00
Simon Gomizelj
7c3477e738
Fix a bug where the compiler doesn't properly handle unquote-splice
...
Added test coverage as well
2018-04-30 09:38:57 -07:00
Kodi Arfer
7e1b890d7c
Merge pull request #1586 from Kodiologist/multi-expr-try
...
Fix a bug that caused `try` to drop expressions
2018-04-30 09:24:24 -07:00
Kodi Arfer
c7ac4c60c4
Fix a bug that caused try
to drop expressions
2018-04-30 09:18:01 -07:00
Kodi Arfer
51416424e2
Merge pull request #1585 from Kodiologist/empty-bodies
...
Allow `while` and `for` with empty bodies
2018-04-29 20:05:08 -07:00
Kodi Arfer
ec1c92bf4e
Allow for
with an empty body
2018-04-29 19:51:00 -07:00
Kodi Arfer
b7e5c5f17a
Allow while
with an empty body
2018-04-29 19:51:00 -07:00
Kodi Arfer
1eccd10d24
Merge pull request #1583 from Kodiologist/update-test_preprocessor_exceptions
...
Update test_preprocessor_exceptions
2018-04-29 19:50:30 -07:00
Kodi Arfer
a8fe95c5b6
Update test_preprocessor_exceptions
...
This test has been passing since b023ebd0b5
, so I removed the xfail. I also rewrote the test to use pytest.raises.
2018-04-29 19:29:17 -07:00
Kodi Arfer
e5c55d08c9
Merge pull request #1582 from Kodiologist/hysequence
...
Don't let HyExpression etc. inherit from HyList
2018-04-29 19:26:55 -07:00
Kodi Arfer
87aced2370
Don't let HyExpression etc. inherit from HyList
...
This means the compiler no longer allows e.g. `(fn (x) ...)` in place of `(fn [x] ...)`.
2018-04-29 19:17:47 -07:00
Simon Gomizelj
032247e380
Merge pull request #1588 from Kodiologist/no-amp-key
...
Remove &key
2018-04-27 00:21:11 -04:00
Ryan Gonzalez
fbeff8d25c
Merge pull request #1587 from Kodiologist/no-empty-catchers
...
Ban `(except)`
2018-04-23 21:50:56 -05:00
Kodi Arfer
e3d21118c0
Merge pull request #1575 from Kodiologist/fix-macroexpand-nan
...
Fix bug in macro-expanding NaN
2018-04-21 12:34:51 -07:00
Kodi Arfer
c1a487cdf7
Move logic from macroexpand_1 to macroexpand
...
By ending macro-expansion immediately when appropriate, this change fixes a bug arising from the fact that NaN != NaN.
2018-04-21 12:25:29 -07:00
Kodi Arfer
026316ebef
Refactor macroexpand_1
2018-04-21 12:25:29 -07:00
Kodi Arfer
116d7fa6ec
Copy in compile_atom instead of macroexpand_1
...
This copying is what keeps all the mutating code in the compiler methods (e.g., `expr.pop(0)`) from breaking cases in which Hy model objects are compiled more than once or inspected after compilation.
2018-04-21 12:25:29 -07:00
Kodi Arfer
4a6b633ad2
Add some missing imports
2018-04-21 12:25:29 -07:00
Kodi Arfer
1f95da2b0b
Avoid using a core function name as a variable
2018-04-21 12:25:29 -07:00
Kodi Arfer
a605936651
Remove &key
...
It's redundant with &optional.
2018-04-19 09:26:02 -07:00
Kodi Arfer
7bf2901364
Ban (except)
...
It's rarely useful, because it catches all exceptions, but it doesn't let you do anything other than return `None`. You can still get the same effect with `(except [])`.
2018-04-16 19:34:50 -07:00