1
0
Fork 0
mirror of git://git.code.sf.net/p/zsh/code synced 2025-08-18 17:20:59 +02:00

48601/0003: docs: functions -M: Add a subheading and index entries.

This commit is contained in:
Daniel Shahaf 2021-04-16 18:03:45 +00:00
parent f571aff1b2
commit b992d91059
2 changed files with 9 additions and 0 deletions

View file

@ -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).

View file

@ -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 ))