Hy fork
Go to file
Gergely Nagy 5d895c2005 Making (import) a lot smarter
With these changes, the import function will become a lot smarter, and
will combine all of import, import-from and import-as in a hyly lispy
syntax:

 (import sys os whatever_else)
 (import [sys [exit argv]] [os :as real_os]
         [whatever_else [some_function :as sf]])

That is, each argument of import can be:

 - A plain symbol, which will be imported
 - A list, which will be handled specially

If the argument is a list, the first element will always be the module
name to import, the second member can be either of these:

 - A list of symbols to import
 - The ':as' keyword
 - Nothing

If it is the ':as' keyword, the third argument must be an alias. If it
is a list of symbols to import, we'll iterate through that list too. If
any symbol is followed by an ':as' keyword, we'll pick all three, and
treat the third member as an alias. If there is nothing else in the
list, we'll import the module as-is.

All this combined fixes #113.

Signed-off-by: Gergely Nagy <algernon@madhouse-project.org>
2013-04-13 15:06:31 +02:00
bin Screw it; buyer beware. 2013-04-12 23:08:22 -04:00
docs small internals tweak 2013-04-08 21:53:06 -04:00
eg Add in a Python 3 hello world 2013-04-02 21:33:08 -04:00
hy Making (import) a lot smarter 2013-04-13 15:06:31 +02:00
tests Making (import) a lot smarter 2013-04-13 15:06:31 +02:00
.gitignore adding build to gitignore 2013-03-06 19:51:10 -05:00
.travis.yml Why is the blacklist not working? 2013-04-10 22:00:51 -04:00
AUTHORS Add @khinsen to AUTHORS 2013-04-09 19:55:19 -04:00
LICENSE Removing my name from the license. 2013-04-05 20:04:36 -04:00
Makefile removing site target 2013-04-12 23:46:28 -04:00
NEWS compiler: add else' support in try' 2013-04-09 17:00:30 +02:00
README.md update eww-arrr-el 2013-04-12 23:11:53 -04:00
requirements-dev.txt Syntax highlight blocks as clj 2013-04-01 12:55:16 -04:00
requirements.txt Adding back Python 2.6. 2013-03-13 20:02:16 -04:00
setup.cfg Adding in some basic bits in 2013-03-02 20:58:58 -05:00
setup.py Forgot these. 2013-03-27 22:19:57 -04:00
TODO note to self, changelog 2013-04-03 20:39:00 -04:00
tox.ini Add flake8 in tox 2013-04-06 21:16:28 +02:00

Hy

Lisp and Python should love each other. Let's make it happen.

Build Status

Hylarious Hacks

Django + Lisp

Python sh fun

OK, so, why?

Well. Python is awesome. So awesome, that we have so many tools to alter the languge in a core way, but we never use them.

Why?

Well, I wrote Hy to help people realize one thing about Python:

It's really goddamn awesome.

Oh, and lisps are neat.

Project