diff options
author | Peter Stephenson <pws@users.sourceforge.net> | 2013-03-17 20:52:55 +0000 |
---|---|---|
committer | Peter Stephenson <pws@users.sourceforge.net> | 2013-03-17 20:52:55 +0000 |
commit | ab8fe84a8c179f5990c4fd7cd7e2cfa82ed03cc3 (patch) | |
tree | 051041d09465f82a0861f9cea523b49fe04b1aa3 /Doc/Zsh | |
parent | 136cc1e1b79ebc07f5deb630fea9d325276d077c (diff) | |
download | zsh-ab8fe84a8c179f5990c4fd7cd7e2cfa82ed03cc3.tar.gz zsh-ab8fe84a8c179f5990c4fd7cd7e2cfa82ed03cc3.tar.xz zsh-ab8fe84a8c179f5990c4fd7cd7e2cfa82ed03cc3.zip |
31155: minor extra zcalc features and documentation
Diffstat (limited to 'Doc/Zsh')
-rw-r--r-- | Doc/Zsh/contrib.yo | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/Doc/Zsh/contrib.yo b/Doc/Zsh/contrib.yo index f13aa79cf..b191e10d9 100644 --- a/Doc/Zsh/contrib.yo +++ b/Doc/Zsh/contrib.yo @@ -3144,12 +3144,14 @@ line preceded by `tt(4> )' is available as tt($4). The last value calculated is available as tt(ans). Full command line editing, including the history of previous calculations, is available; the history is saved in the file tt(~/.zcalc_history). To exit, enter a blank line or type `tt(:q)' -on its own (`tt(q)' is allowed for historical compatibility). A -line ending with a single backslash is treated in the same fashion +on its own (`tt(q)' is allowed for historical compatibility). + +A line ending with a single backslash is treated in the same fashion as it is in command line editing: the backslash is removed, the function prompts for more input (the prompt is preceded by `tt(...)' to indicate this), and the lines are combined into one to get the final -result. +result. In addition, if the input so far contains more open than +close parentheses tt(zcalc) will prompt for more input. If arguments are given to tt(zcalc) on start up, they are used to prime the first few positional parameters. A visual indication of this is given when @@ -3219,11 +3221,13 @@ scope. ) item(tt(:function) var(name) [ var(body) ])( Define a mathematical function or (with no var(body)) delete it. +tt(:function) may be abbreviated to tt(:func) or simply tt(:f). +The var(name) may contain the same characters as a shell function name. The function is defined using tt(zmathfuncdef), see below. Note that tt(zcalc) takes care of all quoting. Hence for example: -example(function cube $1 * $1 * $1) +example(:f cube $1 * $1 * $1) defines a function to cube the sole argument. ) |