zsh-workers
 help / color / mirror / code / Atom feed
From: "Jun T." <takimoto-j@kba.biglobe.ne.jp>
To: zsh-workers@zsh.org
Subject: Re: caching mechanism and Re: PATCH Completion for _yum
Date: Wed, 14 Dec 2016 01:18:46 +0900	[thread overview]
Message-ID: <C94A5236-83E2-425A-A207-D0315F668D55@kba.biglobe.ne.jp> (raw)
In-Reply-To: <6472.1481623850@hydra.kiddle.eu>


2016/12/13 19:10, Oliver Kiddle <okiddle@yahoo.co.uk> wrote:

>>  if ( [[ ${+_dput_cfhosts} -eq 0 ]] || _cache_invalid dputhosts ) && ! _retrieve_cache dputhosts; then
>> - which makes no sense to me.
> 
> I went through correcting other cases of this particular broken logic.
> Substituting instead this logic:
>  if (( ! $+_dput_cfhosts[1] )) && { _cache_invalid dputhosts ||
>      ! _retrieve_cache dputhosts }

I guess what is intended by the original code is to be sure to regenerate
the data if the cache is invalid, even if the variable _dput_cfhosts
already exists in the current zsh.

But,

> Whether we want to be keeping caches also in a global variable is a
> different question

keeping the data in a variable may not be a good idea.
Suppose one zsh (zsh-A), which is still running, has created a cache long
time ago (and the cache is now invalid). If another zsh refreshes the cache,
zsh-A will not refresh its _dput_cfhosts next time it needs it, since the
cache is now valid.



  reply	other threads:[~2016-12-13 17:02 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-10-26 17:37 PATCH Completion for _yum (contains FIXMEs) Paul Seyfert
2016-10-27  1:30 ` Daniel Shahaf
2016-10-31 12:09   ` Paul Seyfert
2016-11-10 10:18     ` Paul Seyfert
2016-11-10 15:49       ` Oliver Kiddle
2016-11-12  0:19         ` PATCH Completion for _yum Paul Seyfert
     [not found]           ` <31607.1478915523@hydra.kiddle.eu>
2016-11-22 19:05             ` caching mechanism and " Oliver Kiddle
2016-12-13 10:10               ` Oliver Kiddle
2016-12-13 16:18                 ` Jun T. [this message]
2016-12-13 17:21                   ` Bart Schaefer
2016-12-14 11:38                     ` Oliver Kiddle
2016-12-14 14:23                       ` Jun T.
2016-12-14 15:03                         ` Oliver Kiddle
2016-12-14 15:23                           ` Jun T.
2016-12-14 17:46                             ` Oliver Kiddle
2016-12-14 20:09                               ` Bart Schaefer
2016-12-15  9:38                               ` Peter Stephenson
2016-12-15 17:15                                 ` Before 5.3.1 (was Re: caching mechanism and Re: PATCH Completion for _yum) Bart Schaefer
2016-12-13 16:38                 ` caching mechanism and Re: PATCH Completion for _yum Bart Schaefer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=C94A5236-83E2-425A-A207-D0315F668D55@kba.biglobe.ne.jp \
    --to=takimoto-j@kba.biglobe.ne.jp \
    --cc=zsh-workers@zsh.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).