From c85a79cd56fc8422445bee080e9fcc3cee2a0510 Mon Sep 17 00:00:00 2001 From: Kaz Kylheku Date: Thu, 3 Jul 2014 08:03:19 -0700 Subject: * 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. --- txr.1 | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) (limited to 'txr.1') diff --git a/txr.1 b/txr.1 index c64a9a63..b7fe8b98 100644 --- a/txr.1 +++ b/txr.1 @@ -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
+) (ip +) + (ado +) + (ido +) .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 -- cgit v1.2.3