diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2014-12-23 09:17:27 -0800 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2014-12-23 09:17:27 -0800 |
commit | cbdbb602b8b821e2d353ad29e7d91796e87ef556 (patch) | |
tree | 31c4c981276e350af2e5c498e71542ab5d0a0e3b /txr.1 | |
parent | e68f3828d79d16d2afc929c83d499e8e2e0dd38a (diff) | |
download | txr-cbdbb602b8b821e2d353ad29e7d91796e87ef556.tar.gz txr-cbdbb602b8b821e2d353ad29e7d91796e87ef556.tar.bz2 txr-cbdbb602b8b821e2d353ad29e7d91796e87ef556.zip |
* eval.c (ap_s, ret_s, aret_s): New symbol variables.
(me_ret): Static function renamed to me_ret_aret.
Handles ret and aret macro expansion.
(eval_init): Initialize ap_s, ret_s and aret_s.
Re-register ret macro using ret_s and bind to me_ret_aret.
Register aret macro.
* txr.1: Documented aret.
* tl.vim, txr.vim: Regenerated.
Diffstat (limited to 'txr.1')
-rw-r--r-- | txr.1 | 42 |
1 files changed, 42 insertions, 0 deletions
@@ -20880,6 +20880,48 @@ and the expression returns a function similar to .codn (lambda (. rest) 42) . +.coNP Macro @ aret +.synb +.mets (aret << form ) +.syne +.desc +The +.code ret +macro's +.meta form +argument is treated similarly to the second and subsequent arguments of the +.code op +operator. + +The +.code aret +macro produces a function which takes any number of arguments, +and returns the value specified by +.metn form . + +.meta form +can contain +.code ap +meta syntax like +.meta @n +and +.codn @rest . + +The following equivalence holds: + +.cblk + (aret x) <--> (ap identity x)) +.cble + +Thus the expression +.code (aret @2) +returns a function similar to +.codn (lambda (. rest) (second rest)) , +and the expression +.code (aret 42) +returns a function similar to +.codn (lambda (. rest) 42) . + .coNP Functions @ chain and @ chand .synb .mets (chain << func *) |