Commit Graph

572 Commits

Author SHA1 Message Date
Kodi Arfer
9cc90362d0 Docs: string literal prefixes must be in lowercase 2018-07-11 11:24:19 -07:00
gilch
3548d084c6 Style guide reference landmarks; headers and uppercase directives.
And a lot of rewriting for clarity.
2018-06-21 00:43:36 -06:00
Kodi Arfer
da754c0e5d Update NEWS and docs for the new comprehensions 2018-06-13 17:31:08 -07:00
gilch
b65a70f04f Minor style guide corrections based on feedback. 2018-06-11 20:17:58 -06:00
gilch
122eba9bd8 Style guide update. 2018-06-10 23:03:05 -06:00
Kodi Arfer
8296a36e12 Add tests and docs for model patterns 2018-05-28 16:15:47 -07:00
Kodi Arfer
38fdcc2114 Don't let HySymbol inherit from HyString 2018-05-20 14:11:35 -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
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
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
Kodi Arfer
a605936651 Remove &key
It's redundant with &optional.
2018-04-19 09:26:02 -07:00
Kodi Arfer
bbf669d407 Update docs and NEWS for HyCons removal 2018-04-12 16:45:17 -07:00
Simon Gomizelj
69202df23d Update documentation and add a NEW entry 2018-04-07 22:29:20 -07:00
Kodi Arfer
474de9e4c3 Fix a typo in the mangling documentation 2018-04-04 10:51:03 -07:00
Kodi Arfer
f17a21be63 Use X as the mangle delimiter on Python 3 2018-04-04 10:50:33 -07:00
Yigong Wang
e0d37d63f7 Code review feedback 2018-03-26 22:47:12 -04:00
Yigong Wang
950c1973e4 Add hy --spy in quickstart 2018-03-26 21:07:52 -04:00
Kodi Arfer
eda0b89f67 Document mangling 2018-03-13 14:56:49 -04:00
Kodi Arfer
4d77dd0d40 Spin off syntax documentation from api.rst 2018-03-13 14:56:49 -04:00
Kodi Arfer
8c00ab66f9 NEWS and docs for hy-repr 2018-03-10 18:11:07 -08:00
Jakub Wilk
d1cb630698 Fix typos 2018-02-15 16:35:33 +01:00
Tuukka Turto
cf87de5cc2
Merge pull request #1483 from vodik/remove-def
Just remove `def`
2018-01-31 08:54:59 +02:00
Simon Gomizelj
0cd4df3898 Remove def and standardize on setv 2018-01-21 00:25:33 -05:00
Tuukka Turto
a9621817f9
Merge pull request #1433 from Kodiologist/while-multistatement
Handle statements in the condition of `while`
2018-01-11 07:45:27 +02:00
Jakub Wilk
b8b64d42bd docs/conf.py: make regexp string raw
Fixes:

    conf.py:12: DeprecationWarning: invalid escape sequence \Z

