about summary refs log tree commit diff
diff options
context:
space:
mode:
authorDaniel Shahaf <d.s@daniel.shahaf.name>2021-04-16 18:03:45 +0000
committerDaniel Shahaf <d.s@daniel.shahaf.name>2021-05-18 02:01:13 +0000
commitb992d91059b0a6bf2da7519aafcab9dff865498c (patch)
treecf3512119bb0e90d56da8d81fd7713a9109280a2
parentf571aff1b2d56d8354ba2530eca30dd45785c714 (diff)
downloadzsh-b992d91059b0a6bf2da7519aafcab9dff865498c.tar.gz
zsh-b992d91059b0a6bf2da7519aafcab9dff865498c.tar.xz
zsh-b992d91059b0a6bf2da7519aafcab9dff865498c.zip
48601/0003: docs: functions -M: Add a subheading and index entries.
-rw-r--r--ChangeLog3
-rw-r--r--Doc/Zsh/builtins.yo6
2 files changed, 9 insertions, 0 deletions
diff --git a/ChangeLog b/ChangeLog
index 6381e4f4a..b9ffd9471 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,8 @@
 2021-05-18  Daniel Shahaf  <d.s@daniel.shahaf.name>
 
+	* 48601/0003: Doc/Zsh/builtins.yo: docs: functions -M: Add a
+	subheading and index entries.
+
 	* 48601/0002: Doc/Zsh/builtins.yo: docs: functions -M: Document
 	the return status / result interdependency gotchas (cf. 48147).
 
diff --git a/Doc/Zsh/builtins.yo b/Doc/Zsh/builtins.yo
index 51b1f1744..0129c6b57 100644
--- a/Doc/Zsh/builtins.yo
+++ b/Doc/Zsh/builtins.yo
@@ -893,6 +893,10 @@ without affecting the other.  A typical idiom is that var(oldfn) is the
 name of a library shell function which is then redefined to call
 tt(newfn), thereby installing a modified version of the function.
 
+em(The )tt(-M)em( and )tt(+M)em( flags)
+cindex(defining mathematical functions)
+cindex(functions, defining mathematical)
+
 Use of the tt(-M) option may not be combined with any of the options
 handled by tt(typeset -f).
 
@@ -929,6 +933,8 @@ Therefore, care must be taken not to use syntactical constructs that perform
 arithmetic evaluation after evaluating what is to be the result of the function.
 For example:
 
+findex(zmath_cube)
+findex(cube)
 example(# WRONG
 zmath_cube+LPAR()+RPAR() {
   (( $1 * $1 * $1 ))