hy/tests
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
..
compilers Updating yield. 2013-04-12 23:48:58 -04:00
importer Fix flake8 errors in tests 2013-04-06 21:22:35 +02:00
lex Merge remote-tracking branch 'khinsen/float_and_complex_2' into paultag/master 2013-04-12 18:16:43 +02:00
macros Fix flake8 errors in tests 2013-04-06 21:22:35 +02:00
native_tests Making (import) a lot smarter 2013-04-13 15:06:31 +02:00
resources Test importing things with dashes 2013-04-07 09:54:53 -04:00
__init__.py Fix flake8 errors in tests 2013-04-06 21:22:35 +02:00