Commit Graph

2722 Commits

Author SHA1 Message Date
Kodi Arfer
e86222c93f Allow calling defseq without requireing seq 2016-12-07 16:21:17 -08:00
Kodi Arfer
f4b00aed17 More copyediting of sequences.rst
I removed "they aren't suited for infinite sequences" since it seems like in fact they are, as given in some of the examples and the tests.
2016-12-07 16:17:58 -08:00
Kodi Arfer
6bf5ebd8ee Remove some trailing spaces 2016-12-07 16:17:52 -08:00
Ryan Gonzalez
2c9a224bd6 Merge pull request #1050 from tuturto/multimethod
Modify multimethods to use dispatching function
2016-12-07 17:20:04 -06:00
Ryan Gonzalez
5b879323aa Lvalue of setv is checked too early when using or
Fix #1151
2016-12-01 09:49:51 +02:00
Tuukka Turto
538d36a7c6 Fix grammar 2016-12-01 00:22:42 +02:00
Tuukka Turto
4219faf532 Update true, false -> True, False 2016-11-30 23:45:21 +02:00
Tuukka Turto
269218a8fd Merge branch 'master' into seq 2016-11-30 23:41:01 +02:00
Ryan Gonzalez
24ebbc611e Give an error on empty attributes (#1138)
Give an error on empty attributes

closes #1137
2016-11-30 07:00:48 +02:00
Tuukka Turto
00615cef36 Add arity-overloaded defn
Old defmulti has been renamed to defn and extended to detect when it is
used to define regular function and when a arity-overloaded one.
2016-11-29 16:21:31 +02:00
Tuukka Turto
cd90959103 Update version added in docs 2016-11-29 07:22:38 +02:00
Tuukka Turto
75c0080cee Change nil to None 2016-11-29 07:18:30 +02:00
Tuukka Turto
aeab485a4f Merge branch 'master' into multimethod 2016-11-29 07:14:54 +02:00
Kodi Arfer
4e93fcba8a Ignore a new Flake8 whitespace error (#1158)
Ignore a new Flake8 whitespace error

Fixes #1157.

The new check is E305. Since we're now using the `--ignore` option, we have to list all the checks that are ignored by default, too.

I decided that ignoring E305 was better than changing the whitespace it was complaining about because, in at least some cases in our current codebase, single blank lines are used to indicate that several top-level definitions are associated with each other. Don't try to ignore the undocumented Flake8 error W504.
2016-11-27 09:54:59 +02:00
gilch
c5ccd6c852 Merge pull request #1156 from Kodiologist/bool-spelling-2
Burninate the synonyms `true`, `false`, and `nil`
2016-11-26 17:40:58 -07:00
Kodi Arfer
f831b3e98f Merge branch 'entry_point' 2016-11-25 16:04:24 -08:00
Kodi Arfer
ed8e37da62 Burninate the synonyms true, false, and nil
Per the straw poll in #908, as an alternative to #1147.

Now you must use `True`, `False`, and `None`, as in Python. Or just assign `true` to `True`, etc.; the old synonyms aren't reserved words anymore.
2016-11-23 18:35:17 -08:00
Paul Tagliamomnte
f644dda0dd Add @Kodiologist 2016-11-21 11:44:00 -05:00
Tuukka Turto
a7f6d1d3f7 Add support for multiple statements in sequences 2016-11-09 08:52:18 +02:00
Tuukka Turto
584a40d9c0 Update tests to work with Pytho 2.x
In Python 2.x (range 10) is mapped to xrange(10) in Python
terms. However, xrange doesn't support slicing, which caused tests to
fail. By forxing xrange into list, we have slicing available.
2016-11-09 05:07:31 +02:00
Tuukka Turto
241d554b0b Add lazy sequences into contrib 2016-11-08 21:23:49 +02:00
Kodi Arfer
2242097b6b Translate (.a.b.c x) to x.a.b.c(). (#1105)
Translate (.a.b.c x) to x.a.b.c().

This is useful for, e.g., calling the Series.str.lower method in pandas.
2016-11-07 19:45:25 +02:00
Tuukka Turto
bae4d61e04 Fix require to new syntax 2016-11-03 14:32:23 +02:00
Tuukka Turto
77bc767907 Merge branch 'master' into multimethod
Conflicts:
	docs/contrib/multi.rst
2016-11-03 14:06:13 +02:00
Tuukka Turto
f60ed24c29 Add docs and tests for as-> macro (#1141)
Add docs and tests for as-> macro

Closes #1047
2016-11-03 10:20:26 +02: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
Tuukka Turto
0abc218ae0 Merge branch 'master' into pr/1135 2016-10-25 15:10:21 +03:00
Tuukka Turto
d969ed63d6 Merge branch 'master' into pr/1081 2016-10-20 19:23:57 +03:00
Tuukka Turto
1459eea697 Merge branch 'master' into pr/1048 2016-10-20 19:19:21 +03:00
Tuukka Turto
9ee9f3a55a Merge branch 'master' into pr/1131 2016-10-20 19:12:33 +03:00
gilch
498c73d7e7 Merge pull request #1132 from Kodiologist/remove-type-checks
Don't check the type of arguments to `inc`, `odd?`, etc.
2016-10-15 13:40:41 -06:00
Kodi Arfer
ac01c0f03f Changed version punctuation for PEP 440 compliance
They now look like:  0.11.0+295.gec6e264.dirty
instead of:          0.11.0-295-gec6e264-dirty
2016-10-13 13:41:14 -07:00
Kodi Arfer
ec6e264753 Allow calling setup.py from a subdirectory 2016-10-13 13:32:13 -07:00
Kodi Arfer
23c457cee5 Generate hy.version using git describe 2016-10-12 17:11:44 -07:00
Ryan Gonzalez
34304c41c7 Test Python 3.6 apart from nightly (#1133)
* Test Python 3.6 apart from nightly (ref. #1113) change to `3.6-dev`
2016-10-12 16:11:46 -06:00
Kodi Arfer
0eb4076768 Require Python 3 for neg? and pos? type tests
Python 2 allows 2 < "hello" and the like.
2016-10-11 20:14:14 -07:00
Kodi Arfer
cd1d12565d Assertion-testing style edit 2016-10-11 15:48:40 -07:00
Kodi Arfer
4b0296d257 Don't check the type of arguments to inc, odd?, etc.
This allows them to be used with numeric types that aren't built in, such as NumPy arrays. Because Python uses duck typing, there's generally no way to know in advance whether a given value will accept a given operator. Of course, things like `(inc "hello")` will still raise a `TypeError`, because so does `(+ "hello" 1)`.
2016-10-11 14:04:50 -07:00
Kodi Arfer
108537a4e0 Allow &rest after &optional, like Python 2016-10-11 13:31:22 -07:00
Ryan Gonzalez
11481aba78 Merge pull request #1130 from ElGoreLoco/patch-1
Remove invalid `)` from URL
2016-10-09 08:31:16 -05:00
Jorge
72ded830b6 Remove invalid ) from URL 2016-10-09 13:01:08 +02:00
Ryan Gonzalez
790a1a9456 Merge pull request #1129 from bheesham/makefile
Add PHONY targets; wrap call to recursive make; add path to find.
2016-10-05 08:43:32 -05:00
Bheesham Persaud
1711b1f5ad Add PHONY targets; wrap call to recursive make; add path to find.
I've marked added the rest of the phony build targets; wrapped the
recursive make call[0], and added the path specifier to the find
command for compatibility with BSD find.

[0]: https://www.gnu.org/software/make/manual/html_node/Recursion.html
2016-10-04 21:53:59 -04:00
Ryan Gonzalez
7867ebd049 Merge pull request #1123 from Kodiologist/double-hyphen-version
Allow --version as a synonym for -v
2016-09-29 11:42:32 -05:00
Kodi Arfer
a33f80b2ce Allow --version as a synonym for -v
--version is a GNU standard that is also common for non-GNU programs, such as Python.
2016-09-29 09:18:04 -07:00
Ryan Gonzalez
77d922c592 Merge pull request #1122 from Kodiologist/hyset-fixes
Don't sort or deduplicate the items in a HySet
2016-09-27 13:32:25 -05:00
Kodi Arfer
0880610401 Don't sort or deduplicate the items in a HySet
Fixes #1120.

I also added hy.models._wrapper[set] so a macro can return an ordinary set in place of a HySet.
2016-09-26 09:47:04 -07:00
gilch
399d2bcf21 clarify documentation of import (#1121)
* clarify documentation of import

Add a comment showing the equivalent python of the long example, and demonstrate how to get `from` and `as` on the same line.

* add python example comment in last import example
2016-09-25 21:29:53 -06:00
gilch
1d3142c8de change quickstart install from PyPI to GitHub (#1116)
* change Quickstart install from PyPI to GitHub
2016-09-24 15:54:32 -06:00
gilch
f8fc1fb71b Merge pull request #1113 from zackmdavis/travis_by_night
nightly Python on Travis CI??
2016-09-24 11:48:47 -06:00