From b1d1e6aa735442a1f22a224a3627427aa74b23f3 Mon Sep 17 00:00:00 2001 From: Kaz Kylheku Date: Sat, 6 Jul 2019 09:53:54 -0700 Subject: doc: op: incorrect example. * txr.1: Switch op example to ap and move under description of ap, which needs an example anyway. Add new examples for op. Reported by user vapnik spaknik. --- txr.1 | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) (limited to 'txr.1') diff --git a/txr.1 b/txr.1 index 5bdf24a6..f1d6c1ec 100644 --- a/txr.1 +++ b/txr.1 @@ -45044,15 +45044,15 @@ from a quasiliteral within a nested (op ... (op ... `@@@1`)) .brev -.TP* Example: +.TP* Examples: .verb - ;; Take a list of pairs and produce a list in which those pairs - ;; are reversed. + (let ((c 0)) + (mapcar (op cons (inc c)) '(a b c))) + --> ((1 . a) (2 . b) (3 . c)) - (mapcar (op list @2 @1) '((1 2) (a b))) -> ((2 1) (b a)) + (reduce-left (op + (* 10 @1) @2) '(1 2 3)) --> 123 .brev - .coNP Macro @ lop .synb .mets (lop << form +) @@ -45230,6 +45230,15 @@ and .code ipf functions. +.TP* Example: + +.verb + ;; Take a list of pairs and produce a list in which those pairs + ;; are reversed. + + (mapcar (ap list @2 @1) '((1 2) (a b))) -> ((2 1) (b a)) +.brev + .coNP Macros @ opip and @ oand .synb .mets (opip << clause *) -- cgit v1.2.3