summary refs log tree commit diff
path: root/Doc/Zsh
diff options
context:
space:
mode:
authorPeter Stephenson <pws@zsh.org>2016-06-21 16:34:55 +0100
committerPeter Stephenson <pws@zsh.org>2016-06-21 16:34:55 +0100
commit5103c85abb239a12a3d29da9b41515cd4af19a9f (patch)
treeeb5e729b2d2c06274c8a08eaf332beb9a72f7abc /Doc/Zsh
parent016929e043abb8ba778293c29081ca8e227c6e58 (diff)
downloadzsh-5103c85abb239a12a3d29da9b41515cd4af19a9f.tar.gz
zsh-5103c85abb239a12a3d29da9b41515cd4af19a9f.tar.xz
zsh-5103c85abb239a12a3d29da9b41515cd4af19a9f.zip
38736: various RPN mode enhancements for zcalc
Diffstat (limited to 'Doc/Zsh')
-rw-r--r--Doc/Zsh/contrib.yo23
1 files changed, 21 insertions, 2 deletions
diff --git a/Doc/Zsh/contrib.yo b/Doc/Zsh/contrib.yo
index b9c1c0a80..c875c95da 100644
--- a/Doc/Zsh/contrib.yo
+++ b/Doc/Zsh/contrib.yo
@@ -3806,10 +3806,23 @@ are printed instead of just the most recent result.  Hence, for example,
 tt(zcalc -r4) shows tt($stack[4]) to tt($stack[1]) each time results
 are printed.
 )
-item(Duplication)(
+item(Duplication: tt(=))(
 The pseudo-operator tt(=) causes the most recent element of
 the stack to be duplicated onto the stack.
 )
+item(tt(pop))(
+The pseudo-function tt(pop) causes the most recent element of
+the stack to be popped.  A `tt(<)' on its own has the same effect.
+)
+item(tt(<)var(ident))(
+The expression tt(<) followed (with no space) by a shell identifier
+causes the most recent element of the stack to be popped and
+assigned to the identifier.
+)
+item(Exchange: tt(xy))(
+The pseudo-function tt(xy) causes the most recent two elements of
+the stack to be exchanged.
+)
 enditem()
 
 The prompt is configurable via the parameter tt(ZCALCPROMPT), which
@@ -3872,7 +3885,13 @@ Note that tt(zcalc) takes care of all quoting.  Hence for example:
 
 example(:f cube $1 * $1 * $1)
 
-defines a function to cube the sole argument.
+defines a function to cube the sole argument.  Functions so defined, or
+indeed any functions defined directly or indirectly using tt(functions
+-M), are available to execute by typing only the name on the line in RPN
+mode; this pops the appropriate number of arguments off the stack
+to pass to the function, i.e. 1 in the case of the example tt(cube)
+function.  If there are optional arguments only the mandatory
+arguments are supplied by this means.
 )
 item(tt([#)var(base)tt(]))(
 This is not a special command, rather part of normal arithmetic