when building docs using Python 3.6 with warnings enabled.
2018-01-08 23:19:08 +01:00
Jakub Wilk
03cd437f01 Fix typo 2018-01-08 22:45:00 +01:00
Simon Gomizelj
c5231bc242 Document defn/a, fn/a, for/a, with/a 2017-12-31 09:02:46 -05:00
Yoan Tournade
52292da695
Update interop doc: print function is lower-case
(A typo made use of Print function, which is not defined)
2017-12-09 23:12:19 +01:00
Rob Day
76bbf05812 Update documentation to cover new 'try' body rules 2017-12-03 09:47:41 +00:00
Jakub Wilk
e2e1b04ea3 Fix typos 2017-11-26 00:44:03 +01:00
Kodi Arfer
1b3fc81f3f Document eval-X-compile 2017-11-02 08:43:43 -07:00
Kodi Arfer
ed0b273551 Fix a bug in docs/conf.py
Without the trailing slash, `py = ('https://docs.python.org/3', None)` mysteriously creates links to the Python 2 documentation rather than Python 3.
2017-11-02 07:32:03 -07:00
Kodi Arfer
b25a69179f Update the documentation of while 2017-11-02 07:32:03 -07:00
Ryan Gonzalez
e0e664c030
Merge branch 'master' into letmacro 2017-11-01 09:39:18 -05:00
gilch
91bdaea535 add documentation macros 2017-10-30 21:25:25 -06:00
gilch
e90f082baf back let with dict for better defclass behavior 2017-10-30 20:23:57 -06:00
gilch
497e929913 generalize #% to arbitrary expressions 2017-10-26 14:23:25 -06:00
gilch
b5f1136ba5 %* %** parameters for #% tag macro 2017-10-26 13:03:01 -06:00
gilch
f81fb771eb change xi macro to #% tag macro 2017-10-26 12:55:48 -06:00
gilch
d2e8537d3f document let 2017-09-23 15:00:00 -06:00
Ryan Gonzalez
db210929d0 Merge pull request #1360 from gilch/model-repr
proper reprs for Hy models
2017-09-18 08:45:28 -05:00
gilch
d38956fb9e remove trailing commas in HyDict reprs 2017-09-18 01:03:00 -06:00
Rob Day
5a6488e353 Treat _42 etc. as a variable name, not an integer 2017-09-16 16:12:29 -07:00
Kodi Arfer
0c229ebda5 NEWS and docs for hashstrings 2017-09-08 11:27:34 -07:00
Kodi Arfer
0a633d8024 Correct a ReST syntax typo 2017-09-08 11:27:34 -07:00
gilch
af8d209496 update docs for new hy model reprs 2017-09-08 10:59:57 -07:00
Zaheer Soebhan
9afb196c8b Change the examples in the tutorial to Python 3 2017-08-27 14:17:07 -07:00
Kodi Arfer
cebb820b6c Update NEWS and docs for return 2017-08-20 08:45:17 -07:00
Ryan Gonzalez
dea99c8b76 Merge pull request #1354 from gilch/comment-discard
add #_ discard syntax
2017-08-19 11:29:57 -05:00
Kodi Arfer
8d40a68232 Initialize the return variable of with 2017-08-19 07:35:41 -07:00
Jordan Danford
c67b8bccb9 Expose read, read_str, and eval in Python
- Expose `read`, `read_str`, and `eval` in Python
- Add string evaluation example to interop section of docs
- Add test for `eval`
- Explain `eof` keyword argument in `read` docstring
2017-08-05 17:29:15 -07:00
gilch
4dd57c84ee NEWS and docs for (comment ...) and #_ 2017-08-04 16:37:39 -06:00
Kodi Arfer
e8ffd41202 Merge pull request #1349 from woodrush/fix-unquote-splice-none
Allow `unquote-splice` to accept any false value as empty
2017-08-02 19:50:47 -04:00
Kodi Arfer
ecc974de1e Implement Python 2 exec
The implementation of `hy.core.language.exec` draws code from the `exec_` function in commit f574c7be6ebc80041ef58ca29588f310248ebed4 of the library Six, which is copyright 2010–2017 Benjamin Peterson and licensed under the Expat license.
2017-08-02 13:33:59 -04:00
Hikaru Ikuta
dbffe987f5 Update docs on unquote-splice 2017-08-02 18:03:24 +09:00
Kodi Arfer
3f3cce8785 Update docs: apply is gone; #* and #** are in 2017-07-19 11:00:43 -07:00
Kodi Arfer
bb91b57dca Require capitalizing NaN and Inf like so 2017-07-10 08:50:49 -07:00
Kodi Arfer
ca95194240 Change eval from a special form to a function 2017-06-27 08:14:29 -06:00
Ryan Gonzalez
e92ef484a0 Merge pull request #1310 from gilch/tagged-literals
Tag macros
2017-06-23 10:13:43 -05:00
gilch
6cd3201421 rename sharp macros to tag macros 2017-06-22 22:48:46 -06:00
gilch
20c26a52e4 make sharp macros take arbitrary identifiers
Previously, only a single character was allowed.
2017-06-22 22:46:24 -06:00
Zack M. Davis
acf6e0e0fe remove @zackmdavis from core 2017-06-21 14:04:00 -07:00
Kodi Arfer
49fd49e7ee Fix dirty-flag removal in docs/conf.py 2017-06-20 14:26:39 -07:00
Kodi Arfer
d86381ff98 Merge pull request #1300 from Kodiologist/contributing
Overhaul CONTRIBUTING.rst
2017-06-14 14:08:34 -07:00
Tristram Oaten
fc3dd8ab66 Fix Tuukka print example (#1304)
It was missing quotes around "Tuukka". Output from hy to confirm everything's good:

```clojure
hy unknown using CPython(default) 3.6.1 on Linux
=> (print "Hello there," "Tuukka")
Hello there, Tuukka
```
2017-06-12 08:36:47 -05:00
Kodi Arfer
0baffaa360 Overhaul CONTRIBUTING.rst 2017-06-10 09:08:15 -07:00
neil-lindquist
d3df17d9d8 Modify cond to support single argument branches 2017-06-10 08:30:53 -07:00
Kodi Arfer
dffa2811e6 Return from the else clause of a try form
I overhauled the documentation of `try` while I was editing it.
2017-05-25 20:48:09 -05:00
Kodi Arfer
479c1755a9 Show a version number at the top of each docs page 2017-05-23 11:29:48 -07:00
Kodi Arfer
e15992829d Simplify docs/conf.py 2017-05-23 11:28:34 -07:00
Kodi Arfer
dd9774fb6d Remove the documentation's dependency on Hy itself 2017-05-23 11:28:28 -07:00
gilch
b9279183d7 Merge pull request #1286 from Kodiologist/new-license-headers
Use license headers consistently
2017-05-22 13:36:53 -06:00
Yuval Langer
687d750a88 Remove stray use of setf in documentation 2017-05-19 13:36:06 -07:00
Kodi Arfer
0162647bf3 Update the docs copyright footer. 2017-05-15 13:09:34 -04:00
Kodi Arfer
d3fa375052 Migrate from Nose to pytest 2017-04-26 14:00:11 -07:00
Kodi Arfer
4c38e2c9dd Rename reader macros to "sharp macros" (#1282)
They're not actually reader macros, since their arguments are parsed s-expressions, like a regular macro, not pre-parsed source text.
2017-04-21 10:07:48 -05: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
bb9f543246 Merge pull request #1265 from tuturto/repl-doc
Add --repl-output-fn into command line docs
2017-04-01 08:01:43 -07:00
Kodi Arfer
36d09cb194 More documentation of strings and keywords
Currently, HyKeyword is not in fact a subclass of HyString, so I removed that statement.
2017-04-01 08:23:41 +03:00
Tuukka Turto
5b2d823028 Add --repl-output-fn into command line docs 2017-04-01 08:10:45 +03:00
Kodi Arfer
f8e5645c2e Small NEWS and docs fixes for hy-repr (#1258) 2017-03-25 12:13:44 -05:00
Kodi Arfer
33a696d487 Add a command-line option --repl-output-fn (especially for hy.contrib.hy-repr) 2017-03-24 09:03:12 -07:00
Kodi Arfer
bf2f90a0d9 Add hy.contrib.hy-repr 2017-03-24 08:43:53 -07:00
Kodi Arfer
05cfe89dd9 Merge branch 'master' into master 2017-03-09 07:24:07 -08:00
Kai Lüke
80f0e4af14 fix example in documentation to unquote in quasi quote 2017-03-09 15:02:23 +01:00
John Patterson
8fb7706a68 Added class use example to tutorial
I was following along and noticed that it wasn't actually explained how to _use_ the object we just made. I include both the `setv` style of writing the Hy as we've been using in the rest of the docs up to this point and a more LISP-y style use of the object.
2017-03-08 22:39:41 -06: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
484daafa53 Move hy.core.reserved to hy.extra.reserved (#1231)
It was an odd one out by being in hy.core but needing to be called by a qualified name. It's at home in hy.extra.
2017-03-02 16:49:32 -06:00
Tuukka Turto
8b84114869 Document get in nested structure (#1236) 2017-02-24 14:22:27 -08:00
Kodi Arfer
e4a7b317e1 Make fn work like lambda and remove lambda (#1228)
* with-decorator: Allow a `setv` form as the form to be decorated

This feature is of dubious value by itself, but it's necessary to allow `defn` to create a lambda instead of a `def`.

* Make `fn` work the same as `lambda`

That is, allow it to generate a `lambda` instead of a `def` statement if the function body is just an expression.

I've removed two uses of with_decorator in hy.compiler because they'd require adding another case to HyASTCompiler.compile_decorate_expression and they have no ultimate effect, anyway.

In a few tests, I've added a meaningless statement in `fn` bodies to force generation of a `def`.

I've removed `test_fn_compiler_empty_function` rather than rewrite it because it seems like a pain to maintain and not very useful.

* Remove `lambda`, now that `fn` does the same thing
2017-02-22 17:36:52 -06:00
Kodi Arfer
45b7a4ac9d Add bytestring literals 2017-02-19 09:04:45 +02: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
f3edeb99ae Allow commas and underscores in numeric literals
You can use them as thousands separators.

This change differs from PEP 515 in that not only does it allow commas in addition to underscores, but it's much more liberal about placement. Any number of underscores or commas can be placed anywhere, even at the start.
2017-02-15 09:03:24 +02:00
Kodi Arfer
1d6de2792e Merge branch 'let-it-be' 2017-02-13 09:19:37 -08:00
Kodi Arfer
3ec919278d Remove let from documentation 2017-02-13 09:12:21 -08:00
Charles de Lacombe
83cdaf0a71 Docs: Hy <-> Python interop fix #1061 (#1218)
* Docs: Hy <-> Python interop fix #1061

I separated the existing text in two sections, with some additional
explanations and a link to Hy's `import`.

* added interop page

* simplified interop section in tutorial

* remove the TODO from interop section in tutorial

Because yay

* Corrections from @Kodiologist

I kept the part about mangling, but added a warning about its incompleteness. I
think it can be useful for somebody who just wants to use a Python module in his
code. Maybe it can be removed when the actual documentation for mangling is
written.

* Added myself to AUTHORS.

I'll do my best to be worthy of it. Thanks for this awesome project!
2017-02-10 17:11:21 -08:00
Jakub Wilk
99d31d153c Use HTTPS for github.com, docs.python.org and notes.pault.ag URLs (#1219)
* Use HTTPS for github.com

* Use HTTPS for docs.python.org

* Use HTTPS for notes.pault.ag
2017-02-07 13:25:40 -06:00
Kodi Arfer
9ca7f49c88 Make xor return single true inputs
The documentation should now be correct (#1214).
2017-02-03 22:25:38 +02:00
Kodi Arfer
2dd1432b07 Docs: add an example of evaluating a string 2017-01-19 09:26:12 -08:00