Commit Graph

450 Commits

Author SHA1 Message Date
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
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
2f16ad6e78 Merge branch 'master' into pr/208 2013-06-25 19:20:58 -04:00
Morten Linderud
42468051f5 Builtins fix for 2 and 3, tests aswell 2013-06-25 17:02:02 +02: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
Paul Tagliamonte
289586b340 Adding back in keywords.
Yes, I'm your hero, @algernon
2013-06-18 22:57:51 -04:00
Paul Tagliamonte
f9b13a625f Style fix 2013-06-18 21:48:42 -04:00
Paul Tagliamonte
b00f181e1e Merge branch 'master' into pr/187 2013-06-18 21:17:13 -04:00
Paul Tagliamonte
0f9324e794 Merge branch 'master' into pr/192 2013-06-08 20:13:53 -04:00
Paul Tagliamonte
d15aa31a32 style fixes 2013-06-08 20:10:27 -04:00
Thomas Ballinger
00da0468e6 larger kludge for escaped characters 2013-06-07 17:07:22 -04:00
Konrad Hinsen
6eacf63b53 Provide both eval-and-compile and eval-when-compile 2013-06-07 16:36:04 +02:00
Konrad Hinsen
80105d9731 eval-when-compile permits compile-time definitions that can be used from macros 2013-06-07 16:36:04 +02:00
Konrad Hinsen
12abef5ed5 Forgot boolean constants.. 2013-06-07 16:35:28 +02:00
Konrad Hinsen
e47bac1f96 Permit macros to return constants 2013-06-05 12:19:06 +02:00
Paul Tagliamonte
9c28e0292d Merge branch 'master' into pr/185
Conflicts:
	hy/macros.py
	tests/compilers/test_compiler.py

Hoodoggy!
2013-05-17 11:17:51 -04:00
Paul Tagliamonte
c0fd41620f Merge branch 'master' into pr/182 2013-05-17 11:09:37 -04:00
Paul Tagliamonte
5a1b004bfb Merge branch 'master' into pr/179 2013-05-17 11:08:30 -04:00
Paul Tagliamonte
81096596c7 style fix - long line 2013-05-17 11:07:36 -04:00
Konrad Hinsen
269da19d76 Make macros module-specific.
A macro is available in the module where it was defined and
in any module that does a require of the defining module.
Only macros defined in hy.core are globally available.
Fixes #181
2013-05-16 15:34:14 +02:00
Nicolas Dandrimont
9e03e0e6ec Modify HyDict semantics to allow nesting expressions
HyDicts are now HyLists, that get compiled down to dicts
only by the compiler.
2013-05-14 11:43:17 +02:00
Julien Danjou
66e5af4a82 Write a test for builds() check
Signed-off-by: Julien Danjou <julien@danjou.info>
2013-05-14 11:03:13 +02:00
Julien Danjou
4e202aa1a5 Check that compiler error are user always user friendly
Signed-off-by: Julien Danjou <julien@danjou.info>
2013-05-13 18:14:39 +02:00
Paul Tagliamonte
de85940114 Meh, 0.9.8 time. 2013-05-12 13:40:53 -04:00
Paul Tagliamonte
8717d40e19 Rushed fix for the contrib.meth macros 2013-05-12 13:40:30 -04:00
Nicolas Dandrimont
5a74fff7e6 Fix up the native-macros to use compiler imports 2013-05-11 21:25:21 +02:00
Paul Tagliamonte
636eec8f51 style fixes 2013-05-11 13:59:19 -04:00
Nicolas Dandrimont
b380b330cd Add a defmacro builtin 2013-05-11 09:13:15 +02:00
Nicolas Dandrimont
0986f9001e Change macros to be called with separate arguments
This provides free argument-length checking for macros.
2013-05-11 09:09:34 +02:00
Nicolas Dandrimont
74d4937078 Don't return a useless pass in require 2013-05-11 08:04:59 +02:00
Paul Tagliamonte
2426237916 Add the (require) form. 2013-05-10 23:43:34 -04:00
Nicolas Dandrimont
2860ef6ff7 Don't macro-expand inside quotes 2013-05-11 00:29:42 +02:00
Nicolas Dandrimont
68399b9fc3 Make sure splicing works at all times 2013-05-11 00:26:37 +02:00
Nicolas Dandrimont
58bb3239ee Distinguish between quote and quasiquote 2013-05-10 23:42:38 +02:00
Nicolas Dandrimont
322a9992e5 Implement unquote and unquote-splicing 2013-05-10 23:42:38 +02:00
Paul Tagliamonte
9811b7514e Merge branch 'master' into pr/171 2013-05-09 20:39:49 -04:00
Paul Tagliamonte
1fa53f9255 Try/Except: Ensure that we return properly
From both inside a try and in an exception handler.
2013-05-08 20:41:16 -04:00
Nicolas Dandrimont
0055f00a76 Allow kwapply for any expression.
This fixes #103.
2013-05-09 02:28:42 +02:00
Paul Tagliamonte
98134e7396 Merge branch 'master' into bugfix/paultag/fix-try-except 2013-05-08 20:22:51 -04:00
Paul Tagliamonte
066c9781c7 Merge branch 'master' into pr/170 2013-05-08 20:11:57 -04:00
Paul Tagliamonte
058197a24f Allow returning inside a try / except. Closes #163 2013-05-08 20:00:09 -04:00
Nicolas Dandrimont
4e3f842972 Add &optional arguments.
Python doesn't really have that concept, so make them clash with &key arguments.
2013-05-08 21:11:33 +02:00
Nicolas Dandrimont
772927c53d Drop the bare names that were sprinkled everywhere in the generated AST.
This closes #162

We make sure not to drop *explicitly written* bare names.
2013-05-08 18:49:07 +02:00
Nicolas Dandrimont
c7176c05c0 Merge branch 'jd/defclass' of https://github.com/jd/hy into jd-jd/defclass 2013-05-08 15:30:20 +02:00
Julien Danjou
a823aca0c8 Run unit tests against hy2py
Signed-off-by: Julien Danjou <julien@danjou.info>
2013-05-08 14:39:38 +02:00
Julien Danjou
ad7e110af4 Implements defclass
This fixes issue #156

Signed-off-by: Julien Danjou <julien@danjou.info>
2013-05-08 12:38:57 +02:00