Commit Graph

138 Commits

Author SHA1 Message Date
Gergely Nagy
3f01ed5014 Add a Botsbuildbots function
A tribute to Portal 2, this function will return an infinite list of the
contents of the AUTHORS file on GitHub master (assuming requests is
installed). Except, the macro does this, the function never gets called,
it is purely there for tribute reasons.

Signed-off-by: Gergely Nagy <algernon@madhouse-project.org>
2014-09-05 12:37:51 +02:00
han semaj
99db02668b Fix 'some' (first logical true value or nil) 2014-09-04 21:29:38 +12:00
Morten Linderud
bc0ef3ea14 Merge pull request #641 from microamp/issue-638
Fix #638: Make nth return default value when out of bounds
2014-09-03 14:28:01 +02:00
han semaj
c8985a898b Shadow '+' to handle string/list concatenation 2014-08-26 21:38:52 +12:00
han semaj
ecc664337d Make nth return default value when out of bounds 2014-08-23 23:35:31 +12:00
Paul Tagliamonte
37fc9e08d0 Merge branch 'master' into pr/635 2014-08-18 12:10:08 -04:00
han semaj
3f1a24bfe3 Implement interleave and interpose 2014-08-17 14:53:57 +12:00
Foxboron
c8adf9b726 Renamed stdin -> from-file and removed apply from tests + docs 2014-08-14 18:18:05 +02:00
Foxboron
f7675c829e Added read and tests 2014-08-12 18:37:46 +02:00
han semaj
2628653380 Remove 'remove' (duplicate of 'filterfalse') 2014-07-21 23:07:59 +12:00
han semaj
f94381b7e3 Export filterfalse/input/zip_longest 2014-07-21 23:01:18 +12:00
Tuukka Turto
f3ecb96119 Merge branch 'master' into pr/593 2014-06-24 23:23:48 +03:00
James King
8e173937c3 Add shadow.hy to core
This new core module allows us to shadow the builtin Python operators so
they may be passed to sequence functions that expect functions:

    => (map / [1 2 3 4 5])
    [1.0, 0.5, 0.3333333333333333, 0.25]
2014-05-26 21:50:47 -04:00
John MacKenzie
15ad6cb998 defmacro/g! and HyObject#startswith
Currently, defmacro/g! doesn't respond well when it comes across a
HyObject that doesn't respond to the instance method startswith (e.g.
HyInteger, HyFloat, etc.). This updates defmacro/g! to be a little
safer when searching for the gensyms it needs to create.
2014-05-15 01:51:38 +00:00
Tuukka Turto
726d1735db Merge branch 'master' into pr/571
Conflicts:
	AUTHORS
	tests/native_tests/core.hy
2014-05-13 09:32:51 +03:00
Paul Tagliamonte
2b08674c88 Merge branch 'master' into pr/522 2014-05-12 22:10:09 -04:00
Paul Tagliamonte
ca0271df95 Merge branch 'master' into pr/574
Conflicts:
	AUTHORS
2014-05-12 20:15:51 -04:00
Christian Weilbach
01ee54cf62 Merge https://github.com/hylang/hy
Fix butlast and test for disassemble.

Conflicts:
	hy/core/language.hy
