Commit Graph

124 Commits

Author SHA1 Message Date
Gergely Nagy
32f5d5dea7 Drop a set of brackets from with.
This changes with syntax from (with [[x (expr)] (expr)] ...) to (with
[x (expr) (expr)] ...). Should have no ill side effects apart from the
syntax change.

Closes #852.

Signed-off-by: Gergely Nagy <algernon@madhouse-project.org>
2015-10-01 10:08:04 +02:00
Gergely Nagy
9f88e07e1d Drop a set of brackets from let.
This changes let to use a flat list of symbol-value pairs instead of a
vector of vectors. One side effect is that (let [[a 1] z]) is not
expressible now, and one will explicitly need to set a nil value for z,
such as: (let [a 1 z nil]).

Closes #713.

Signed-off-by: Gergely Nagy <algernon@madhouse-project.org>
2015-10-01 10:08:04 +02:00
Gergely Nagy
26f342d580 Teach apply about symbol mangling
apply now mangles strings and keywords according to the Hy mangling
rules (by using the same function, now imported from
hy.lex.parser). With this change, if the dict passed to apply has
keywords, strings or quoted symbols, they'll get mangled, to turn them
into proper keys.

This only works for the cases where the keys are directly in the apply
params. A previously deffed dict, or key through a variable will not be
mangled.

This closes #219.

