zsh-users
 help / color / mirror / code / Atom feed
From: Perry Smith <pedz@easesoftware.com>
To: zsh-users@zsh.org
Subject: Prepend to array
Date: Mon, 9 May 2022 15:30:30 -0500	[thread overview]
Message-ID: <7BFD80EB-FA4C-446C-927E-FCBFDDA28246@easesoftware.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 664 bytes --]

I have no idea where I came up with this but reading the internet and the documentation leads me to think that this isn’t really supported.

> # Add in my own functions
> fpath[1,0]=$ZDOTDIR/functions

It does exactly what I want: it prepends $ZDOTDIR/functions to the front of the fpath array.  I can’t even find an example where the 2nd index is less than the first index.

So, I thought I would ask:

1) Is the above syntax supported or does it just happen to work currently?

2) What is the prescribed method of prepending to an array: e.g.

Before
fpath=( /a/b /c/d )

After
fpath=( /x/y /a/b /c/d )

Thank you for your time,
Perry


[-- Attachment #2: Message signed with OpenPGP --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

             reply	other threads:[~2022-05-09 20:31 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-05-09 20:30 Perry Smith [this message]
2022-05-09 23:45 ` 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=7BFD80EB-FA4C-446C-927E-FCBFDDA28246@easesoftware.com \
    --to=pedz@easesoftware.com \
    --cc=zsh-users@zsh.org \
    --subject='Re: Prepend to array' \
    /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

Code repositories for project(s) associated with this 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).