Commit Graph

10 Commits

Author SHA1 Message Date
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
Nicolas Dandrimont
a90c866327 Rewrite language.hy not to require hy.core.macros
As was intended when the bootstrap and core macros were separated.
2013-09-29 18:13:28 +02:00
Bob Tolbert
7e8a7edbdc finally fixed access to hy.core.macros here. have to explicitly require them 2013-09-14 12:17:06 -06:00
Bob Tolbert
d9dee8ec67 One more commit to change the test for Python 2/3 to a macro
Note that this can't use the macro in hy.core.macros so there
is a local copy in language.hy
2013-09-03 18:41:11 -06:00
Bob Tolbert
9d2ad4b4ff slightly cleaner version of drop-while, could use yield-from when ready 2013-09-03 13:52:00 -06:00
Bob Tolbert
399ea1889a Second (smaller) set of native core functions
This rounds out the first pass at a set of core functions, adding
some that were not in the first PR.

From here I'm working on a contrib.seq and contrib.io module to
hold less obvious but maybe interesting native functions that can
move to core if desired.

This should also close out issure #150 asking for some core
functions like these.
2013-09-03 13:52:00 -06:00
kaizoku
b892ec4e66 Add zero? predicate to check if an object is zero 2013-09-02 02:28:21 -07:00
Bob Tolbert
41ae4f4d2c Update:
Updated most methods to replace While with For, and added tons of new tests
    for things like (cycle []) and lists with None's in them.

    thanks @olasd

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-29 08:52:28 -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
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