zsh-workers
 help / color / mirror / code / Atom feed
* Re: Determining whether a function is used in an arithmetic context
       [not found] ` <CA+_8RBDSKtMkaQM+UXxavB5NCc1M=HbBhiJbboCMDtCH2e37yA@mail.gmail.com>
@ 2017-07-25  8:59   ` Peter Stephenson
  0 siblings, 0 replies; only message in thread
From: Peter Stephenson @ 2017-07-25  8:59 UTC (permalink / raw)
  To: Zsh Hackers' List

On Mon, 24 Jul 2017 22:47:39 -0500
dana <dana@dana.is> 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


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2017-07-25  9:09 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <CGME20170725035005epcas3p1465f06f865f80047a4a87239ed5bc910@epcas3p1.samsung.com>
     [not found] ` <CA+_8RBDSKtMkaQM+UXxavB5NCc1M=HbBhiJbboCMDtCH2e37yA@mail.gmail.com>
2017-07-25  8:59   ` Determining whether a function is used in an arithmetic context Peter Stephenson

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).