Commit Graph

2234 Commits

Author SHA1 Message Date
Nicolas Dandrimont
761926df95 Merge branch 'reqs-astor' of https://github.com/berkerpeksag/hy into berkerpeksag-reqs-astor 2013-12-23 15:25:46 +01:00
Foxboron
c9fdd40c9f Hy reader macros #377
Added first iteration of reader macros
Refactored defmacro and defreader
Added test inn hy/tests/lex/test_lex.py
Added new test in hy/tests/native/tests
Added new test in hy/tests/macros.

changed the error given in the dispatch macro and added some handling for missing symbol and invalid characters
2013-12-23 14:33:51 +01:00
Berker Peksag
27691e4d82 Remove astor from requirements-dev.txt.
This is not necessary since 870c136.
2013-12-23 08:12:22 +02:00
Nicolas Dandrimont
1a701d4dc4 Whitespace fix 2013-12-22 20:04:12 +01:00
Nicolas Dandrimont
ec2b5fb7ad Merge branch 'kwapply-macro' of https://github.com/Willyfrog/hy into Willyfrog-kwapply-macro
Conflicts:
	hy/core/language.hy
	hy/core/macros.hy
	tests/native_tests/language.hy
2013-12-22 20:03:00 +01:00
Nicolas Dandrimont
ceb612f385 Merge branch 'fix/arith-identity' of https://github.com/theanalyst/hy into theanalyst-fix/arith-identity 2013-12-22 19:32:10 +01:00
Nicolas Dandrimont
799c39ffad Implement del
Closes #385.
2013-12-22 20:26:57 +02:00
Nicolas Dandrimont
0f96c24965 Make _storeize generic
This allows to change an expression's context to something else than ast.Store if needed.
2013-12-22 20:26:57 +02:00
Paul Tagliamonte
cccf90c702 Merge branch 'master' into pr/374 2013-12-22 13:22:39 -05:00
Paul Tagliamonte
8efefc4817 Merge branch 'master' into pr/379 2013-12-22 13:18:59 -05:00
Guillermo Vaya
0109234eb7 Added meth tests by mocking a Flask app 2013-12-20 21:16:56 +01:00
Bob Tolbert
3204c2a574 Fix for readline REPL problem Darwin Python3
On OS X Mavericks, the Hy REPL doesn't allow the 'b' character when
running with Python 3.3. This appears to be a common problem
for Darwin and readline as mentioned in this post

http://superuser.com/questions/297527/cant-type-the-b-letter-in-python-shell-in-os-x
2013-12-20 07:23:35 -07:00
Berker Peksag
abcd97b1f1 Add update_coreteam script. 2013-12-17 18:50:01 +02:00
Vasudev Kamath
58313884b2 Added information about core team members
Signed-off-by: Vasudev Kamath <kamathvasudev@gmail.com>
2013-12-17 14:36:19 +02:00
Bob Tolbert
c80e3c75a0 Adding automatic gensym macro
Adding to the manual gensym for macros are 2 new
macros, but very literal from the CL in
letoverlambda.

The first is the (with-gensyms ...) macro that
can generate a small set of syms for a macro. Works
something like:

(defmacro adder2 [A B]
  (with-gensyms [a b]
    `(let [[~a ~A] [~b ~B]]
       (+ ~a ~b))))

and ~a and ~b will be replaced with (gensym "a") and
(gensym "b") respectively.

Then the final macro is a new defmacro that will automatically
replace symbols prefaced with "g!" with a new gensym based on the
rest of the symbol. So in this final version of 'nif':

(defmacro/g! nif4 (expr pos zero neg)
  `(let [[~g!result ~expr]]
     (cond [(pos? ~g!result) ~pos]
           [(zero? ~g!result) ~zero]
           [(neg? ~g!result) ~neg])))

all uses of ~g!result will be replaced with (gensym "result").
2013-12-15 18:47:46 -07:00
Bob Tolbert
f5d88bb108 gensym in Hy
Simple implementation of gensym in Hy.

Returns a new HySymbol.

Usable in macros like:

(defmacro nif [expr pos zero neg]
  (let [[g (gensym)]]
    `(let [[~g ~expr]]
       (cond [(pos? ~g) ~pos]
             [(zero? ~g) ~zero]
             [(neg? ~g) ~neg]))))

This addresses all the general comments about (gensym), and doesn't
try to implement "auto-gensym" yet. But clearly the macro approach
instead of the pre-processor approach (as described in the
letoverlambda (http://letoverlambda.com/index.cl/guest/chap3.html#sec_5)
is the way to go
2013-12-15 12:36:36 -07:00
Abhishek L
f72ff53f41 Operators + and * work without args, fixes #372
Like other lisps, operators `+` and `*` return their identity values
when called with no arguments. Also with a single operand they return
the operand.

This fixes #372
2013-12-16 00:04:43 +05:30
Morten Linderud
c11b231c1c Merge pull request #328 from berkerpeksag/add-astor
Add astor to install_requires.
2013-12-11 08:13:03 -08:00
Morten Linderud
bf838619f1 Merge pull request #369 from berkerpeksag/skip-test
Explicitly skip the skipped test in test_bin.
2013-12-11 08:10:30 -08:00
Berker Peksag
e674eb4b56 Explicitly skip the skipped test in test_bin. 2013-12-10 19:43:56 +02:00
Berker Peksag
3e8941cdde Convert stdout and stderr to UTF-8 properly in the run_cmd helper. 2013-12-10 18:59:06 +02:00
Berker Peksag
870c136469 Add astor to install_requires.
`hy --spy` fails on hy 0.9.11.

    $ hy --spy
    hy 0.9.11
    => (type "hy")
    Traceback (most recent call last):
      File "/usr/local/lib/python2.7/dist-packages/hy/cmdline.py", line 68, in print_python_code
        import astor.codegen
    ImportError: No module named astor.codegen
2013-12-10 17:46:45 +02:00
Guillermo Vaya
aeb0cd4c72 Fixed docstring 2013-12-09 11:49:17 +01:00
Guillermo Vaya
f913c2aa8c meth wasn't accepting correctly its parameters
Now also accepts more than 1 statement in the code part of the macro
refactored to use only 1 codebase (no more route != route-with-macros)
2013-12-09 11:48:13 +01:00
Kevin Zita
8970662dcb Update requirements.txt and setup.py to use rply upstream.
Closes #364.
2013-12-08 07:11:42 +02:00
Abhishek L
948e6d34c7 Merge branch master onto pr/284
Conflicts:
	hy/core/language.hy
2013-12-06 20:07:39 +05:30
Morten Linderud
699396b5a3 Merge pull request #358 from theanalyst/feature/macros-none
Allow macros to return None, fixes #357
2013-12-06 03:53:44 -08:00
Morten Linderud
db68e230b6 Merge pull request #361 from berkerpeksag/spy-versionadded
Add versionadded directive to cli.rst.
2013-12-06 03:48:40 -08:00
Berker Peksag
ecd13ef659 Add versionadded directive to cli.rst. 2013-12-06 07:51:32 +02:00
Abhishek L
f1c68bd51a Allow macros to return None, fixes #357
Allows Hy macros to return None, to test this

  (defmacro foo [])
  (foo)

Should work now
2013-12-06 00:27:45 +05:30
Nicolas Dandrimont
cc147512fc Merge branch 'paultag/feature/support-question-marks' of https://github.com/paultag/hy into paultag-paultag/feature/support-question-marks
Conflicts:
	hy/core/language.hy
2013-12-05 19:28:59 +01:00
Nicolas Dandrimont
f4f0972e6e Merge branch 'master' of https://github.com/hcarvalhoalves/hy into hcarvalhoalves-master 2013-12-05 19:10:34 +01:00
Nicolas Dandrimont
f0a9149383 Merge branch 'string-cast' of https://github.com/Willyfrog/hy into Willyfrog-string-cast 2013-12-05 19:04:22 +01:00
Joe H. Rahme
61112138ca Adds try-hy to the docs
As requested in PR #350.
This commit also adds Joe "rahmu" Hakim Rahme to the AUTHORS file
2013-12-05 23:07:46 +05:30
Berker Peksag
2c76d8ec90 Document command line options. 2013-12-05 22:03:05 +05:30
Nicolas Dandrimont
f9a1995be8 Make HyObject.replace more resilient
This makes it work on quoted objects
2013-12-04 03:25:33 +02:00
Paul Tagliamonte
2f845c2a1e Add @hcarvalhoalves to AUTHORS. We fucked up that PR :) 2013-12-03 00:03:13 -05:00
Morten Linderud
c933f703ff Merge pull request #349 from hcarvalhoalves/fix-osx-complete
Fix REPL completions on OS X
2013-12-02 21:01:35 -08:00
Paul Tagliamonte
fd2421587e Merge branch 'master' into pr/346 2013-12-02 23:48:58 -05:00
Paul Tagliamonte
31ad46c550 Erm, revert that. Apparently that wasn't proper. 2013-12-02 23:47:43 -05:00
Paul Tagliamonte
887f8819d4 add coveralls token 2013-12-02 23:46:30 -05:00
Paul Tagliamonte
de424fd2b6 Merge branch 'master' into pr/347 2013-12-02 23:41:54 -05:00
Paul Tagliamonte
611141a8e8 Merge branch 'master' into pr/348 2013-12-02 23:41:07 -05:00
Henrique Carvalho Alves
1b7d7bcef7 Fix REPL completions on OS X 2013-12-03 01:07:05 -02:00
Abhishek L
ba3ba37665 Adding support for coverage tests at coveralls
This commit adds support for coverage tests at coveralls.io,
using coverage plugin from nosetests
2013-12-03 01:58:35 +05:30
J Kenneth King
3972878d98 Add link to try-hy 2013-12-02 09:30:26 -05:00
Guillermo Vaya
3cc0f8a717 Added info about tox, so people can use it prior to a PR 2013-12-02 12:07:05 +01:00
Paul Tagliamonte
fd60a864eb Translate all foo? -> is_foo. Close #334
The fancypants Hy award goes to Nick for coming up with the quoted
symbol hack for exports. This broke with foo?, since the export string
needs to be is_foo, but using a quoted string will pick up the change
due to it being a Symbol.

Mad clown love for that, @olasd.
2013-12-01 15:03:31 -05:00
Paul Tagliamonte
9531d772cf add the start of hacking rules 2013-12-01 12:56:26 -05:00
Paul Tagliamonte
c255607205 don't test the halting problem anymore. 2013-12-01 09:48:16 -05:00