Merge branch 'master' into pr/347
This commit is contained in:
commit
de424fd2b6
11
.coveragerc
Normal file
11
.coveragerc
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
[run]
|
||||||
|
omit =
|
||||||
|
*/python?.?/*
|
||||||
|
*/lib-python/?.?/*.py
|
||||||
|
*/lib_pypy/_*.py
|
||||||
|
*/site-packages/nose/*
|
||||||
|
*/pypy/*
|
||||||
|
|
||||||
|
exclude_lines =
|
||||||
|
# Have to re-enable the standard pragma
|
||||||
|
pragma: no cover
|
10
.travis.yml
10
.travis.yml
@ -7,13 +7,15 @@ python:
|
|||||||
- "2.6"
|
- "2.6"
|
||||||
# command to install dependencies
|
# command to install dependencies
|
||||||
install:
|
install:
|
||||||
- pip install -r requirements.txt --use-mirrors
|
- pip install -r requirements.txt
|
||||||
- if [[ $TRAVIS_PYTHON_VERSION == '2.6' ]]; then pip install argparse importlib unittest2 astor --use-mirrors; fi
|
- pip install coveralls
|
||||||
- if [[ $TRAVIS_PYTHON_VERSION == '2.7' ]]; then pip install astor --use-mirrors; fi
|
- if [[ $TRAVIS_PYTHON_VERSION == '2.6' ]]; then pip install argparse importlib unittest2 astor; fi
|
||||||
- if [[ $TRAVIS_PYTHON_VERSION == 'pypy' ]]; then pip install astor --use-mirrors; fi
|
- if [[ $TRAVIS_PYTHON_VERSION == '2.7' ]]; then pip install astor; fi
|
||||||
|
- if [[ $TRAVIS_PYTHON_VERSION == 'pypy' ]]; then pip install astor; fi
|
||||||
- python setup.py -q install
|
- python setup.py -q install
|
||||||
# # command to run tests
|
# # command to run tests
|
||||||
script: make travis
|
script: make travis
|
||||||
|
after_success: coveralls
|
||||||
notifications:
|
notifications:
|
||||||
email:
|
email:
|
||||||
- paultag@gmail.com
|
- paultag@gmail.com
|
||||||
|
2
Makefile
2
Makefile
@ -53,7 +53,7 @@ diff:
|
|||||||
r: d tox diff
|
r: d tox diff
|
||||||
|
|
||||||
travis:
|
travis:
|
||||||
nosetests -s
|
nosetests -s --with-coverage --cover-package hy
|
||||||
ifeq (PyPy,$(findstring PyPy,$(shell python -V 2>&1 | tail -1)))
|
ifeq (PyPy,$(findstring PyPy,$(shell python -V 2>&1 | tail -1)))
|
||||||
@echo "skipping flake8 on pypy"
|
@echo "skipping flake8 on pypy"
|
||||||
else
|
else
|
||||||
|
@ -8,7 +8,7 @@ Lisp and Python should love each other. Let's make it happen. [Try it](http://tr
|
|||||||
[![Build Status](https://travis-ci.org/hylang/hy.png?branch=master)](https://travis-ci.org/hylang/hy)
|
[![Build Status](https://travis-ci.org/hylang/hy.png?branch=master)](https://travis-ci.org/hylang/hy)
|
||||||
[![Downloads](https://pypip.in/d/hy/badge.png)](https://crate.io/packages/hy)
|
[![Downloads](https://pypip.in/d/hy/badge.png)](https://crate.io/packages/hy)
|
||||||
[![version](https://pypip.in/v/hy/badge.png)](https://crate.io/packages/hy)
|
[![version](https://pypip.in/v/hy/badge.png)](https://crate.io/packages/hy)
|
||||||
|
[![Coverage Status](https://coveralls.io/repos/hylang/hy/badge.png)](https://coveralls.io/r/hylang/hy)
|
||||||
|
|
||||||
Hylarious Hacks
|
Hylarious Hacks
|
||||||
---------------
|
---------------
|
||||||
|
@ -83,3 +83,15 @@ To build the docs in HTML::
|
|||||||
$ make html
|
$ make html
|
||||||
|
|
||||||
Write docs---docs are good! Even this doc!
|
Write docs---docs are good! Even this doc!
|
||||||
|
|
||||||
|
|
||||||
|
Core Development Rules
|
||||||
|
======================
|
||||||
|
|
||||||
|
All incoming changes need to be acked by 2 different members of Hylang's
|
||||||
|
core team. Additional review is clearly welcome, but we need a minimum of
|
||||||
|
2 signoffs for any change.
|
||||||
|
|
||||||
|
If a core member is sending in a PR, please find 2 core members that don't
|
||||||
|
include them PR submitter. The idea here is that one can work with the PR
|
||||||
|
author, and a second acks the entire change set.
|
||||||
|
@ -736,6 +736,7 @@ using the backquote (`) symbol.
|
|||||||
|
|
||||||
|
|
||||||
.. code-block:: clj
|
.. code-block:: clj
|
||||||
|
|
||||||
;; let `qux' be a variable with value (bar baz)
|
;; let `qux' be a variable with value (bar baz)
|
||||||
`(foo ~qux)
|
`(foo ~qux)
|
||||||
; equivalent to '(foo (bar baz))
|
; equivalent to '(foo (bar baz))
|
||||||
@ -751,6 +752,7 @@ be alternatively written using the (') symbol
|
|||||||
|
|
||||||
|
|
||||||
.. code-block:: clj
|
.. code-block:: clj
|
||||||
|
|
||||||
=> (setv x '(print "Hello World"))
|
=> (setv x '(print "Hello World"))
|
||||||
; variable x is set to expression & not evaluated
|
; variable x is set to expression & not evaluated
|
||||||
=> x
|
=> x
|
||||||
@ -758,6 +760,7 @@ be alternatively written using the (') symbol
|
|||||||
=> (eval x)
|
=> (eval x)
|
||||||
Hello World
|
Hello World
|
||||||
|
|
||||||
|
|
||||||
require
|
require
|
||||||
-------
|
-------
|
||||||
|
|
||||||
|
@ -1,24 +0,0 @@
|
|||||||
#!/usr/bin/env hy
|
|
||||||
|
|
||||||
;; Very much a knockoff (straight port) of Dan Gulotta's 2013 MIT Mystery Hunt
|
|
||||||
;; puzzle "The Halting Problem". His Copyright terms are unclear, so presume
|
|
||||||
;; that this is distributable, but not free.
|
|
||||||
|
|
||||||
|
|
||||||
(defn evaluate [f] ((f (lambda [x] (+ x 1))) 0))
|
|
||||||
|
|
||||||
(defn successor [n] (lambda [f] (lambda [x] (f ((n f) x)))))
|
|
||||||
(defn plus [m n] ((n successor) m))
|
|
||||||
(defn exponent [m n] (n m))
|
|
||||||
(defn zero [f] (lambda [x] x))
|
|
||||||
(defn one [f] (lambda [x] (f x)))
|
|
||||||
|
|
||||||
(defn predecessor [n] (lambda [f] (lambda [x]
|
|
||||||
(((n (lambda [g] (lambda [h] (h (g f))))) (lambda [y] x)) (lambda [z] z)))))
|
|
||||||
|
|
||||||
(defn subtract [m n] ((m predecessor) n))
|
|
||||||
|
|
||||||
(setv two (plus one one))
|
|
||||||
(setv three (plus two one))
|
|
||||||
|
|
||||||
(print (evaluate (exponent three three)))
|
|
@ -75,12 +75,6 @@ def test_bin_hy_icmd():
|
|||||||
assert "figlet" in output
|
assert "figlet" in output
|
||||||
|
|
||||||
|
|
||||||
def test_bin_hy_file():
|
|
||||||
ret = run_cmd("hy eg/nonfree/halting-problem/halting.hy")
|
|
||||||
assert ret[0] == 0
|
|
||||||
assert "27" in ret[1]
|
|
||||||
|
|
||||||
|
|
||||||
def test_bin_hy_missing_file():
|
def test_bin_hy_missing_file():
|
||||||
ret = run_cmd("hy foobarbaz")
|
ret = run_cmd("hy foobarbaz")
|
||||||
assert ret[0] == 2
|
assert ret[0] == 2
|
||||||
|
Loading…
Reference in New Issue
Block a user