Zack M. Davis
ef079d5e08
implement keyword-only arguments
Python 3 supports keyword-only arguments as described in the immortal PEP 3102. This commit implements keyword-only argument support for Hy using a `&kwonly` lambda-list-keyword with semantics analogous how `&optional` arguments are handled: `&kwonly` arguments are either a symbol, in which case the keyword argument so named is mandatory, or a two-element list, the first of which is the symbolic name of the keyword argument and the second of which is its default value if not supplied. If Hy is running under Python 2, attempting to use `&kwonly` args will raise a HyTypeError. This effort is with the aim of resolving #453.
Hy
Lisp and Python should love each other. Let's make it happen. Try it.
Hylarious Hacks
OK, so, why?
Well. Python is awesome. So awesome, that we have so many tools to alter the language in a core way, but we never use them.
Why?
Well, I wrote Hy to help people realize one thing about Python:
It's really awesome.
Oh, and lisps are neat.
(fan art from the one and only doctormo)
Project
- Code: https://github.com/hylang/hy
- Docs: http://hylang.org/
- Quickstart: http://hylang.org/en/latest/quickstart.html
- Bug reports: We have no bugs! Your bugs are your own! (https://github.com/hylang/hy/issues)
- License: MIT (Expat)
- Contributor Guidelines & Code of Conduct
Description
Languages
Python
50.7%
Hy
41.5%
reStructuredText
7.1%
Batchfile
0.4%
Makefile
0.3%