Commit Graph

1601 Commits

Author SHA1 Message Date
Paul Tagliamonte
4d31af2264 Add @zackmdavis to core 2015-06-29 22:14:10 -04:00
Paul Tagliamonte
920c801733 Fix markup slightly. 2015-06-23 08:33:42 -04:00
Paul‮etnomailgaT‭
aac2bc52f9 Merge pull request #819 from algernon/misc/CoC
Adopt a Code of Conduct
2015-06-23 08:32:56 -04:00
Gergely Nagy
bf16b2ce2f
Adopt a Code of Conduct
Include the text of the Contributor Covenant (1.1.0) in
CONTRIBUTING.rst, and add a link to the document to README.md.

Signed-off-by: Gergely Nagy <algernon@madhouse-project.org>
2015-06-23 14:28:56 +02:00
Paul‮etnomailgaT‭
950c1bd41b Merge pull request #719 from unmerged/nonlocal-keyword
Added `nonlocal`. `global` takes multiple args.
2015-06-22 09:55:51 -04:00
Abhishek L
c2006280db Merge pull request #814 from farhaven/clean-defmain
Make (defmain ...) a clean macro
2015-06-21 23:32:42 +05:30
Gregor Best
509b72a799 Make (defmain ...) a clean macro 2015-06-15 21:11:48 +02:00
Paul Tagliamonte
4d7bdf515a Update my email 2015-06-15 14:59:40 -04:00
Berker Peksag
2ad8d444a8 Merge pull request #813 from ewaldgrusk/improve-documentation-of-the-let-form
Documents (left-to-right) order of variable assignments in let expressions
2015-06-14 04:41:22 +03:00
Ewald Grusk
296b6eaa2a documents order of variable assignments in let expressions 2015-06-13 21:10:57 +02:00
Morten Linderud
5b55242455 Merge pull request #810 from farhaven/eval-args
Allow specification of global table and module name for (eval ...)
2015-05-28 17:13:45 +02:00
Gregor Best
dcd23cf494 Add tests for eval with explicit global dict 2015-05-23 13:50:17 +02:00
Gregor Best
4adddbbf25 Allow specification of global table and module name for (eval ...) 2015-05-20 20:44:52 +02:00
Berker Peksag
685688f04c Update versionadded directives.
0.11.0 is a backwards incompatible release.
2015-05-09 22:12:04 +03:00
Paul Tagliamonte
767174681e 0.11.0 Release. 2015-05-09 14:16:28 -04:00
Zack M. Davis
82b68da88c preliminary draft of NEWS for 0.10.2 2015-05-03 10:19:25 -07:00
Paul Tagliamonte
42983d173f Merge branch 'master' into pr/796 2015-04-30 11:14:54 -04:00
Berker Peksag
5f1776fe06 Merge pull request #793 from kirbyfan64/destruct-args
Add argument destructuring
2015-04-30 14:01:47 +03:00
Berker Peksag
d11014d115 Merge pull request #777 from tianon/compare-shadows
Add shadow functions for comparison operators
2015-04-30 13:58:32 +03:00
Zack M. Davis
2ad2d5a418 fix keyword lambda values by retaining statements in Result
As reported in issue #748, there was a bug in which passing a lambda
as the value of a :keyword argument would fail—

$ hy --spy
hy 0.10.1 using CPython(default) 3.4.0 on Linux
=> (sorted (range 10) :key (fn [x] (- x)))
from hy.core.language import range
sorted(range(10), key=_hy_anon_fn_1)
Traceback (most recent call last):
  File "<input>", line 1, in <module>
NameError: name '_hy_anon_fn_1' is not defined

The function call would appear in the generated AST without being
preceded by the appropriate function definition corresponding to the
anonymous function argument value in the Hy source, causing either a
NameError (as in the example above), or erroneous reuse of whatever
function was already pointed to by the `_hy_anon_fn_` name referenced
in the list of keywords passed to `ast.Call`.

