zsh-users
 help / color / mirror / code / Atom feed
From: "René Neumann" <lists@necoro.eu>
To: zsh-users@zsh.org
Subject: Re: autoload variables
Date: Mon, 30 Aug 2021 23:34:20 +0200	[thread overview]
Message-ID: <e88843c4-5760-9afe-e7d2-da85b1304fa8@necoro.eu> (raw)
In-Reply-To: <CAPT4cGf3xGbvKuhrPVfzKo3FnB_-zb7pRwAs_musjCjS_BfuLw@mail.gmail.com>

Am 30.08.21 um 18:57 schrieb Anthony Fletcher:
> On Mon, 30 Aug 2021 at 12:40, René Neumann <lists@necoro.eu> wrote:
>>
>> Is there a reason you need this as a variable? Would a function
>>
>> upif() { ip -4 r | ... }
>>
>> not suffice?
>>
>> - René
>>
> 
> A function would work but then you need to run it every time to get the
> same value..... and of course the variable is for other commands. Thus
>         systemcommand $(upif)
> In this particular case anything to do with the uplink interface (eg
> dump_dhcp6). I guess the function could cache the result for speed.
> 

As always: the tradeoff between having everything loaded "just in case" 
vs the "doing extra work when I need it".

In my eyes, it heavily depends on the use cases: When you write, "I need 
it (only) when debugging networks", I hear "once in a blue moon" and 
would argue that any discussion about speed is wasted time (i.e. well, 
let it recalc the value each of the four times a month one needs it).
But you also might be someone for whom "debugging networks" is part of 
the job, which of course shifts the focus a lot...


  parent reply	other threads:[~2021-08-30 21:35 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-30 15:22 Anthony Fletcher
2021-08-30 15:41 ` Roman Perepelitsa
2021-08-30 16:40 ` René Neumann
2021-08-30 16:57   ` Anthony Fletcher
2021-08-30 19:30     ` Mikael Magnusson
2021-08-30 21:34     ` René Neumann [this message]
2021-08-30 21:46       ` Bart Schaefer
2021-08-31  0:10         ` Anthony Fletcher
2021-08-31 18:11           ` Roman Perepelitsa
2021-08-31 19:16             ` Bart Schaefer
2021-08-30 16:49 ` Bart Schaefer
2021-08-31 20:37 ` Marc Chantreux
2021-08-31 21:03   ` Roman Perepelitsa
2021-09-01  8:29     ` Marc Chantreux
2021-09-01  9:51       ` Roman Perepelitsa
2021-09-01 10:06         ` Marc Chantreux
2021-09-01 13:52           ` Bart Schaefer
2021-09-02 23:09         ` Anthony Fletcher
2021-09-03  0:07           ` Bart Schaefer
2021-09-03  6:52           ` Marc Chantreux

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=e88843c4-5760-9afe-e7d2-da85b1304fa8@necoro.eu \
    --to=lists@necoro.eu \
    --cc=zsh-users@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).