Commit Graph

2234 Commits

Author SHA1 Message Date
Paul Tagliamonte
8283920402 Merge branch 'master' into pr/251 2013-07-16 21:09:00 -04:00
Paul Tagliamonte
967bb95534 Merge branch 'master' into pr/237 2013-07-16 21:05:31 -04:00
Paul Tagliamonte
3dde930ede Merge branch 'master' into pr/236 2013-07-16 20:57:29 -04:00
Guillermo Vaya
6778e9b2e1 added @tuturto sugesstions and flake8 errors 2013-07-16 20:41:56 +02:00
Tuukka Turto
624dfdc8c9 clarified foreach - else 2013-07-16 20:23:38 +03:00
Guillermo Vaya
dda291cfb5 make assoc accept multiple values, also added a even/odd check for checkargs 2013-07-16 14:35:57 +02:00
Bob Tolbert
c42492ad84 Fix missing docstrings from defclass issue #248
Added ability to parse doc strings set in defclass declarations,
likei:

(defclass Foo [object]
  "this is the doc string"
  [[x 1]])
2013-07-15 06:58:08 -06:00
Joe H. Rahme
a85ba71a20 Removes link to interactive demo from docs 2013-07-15 10:45:42 +02:00
Paul Tagliamonte
7c91913122 Fix yielding to not suck (#151)
This adds a class to avoid returning when we have a Yieldable
 expression contained in the body of the function. This breaks Python
 2.x, and ought to break Python 3.x, but doesn't.

 We need this fo' context managers, etc.

 This commit also has work from @rwtolbert adding new testcases and
 fixes for yielded entries behind a while / for.
2013-07-14 13:11:27 -04:00
Bob Tolbert
df7bb1d29a Provide bin scripts for both Windows and *nix
Summary: This update does away with the scripts in bin and changes
setup.py to use entry_points in cmdline.py for the scripts 'hy' and
'hyc'.

This fixes installing and running on Windows.

The tests are updated to run the 'hy' script produced by setup.py
and not from bin/hy. This is more correct and makes the tox tests
run on both Window and *nix.

For running hy or nosetests directly in the source tree, you do have
to run 'python setup.py develop' first. But since tox runs and builds
dists, all tox tests pass on all platforms.

Also, since there is no built-in readline on Windows, the setup.py
only on Windows requires 'pyreadline' as a replacement.

Switched from optparse to argparse in cmdline.py

Instead of trying to manually separate args meant for
hy from args meant for a hy script, this switches from
optparse to argparse for the CLI.

argparse automatically peels out args meant for hy and leaves
the rest, including the user hy script in options.args.

This fixes the issue @paultag found running "hy foo" where
foo is not a real file. Also added a test that makes sure
trying to run a non-existent script exits instead of dropping
the user into the REPL.

Added argparse as setup.py resource (and removed from tox.ini) as well as removed uses of deprecated setf
2013-07-14 09:06:42 -06:00
Bob Tolbert
62f1f40830 Add set of new core functions
Add set of new core functions to the stdlib.

Moved the auto-import code from compile_expression to
HySymbol so that "even?' in this style expression will
be found and imported.

(list (filter even? [1 2 3 4 5]))

The core functions are documented in 2 sections, one
for basic functions like (even?..) and (nth ...) and
one for all the sequence functions.

Update: This removes all the caching decorators, misnamed as
'lazy-seq' from the core. All sequence methods now just use
yield to return a generator, so they are Python-lazy

Further refinements of core functions

Cleaned up the docs to use 'iterator' instead of 'generator'

Fixed drop to just return the iterator instead of an extra
yield loop. But also added a test to catch dropping too
many.
2013-07-13 09:55:16 -06:00
Julien Danjou
9cf3ee4b43 Merge pull request #241 from rahmu/240
Removes `setf` in favor of `setv`
2013-07-13 00:35:49 -07:00
Tuukka Turto
6dc424007f removed setf 2013-07-10 11:39:27 +03:00
Tuukka Turto
e09a89b7cf foreach - else clarification 2013-07-10 08:24:58 +03:00
Tuukka Turto
08734602ca defclass clarification 2013-07-10 07:11:11 +03:00
Joe H. Rahme
236ebccc74 Removes setf in favor of setv 2013-07-10 02:16:49 +02:00
Tuukka Turto
9c31e34a26 documentation for builtins
relates #18
2013-07-09 12:04:53 +03:00
Paul Tagliamonte
d4aa9b8632 Update NEWS. 2013-07-07 14:03:25 -04:00
Paul Tagliamonte
07cf0b72d1 0.9.10 release. Bugfix only. 2013-07-06 19:41:08 -04:00
Paul Tagliamonte
3358b5581c Include hy files in the release. 2013-07-06 19:40:47 -04:00
Paul Tagliamonte
e005cb773c Preparing 0.9.9 2013-07-06 19:34:01 -04:00
Paul Tagliamonte
801a16c415 Adding NEWS entry 2013-07-06 15:04:11 -04:00
Nicolas Dandrimont
1cb8db1cb2 Fix flake error 2013-07-06 20:39:02 +02:00
Morten Linderud
e4ae9880f4 Don't leave cruft around in sys.modules when an import fails.
Closes: #214, #225

Squashed from a bunch of commits by @olasd
2013-07-06 20:37:44 +02:00
Paul Tagliamonte
b78be9a594 Jank @olasd's hack, clean up core.
The core shall from now on be only for the core language bits. Macro
 bits shall live in hy.macros and in hy.compiler. This cleans up
 garbage.
2013-07-06 14:00:11 -04:00
Paul Tagliamonte
8d96f68bd6 Merge branch 'master' into pr/222 2013-07-06 13:45:29 -04:00
Paul Tagliamonte
2c4c95725e Style fixes. 2013-07-06 13:43:05 -04:00
Tuukka Turto
35e28e52ac documentation for some of the builtins
references #18
2013-07-06 19:48:09 +03:00
Ralph Moritz
748f54b2f9 Move code from hy.readline_helpers into new hy.completer.completion context
manager so we can "wrap" readline completion around REPL interaction.
2013-07-06 18:02:01 +02:00
Paul Tagliamonte
5554c50671 Updating NEWS entries. 2013-07-04 22:25:40 -04:00
Paul Tagliamonte
56ccdf97e3 Style fixes. 2013-07-04 21:31:17 -04:00
Paul Tagliamonte
2e909d5357 Merge branch 'master' into pr/213 2013-07-04 21:25:58 -04:00
Ralph Moritz
888dc19882 Get Hy working on Windows by making readline use conditional. 2013-07-01 22:41:56 +02:00
Julien Danjou
b22f477081 Merge pull request #202 from paultag/paultag/feature/start-language-lib
Add in a language lib.
2013-07-01 08:52:57 -07:00
Tuukka Turto
cabf40bd2a documented else / finally syntax for try / catch 2013-06-30 08:27:15 +03:00
Paul Tagliamonte
86af7eacf1 Add in a new core language file.
This will let us implement common functions seen in other lisps,
 and allow them to be importable, without explicit imports. The goal
 is to keep this as small as we can; we don't want too much magic.

 I've added `take' and `drop' as examples of what we can do.
2013-06-29 18:51:11 -04:00
Paul Tagliamonte
ceea41ac93 Merge branch 'master' into pr/197 2013-06-29 11:53:28 -04:00
Nicolas Dandrimont
b65c2a4596 whitespace fix 2013-06-26 08:50:37 +02:00
Guillermo Vaya
482282178c changed macro to ignore empty trees and made compiler do the substitution work 2013-06-26 08:50:37 +02:00
Guillermo Vaya
4c7b4f70e3 changed try to testing for an empty list for legibility (as suggested by paultag), also added to authors 2013-06-26 08:50:37 +02:00
Guillermo Vaya
7b7b953410 set the value of empty hy expression to [] 2013-06-26 08:50:37 +02:00
Paul Tagliamonte
9b45dd4ffe add tumblr printer 2013-06-25 21:47:54 -04:00
Paul Tagliamonte
612b9f783f Merge branch 'master' into pr/209 2013-06-25 19:24:29 -04:00
Paul Tagliamonte
59550c9abd tell flake8 to shut up 2013-06-25 19:23:44 -04:00
Paul Tagliamonte
2f16ad6e78 Merge branch 'master' into pr/208 2013-06-25 19:20:58 -04:00
Duncan McGreggor
de8b62d0d5 Added Twisted example. 2013-06-25 10:54:40 -07:00
Morten Linderud
42468051f5 Builtins fix for 2 and 3, tests aswell 2013-06-25 17:02:02 +02:00
Bob Tolbert
1f977cae8d Merge remote-tracking branch 'upstream/master' 2013-06-23 23:09:30 -06:00
Morten Linderud
73c1f218e2 fixed a bug and added tests 2013-06-24 03:26:40 +02:00
Morten Linderud
a455800bc7 added break and continue 2013-06-24 02:40:10 +02:00