Signed-off-by: Gergely Nagy <algernon@madhouse-project.org>
2015-09-24 09:47:12 +02:00
Paul Tagliamonte
fc5d74ba85 Add in documentation for non-base 10 numbers 2015-09-15 12:18:56 -04:00
Ryan Gonzalez
6c076f76f7 Allow 'for' and 'cond' to take a multi-expression body (closes #868) 2015-08-10 10:14:55 +02:00
Gergely Nagy
54fb0102aa Merge pull request #875 from algernon/glc/defclass
defclass reimagined
2015-08-10 09:39:00 +02:00
Gergely Nagy
dee02c5928
docs: Minor corrections, related to the alias removals
Fixed up the documentation language here and there, related to the alias
removals in previous commits.

Signed-off-by: Gergely Nagy <algernon@madhouse-project.org>
2015-08-10 09:33:23 +02:00
Gergely Nagy
8e2a892469
hy.contrib.alias: Move defn-alias and defmacro-alias here
As discussed in #880, move defn-alias and defmacro-alias to a contrib
module.

Signed-off-by: Gergely Nagy <algernon@madhouse-project.org>
2015-08-10 09:24:48 +02:00
gilch
7d8ddd9ecb remove lisp-if / lisp-if-not in favor of lif / lif-not 2015-08-09 01:21:12 -06:00
gilch
4cdfdfbafe remove defun in favor of defn 2015-08-09 01:09:52 -06:00
gilch
33e0b4b3db remove progn in favor of do 2015-08-09 01:00:51 -06:00
gilch
66c1f38fcc remove catch in favor of except 2015-08-09 00:53:10 -06:00
gilch
e8d26f1067 remove throw in favor of raise 2015-08-09 00:52:42 -06:00
Calem Bendell
12db748c97 corrected slice to cut in docs
corrected slice to cut in the documentation.

also corrected a line in parse tumblr that used slice
2015-08-05 13:21:37 +02:00
Gergely Nagy
cbc2eed900
defclass reimagined
defclass now has a new syntax:

 (defclass Name [BaseList]
   [property value
    property value] ;; optional

   (defn method [self]
     self.property))

Anything after the optional property list (which will be translated to a
setv within the class context) will be added to the class body. This
allows one to have side effects and complex expressions within the class
definition.

As a side effect, defining methods is much more friendly now!

Closes #850.

Signed-off-by: Gergely Nagy <algernon@madhouse-project.org>
2015-08-04 16:43:07 +02:00
Zack M. Davis
016557deab reader macro #@ for with-decorator
The `with-decorator` special form is not the most ergonomic—this commit
introduces a new builtin `#@` reader macro that expands to an invocation
of `with-decorator`. To support this, `reader_macroexpand` is made to
also look in the default `None` namespace, in imitation of how
regular (non-reader) macros defined in hy.core are looked up. The
docstring of `hy.macros.reader` is also edited slightly for accuracy.

This in the matter of issue #856.
2015-07-26 15:05:38 -07:00
Ryan Gonzalez
736d7a7991 Let setv take pairs of arguments (ref. #844) 2015-07-25 17:45:34 -05:00
Zack M. Davis
4b00a84f9f documentation for &kwonly 2015-07-22 22:06:51 -07:00
Morten Linderud
c2fe74c4a2 Merge pull request #803 from farhaven/nonlocal-doc
Add documentation for the (nonlocal ...) directive
2015-07-01 15:30:30 +02:00
Gregor Best
b106e3c08d Expand doc for defn with &kwargs 2015-07-01 14:57:53 +02:00
Ewald Grusk
296b6eaa2a documents order of variable assignments in let expressions 2015-06-13 21:10:57 +02:00
Gregor Best
4adddbbf25 Allow specification of global table and module name for (eval ...) 2015-05-20 20:44:52 +02:00
Gregor Best
802ef0cd0d reword nonlocal doc a bit to mention nested fn scopes as well 2015-05-12 09:30:22 +02:00
Gregor Best
5743f6ae78 Add versionadded tag to nonlocal doc 2015-05-12 09:29:55 +02:00
Gregor Best
e4ed5cc357 Mention that nonlocal is for Python3.0 and up only 2015-05-12 00:00:54 +02:00
Gregor Best
9ed9bc5e11 Add documentation for the (nonlocal ...) directive
Signed-off-by: Gregor Best <gbe@unobtanium.de>
2015-05-11 23:38:02 +02:00
Berker Peksag
685688f04c Update versionadded directives.
0.11.0 is a backwards incompatible release.
2015-05-09 22:12:04 +03:00
Antony Woods
0496b7f7b6 Added name to AUTHORS and added documentation 2015-03-19 08:43:11 +00:00
Nicolás Della Penna
750d7b51be minor change
changed the specific values to make the example slightly more clear
2015-03-12 03:38:15 +02:00
Adrià Garriga-Alonso
f7b5486b69 Assert now may take an optional label, like in Python 2015-02-22 17:34:19 +01:00
Kevin Yap
8c0ac0862f Adhere to CPython's documentation guidelines
- Inline code is written using ``double backticks``
- Italicized text uses *asterisks* rather than `single backticks`
- Function parameters are italicized rather than written as inline code
2014-12-07 02:09:43 -08:00
Kevin Yap
997501bcc4 Fixes to language documentation
- Use backticks consistently for inline code
- Capitalize section headers and proper nouns
- Minor grammatical fixes
2014-12-06 15:46:44 -08:00
Tianon Gravi
96410f506e Add a dedicated lisp-if-not / lif-not macro
This is in parallel to `if` / `if-not` (so not without precedent). :)
2014-11-06 12:44:15 -07:00
Abhishek L
1da6d0af43 docs: fix decorator to reflect multiple decorators
* docs/language/api.rst: the `with-decorator' builtin supports multiple
  decorators which it applies in order. Docs are updated to reflect this
2014-05-24 17:35:39 +05:30
Berker Peksag
0f0c4227b6 Merge pull request #604 from Duta/master
Minor typo
2014-05-17 22:29:44 +03:00
Bertie Wheen
02fa251175 Minor typo
Sorry for tiny commits :P
2014-05-17 19:04:41 +01:00
Bertie Wheen
a102a268a9 Rephrased confusing comment 2014-05-17 18:46:01 +01: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
Abhishek L
4f74652c73 the mega typo fix commit
Wow! much typos! such fix!
2014-05-05 23:47:14 +05:30
Abhishek L
ad0191f343 Merge master onto pr/580 2014-05-02 19:37:54 +05:30
Tuukka Turto
d539f73d4d correct ..versionadded:: for defmain
my mistake, should have spotted before merging and pushing
2014-05-02 12:27:19 +03:00
Tuukka Turto
b1a928037e Merge branch 'master' into pr/526 2014-05-02 10:34:37 +03:00
pyos
f02e044719 Move the documentation for zipwith to the correct place. 2014-04-29 18:04:21 +04:00
Tuukka Turto
01fa9d6a3c document set-comp 2014-04-28 21:35:28 +03:00
Tuukka Turto
3a66a2d1be document dict-comp and genexpr 2014-04-28 21:09:06 +03:00
Matthew Wampler-Doty
fa5f51e0f1 Adding Version Added 0.10.1 2014-04-25 08:19:22 -05: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
f4b67e8bd8 documentation for doto
relates #567
2014-04-21 13:28:08 +03:00
Morten Linderud
e5e1489f0f Merge pull request #553 from berkerpeksag/missing-versionadded
Add a missing versionadded directive to the lisp-if/lif documentation.
2014-04-13 17:33:20 +02:00
Berker Peksag
c5dfba3c4f Fix a code-block in the lambda documentation. 2014-04-13 18:04:42 +03:00