This commit aims to fix the problem by handling it in same way that
the expression/statement gap is bridged many other places in the
compiler, by adding the compiled value of the keyword argument to the
Result object being built during `_compile_collect`, with the
understanding that any Python statements implied by the argument value
will be appropriately preserved therein.
2015-04-26 15:57:08 -07:00
Berker Peksag
854940cabd Merge pull request #772 from theanalyst/f/travis/containers
travis: run in container infra & remove pypy hacks
2015-04-26 12:37:35 +03:00
Berker Peksag
5106789f17 Merge pull request #795 from zackmdavis/infix_matrix_multiplication
add support for Python 3.5 infix matrix multiplication
2015-04-26 12:21:56 +03:00
Tianon Gravi
ff1c4ccdb3 Add shadow functions for comparison operators 2015-04-24 12:19:23 -06:00
Zack M. Davis
d40405fde3 bump astor dependency to 0.5 to support matrix multiplication operator
See berkerpeksag/astor@0350295e.
2015-04-19 20:24:25 -07:00
Ryan Gonzalez
4ead84b058 Add argument destructuring 2015-04-18 12:32:03 -05:00
Zack M. Davis
0dbf2126cf adds support for Python 3.5 infix matrix multiplication
Python 3.5 will have a new commercial-at infix operator with the magic
methods __matmul__, __rmatmul__, and __imatmul__, unused as yet in the
standard library, but intended to represent matrix multiplication in
numerical code; see PEP 465 (https://www.python.org/dev/peps/pep-0465/)
for details. This commit (developed against Python 3.5 alpha 3) brings
support for this operator to Hy when running under Python 3.5 (or,
hypothetically as yet, greater). For Hy under Python <= 3.4, attempting
to use `@` in function-call position currently results in a NameError;
this commit does not change that behavior.

This is intended to resolve #668.
2015-04-12 21:45:39 -07:00
Berker Peksag
4938163ec4 Merge pull request #782 from acron0/last-core
Added (last) function to core language
2015-04-08 09:20:59 +03:00
Antony Woods
d1ed8f49d3 Re-implemented last function so that it also supports iterators. Added a test to reflect this. 2015-04-07 10:30:52 +01:00
Antony Woods
0496b7f7b6 Added name to AUTHORS and added documentation 2015-03-19 08:43:11 +00:00
Antony Woods
cbd942fd02 Added (last) function to core language 2015-03-18 15:23:43 +00:00
Berker Peksag
3d41630219 Merge pull request #779 from mdshw5/patch-1
Update style-guide.rst
2015-03-13 15:25:54 +02:00
Matt Shirley
1f19c6b12b Update style-guide.rst
I think you must have spilt something on your keyboard.
2015-03-13 09:23:38 -04:00
Berker Peksag
f5285d6028 Merge pull request #776 from nikete/patch-1
minor change
2015-03-12 13:06:19 +02:00
Nicolás Della Penna
750d7b51be minor change
changed the specific values to make the example slightly more clear
2015-03-12 03:38:15 +02:00
Berker Peksag
55d4d20f79 Merge pull request #773 from NathanW2/run_file
Run file using hy -i
2015-02-28 19:07:04 +02:00
Nathan Woodrow
a3ad4df6a1 Run file using hy -i
Add test for -i using file
2015-02-28 18:11:42 +10:00
Abhishek Lekshmanan
2a4558f1d2 travis: run in container infra & remove pypy hacks
Using travis' container based infra which is faster & allows caching pip
and is faster, also after the environment update hy seems happy with
pypy2.5 so removing the hacks needed to pass that.
2015-02-26 11:29:11 +05:30
Morten Linderud
a3775316e7 Merge pull request #770 from rhaps0dy/master
Added myself to AUTHORS
2015-02-22 18:19:57 +01:00
Adrià Garriga-Alonso
f14a84125a Added myself to AUTHORS 2015-02-22 18:18:02 +01:00
Adrià Garriga-Alonso
f7b5486b69 Assert now may take an optional label, like in Python 2015-02-22 17:34:19 +01:00
Berker Peksag
49e7376b0e Merge pull request #765 from zackmdavis/appease_flake8
move imports and operators to satisfy new version of pep8 checker
2015-02-17 08:32:50 +02:00
Zack M. Davis
0fd6ed052c move imports and operators to satisfy new version of pep8 checker
jcrocholl/pep8 (used by flake8, used in Hy's continuous integration
builds) introduced an imports-at-top-of-file check in 1.6.0 and a
line-breaks-around-binary-operators check in 1.6.2. This commit makes
nonfunctional changes to bring the Hy codebase in compliance with this
tool, fixing #764.
2015-02-16 22:21:49 -08:00
Morten Linderud
5edcdd26b8 Merge pull request #763 from zackmdavis/hy_io_error
improve traceback legibility by means of distinguishing source of IOErrors
2015-02-17 00:30:24 +01:00
Zack M. Davis
f247470621 appends to AUTHORS 2015-02-16 14:52:41 -08:00
Zack M. Davis
4bea6dc59e distinguish IOError when loading file from that raised by program itself
Previously, Hy scripts that raised a subclass of IOError would be caught
by code intended to deal with IOErrors raised when Hy couldn't import
the script itself, resulting in either a misleading "Can't open file"
error message, or a misleading TypeError traceback from not being able
to format the "Can't open file" message (for IOErrors for which the
errno attribute was None). This commit (a straightforward implementation
of the idea proposed by @slimetree in #714) introduces a new HyIOError
class, raises that when `import_file_to_hst` can't open the file path,
and catches it in the `cmdline_handler`.

This is believed to fix #513, #714, and #727.
2015-02-16 14:27:18 -08:00
Abhishek L
31edaf6dee Merge pull request #762 from larme/add-is-symbol-function
add `symbol?` function to `hy.core`
2015-01-29 23:06:11 +05:30
Zhao Shenyang
95107df685 Add Shenyang Zhao to AUTHORS 2015-01-30 01:25:06 +08:00
Zhao Shenyang
487710c093 add documents for symbol? 2015-01-30 01:21:26 +08:00
Zhao Shenyang
dafcc7ec70 add symbol? function to hy.core
`symbol?` will test if the input is an instance of HySymbol. It's useful when writing macros.
2015-01-29 23:17:52 +08:00
Berker Peksag
8d6f9c3d84 Merge pull request #756 from icholy/master
Fix issues with tab completion.
2015-01-19 19:30:47 +02:00