diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2014-07-03 08:03:19 -0700 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2014-07-03 08:03:19 -0700 |
commit | c85a79cd56fc8422445bee080e9fcc3cee2a0510 (patch) | |
tree | 380f823603a5567c894967ee1c965e691977d086 /txr.1 | |
parent | 578a99566965396df51623eb701dc3d76793c3ea (diff) | |
download | txr-c85a79cd56fc8422445bee080e9fcc3cee2a0510.tar.gz txr-c85a79cd56fc8422445bee080e9fcc3cee2a0510.tar.bz2 txr-c85a79cd56fc8422445bee080e9fcc3cee2a0510.zip |
* eval.c (apf_s, ipf_s): New symbol variables.
(me_ap, me_ip): Generate a much simpler macro-expansion:
a call to apf or ipf, rather than lambda syntax.
(me_ado, me_ido): New static functions.
(eval_init): Initialize apf_s and ipf_s variables.
Use them in the registration calls for apf and ipf.
Register ado and ido macros.
* txr.1: Streamlined documentation for ap and ip,
and added ado and ido.
Diffstat (limited to 'txr.1')
-rw-r--r-- | txr.1 | 21 |
1 files changed, 15 insertions, 6 deletions
@@ -12099,13 +12099,15 @@ is the first argument of the inner function. Of course, if there are three levels of nesting, then three metas are needed to insert a parameter from the outermost op, into the innermost op. -.SS Macros ap and ip +.SS Macros ap, ip, ado and ido. .TP Syntax: (ap <form>+) (ip <form>+) + (ado <form>+) + (ido <form>+) .TP Description: @@ -12120,9 +12122,7 @@ list as arguments. In other words, the following equivalence holds: - (ap form ...) <--> (lambda (args) (apply (op form ...))) - -except that the symbol args is to be understood as a generated symbol (gensym). + (ap form ...) <--> (apf (op form ...)) The ap macro nests properly with op and do, in any combination, in regard to the @@n notation. @@ -12131,9 +12131,18 @@ The ip macro is very similar to the ap macro, except that it is based on the semantics of the function iapply rather than apply, according to the following equivalence: - (ap form ...) <--> (lambda (args) (iapply (op form ...))) + (ip form ...) <--> (ipf (op form ...)) + +The ado and ido macros is related to do macro in the same way that ap and ip +are related to op. They produce a one-argument function is produced which works +as if by applying its arguments to the function generated by do, +according ot the following equivalence: + + (ado form ...) <--> (apf (do form ...)) + + (ido form ...) <--> (ipf (do form ...)) -See also: the apf function +See also: the apf and ipf functions. .SS Macro ret |