Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Determining whether a function is used in an arithmetic context
- X-seq: zsh-workers 41455
- From: Peter Stephenson <p.stephenson@xxxxxxxxxxx>
- To: Zsh Hackers' List <zsh-workers@xxxxxxx>
- Subject: Re: Determining whether a function is used in an arithmetic context
- Date: Tue, 25 Jul 2017 09:59:39 +0100
- Cms-type: 201P
- In-reply-to: <CA+_8RBDSKtMkaQM+UXxavB5NCc1M=HbBhiJbboCMDtCH2e37yA@mail.gmail.com>
- List-help: <mailto:zsh-workers-help@zsh.org>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:zsh-workers@zsh.org>
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
- Organization: Samsung Cambridge Solution Centre
- References: <CGME20170725035005epcas3p1465f06f865f80047a4a87239ed5bc910@epcas3p1.samsung.com> <CA+_8RBDSKtMkaQM+UXxavB5NCc1M=HbBhiJbboCMDtCH2e37yA@mail.gmail.com>
On Mon, 24 Jul 2017 22:47:39 -0500
dana <dana@xxxxxxx> wrote:
> I was playing with arithmetic functions recently and i wanted to have one
> of them behave differently depending on whether it's used in an arithmetic
> context or not. I can't seem to figure out a *reliable* way to detect that,
> though.
(This part of the discussion on zsh-workers.)
If it seems worth doing, expanding doshfunc so the last argument is a
set of bit flags and adding an argument to runshfunc to indicate a
context that would show up in the appropriate place in $zsh_eval_context
(potentially useful for modules to make functions called in a particular
way easy to detect) isn't hard. But if it's more churn that people won't
actually use much it's probably not worth doing.
pws
Messages sorted by:
Reverse Date,
Date,
Thread,
Author