From a6f6072761d124c60793325bc512048b0f31f5a3 Mon Sep 17 00:00:00 2001 From: Kaz Kylheku Date: Sat, 11 Jul 2020 14:44:19 -0700 Subject: listener: new *-1, *-2 ... *-20 macros. * arith.h (minus_s): Declared. * eval.c (reg_symacro): Changing to external linkage. * eval.h (macro_time_s, reg_symacro): Declared. * parser.c (repl): Bind the *-1 to *-20 symbol macros. * txr.1: Documented. --- txr.1 | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'txr.1') diff --git a/txr.1 b/txr.1 index 3d54cfca..0f3561e8 100644 --- a/txr.1 +++ b/txr.1 @@ -73541,6 +73541,25 @@ Thus, up to the previous hundred results can be referenced: 10 .brev +.coNP Symbol Macros @, *-1 @, *-2 @, ... @ *-20 +The listener provides small number of symbol macros for referencing the +results of previous commands in a relative. The macro +.code *-1 +refers to the value of the immediately previous command. The macro +.code *-2 +refers to the value of the command before that one and so on. + +Note: each of these macros expands to a reference to the +.code *r +vector, according to the following pattern: + +.mono + *-1 --> [*r (mod (- *v 1) 100)] + *-2 --> [*r (mod (- *v 2) 100)] + ... + *-20 --> [*r (mod (- *v 20) 100)] +.onom + .coNP Variable @ *n .desc The listener variable -- cgit v1.2.3