2014-05-03 16:33:39 +02:00
Tuukka Turto
b1a928037e Merge branch 'master' into pr/526 2014-05-02 10:34:37 +03:00
pyos
8e4b21103c Reimplement some built-ins in terms of the standard library.
As a result:

  * functions such as `nth` should work correctly on iterators;
  * `nth` will raise `IndexError` (in a fashion consistent with `get`)
    when the index is out of bounds;
  * `take`, etc. will raise `ValueError` instead of returning
    an ambiguous value if the index is negative;
  * `map`, `zip`, `range`, `input`, `filter` work the same way (Py3k one)
    on both Python 2 and 3 (see #523 and #331).
2014-04-29 18:03:43 +04:00
Tuukka Turto
bdd8e3c82e merge #547 - keyword? 2014-04-28 21:59:33 +03:00
Matthew Wampler-Doty
f2f38a1cf8 Refactor for loop to use cond 2014-04-22 16:47:42 -07:00
Matthew Wampler-Doty
5c9a8f8975 Closes #573, restores 0.9.12 for loop behavior (and everyone wins!) 2014-04-22 08:57:18 -07:00
Matthew Wampler-Doty
43f63e9ae7 Shortening docstring 2014-04-21 13:17:40 -07:00
Matthew Wampler-Doty
834b0019a7 Fixing doto to be API compatible with Clojure's doto 2014-04-21 12:35:56 -07:00
Tuukka Turto
21cff9d14f initial implementation for doto macro
relates #567
2014-04-21 08:04:03 +03:00
Paul Tagliamonte
217f3ad65f Merge branch 'master' into pr/515 2014-04-10 22:52:41 -04:00
Christopher Allan Webber
d5194f23fa Properly add yield-from, using python's real "yield from".
The yield-from that existed previously wasn't actually implementing the
full complexity of "yield from":

  http://legacy.python.org/dev/peps/pep-0380/#formal-semantics

... this includes passing along errors, and many other things.

Also removes the yield-from backport macro, since it does not seem
possible at present to conditionally build macros.

Thus, there is no longer yield-from on pre-python-3.3 systems.

Includes updated docs and tests to reflect all this.
2014-04-10 14:07:49 -05:00
Christopher Allan Webber
774aad2ca8 defmain macro; handles the whole if __name__ == __main__ / main function dance
Example:

  (defmain [&rest args]
    (print "now we're having a fun time!")
    (print args))

Which outputs:

  $ hy test.hy
  now we're having a fun time!
  (['test.hy'],)

Includes documentation and tests.
2014-04-10 13:58:38 -05:00
Christopher Allan Webber
f3d978c5a3 Added lisp-if (or lif), with tests and documentation.
Now everyone can get along and everyone can have a pony, and that pony is
actually a unicorn that shoots rainbows from its horn.
2014-04-10 13:51:28 -05:00
Berker Peksag
3528cc8278 Kill kwapply.
Closes #433.
2014-04-09 20:10:31 +03:00
Paul Tagliamonte
3a9cf486db Add a keyword? function to detect keywords.
Thanks to algernon for the function body; huge improvement.
2014-04-02 22:22:23 -04:00
Berker Peksag
a11f92da37 Merge pull request #492 from theanalyst/fix/coll
Replace forgotten instances of coll? function
2014-03-08 18:42:38 +02:00
Christian Weilbach
1a6b484ccb Remove profile export. 2014-03-02 12:24:05 +01:00
Christian Weilbach
2e4b77267e Remove profile fn.
https://github.com/hylang/hy/pull/522#issuecomment-35972534
2014-02-26 00:03:42 +01:00
Christian Weilbach
46d77f69e6 Fix disassembly, add butlast, profile 2014-02-24 23:08:40 +01:00
Berker Peksag
6829d6fb3a Tweak the zipwith doc a bit and add @kirbyfan64 to AUTHORS. 2014-02-22 02:21:34 +02:00
kirbyfan64
d282d65cde Add zipwith 2014-02-22 02:14:27 +02:00
han semaj
24a1567b00 Implement every? and some 2014-02-11 21:42:56 +13:00
Abhishek L
a41a3c7edc faster distinct: maintain seen items in a set
* hy/core/language.hy: maintain the seen items in a set instead of a
  list in `distinct`. This is much faster for lookups.
2014-02-04 01:35:41 +05:30
Abhishek L
4432c00c59 Replace forgotten instances of coll? function
Replacing coll? wherever applicable
2014-02-03 21:48:30 +05:30
Abhishek L
4b54e3c748 Merge master onto pr/471
Conflicts:
	hy/core/language.hy
2014-01-30 21:50:23 +05:30
James King
cbb8cc1d37 Add integer-char? to core 2014-01-28 17:28:41 -05:00
Nicolas Dandrimont
52144820ca Add a cons object and related mechanisms
Closes: #183
2014-01-23 23:08:52 +01:00
Nicolas Dandrimont
fad67bd8f5 Merge branch 'master' into pr/468 2014-01-23 22:14:23 +01:00
Nicolas Dandrimont
b99af411c8 Merge branch 'master' into pr/461
Conflicts:
	tests/native_tests/native_macros.hy
2014-01-23 21:57:17 +01:00
Abhishek L
10f1f24a18 Adding a simple `identity' function
* hy/core/language.hy: Adding a simple `identity` function that returns
  the argument supplied to it

* docs/language/core.rst: Updated docs with identity function
2014-01-22 00:56:28 +05:30
Gergely Nagy
3bad6c14ee
hy/core/macros.hy: Reimplement (unless) in terms of (if-not)
Signed-off-by: Gergely Nagy <algernon@madhouse-project.org>
2014-01-18 22:57:29 +01:00
Gergely Nagy
e90b24b73a
hy/core/macros.hy: Add an (if-not) macro
Sometimes it is better to start with the false condition, sometimes that
makes the code clearer. For that, the (if-not) macro, which simply
reverses the order of the condition blocks, can be of great use.

Signed-off-by: Gergely Nagy <algernon@madhouse-project.org>
2014-01-18 22:56:20 +01:00
Gergely Nagy
21709f0199 hy/core/macros.hy: Add defn-alias / defun-alias
In the same vein as defmacro-alias, this implements defn-alias /
defun-alias, which does essentially the same thing as defmacro-alias,
but for functions.

Signed-off-by: Gergely Nagy <algernon@balabit.hu>
2014-01-18 16:09:35 +01:00